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

This commit is contained in:
ibuler
2025-02-28 13:54:29 +08:00
13 changed files with 116 additions and 132 deletions

View File

@@ -119,6 +119,16 @@ export default [
title: i18n.t('AccountCheckUpdate'), title: i18n.t('AccountCheckUpdate'),
permissions: ['accounts.view_accountrisk'] permissions: ['accounts.view_accountrisk']
} }
},
{
path: ':id',
component: () => import('@/views/pam/RiskDetect/AccountCheckDetail/index.vue'),
name: 'AccountCheckDetail',
meta: {
title: i18n.t('RiskDetectionDetail'),
permissions: ['accounts.view_accountrisk']
},
hidden: true
} }
] ]
} }

View File

@@ -51,7 +51,7 @@ export default {
name: 'AccountBackupExecutionDetail', name: 'AccountBackupExecutionDetail',
params: { id: row.id } params: { id: row.id }
}), }),
getTitle: ({ row }) => row['short_id'], getTitle: ({ row }) => row.automation.slice(0, 8),
drawer: true, drawer: true,
can: this.$hasPerm('accounts.view_backupaccountexecution') can: this.$hasPerm('accounts.view_backupaccountexecution')
} }
@@ -60,6 +60,7 @@ export default {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
drawer: true,
getTitle: ({ row }) => row.snapshot.name, getTitle: ({ row }) => row.snapshot.name,
getRoute: ({ row }) => ({ getRoute: ({ row }) => ({
name: 'AccountBackupDetail', name: 'AccountBackupDetail',

View File

@@ -44,7 +44,7 @@ export default {
name: 'AccountChangeSecretExecutionDetail', name: 'AccountChangeSecretExecutionDetail',
params: { id: row.id } params: { id: row.id }
}), }),
getTitle: ({ row }) => row['short_id'], getTitle: ({ row }) => row.automation.slice(0, 8),
drawer: true, drawer: true,
can: this.$hasPerm('accounts.view_changesecretexecution') can: this.$hasPerm('accounts.view_changesecretexecution')
} }

View File

@@ -51,7 +51,7 @@ export default {
name: 'AccountDiscoverExecutionDetail', name: 'AccountDiscoverExecutionDetail',
params: { id: row.id } params: { id: row.id }
}), }),
getTitle: ({ row }) => row['short_id'], getTitle: ({ row }) => row.automation.slice(0, 8),
drawer: true drawer: true
} }
}, },
@@ -70,8 +70,7 @@ export default {
getTitle: ({ row }) => row.snapshot.name, getTitle: ({ row }) => row.snapshot.name,
getRoute: ({ row }) => ({ getRoute: ({ row }) => ({
name: 'AccountDiscoverTaskDetail', name: 'AccountDiscoverTaskDetail',
params: { id: row.automation }, params: { id: row.automation }
query: { type: 'pam' }
}), }),
drawer: true drawer: true
}, },

View File

@@ -50,7 +50,7 @@ export default {
name: 'AccountPushExecutionDetail', name: 'AccountPushExecutionDetail',
params: { id: row.id } params: { id: row.id }
}), }),
getTitle: ({ row }) => row['short_id'], getTitle: ({ row }) => row.automation.slice(0, 8),
drawer: true, drawer: true,
can: this.$hasPerm('accounts.view_pushaccountexecution') can: this.$hasPerm('accounts.view_pushaccountexecution')
} }

View File

@@ -41,6 +41,7 @@ export default {
label: this.$t('Asset'), label: this.$t('Asset'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
drawer: true,
can: this.$hasPerm('assets.view_asset'), can: this.$hasPerm('assets.view_asset'),
getTitle({ row }) { getTitle({ row }) {
return row.asset.name return row.asset.name
@@ -57,6 +58,7 @@ export default {
label: this.$t('Username'), label: this.$t('Username'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
drawer: true,
can: this.$hasPerm('accounts.view_account'), can: this.$hasPerm('accounts.view_account'),
getTitle({ row }) { getTitle({ row }) {
return row.account.username return row.account.username

View File

@@ -7,7 +7,7 @@
<script type="text/jsx"> <script type="text/jsx">
import { DrawerListTable as ListTable } from '@/components' import { DrawerListTable as ListTable } from '@/components'
import CopyableFormatter from '@/components/Table/TableFormatters/CopyableFormatter.vue' import CopyableFormatter from '@/components/Table/TableFormatters/CopyableFormatter.vue'
import { DetailFormatter } from '@/components/Table/TableFormatters' import { ActionsFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
export default { export default {
name: 'CloudAccountList', name: 'CloudAccountList',
@@ -63,6 +63,12 @@ export default {
return app.secret return app.secret
} }
} }
},
actions: {
formatter: ActionsFormatter,
formatterArgs: {
hasClone: false
}
} }
}, },
columnsExtra: ['secret'], columnsExtra: ['secret'],

View File

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

View File

@@ -1,97 +0,0 @@
<template>
<TwoCol>
<template>
<AutoDetailCard :fields="detailFields" :object="object" :url="url" />
</template>
<template #right>
<QuickActions :actions="quickActions" type="primary" />
</template>
</TwoCol>
</template>
<script>
import { QuickActions } from '@/components'
import AutoDetailCard from '@/components/Cards/DetailCard/auto'
import { openTaskPage } from '@/utils/jms'
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
export default {
name: 'AccountPushInfo',
components: {
TwoCol,
AutoDetailCard,
QuickActions
},
props: {
object: {
type: Object,
required: true,
default: () => ({})
}
},
data() {
return {
quickActions: [
{
title: this.$t('ManualExecution'),
attrs: {
type: 'primary',
label: this.$t('Execute'),
disabled: !this.$hasPerm('accounts.add_changesecretexecution') || !this.object.is_active
},
callbacks: {
click: function() {
this.$axios.post(
`/api/v1/accounts/push-account-executions/`,
{ automation: this.object.id }
).then(res => {
openTaskPage(res['task'])
})
}.bind(this)
}
}
],
url: `/api/v1/accounts/push-account-automations/${this.object.id}`,
detailFields: [
'id', 'name',
{
key: this.$t('Accounts'),
value: this.object.accounts.join(', ')
},
{
key: this.$t('AssetsOfNumber'),
value: this.object.assets.length
},
{
key: this.$t('NodeOfNumber'),
value: this.object.nodes.length
},
{
key: this.$t('PasswordStrategy'),
value: this.object.secret_strategy.label
},
{
key: this.$t('Crontab'),
value: this.object.crontab,
formatter: (item, val) => {
return <span>{this.object.is_periodic ? val : '-'}</span>
}
},
{
key: this.$t('Interval'),
value: this.object.interval,
formatter: (item, val) => {
return <span>{this.object.is_periodic ? val : '-'}</span>
}
},
'date_created', 'date_updated', 'comment', 'is_active'
]
}
},
computed: {}
}
</script>
<style scoped>
</style>

View File

@@ -0,0 +1,65 @@
<template>
<TwoCol>
<template>
<AutoDetailCard :fields="detailFields" :object="object" :url="url" />
</template>
<template #right>
<QuickActions :actions="quickActions" type="primary" />
</template>
</TwoCol>
</template>
<script>
import { QuickActions } from '@/components'
import AutoDetailCard from '@/components/Cards/DetailCard/auto'
import { openTaskPage } from '@/utils/jms'
import TwoCol from '@/layout/components/Page/TwoColPage.vue'
export default {
name: 'AccountCheckDetail',
components: {
TwoCol,
AutoDetailCard,
QuickActions
},
props: {
object: {
type: Object,
required: true,
default: () => ({})
}
},
data() {
return {
quickActions: [
{
title: this.$t('ManualExecution'),
attrs: {
type: 'primary',
label: this.$t('Execute'),
disabled: !this.$hasPerm('accounts.add_checkaccountautomation') || !this.object.is_active
},
callbacks: {
click: function() {
this.$axios.post(
`/api/v1/accounts/check-account-executions/`,
{ automation: this.object.id }
).then(res => {
openTaskPage(res['task'])
})
}.bind(this)
}
}
],
url: `/api/v1/accounts/check-account-automations/${this.object.id}`,
detailFields: [
'id', 'name', 'date_created', 'date_updated', 'comment'
]
}
}
}
</script>
<style scoped>
</style>

View File

@@ -8,25 +8,24 @@
<script> <script>
import { GenericDetailPage } from '@/layout/components' import { GenericDetailPage } from '@/layout/components'
import AccountPushInfo from './AccountPushInfo' import AccountCheckDetail from './Detail.vue'
export default { export default {
components: { components: {
GenericDetailPage, GenericDetailPage,
AccountPushInfo AccountCheckDetail
}, },
data() { data() {
return { return {
plan: { name: '', username: '', comment: '' }, plan: { name: '', username: '', comment: '' },
config: { config: {
titlePrefix: this.$t('AccountCheckDetail'), titlePrefix: this.$t('AccountCheckDetail'),
activeMenu: 'AccountPushInfo', url: '/api/v1/accounts/check-account-automations',
url: '/api/v1/accounts/push-account-automations',
submenu: [ submenu: [
{ {
title: this.$t('Basic'), title: this.$t('Basic'),
name: 'AccountPushInfo', name: 'AccountCheckDetail',
hidden: () => !this.$hasPerm('accounts.view_changesecretautomation') hidden: () => !this.$hasPerm('accounts.view_accountrisk')
} }
] ]
} }

View File

@@ -47,12 +47,11 @@ export default {
label: this.$t('ID'), label: this.$t('ID'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
route: 'AccountCheckExecutionDetail',
getRoute: ({ row }) => ({ getRoute: ({ row }) => ({
name: 'AccountCheckExecutionDetail', name: 'AccountCheckExecutionDetail',
params: { id: row.id } params: { id: row.automation }
}), }),
getTitle: ({ row }) => row['short_id'], getTitle: ({ row }) => row.automation.slice(0, 8),
drawer: true, drawer: true,
can: this.$hasPerm('accounts.view_checkaccountexecution') can: this.$hasPerm('accounts.view_checkaccountexecution')
} }
@@ -61,9 +60,10 @@ export default {
label: this.$t('DisplayName'), label: this.$t('DisplayName'),
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
drawer: true,
getTitle: ({ row }) => row.snapshot.name, getTitle: ({ row }) => row.snapshot.name,
getRoute: ({ row }) => ({ getRoute: ({ row }) => ({
name: 'AccountCheckDetail', name: 'AccountCheckList',
params: { id: row.automation } params: { id: row.automation }
}) })
}, },

View File

@@ -33,35 +33,34 @@ export default {
name: { name: {
formatter: DetailFormatter, formatter: DetailFormatter,
formatterArgs: { formatterArgs: {
route: 'AccountCheckDetail' getRoute: ({ row }) => ({
name: 'AccountCheckDetail',
params: { id: row.id }
})
} }
}, },
assets: { assets: {
formatter: AmountFormatter, formatter: AmountFormatter,
formatterArgs: { formatterArgs: {
async: false, async: false,
getRoute({ row }) { drawer: true,
return { getTitle: ({ row }) => row.assets[0].name,
getRoute: ({ row }) => ({
name: 'AssetDetail', name: 'AssetDetail',
params: { params: { id: row.assets[0].id }
id: row.id })
}
}
}
} }
}, },
nodes: { nodes: {
formatter: AmountFormatter, formatter: AmountFormatter,
formatterArgs: { formatterArgs: {
async: false, async: false,
getRoute({ row }) { drawer: true,
return { getRoute: ({ row }) => ({
name: 'AssetDetail', name: 'AssetDetail',
params: { query: { tab: 'Basic' },
id: row.id params: { id: row.assets[0].id }
} })
}
}
} }
}, },
secret_strategy: { secret_strategy: {