Merge branch 'pam' of github.com:jumpserver/lina into pam

This commit is contained in:
ibuler
2025-02-18 16:51:33 +08:00
16 changed files with 118 additions and 123 deletions

View File

@@ -30,7 +30,7 @@ export default {
columnsShow: {
default: [
'automation', 'backup_name', 'trigger',
'date_start', 'date_finished', 'duration', 'actions'
'date_start', 'date_finished', 'actions'
]
},
columnsMeta: {

View File

@@ -38,7 +38,7 @@ export default {
columnsShow: {
min: ['name', 'actions'],
default: [
'name', 'backup_type', 'org_name', 'periodic_display',
'name', 'backup_type', 'periodic_display',
'executed_amount', 'is_active', 'actions'
]
},

View File

@@ -22,7 +22,7 @@ export default {
],
columnsShow: {
default: [
'automation', 'change_secret_name', 'status',
'automation', 'change_secret_name', 'trigger', 'status',
'date_start', 'date_finished', 'actions'
]
},

View File

@@ -36,7 +36,7 @@ export default {
)
},
{
title: this.$t('AccountRecord'),
title: this.$t('RecordList'),
name: 'ChangeSecretRecord',
hidden: () => !this.$hasPerm('accounts.view_changesecretrecord'),
component: () => import(

View File

@@ -28,7 +28,7 @@ export default {
],
columnsShow: {
default: [
'automation', 'push_user_name', 'status',
'automation', 'push_user_name', 'trigger', 'status',
'date_start', 'date_finished', 'actions'
]
},

View File

@@ -28,7 +28,7 @@ export default {
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue')
},
{
title: this.$t('AccountRecord'),
title: this.$t('RecordList'),
name: 'AccountPushRecord',
hidden: () => !this.$hasPerm('accounts.view_pushsecretrecord'),
component: () => import(

View File

@@ -1,10 +1,10 @@
<template>
<div>
<el-row :gutter="16">
<el-col :lg="12" :sm="24" class="margin-top-10 card-left">
<el-col :lg="12" :md="24" class="margin-top-10 card-left">
<SummaryCountCard :config="logConfig" :items="LogItems" />
</el-col>
<el-col :lg="12" :sm="24" class="margin-top-10 card-right">
<el-col :lg="12" :md="24" class="margin-top-10 card-right">
<SummaryCountCard :config="sessionConfig" :items="sessionItems" />
</el-col>
</el-row>

View File

@@ -1,7 +1,7 @@
<template>
<div>
<el-row :gutter="16">
<el-col :lg="24" :sm="12" class="margin-top-10">
<el-col :sm="24" :md="24" class="margin-top-10">
<SummaryCountCard :config="logConfig" :items="LogItems" />
</el-col>
</el-row>

View File

@@ -1,17 +1,16 @@
<template>
<div v-if="this.$hasPerm('accounts.view_changesecretautomation')">
<div v-if="this.$hasPerm('accounts.view_changesecretautomation')" class="change-secret-container">
<div class="switch-date-wrapper">
<SwitchDate class="switch-date" @change="onChange" />
</div>
<el-row type="flex">
<el-col :span="16">
<el-row>
<el-col :lg="16" :md="24">
<CardSummary :days="days" class="card-summary" />
</el-col>
<el-col :span="8">
<DataSummary :days="days" class="data-summary" style="margin-left: 1rem" />
<el-col :lg="8" :md="24">
<DataSummary :days="days" class="data-summary" />
</el-col>
</el-row>
@@ -83,6 +82,10 @@ export default {
}
}
.change-secret-container {
min-width: 670px;
}
.switch-date-wrapper {
margin-bottom: 1.25rem;
}
@@ -106,4 +109,21 @@ export default {
margin-bottom: unset !important;
}
}
.data-summary {
margin-left: 1rem
}
.account-summary,
.data-summary,
.card-summary,
.failed-account-summary {
min-width: unset;
}
@media (max-width: 1200px) {
::v-deep .data-summary {
margin-left: unset !important;
}
}
</style>

View File

@@ -43,55 +43,28 @@ export default {
return {
tooltip: {
trigger: 'item',
formatter: (params) => {
formatter: params => {
return `${params.name}: ${params.value} (${params.percent}%)`
}
},
legend: {
orient: 'vertical',
top: '25%',
right: this.$i18n.locale === 'zh' ? '20%' : '10%',
itemGap: 20,
textStyle: {
color: '#666',
fontSize: 12
},
icon: 'circle',
itemWidth: 8,
itemHeight: 8,
formatter: (name) => {
const data = [
{ 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}: ${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
}
}
icon: 'rect',
itemWidth: 10,
itemHeight: 10,
left: '2%'
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
series: [
{
name: this.$t('Task Distribution'),
type: 'pie',
radius: ['50%', '60%'],
center: ['30%', '50%'],
top: '10%',
radius: ['45%', '60%'],
label: {
show: false
},
@@ -194,7 +167,8 @@ export default {
border-radius: 4px;
.header {
padding: 1.25rem;
padding: 1.25rem 1.25rem 0;
margin-bottom: 8px;
.content {
justify-content: flex-start;
@@ -212,7 +186,7 @@ export default {
.chart-container {
width: 100%;
height: 19.25rem;
height: 321px;
}
}
}

View File

@@ -5,19 +5,19 @@
<div class="summary-container">
<el-row :gutter="20">
<el-col :span="16">
<el-col :span="16" :xs="24">
<DataSummary class="data-summery" />
</el-col>
<el-col :span="8">
<el-col :span="8" :xs="24">
<AccountSecretSummary class="account-secret-summary" />
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="16">
<el-col :span="16" :xs="24">
<RiskSummary class="risk-summary" />
</el-col>
<el-col :span="8">
<el-col :span="8" :xs="24">
<MissionSummery class="mission-summery" />
</el-col>
</el-row>
@@ -83,9 +83,15 @@ export default {
margin-top: unset;
::v-deep .echarts {
height: 205px;
height: 178px;
}
}
}
@media (max-width: 768px) {
.risk-summary,
.data-summery {
margin-bottom: 1.25rem;
}
}
</style>

View File

@@ -158,37 +158,33 @@ export default {
}
},
mounted() {
if (this.$route.query && this.$route.query.type) {
this.initial.type = 'adhoc'
switch (this.$route.query.type) {
case 'adhoc':
this.initial.type = 'adhoc'
if (this.$route.query.id) {
this.$axios.get(`/api/v1/ops/adhocs/${this.$route.query.id}`).then((data) => {
this.initial.module = data.module
this.initial.args = data.args
this.initial.instant = true
this.initial.runAfterSave = true
this.instantTask = true
this.createSuccessNextRoute = { name: 'Adhoc' }
this.ready = true
})
} else {
const type = this.$route.query['_type']
switch (type) {
case 'adhoc':
this.initial.type = 'adhoc'
if (this.$route.query.id) {
this.$axios.get(`/api/v1/ops/adhocs/${this.$route.query.id}`).then((data) => {
this.initial.module = data.module
this.initial.args = data.args
this.initial.instant = true
this.initial.runAfterSave = true
this.instantTask = true
this.createSuccessNextRoute = { name: 'Adhoc' }
this.ready = true
}
break
case 'playbook':
this.initial.type = 'playbook'
if (this.$route.query.id) {
this.initial.playbook = this.$route.query.id
this.ready = true
} else {
this.ready = true
}
break
}
} else {
this.ready = true
})
} else {
this.ready = true
}
break
case 'playbook':
this.initial.type = 'playbook'
if (this.$route.query.id) {
this.initial.playbook = this.$route.query.id
this.ready = true
} else {
this.ready = true
}
break
}
},
methods: {}

View File

@@ -1,6 +1,7 @@
<template>
<div>
<GenericListTable
ref="ListTable"
:create-drawer="createDrawer"
:detail-drawer="detailDrawer"
:header-actions="headerActions"
@@ -22,6 +23,7 @@ export default {
JobRunDialog
},
data() {
const vm = this
return {
item: {},
createDrawer: () => import('@/views/ops/Job/JobUpdateCreate.vue'),
@@ -113,7 +115,12 @@ export default {
}
},
headerActions: {
createRoute: 'JobCreate',
onCreate: () => {
vm.$router.push({
query: { _type: 'adhoc' }
})
vm.$refs.ListTable.onCreate()
},
hasRefresh: true,
hasExport: false,
hasImport: false

View File

@@ -1,6 +1,7 @@
<template>
<div>
<GenericListTable
ref="ListTable"
:create-drawer="createDrawer"
:detail-drawer="detailDrawer"
:header-actions="headerActions"
@@ -23,6 +24,7 @@ export default {
JobRunDialog
},
data() {
const vm = this
return {
createDrawer: () => import('@/views/ops/Job/JobUpdateCreate.vue'),
detailDrawer: () => import('@/views/ops/Job/JobDetail/index.vue'),
@@ -117,13 +119,11 @@ export default {
hasRefresh: true,
hasExport: false,
hasImport: false,
createRoute: () => {
return {
name: 'JobCreate',
query: {
type: 'playbook'
}
}
onCreate: () => {
vm.$router.push({
query: { _type: 'playbook' }
})
vm.$refs.ListTable.onCreate()
}
},
showJobRunDialog: false

View File

@@ -26,7 +26,7 @@ export default {
},
{
name: 'records',
title: this.$t('Records'),
title: this.$t('RecordList'),
hidden: !this.$hasPerm('audits.view_integrationapplicationlog'),
component: () => import('@/views/pam/Integration/components/CallRecords.vue')
},

View File

@@ -8,7 +8,7 @@ import { openTaskPage } from '@/utils/jms'
import { DetailFormatter } from '@/components/Table/TableFormatters'
export default {
name: 'AccountPushExecutionList',
name: 'CheckAccountExecutionList',
components: {
GenericListTable
},
@@ -24,7 +24,7 @@ export default {
tableConfig: {
url: '/api/v1/accounts/check-account-executions/',
columns: [
'task_name', 'asset_amount',
'automation', 'task_name', 'asset_amount',
'node_amount', 'status', 'trigger',
'date_start', 'date_finished', 'actions'
],
@@ -36,9 +36,16 @@ export default {
},
columnsMeta: {
automation: {
label: this.$t('TaskID'),
formatter: function(row) {
return <span>{row.automation}</span>
label: this.$t('ID'),
formatter: DetailFormatter,
formatterArgs: {
route: 'AccountCheckExecutionDetail',
getRoute: ({ row }) => ({
name: 'AccountCheckExecutionDetail',
params: { id: row.id }
}),
drawer: true,
can: this.$hasPerm('accounts.view_checkaccountexecution')
}
},
task_name: {
@@ -68,12 +75,6 @@ export default {
status: {
label: this.$t('Result')
},
timedelta: {
label: this.$t('TimeDelta'),
formatter: function(row) {
return row.timedelta.toFixed(2) + 's'
}
},
actions: {
formatterArgs: {
hasDelete: false,
@@ -83,26 +84,17 @@ export default {
{
name: 'log',
type: 'primary',
can: this.$hasPerm('accounts.view_pushaccountexecution'),
can: this.$hasPerm('accounts.view_checkaccountexecution'),
title: this.$t('Log'),
callback: function({ row }) {
openTaskPage(row['id'])
}
},
{
name: 'detail',
title: this.$t('Detail'),
type: 'info',
can: this.$hasPerm('accounts.view_pushaccountexecution'),
callback: function({ row }) {
return this.$router.push({ name: 'AccountCheckExecutionDetail', params: { id: row.id }})
}
},
{
name: 'report',
title: this.$t('Report'),
type: 'success',
can: this.$hasPerm('accounts.view_pushaccountexecution'),
can: this.$hasPerm('accounts.view_checkaccountexecution'),
callback: function({ row }) {
window.open(`/api/v1/accounts/check-account-executions/${row.id}/report/`)
}