From 2e92cc02ea7816559c76597bc3679083c73f2f0e Mon Sep 17 00:00:00 2001 From: Aaron3S Date: Thu, 16 Feb 2023 20:00:09 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=AE=A1=E8=AE=A1?= =?UTF-8?q?=E5=8F=B0dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/ja.json | 3 ++ src/i18n/langs/zh.json | 3 ++ src/views/dashboard/Audit/RightSummary.vue | 36 ++++++++++++---------- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/src/i18n/langs/ja.json b/src/i18n/langs/ja.json index 979f5dc9d..8ceb04faa 100644 --- a/src/i18n/langs/ja.json +++ b/src/i18n/langs/ja.json @@ -761,6 +761,9 @@ "Filename": "ファイル名" }, "dashboard": { + "TotalJobLog": "ジョブ実行総数", + "TotalJobRunning": "実行中のジョブ数", + "TotalJobFailed": "実行失敗ジョブ数", "ActiveAsset": "最近ログインされました", "ActiveUser": "最近ログインしました", "ActiveUserAssetsRatioTitle": "占有率統計", diff --git a/src/i18n/langs/zh.json b/src/i18n/langs/zh.json index e8cbc034e..e03f40140 100644 --- a/src/i18n/langs/zh.json +++ b/src/i18n/langs/zh.json @@ -757,6 +757,9 @@ } }, "dashboard": { + "TotalJobLog": "作业执行总数", + "TotalJobRunning": "运行中作业数", + "TotalJobFailed": "执行失败作业数", "ActiveAsset": "近期被登录过", "ActiveUser": "近期登录过", "ActiveUserAssetsRatioTitle": "占比统计", diff --git a/src/views/dashboard/Audit/RightSummary.vue b/src/views/dashboard/Audit/RightSummary.vue index af6b485f8..8b1f48edb 100644 --- a/src/views/dashboard/Audit/RightSummary.vue +++ b/src/views/dashboard/Audit/RightSummary.vue @@ -34,8 +34,8 @@ export default { tip: this.$t('dashboard.SessionTrend') }, chartTitleConfig: { - title: this.$t('route.BatchCommand'), - tip: this.$t('route.BatchCommand') + title: this.$t('route.JobExecutionLog'), + tip: this.$t('route.JobExecutionLog') }, chartConfig: { datesMetrics: [], @@ -43,9 +43,9 @@ export default { secondaryData: [0] }, data: { - total_count_jobs: 0, - total_count_jobs_unexecuted: 0, - total_count_jobs_executed_failed: 0 + total_count_job_logs_running: 0, + total_count_job_logs_failed: 0, + total_count_job_logs: 0 } } }, @@ -53,26 +53,26 @@ export default { summaryItems() { return [ { - title: this.$t('route.BatchCommand') + this.$t('dashboard.Num'), + title: this.$t('dashboard.TotalJobLog'), body: { route: { name: `CommandList` }, - count: this.data.total_count_jobs, + count: this.data.total_count_job_logs, disabled: true } }, { - title: this.$t('dashboard.BatchCommandNotExecuted'), + title: this.$t('dashboard.TotalJobRunning'), body: { route: { name: `CommandList` }, - count: this.data.total_count_jobs_unexecuted, + count: this.data.total_count_job_logs_running, disabled: true } }, { - title: this.$t('dashboard.ExecuteFailedCommand'), + title: this.$t('dashboard.TotalJobFailed'), body: { route: { name: `CommandList` }, - count: this.data.total_count_jobs_executed_failed, + count: this.data.total_count_job_logs_failed, disabled: true } } @@ -90,16 +90,16 @@ export default { methods: { async getData() { const data = await this.$axios.get(`/api/v1/index/?days=${this.days} - &total_count_jobs=1 - &total_count_jobs_unexecuted=1 - &total_count_jobs_executed_failed=1 + &total_count_job_logs=1 + &total_count_job_logs_running=1 + &total_count_job_logs_failed=1 &session_dates_metrics=1 `) const totalCountSession = data.dates_metrics_total_count_session this.chartConfig.datesMetrics = data.dates_metrics_date - this.data.total_count_jobs = data?.total_count_jobs - this.data.total_count_jobs_unexecuted = data?.total_count_jobs_unexecuted - this.data.total_count_jobs_executed_failed = data?.total_count_jobs_executed_failed + this.data.total_count_job_logs = data?.total_count_job_logs + this.data.total_count_job_logs_running = data?.total_count_job_logs_running + this.data.total_count_job_logs_failed = data?.total_count_job_logs_failed if (totalCountSession.length > 1) { this.chartConfig.secondaryData = totalCountSession } @@ -112,10 +112,12 @@ export default { .margin-top-16 { margin-top: 16px; } + .box { margin-top: 16px; padding: 20px; background: #fff; + .head { display: flex; justify-content: space-between;