perf: 优化审计台dashboard

This commit is contained in:
Aaron3S
2023-02-16 20:00:09 +08:00
committed by huailei
parent 5bc0de8cff
commit 2e92cc02ea
3 changed files with 25 additions and 17 deletions

View File

@@ -761,6 +761,9 @@
"Filename": "ファイル名"
},
"dashboard": {
"TotalJobLog": "ジョブ実行総数",
"TotalJobRunning": "実行中のジョブ数",
"TotalJobFailed": "実行失敗ジョブ数",
"ActiveAsset": "最近ログインされました",
"ActiveUser": "最近ログインしました",
"ActiveUserAssetsRatioTitle": "占有率統計",

View File

@@ -757,6 +757,9 @@
}
},
"dashboard": {
"TotalJobLog": "作业执行总数",
"TotalJobRunning": "运行中作业数",
"TotalJobFailed": "执行失败作业数",
"ActiveAsset": "近期被登录过",
"ActiveUser": "近期登录过",
"ActiveUserAssetsRatioTitle": "占比统计",

View File

@@ -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;