Skip to content

Commit

Permalink
Merge branch 'pam' of github.com:jumpserver/lina into pam
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuler committed Feb 12, 2025
2 parents 19dc42c + 7375dc5 commit 1bdc27e
Show file tree
Hide file tree
Showing 10 changed files with 185 additions and 118 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
73 changes: 46 additions & 27 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 @@ -41,10 +41,16 @@ export default {
computed: {
chartOption() {
return {
tooltip: {
trigger: 'item',
formatter: (params) => {
return `${params.name}: ${params.value} (${params.percent}%)`
}
},
legend: {
orient: 'vertical',
top: '13%',
right: '15%',
top: '25%',
right: this.$i18n.locale === 'zh' ? '20%' : '10%',
itemGap: 20,
textStyle: {
color: '#666',
Expand All @@ -55,23 +61,37 @@ 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)
return name.padEnd(10, '\u2003') + (item.value || 0)
const item = data.find(item => item.name === name)
return `${name}: ${item?.value || 0}`
},
rich: {
name: {
width: this.$i18n.locale === 'zh' ? 120 : 200,
color: '#666',
fontSize: 12,
padding: [0, 15, 0, 0]
},
value: {
width: 60,
align: 'right',
color: '#666',
fontSize: 12
}
}
},
series: [
{
name: '任务分布',
name: this.$t('Task Distribution'),
type: 'pie',
radius: ['50%', '70'],
center: ['25%', '50%'],
radius: ['50%', '60%'],
center: ['30%', '50%'],
label: {
show: false
},
Expand All @@ -80,24 +100,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 +159,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 Expand Up @@ -172,7 +192,6 @@ export default {
height: 100%;
background: #fff;
border-radius: 4px;
box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.header {
padding: 1.25rem;
Expand All @@ -193,7 +212,7 @@ export default {
.chart-container {
width: 100%;
height: 226px;
height: 19.25rem;
}
}
}
Expand Down
Loading

0 comments on commit 1bdc27e

Please sign in to comment.