mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: Pam dashboard
This commit is contained in:
@@ -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')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -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,
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
@@ -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
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -68,7 +68,7 @@ export default {
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '任务分布',
|
||||
name: this.$t('Task Distribution'),
|
||||
type: 'pie',
|
||||
radius: ['50%', '70'],
|
||||
center: ['25%', '50%'],
|
||||
@@ -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_gathered_account_automation,
|
||||
name: this.$t('DiscoverAccounts')
|
||||
},
|
||||
{
|
||||
value: this.counter.total_count_backup_account_automation,
|
||||
name: '账号备份任务'
|
||||
},
|
||||
{
|
||||
value: this.counter.total_count_risk_account,
|
||||
name: '风险账号'
|
||||
name: this.$t('AccountBackup')
|
||||
},
|
||||
{
|
||||
value: this.counter.total_count_integration_application,
|
||||
name: '集成应用'
|
||||
name: this.$t('RelevantApp')
|
||||
}
|
||||
],
|
||||
emphasis: {
|
||||
@@ -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
|
||||
}
|
||||
})
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
class="metric-item"
|
||||
/>
|
||||
</template>
|
||||
<!-- <el-row :gutter="20">
|
||||
<el-col v-for="item of summaryItems" :key="item.title" :md="6" :sm="12" :xs="12">
|
||||
<SummaryCard :body="item.body" :title="item.title" />
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -35,15 +30,19 @@ export default {
|
||||
tip: this.$t('RealTimeData')
|
||||
},
|
||||
counter: {
|
||||
total_long_time_no_login_accounts: '.',
|
||||
total_weak_password_accounts: '.',
|
||||
total_long_time_change_password_accounts: '.',
|
||||
total_leaked_password_accounts: '.',
|
||||
total_repeated_password_accounts: '.',
|
||||
total_password_expired_accounts: '.',
|
||||
total_no_admin_account_accounts: '.',
|
||||
total_password_error_accounts: '.',
|
||||
total_new_found_accounts: '.'
|
||||
'total_long_time_no_login_accounts': '.',
|
||||
'total_new_found_accounts': '.',
|
||||
'total_group_changed_accounts': '.',
|
||||
'total_sudo_changed_accounts': '.',
|
||||
'total_authorized_keys_changed_accounts': '.',
|
||||
'total_account_deleted_accounts': '.',
|
||||
'total_password_expired_accounts': '.',
|
||||
'total_long_time_password_accounts': '.',
|
||||
'total_weak_password_accounts': '.',
|
||||
'total_leaked_password_accounts': '.',
|
||||
'total_repeated_password_accounts': '.',
|
||||
'total_password_error_accounts': '.',
|
||||
'total_no_admin_account_accounts': '.'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -51,9 +50,58 @@ export default {
|
||||
summaryItems() {
|
||||
return [
|
||||
{
|
||||
title: this.$t('LeakedPassword'),
|
||||
title: this.$t('NoLoginLongTime'),
|
||||
body: {
|
||||
count: this.counter.total_leaked_password_accounts,
|
||||
count: this.counter.total_long_time_no_login_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('NewAccountsFound'),
|
||||
body: {
|
||||
count: this.counter.total_new_found_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('GroupChanged'),
|
||||
body: {
|
||||
count: this.counter.total_group_changed_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('SudoChanged'),
|
||||
body: {
|
||||
count: this.counter.total_sudo_changed_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('AuthorizedKeysChanged'),
|
||||
body: {
|
||||
count: this.counter.total_authorized_keys_changed_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('AccountDeleted'),
|
||||
body: {
|
||||
count: this.counter.total_account_deleted_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('PasswordExpired'),
|
||||
body: {
|
||||
count: this.counter.total_password_expired_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('LongTimePassword'),
|
||||
body: {
|
||||
count: this.counter.total_long_time_password_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
@@ -65,17 +113,9 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('LongTimeNoLogin'),
|
||||
title: this.$t('LeakedPassword'),
|
||||
body: {
|
||||
route: { name: `SessionList`, params: { activeMenu: 'OnlineList' }},
|
||||
count: this.counter.total_long_time_no_login_accounts
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: this.$t('LongTimeNoChangeSecret'),
|
||||
body: {
|
||||
count: this.counter.total_long_time_change_password_accounts,
|
||||
count: this.counter.total_leaked_password_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
@@ -87,28 +127,14 @@ export default {
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('Unmanaged'),
|
||||
body: {
|
||||
count: this.counter.total_new_found_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('Password expiration'),
|
||||
body: {
|
||||
count: this.counter.total_password_expired_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('Error password'),
|
||||
title: this.$t('PasswordError'),
|
||||
body: {
|
||||
count: this.counter.total_password_error_accounts,
|
||||
disabled: true
|
||||
}
|
||||
},
|
||||
{
|
||||
title: this.$t('No admin'),
|
||||
title: this.$t('NoAdminAccount'),
|
||||
body: {
|
||||
count: this.counter.total_no_admin_account_accounts,
|
||||
disabled: true
|
||||
@@ -126,13 +152,19 @@ export default {
|
||||
'/api/v1/accounts/pam-dashboard/',
|
||||
{
|
||||
params: {
|
||||
total_privileged_accounts: 1,
|
||||
total_ordinary_accounts: 1,
|
||||
total_unmanaged_accounts: 1,
|
||||
total_unavailable_accounts: 1,
|
||||
total_long_time_no_login_accounts: 1,
|
||||
total_new_found_accounts: 1,
|
||||
total_group_changed_accounts: 1,
|
||||
total_sudo_changed_accounts: 1,
|
||||
total_authorized_keys_changed_accounts: 1,
|
||||
total_account_deleted_accounts: 1,
|
||||
total_password_expired_accounts: 1,
|
||||
total_long_time_password_accounts: 1,
|
||||
total_weak_password_accounts: 1,
|
||||
total_long_time_change_password_accounts: 1
|
||||
total_leaked_password_accounts: 1,
|
||||
total_repeated_password_accounts: 1,
|
||||
total_password_error_accounts: 1,
|
||||
total_no_admin_account_accounts: 1
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -50,24 +50,20 @@ export default {
|
||||
return {
|
||||
summaryItems: [
|
||||
{
|
||||
label: 'Connectable',
|
||||
key: 'connectable',
|
||||
className: 'connection'
|
||||
label: this.$t('Privileged'),
|
||||
key: 'privileged'
|
||||
},
|
||||
{
|
||||
label: 'Reset secret',
|
||||
key: 'resetSecret',
|
||||
className: 'reset'
|
||||
label: this.$t('Reset secret'),
|
||||
key: 'resetSecret'
|
||||
},
|
||||
{
|
||||
label: 'Privileged Account',
|
||||
key: 'privilegedAccount',
|
||||
className: 'privileged'
|
||||
label: this.$t('Connectable'),
|
||||
key: 'connectable'
|
||||
},
|
||||
{
|
||||
label: 'Regular Account',
|
||||
key: 'regularAccount',
|
||||
className: 'regular'
|
||||
label: this.$t('Valid'),
|
||||
key: 'valid'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user