From 36767cd265131ceaff146d1cf5335793155d80c7 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 13 Jan 2021 20:48:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E7=BB=9F=E8=AE=A1=20(#580)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 添加组织详情统计 * feat: 添加组织详情统计 Co-authored-by: Orange --- src/i18n/langs/cn.json | 8 +++++ src/i18n/langs/en.json | 10 +++++- .../OrganizationDetail/OrganizationDetail.vue | 32 +++++++++++++++++ src/views/xpack/Org/OrganizationList.vue | 35 ++++++++++++++++++- 4 files changed, 83 insertions(+), 2 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 07af3361e..acd47fe89 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -1073,6 +1073,14 @@ "DeleteOrgTitle": "请确保组织内的以下信息已删除", "DeleteOrgMsg": "用户列表、用户组、资产列表、网域列表、管理用户、系统用户、标签管理、资产授权规则", "OrgRole": "组织角色", + "users_amount": "用户数量", + "groups_amount": "用户组数量", + "assets_amount": "资产数量", + "admin_users_amount": "管理用户数量", + "system_users_amount": "系统用户数量", + "applications_amount": "应用数量", + "asset_perms_amount": "资产授权数量", + "app_perms_amount": "应用授权数量", "CreateOrgMsg": "请去组织详情内添加用户", "AddOrgMembers": "添加组织成员" }, diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index c7a8b00f0..ad7a143b1 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -1062,7 +1062,15 @@ "DeleteOrgMsg":"User list、User group、Asset list、Domain list、Admin user、System user、Labels、Asset permission", "OrgRole": "Org role", "CreateOrgMsg": "Please go to Organization Details to add users", - "AddOrgMembers": "Add organization members" + "AddOrgMembers": "Add organization members", + "users_amount": "Users amount", + "groups_amount": "Groups amount", + "assets_amount": "Assets amount", + "admin_users_amount": "Admin users amount", + "system_users_amount": "System users amount", + "applications_amount": "Applications amount", + "asset_perms_amount": "Asset perms amount", + "app_perms_amount": "App perms amount" }, "RestoreButton": "Restore Default", "SubscriptionID": "Subscription ID", diff --git a/src/views/xpack/Org/OrganizationDetail/OrganizationDetail.vue b/src/views/xpack/Org/OrganizationDetail/OrganizationDetail.vue index ab89f7bfa..b78c74593 100644 --- a/src/views/xpack/Org/OrganizationDetail/OrganizationDetail.vue +++ b/src/views/xpack/Org/OrganizationDetail/OrganizationDetail.vue @@ -36,6 +36,38 @@ export default { key: this.$t('common.createBy'), value: this.object.created_by }, + { + key: this.$t('xpack.Organization.users_amount'), + value: this.object.resource_statistics.users_amount + }, + { + key: this.$t('xpack.Organization.groups_amount'), + value: this.object.resource_statistics.groups_amount + }, + { + key: this.$t('xpack.Organization.assets_amount'), + value: this.object.resource_statistics.assets_amount + }, + { + key: this.$t('xpack.Organization.admin_users_amount'), + value: this.object.resource_statistics.admin_users_amount + }, + { + key: this.$t('xpack.Organization.system_users_amount'), + value: this.object.resource_statistics.system_users_amount + }, + { + key: this.$t('xpack.Organization.applications_amount'), + value: this.object.resource_statistics.applications_amount + }, + { + key: this.$t('xpack.Organization.asset_perms_amount'), + value: this.object.resource_statistics.asset_perms_amount + }, + { + key: this.$t('xpack.Organization.app_perms_amount'), + value: this.object.resource_statistics.app_perms_amount + }, { key: this.$t('common.dateCreated'), value: toSafeLocalDateStr(this.object.date_created) diff --git a/src/views/xpack/Org/OrganizationList.vue b/src/views/xpack/Org/OrganizationList.vue index cc4d4e8fc..9cae6658f 100644 --- a/src/views/xpack/Org/OrganizationList.vue +++ b/src/views/xpack/Org/OrganizationList.vue @@ -17,8 +17,41 @@ export default { return { tableConfig: { url: '/api/v1/orgs/orgs/', - columns: ['name', 'comment', 'actions'], + columns: ['name', + 'resource_statistics.users_amount', + 'resource_statistics.groups_amount', + 'resource_statistics.assets_amount', + 'resource_statistics.admin_users_amount', + 'resource_statistics.system_users_amount', + 'resource_statistics.applications_amount', + 'resource_statistics.asset_perms_amount', + 'resource_statistics.app_perms_amount', + 'comment', 'actions'], columnsMeta: { + 'resource_statistics.users_amount': { + label: this.$t('xpack.Organization.users_amount') + }, + 'resource_statistics.groups_amount': { + label: this.$t('xpack.Organization.groups_amount') + }, + 'resource_statistics.assets_amount': { + label: this.$t('xpack.Organization.assets_amount') + }, + 'resource_statistics.admin_users_amount': { + label: this.$t('xpack.Organization.admin_users_amount') + }, + 'resource_statistics.system_users_amount': { + label: this.$t('xpack.Organization.system_users_amount') + }, + 'resource_statistics.applications_amount': { + label: this.$t('xpack.Organization.applications_amount') + }, + 'resource_statistics.asset_perms_amount': { + label: this.$t('xpack.Organization.asset_perms_amount') + }, + 'resource_statistics.app_perms_amount': { + label: this.$t('xpack.Organization.app_perms_amount') + }, actions: { prop: '', formatterArgs: {