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

This commit is contained in:
ibuler 2025-02-05 16:34:44 +08:00
commit 175b819e8e
13 changed files with 233 additions and 50 deletions

View File

@ -242,8 +242,7 @@ export default [
title: i18n.t('ExecutionDetail'),
permissions: ['accounts.view_pushaccountexecution']
}
}
]
}]
},
{
path: 'account-backup',

View File

@ -21,20 +21,13 @@ export default {
RecordViewSecret,
GenericListTable
},
props: {
object: {
type: Object,
required: true,
default: () => ({})
}
},
data() {
const vm = this
return {
secretUrl: '',
showViewSecretDialog: false,
tableConfig: {
url: `/api/v1/accounts/change-secret-records/?execution_id=${this.object.id}`,
url: '/api/v1/accounts/change-secret-records/',
columns: [
'asset', 'account', 'date_finished', 'is_success', 'error', 'actions'
],
@ -157,6 +150,10 @@ export default {
{
value: 'failed',
label: this.$t('Failed')
},
{
label: this.$t('Execution'),
value: 'execution_id'
}
]
}

View File

@ -32,11 +32,6 @@ export default {
title: this.$t('Basic'),
name: 'AccountChangeSecretExecutionInfo',
hidden: () => !this.$hasPerm('accounts.view_changesecretexecution')
},
{
title: this.$t('TaskList'),
name: 'AccountChangeSecretRecord',
hidden: () => !this.$hasPerm('accounts.view_changesecretrecord')
}
],
getTitle: this.getExecutionTitle

View File

@ -12,13 +12,6 @@ export default {
components: {
GenericListTable
},
props: {
object: {
type: Object,
required: false,
default: () => ({})
}
},
data() {
return {
tableConfig: {
@ -35,7 +28,7 @@ export default {
},
columnsMeta: {
automation: {
label: this.$t('TaskID'),
label: this.$t('ExecutionID'),
formatter: function(row) {
return <span>{row.automation}</span>
}
@ -105,6 +98,20 @@ export default {
callback: function({ row }) {
window.open(`/api/v1/accounts/change-secret-executions/${row.id}/report/`)
}
},
{
name: 'record',
title: this.$t('Record'),
can: this.$hasPerm('accounts.view_changesecretrecord'),
callback: function({ row }) {
return this.$router.push({
name: 'AccountChangeSecretList',
query: {
tab: 'ChangeSecretRecord',
execution_id: row.id
}
})
}
}
]
}

View File

@ -34,6 +34,14 @@ export default {
component: () => import(
'@/views/accounts/AccountChangeSecret/AccountChangeSecretExecution/AccountChangeSecretExecutionList.vue'
)
},
{
title: this.$t('RecordList'),
name: 'ChangeSecretRecord',
hidden: () => !this.$hasPerm('accounts.view_changesecretrecord'),
component: () => import(
'@/views/accounts/AccountChangeSecret/AccountChangeSecretExecution/AccountChangeSecretExecutionDetail/AccountChangeSecretRecord.vue'
)
}
]
}

View File

@ -0,0 +1,137 @@
<template>
<div>
<RecordViewSecret
v-if="showViewSecretDialog"
:url="secretUrl"
:visible.sync="showViewSecretDialog"
/>
<GenericListTable :header-actions="headerActions" :table-config="tableConfig" />
</div>
</template>
<script>
import GenericListTable from '@/layout/components/GenericListTable/index.vue'
import { DetailFormatter } from '@/components/Table/TableFormatters'
import RecordViewSecret from '@/components/Apps/ChangeSecret/RecordViewSecret.vue'
export default {
name: 'AccountPushRecord',
components: {
RecordViewSecret,
GenericListTable
},
props: {
object: {
type: Object,
required: false,
default: () => ({})
}
},
data() {
return {
secretUrl: '',
showViewSecretDialog: false,
tableConfig: {
url: '/api/v1/accounts/push-account-records/',
columns: [
'asset', 'account', 'date_finished', 'is_success', 'error'
],
columnsMeta: {
asset: {
label: this.$t('Asset'),
formatter: DetailFormatter,
formatterArgs: {
can: this.$hasPerm('assets.view_asset'),
getTitle({ row }) {
return row.asset.name
},
getRoute({ row }) {
return {
name: 'AssetDetail',
params: { id: row.asset.id }
}
}
}
},
account: {
label: this.$t('Username'),
formatter: DetailFormatter,
formatterArgs: {
can: this.$hasPerm('accounts.view_account'),
getTitle({ row }) {
return row.account.username
},
getRoute({ row }) {
return {
name: 'AssetAccountDetail',
params: { id: row.account.id }
}
}
}
},
is_success: {
label: this.$t('Success'),
formatter: (row) => {
if (row.status === 'pending') {
return <i Class='fa fa fa-spinner fa-spin'/>
}
if (row.is_success) {
return <i Class='fa fa-check text-primary'/>
}
return <i Class='fa fa-times text-danger'/>
}
}
}
},
headerActions: {
hasSearch: true,
hasRefresh: true,
hasLeftActions: true,
hasRightActions: true,
hasExport: false,
hasImport: false,
hasCreate: false,
hasBulkDelete: false,
hasBulkUpdate: false,
searchConfig: {
exclude: ['id', 'status', 'execution'],
options: [
{
label: this.$t('Asset'),
value: 'asset_name'
},
{
label: this.$t('Accounts'),
value: 'account_username'
},
{
value: 'status',
label: this.$t('Status'),
type: 'choice',
children: [
{
default: true,
value: 'success',
label: this.$t('Success')
},
{
value: 'failed',
label: this.$t('Failed')
}
]
},
{
label: this.$t('Execution'),
value: 'execution_id'
}
]
}
}
}
}
}
</script>
<style scoped>
</style>

View File

@ -12,13 +12,6 @@ export default {
components: {
GenericListTable
},
props: {
object: {
type: Object,
required: false,
default: () => ({})
}
},
data() {
return {
tableConfig: {
@ -35,7 +28,7 @@ export default {
},
columnsMeta: {
automation: {
label: this.$t('TaskID'),
label: this.$t('ExecutionID'),
formatter: function(row) {
return <span>{row.automation}</span>
}
@ -91,7 +84,6 @@ export default {
{
name: 'detail',
title: this.$t('Detail'),
type: 'info',
can: this.$hasPerm('accounts.view_pushaccountexecution'),
callback: function({ row }) {
return this.$router.push({ name: 'AccountPushExecutionDetail', params: { id: row.id }})
@ -100,11 +92,24 @@ export default {
{
name: 'report',
title: this.$t('Report'),
type: 'success',
can: this.$hasPerm('accounts.view_pushaccountexecution'),
callback: function({ row }) {
window.open(`/api/v1/accounts/push-account-executions/${row.id}/report/`)
}
},
{
name: 'record',
title: this.$t('Record'),
can: this.$hasPerm('accounts.view_pushsecretrecord'),
callback: function({ row }) {
return this.$router.push({
name: 'AccountPushList',
query: {
tab: 'AccountPushRecord',
execution_id: row.id
}
})
}
}
]
}

View File

@ -26,6 +26,14 @@ export default {
name: 'AccountPushExecutionList',
hidden: !this.$hasPerm('accounts.view_pushaccountexecution'),
component: () => import('@/views/accounts/AccountPush/AccountPushExecutionList.vue')
},
{
title: this.$t('RecordList'),
name: 'AccountPushRecord',
hidden: () => !this.$hasPerm('accounts.view_pushsecretrecord'),
component: () => import(
'@/views/accounts/AccountPush/AccountPushExecutionDetail/AccountPushRecord.vue'
)
}
]
}

View File

@ -56,8 +56,8 @@ export default {
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.privilegedAccount = data.total_privileged_accounts
this.accountConfig.regularAccount = data.total_regular_accounts
}
}
}

View File

@ -39,7 +39,11 @@ export default {
total_weak_password_accounts: '.',
total_long_time_change_password_accounts: '.',
total_leaked_password_accounts: '.',
total_repeated_password_accounts: '.'
total_repeated_password_accounts: '.',
total_password_expired_accounts: '.',
total_no_admin_account_accounts: '.',
total_password_error_accounts: '.',
total_new_found_accounts: '.'
}
}
},
@ -83,16 +87,32 @@ export default {
}
},
{
title: 'Unmanaged'
title: this.$t('Unmanaged'),
body: {
count: this.counter.total_new_found_accounts,
disabled: true
}
},
{
title: 'Password expiration'
title: this.$t('Password expiration'),
body: {
count: this.counter.total_password_expired_accounts,
disabled: true
}
},
{
title: 'Wrong password'
title: this.$t('Error password'),
body: {
count: this.counter.total_password_error_accounts,
disabled: true
}
},
{
title: 'No admin'
title: this.$t('No admin'),
body: {
count: this.counter.total_no_admin_account_accounts,
disabled: true
}
}
]
}

View File

@ -91,6 +91,7 @@ $text-color: #646A73;
padding: 1.25rem;
background-color: #FFF;
overflow: hidden;
border-radius: 0.25rem;
.total-section {
display: flex;

View File

@ -67,12 +67,11 @@ export default {
}
.summary-container {
.account-secret-summary,
.asset-proportion-summary,
.risk-summary,
.mission-summery {
border-radius: 0.5rem;
border-radius: 0.25rem;
}
.account-secret-summary,

View File

@ -95,14 +95,6 @@ module.exports = {
},
extensions: ['.vue', '.js', '.json']
},
plugins: [
new CompressionWebpackPlugin({
algorithm: 'gzip',
test: productionGzipExtensions, // 处理所有匹配此 {RegExp} 的资源
threshold: 10240, // 只处理比这个值大的资源。按字节计算(楼主设置10K以上进行压缩)
minRatio: 0.8 // 只有压缩率比这个值小的资源才会被处理
})
]
},
chainWebpack(config) {
// it can improve the speed of the first screen, it is recommended to turn on preload
@ -153,6 +145,21 @@ module.exports = {
config => config.devtool('cheap-source-map')
)
config
.when(process.env.NODE_ENV === 'production', config => {
config
.plugin('CompressionWebpackPlugin')
.use(CompressionWebpackPlugin, [
{
algorithm: 'gzip',
test: productionGzipExtensions, // 处理所有匹配此 {RegExp} 的资源
threshold: 10240, // 只处理比这个值大的资源。按字节计算(楼主设置10K以上进行压缩)
minRatio: 0.8, // 只有压缩率比这个值小的资源才会被处理
cache: false
}
])
})
config
.when(process.env.NODE_ENV !== 'development',
config => {