Skip to content

Commit

Permalink
feat: App information mgmt and service contract (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongrui authored Dec 20, 2018
1 parent c705455 commit 879a69e
Show file tree
Hide file tree
Showing 10 changed files with 816 additions and 19 deletions.
17 changes: 14 additions & 3 deletions src/components/Base/Image/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ export default class Image extends React.Component {
className: PropTypes.string,
iconLetter: PropTypes.string,
iconSize: PropTypes.number,
isBase64Str: PropTypes.bool,
src: PropTypes.string
};

static defaultProps = {
iconSize: 24,
src: '',
iconLetter: ''
iconLetter: '',
isBase64Str: false
};

state = {
Expand Down Expand Up @@ -46,10 +48,19 @@ export default class Image extends React.Component {

render() {
const {
src, iconLetter, className, iconSize, ...rest
src,
iconLetter,
className,
iconSize,
isBase64Str,
...rest
} = this.props;
const { failed } = this.state;
const imgStr = src && startsWith(src, 'att-') ? `/attachments/${src}` : src;

let imgStr = src && startsWith(src, 'att-') ? `/attachments/${src}` : src;
if (isBase64Str && !imgStr.startsWith('/attachments/')) {
imgStr = `data:image/png;data:image/svg;data:image/jpg;base64,${src}`;
}

if (failed) {
const style = {
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/SideNav/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SideNav extends React.Component {

const { appId } = match.params;
if (appId) {
appStore.fetch(appId);
await appStore.fetch(appId);
}

if (isDev && !hasMeunApps) {
Expand Down Expand Up @@ -229,7 +229,7 @@ class SideNav extends React.Component {
renderSubDev() {
const { t } = this.props;
const { url } = this.props.match;
const { appDetail } = this.props.appStore;
const { appDetail, resetAppDetail } = this.props.appStore;

if (url === '/dashboard') {
return (
Expand All @@ -250,7 +250,7 @@ class SideNav extends React.Component {
return (
<div className={styles.subNav}>
<div className={styles.title}>
<div className={styles.name}>{appDetail.name}</div>
<div className={styles.name}>{resetAppDetail.name}</div>
<Status
className={styles.status}
name={appDetail.status}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/SideNav/navMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ export const getDevSubNavs = appId => [
title: 'Development',
items: [
{
name: 'Version management',
name: 'Version',
link: `/dashboard/app/${appId}/versions`
},
{ name: 'Audit record', link: `/dashboard/app/${appId}/audits` },
{ name: 'App information', link: '#' }
{ name: 'App information', link: `/dashboard/app/${appId}/info` },
{ name: 'Record', link: `/dashboard/app/${appId}/audits` }
]
},
{
Expand Down
12 changes: 9 additions & 3 deletions src/locales/zh/apps.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
"LINK_STEPPER_FOOTER_ADD_APP_VERSION_1": "《Helm 规范及应用开发》。",

"icon_format_note": "图标最佳格式为 png,请重新上传",
"screenshot_format_note": "界面截图最佳格式为 png/jpg ,请重新上传",
"Search result is empty": "搜索结果为空",
"No result for search word": "没有找到与关键字 「{{searchWord}}」 相关的应用",
"File": "文件",
Expand Down Expand Up @@ -157,7 +158,12 @@
"Test Runtime": "测试环境",
"Instance Name ID": "实例名称 ID",
"Create Time": "创建时间",
"": "",
"": "",
"": ""
"App Info": "应用信息",
"Base Info": "基本信息",
"Instructions": "使用说明",
"Terms of service": "服务条款",
"Select file": "选择文件",

"Preview": "预览"

}
Loading

0 comments on commit 879a69e

Please sign in to comment.