From 1c80faede42ab65c3cc9fcc594da8917f5f2f7e4 Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Fri, 2 Dec 2022 17:18:28 +0800 Subject: [PATCH 01/19] =?UTF-8?q?perf:=20=E5=A2=9E=E5=8A=A0celery=E8=BE=93?= =?UTF-8?q?=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tasks/TaskDetail/TaskHistory.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/tasks/TaskDetail/TaskHistory.vue b/src/views/tasks/TaskDetail/TaskHistory.vue index 27e206191..926694bd9 100644 --- a/src/views/tasks/TaskDetail/TaskHistory.vue +++ b/src/views/tasks/TaskDetail/TaskHistory.vue @@ -4,6 +4,7 @@ From 5e321e9a27a69371783c3fe4813280e5e33fe98d Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Mon, 5 Dec 2022 15:28:36 +0800 Subject: [PATCH 05/19] =?UTF-8?q?feat:=20=E8=B5=84=E4=BA=A7=E9=80=89?= =?UTF-8?q?=E6=8B=A9form=20=E5=8C=B9=E9=85=8D=E6=AD=A3=E7=A1=AE=E7=9A=84?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AssetSelect/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/AssetSelect/index.vue b/src/components/AssetSelect/index.vue index afac172e9..6f8400afd 100644 --- a/src/components/AssetSelect/index.vue +++ b/src/components/AssetSelect/index.vue @@ -68,7 +68,7 @@ export default { multiple: true, clearable: true, ajax: { - url: '/api/v1/assets/assets/?fields_size=mini', + url: '/api/v1/assets/assets/', transformOption: (item) => { return { label: item.name + '(' + item.address + ')', value: item.id } } @@ -84,7 +84,7 @@ export default { showMenu: false, showRefresh: true, showAssets: false, - url: '/api/v1/assets/assets/?fields_size=mini', + url: '/api/v1/assets/assets/', nodeUrl: '/api/v1/assets/nodes/', // ?assets=0不显示资产. =1显示资产 treeUrl: '/api/v1/assets/nodes/children/tree/?assets=0' From 208c7c0aa85efdb673e1ee13e77eba5c8b434f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 5 Dec 2022 15:37:58 +0800 Subject: [PATCH 06/19] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=BB=AA?= =?UTF-8?q?=E8=A1=A8=E7=9B=98=E7=8E=AF=E5=BD=A2=E5=9B=BE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dashboard/Audit/DataSummary.vue | 31 ++++++++++++---- src/views/dashboard/Audit/RightSummary.vue | 6 +++- src/views/dashboard/Console/DataSummary.vue | 17 +++++---- src/views/dashboard/components/DataCard.vue | 37 +++++++++++++------- src/views/dashboard/components/RingChart.vue | 2 +- 5 files changed, 66 insertions(+), 27 deletions(-) diff --git a/src/views/dashboard/Audit/DataSummary.vue b/src/views/dashboard/Audit/DataSummary.vue index 1eb831891..c12980152 100644 --- a/src/views/dashboard/Audit/DataSummary.vue +++ b/src/views/dashboard/Audit/DataSummary.vue @@ -1,10 +1,24 @@ @@ -62,17 +76,22 @@ export default { &total_count_commands=1 &total_count_commands_danger=1 `) + const logActive = data.total_count_user_login_success_logs === 0 ? 0 : ((data.total_count_user_login_success_logs / data.total_count_user_login_logs) * 100).toFixed(0) + const logTotal = logActive === 100 ? 0 : 100 - logActive const logs = [ - { name: this.$t('dashboard.ActiveUser'), value: data.total_count_user_login_logs }, - { name: this.$t('dashboard.InActiveUser'), value: data.total_count_user_login_success_logs } + { name: this.$t('dashboard.ActiveUser'), value: logActive }, + { name: this.$t('dashboard.InActiveUser'), value: logTotal } ] this.$set(this.logConfig, 'data', logs) this.$set(this.logConfig, 'total', data.total_count_user_login_logs) this.$set(this.logConfig, 'active', data.total_count_user_login_success_logs) this.$set(this.logConfig, 'weekAdd', data.total_count_user_login_success_logs) + + const assetActive = data.total_count_commands_danger === 0 ? 0 : ((data.total_count_commands_danger / data.total_count_commands) * 100).toFixed(0) + const assetTotal = assetActive === 100 ? 0 : 100 - assetActive const assets = [ - { name: this.$t('dashboard.ActiveAsset'), value: data.total_count_commands }, - { name: this.$t('dashboard.InActiveAsset'), value: data.total_count_commands_danger } + { name: this.$t('dashboard.ActiveAsset'), value: assetActive }, + { name: this.$t('dashboard.InActiveAsset'), value: assetTotal } ] this.$set(this.assetConfig, 'data', assets) this.$set(this.assetConfig, 'total', data.total_count_commands) diff --git a/src/views/dashboard/Audit/RightSummary.vue b/src/views/dashboard/Audit/RightSummary.vue index ae9a9d28c..ca6037f81 100644 --- a/src/views/dashboard/Audit/RightSummary.vue +++ b/src/views/dashboard/Audit/RightSummary.vue @@ -6,7 +6,7 @@ - + @@ -33,6 +33,10 @@ export default { title: this.$t('dashboard.SessionTrend'), tip: this.$t('dashboard.SessionTrend') }, + chartTitleConfig: { + title: this.$t('route.BatchCommand'), + tip: this.$t('route.BatchCommand') + }, chartConfig: { datesMetrics: [], secondaryName: this.$t('dashboard.IndexName'), diff --git a/src/views/dashboard/Console/DataSummary.vue b/src/views/dashboard/Console/DataSummary.vue index e48f3e303..2a0a065a0 100644 --- a/src/views/dashboard/Console/DataSummary.vue +++ b/src/views/dashboard/Console/DataSummary.vue @@ -51,22 +51,27 @@ export default { async init() { const data = await this.$axios.get(`/api/v1/index/?total_count_users=1 &total_count_users_this_week=1 - &total_count_today_login_users=1 + &total_count_login_users=1 &total_count_assets=1 &total_count_assets_this_week=1 &total_count_today_active_assets=1 `) + const userActive = data.total_count_login_users === 0 ? 0 : ((data.total_count_login_users / data.total_count_users) * 100).toFixed(0) + const userTotal = userActive === 100 ? 0 : 100 - userActive const users = [ - { name: this.$t('dashboard.ActiveUser'), value: data.total_count_users }, - { name: this.$t('dashboard.InActiveUser'), value: data.total_count_today_login_users } + { name: this.$t('dashboard.ActiveUser'), value: userActive }, + { name: this.$t('dashboard.InActiveUser'), value: userTotal } ] this.$set(this.userConfig, 'data', users) this.$set(this.userConfig, 'total', data.total_count_users) - this.$set(this.userConfig, 'active', data.total_count_today_login_users) + this.$set(this.userConfig, 'active', data.total_count_login_users) this.$set(this.userConfig, 'weekAdd', data.total_count_users_this_week) + + const assetActive = data.total_count_today_active_assets === 0 ? 0 : ((data.total_count_today_active_assets / data.total_count_assets) * 100).toFixed(0) + const assetTotal = assetActive === 100 ? 0 : 100 - assetActive const assets = [ - { name: this.$t('dashboard.ActiveAsset'), value: data.total_count_assets }, - { name: this.$t('dashboard.InActiveAsset'), value: data.total_count_today_active_assets } + { name: this.$t('dashboard.ActiveAsset'), value: assetActive }, + { name: this.$t('dashboard.InActiveAsset'), value: assetTotal } ] this.$set(this.assetConfig, 'data', assets) this.$set(this.assetConfig, 'total', data.total_count_assets) diff --git a/src/views/dashboard/components/DataCard.vue b/src/views/dashboard/components/DataCard.vue index c6d015b58..648daa42c 100644 --- a/src/views/dashboard/components/DataCard.vue +++ b/src/views/dashboard/components/DataCard.vue @@ -1,20 +1,22 @@