Skip to content

Commit

Permalink
perf: Pam dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
feng626 committed Feb 11, 2025
1 parent 768cae7 commit c932fbb
Show file tree
Hide file tree
Showing 9 changed files with 123 additions and 101 deletions.
8 changes: 4 additions & 4 deletions src/views/dashboard/ChangeSecret/AccountSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export default {
return {
loading: false,
config: {
title: '账号成功/失败情况',
tip: '账号成功/失败情况'
title: this.$t('AccountResult'),
tip: this.$t('AccountResult')
},
lineChartConfig: {
datesMetrics: [],
primaryData: [1],
primaryName: '成功',
primaryName: this.$t('Success'),
secondaryData: [1],
secondaryName: '失败'
secondaryName: this.$t('Failed')
}
}
},
Expand Down
26 changes: 10 additions & 16 deletions src/views/dashboard/ChangeSecret/CardSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ export default {
data() {
return {
logConfig: {
title: '当前状态',
tip: '当前状态'
title: this.$t('CurrentStatus'),
tip: this.$t('CurrentStatus')
},
sessionConfig: {
title: '改密任务执行状态',
tip: '改密任务执行状态'
title: this.$t('ChangeSecretTaskStatus'),
tip: this.$t('ChangeSecretTaskStatus')
},
data: {
total_count_change_secrets: 0,
Expand All @@ -47,23 +47,20 @@ export default {
LogItems() {
return [
{
title: '任务数',
title: this.$t('TaskCount'),
body: {
route: { name: `LoginLogList` },
count: this.data.total_count_change_secrets
}
},
{
title: '定时任务数',
title: this.$t('ScheduledTaskCount'),
body: {
route: { name: `LoginLogList` },
count: this.data.total_count_periodic_change_secrets
}
},
{
title: '资产数',
title: this.$t('AssetsOfNumber'),
body: {
route: { name: `OperateLogList` },
count: this.data.total_count_change_secret_assets
}
}
Expand All @@ -72,23 +69,20 @@ export default {
sessionItems() {
return [
{
title: '任务执行数',
title: this.$t('TaskExecutionCount'),
body: {
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
count: this.data.total_count_change_secret_executions
}
},
{
title: '成功数',
title: this.$t('SuccessCount'),
body: {
route: { name: `SessionList`, params: { activeMenu: 'OfflineList' }},
count: this.data.total_count_success_change_secret_executions
}
},
{
title: '失败数',
title: this.$t('FailCount'),
body: {
route: { name: `FtpLog` },
count: this.data.total_count_failed_change_secret_executions
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/views/dashboard/ChangeSecret/DataSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export default {
data() {
return {
logConfig: {
title: '当前正在改密情况',
tip: '当前正在改密情况'
title: this.$t('OngoingPwdChange'),
tip: this.$t('OngoingPwdChange')
},
data: {
total_count_ongoing_change_secret: 0,
Expand All @@ -36,21 +36,21 @@ export default {
LogItems() {
return [
{
title: '任务执行数',
title: this.$t('TaskExecutionCount'),
body: {
route: { name: `LoginLogList` },
count: this.data.total_count_ongoing_change_secret
}
},
{
title: '资产数',
title: this.$t('AssetsOfNumber'),
body: {
route: { name: `LoginLogList` },
count: this.data.total_count_ongoing_change_secret_assets
}
},
{
title: '账号数',
title: this.$t('AccountAmount'),
body: {
route: { name: `OperateLogList` },
count: this.data.total_count_ongoing_change_secret_accounts
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/ChangeSecret/FailedAccountSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default {
return {
showViewSecretDialog: false,
cardConfig: {
title: '改密失败账号'
title: this.$tc('ChangeSecretFailAccounts')
},
tableConfig: {
url: `/api/v1/accounts/change-secret-records/dashboard/?days=${this.days}`,
Expand Down
2 changes: 1 addition & 1 deletion src/views/dashboard/Pam/AssetProportionSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default {
const str = data[this.url.split('?')[1].split('=')[0]]
if (this.url.includes('accounts')) {
this.titleConfig.title = this.$t('ProportionOfAccontTypes')
this.titleConfig.title = this.$t('ProportionOfAccountTypes')
this.titleConfig.tip = this.$t('ProportionOfAccountTypes')
} else {
this.titleConfig.title = this.$t('ProportionOfAssetTypes')
Expand Down
14 changes: 7 additions & 7 deletions src/views/dashboard/Pam/DataSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ export default {
route: { name: 'PamAccounts' },
total: 0,
weekAdd: 0,
privileged: 0,
resetSecret: 0,
connectable: 0,
privilegedAccount: 0,
regularAccount: 0
valid: 0
}
}
},
Expand All @@ -44,20 +44,20 @@ export default {
params: {
total_accounts: 1,
total_week_add_accounts: 1,
total_privileged_accounts: 1,
total_secret_reset_accounts: 1,
total_connectivity_ok_accounts: 1
total_connectivity_ok_accounts: 1,
total_valid_accounts: 1
}
}
)
this.accountConfig.total = data.total_accounts
this.accountConfig.weekAdd = data.total_week_add_accounts
this.accountConfig.privileged = data.total_privileged_accounts
this.accountConfig.resetSecret = data.total_secret_reset_accounts
this.accountConfig.connectable = data.total_connectivity_ok_accounts
// TODO 额外两个字段
this.accountConfig.privilegedAccount = data.total_privileged_accounts
this.accountConfig.regularAccount = data.total_regular_accounts
this.accountConfig.valid = data.total_valid_accounts
}
}
}
Expand Down
38 changes: 19 additions & 19 deletions src/views/dashboard/Pam/MissionSummery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export default {
data() {
return {
config: {
title: '任务执行情况',
tip: '任务执行情况'
title: this.$t('Task Distribution'),
tip: this.$t('Task Distribution')
},
counter: {
total_count_gathered_account_automation: 0,
total_count_change_secret_automation: 0,
total_count_push_account_automation: 0,
total_count_gathered_account_automation: 0,
total_count_backup_account_automation: 0,
total_count_risk_account: 0,
total_count_integration_application: 0
},
chart: null
Expand All @@ -55,11 +55,11 @@ export default {
itemHeight: 8,
formatter: (name) => {
const data = [
{ name: '账号收集任务', value: this.counter.total_count_gathered_account_automation },
{ name: '账号推送任务', value: this.counter.total_count_push_account_automation },
{ name: '账号备份任务', value: this.counter.total_count_backup_account_automation },
{ name: '风险账号', value: this.counter.total_count_risk_account },
{ name: '集成应用', value: this.counter.total_count_integration_application }
{ name: this.$t('BaseAccountChangeSecret'), value: this.counter.total_count_change_secret_automation },
{ name: this.$t('BaseAccountPush'), value: this.counter.total_count_push_account_automation },
{ name: this.$t('DiscoverAccounts'), value: this.counter.total_count_gathered_account_automation },
{ name: this.$t('AccountBackup'), value: this.counter.total_count_backup_account_automation },
{ name: this.$t('RelevantApp'), value: this.counter.total_count_integration_application }
]
const item = data.find(item => item.name === name)
Expand All @@ -68,7 +68,7 @@ export default {
},
series: [
{
name: '任务分布',
name: this.$t('Task Distribution'),
type: 'pie',
radius: ['50%', '70'],
center: ['25%', '50%'],
Expand All @@ -80,24 +80,24 @@ export default {
},
data: [
{
value: this.counter.total_count_gathered_account_automation,
name: '账号收集任务'
value: this.counter.total_count_change_secret_automation,
name: this.$t('BaseAccountChangeSecret')
},
{
value: this.counter.total_count_push_account_automation,
name: '账号推送任务'
name: this.$t('BaseAccountPush')
},
{
value: this.counter.total_count_backup_account_automation,
name: '账号备份任务'
value: this.counter.total_count_gathered_account_automation,
name: this.$t('DiscoverAccounts')
},
{
value: this.counter.total_count_risk_account,
name: '风险账号'
value: this.counter.total_count_backup_account_automation,
name: this.$t('AccountBackup')
},
{
value: this.counter.total_count_integration_application,
name: '集成应用'
name: this.$t('RelevantApp')
}
],
emphasis: {
Expand Down Expand Up @@ -139,10 +139,10 @@ export default {
async getResourcesCount() {
return this.$axios.get('/api/v1/accounts/pam-dashboard/', {
params: {
total_count_change_secret_automation: 1,
total_count_gathered_account_automation: 1,
total_count_push_account_automation: 1,
total_count_backup_account_automation: 1,
total_count_risk_account: 1,
total_count_integration_application: 1
}
})
Expand Down
Loading

0 comments on commit c932fbb

Please sign in to comment.