diff --git a/src/locales/en.json b/src/locales/en.json index 650b286d..03628ae6 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -92,7 +92,6 @@ "Any(Random)": "Any(Random)", "Application Credentials": "Application Credentials", "Application Template": "Application Template", - "Apply for extended quota": "Apply for extended quota", "Applying": "Applying", "Arch": "Arch", "Architecture": "Architecture", @@ -1330,7 +1329,6 @@ "Resource Class Properties": "Resource Class Properties", "Resource Not Found": "Resource Not Found", "Resource Pool": "Resource Pool", - "Resource Statistic (Last 15 Days)": "Resource Statistic (Last 15 Days)", "Resource Status": "Resource Status", "Resource Status Reason": "Resource Status Reason", "Resource Type": "Resource Type", @@ -1702,7 +1700,6 @@ "VNIC Type": "VNIC Type", "VPN": "VPN", "VPN EndPoint Group": "VPN EndPoint Group", - "VPN Endpoint Group": "VPN Endpoint Group", "VPN Gateway": "VPN Gateway", "VPN Service": "VPN Service", "VPN Service ID": "VPN Service ID", diff --git a/src/locales/zh.json b/src/locales/zh.json index 2ecf7d0a..7b776eae 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -92,7 +92,6 @@ "Any(Random)": "任意(随机)", "Application Credentials": "应用凭证", "Application Template": "应用模板", - "Apply for extended quota": "申请扩展配额", "Applying": "使用中", "Arch": "", "Architecture": "架构", @@ -1330,7 +1329,6 @@ "Resource Class Properties": "资源类属性", "Resource Not Found": "资源未找到", "Resource Pool": "资源池", - "Resource Statistic (Last 15 Days)": "资源统计(最近15天)", "Resource Status": "资源状态", "Resource Status Reason": "资源状态信息", "Resource Type": "资源类型", @@ -1702,7 +1700,6 @@ "VNIC Type": "VNIC类型", "VPN": "VPN", "VPN EndPoint Group": "VPN端点组", - "VPN Endpoint Group": "VPN端点组", "VPN Gateway": "VPN网关", "VPN Service": "VPN服务", "VPN Service ID": "VPN服务ID", diff --git a/src/pages/base/containers/Overview/components/ProjectInfo.jsx b/src/pages/base/containers/Overview/components/ProjectInfo.jsx index bb561b02..02fa6c8a 100644 --- a/src/pages/base/containers/Overview/components/ProjectInfo.jsx +++ b/src/pages/base/containers/Overview/components/ProjectInfo.jsx @@ -40,46 +40,108 @@ export class ProjectInfo extends Component { ); }; - render() { - const { rootStore = {} } = this.props; - const { roles = [], baseRoles = [], user = {} } = rootStore; + get rootStore() { + return this.props.rootStore || {}; + } + + get currentUser() { + const { user: { user } = {} } = this.rootStore; + return user || {}; + } + + get showRoles() { + const { roles = [], baseRoles = [] } = this.rootStore; + return roles.filter((it) => baseRoles.indexOf(it.name) === -1); + } + + get baseRoles() { + const { roles = [], baseRoles = [] } = this.rootStore; + return roles.filter((it) => baseRoles.indexOf(it.name) !== -1); + } + + renderAccount() { + return ( + + {this.currentUser.name} + + ); + } + + renderShowRole() { + return ( + + {this.showRoles.map((item) => item.name).join(', ')} + + ); + } + + renderDomain() { + return ( + + {this.currentUser.domain.name} + + ); + } + + renderBaseRole() { const { collapsed } = this.state; - const icon = collapsed ? : ; - if (!user) { + if (collapsed) { return null; } - const { user: currentUser } = user; - const showRole = roles.filter((it) => baseRoles.indexOf(it.name) === -1); - const baseRole = roles.filter((it) => baseRoles.indexOf(it.name) !== -1); + return ( + + {this.baseRoles.map((item) => item.name).join(', ')} + + ); + } + + renderButton() { + const { collapsed } = this.state; + const icon = collapsed ? : ; + return ( +