mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-25 22:36:23 +00:00
Merge branch 'pam' of github.com:jumpserver/lina into pam
This commit is contained in:
@@ -20,9 +20,15 @@
|
||||
</el-checkbox>
|
||||
<ul>
|
||||
<li v-for="item in assetAccounts" :key="item.id">
|
||||
<a href="">
|
||||
<router-link
|
||||
:to="{
|
||||
name: 'AssetAccountDetail',
|
||||
params: { id: item.id }
|
||||
}"
|
||||
target="_blank"
|
||||
>
|
||||
{{ item.name }}({{ item.username }}) - {{ account.asset.name }}
|
||||
</a>
|
||||
</router-link>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -119,10 +125,13 @@ export default {
|
||||
})
|
||||
},
|
||||
handleConfirm() {
|
||||
this.$axios.delete('/api/v1/accounts/gathered-accounts/', {
|
||||
const url = '/api/v1/accounts/gathered-accounts/'
|
||||
this.$axios.delete(url, {
|
||||
params: {
|
||||
username: this.account.username,
|
||||
asset: this.account.asset.id
|
||||
asset: this.account.asset.id,
|
||||
is_delete_account: this.iDeleteAccount,
|
||||
is_delete_remote: this.iDeleteRemote
|
||||
}
|
||||
}).then(res => {
|
||||
this.$message.success('删除成功')
|
||||
|
@@ -1,33 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<GenericListTable ref="listTable" :header-actions="headerActions" :table-config="tableConfig" />
|
||||
|
||||
<Drawer v-if="showTableUpdateDrawer" :title="drawerTitle" @close-drawer="showTableUpdateDrawer = !showTableUpdateDrawer">
|
||||
<component :is="currentTemplate" />
|
||||
</Drawer>
|
||||
</div>
|
||||
<GenericListTable ref="listTable" :header-actions="headerActions" :table-config="tableConfig" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { ActionsFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
||||
import { openTaskPage } from '@/utils/jms'
|
||||
import { GenericListTable } from '@/layout/components'
|
||||
import Drawer from '@/components/Drawer/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'AccountPushList',
|
||||
components: {
|
||||
Drawer,
|
||||
GenericListTable,
|
||||
AccountPushUpdate: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue'),
|
||||
AccountPushCreate: () => import('@/views/accounts/AccountPush/AccountPushCreateUpdate.vue')
|
||||
GenericListTable
|
||||
},
|
||||
data() {
|
||||
const vm = this
|
||||
return {
|
||||
drawerTitle: '',
|
||||
showTableUpdateDrawer: false,
|
||||
currentTemplate: null,
|
||||
tableConfig: {
|
||||
url: '/api/v1/accounts/push-account-automations/',
|
||||
columns: [
|
||||
@@ -45,12 +32,7 @@ export default {
|
||||
name: {
|
||||
formatter: DetailFormatter,
|
||||
formatterArgs: {
|
||||
isPam: true,
|
||||
getRoute: ({ row }) => ({
|
||||
name: 'AccountPushDetail',
|
||||
params: { id: row.id },
|
||||
query: { type: 'pam' }
|
||||
})
|
||||
route: 'AccountPushDetail'
|
||||
}
|
||||
},
|
||||
accounts: {
|
||||
@@ -63,16 +45,6 @@ export default {
|
||||
return <span> {row.secret_strategy.label} </span>
|
||||
}
|
||||
},
|
||||
username: {
|
||||
showOverflowTooltip: true,
|
||||
formatter: ({ username }) => {
|
||||
if (username === '@USER') {
|
||||
return this.$t('DynamicUsername')
|
||||
} else {
|
||||
return username
|
||||
}
|
||||
}
|
||||
},
|
||||
assets_amount: {
|
||||
label: vm.$t('AssetsOfNumber')
|
||||
},
|
||||
@@ -101,17 +73,11 @@ export default {
|
||||
actions: {
|
||||
formatter: ActionsFormatter,
|
||||
formatterArgs: {
|
||||
isPam: true,
|
||||
updateRoute: 'AccountPushUpdate',
|
||||
onClone: ({ row }) => {
|
||||
vm.$router.push({ name: 'AccountPushCreate', query: { clone_from: row.id }})
|
||||
},
|
||||
onUpdate: ({ row }) => {
|
||||
this.$route.params.id = row.id
|
||||
|
||||
// 解决表单详情中的跳转
|
||||
this.$route.query.type = 'pam'
|
||||
|
||||
this.currentTemplate = 'AccountPushUpdate'
|
||||
this.drawerTitle = this.$t('AccountPushUpdate')
|
||||
this.showTableUpdateDrawer = true
|
||||
vm.$router.push({ name: 'AccountPushUpdate', params: { id: row.id }})
|
||||
},
|
||||
extraActions: [
|
||||
{
|
||||
@@ -138,15 +104,14 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
helpMsg: this.$t('WebHelpMessage'),
|
||||
headerActions: {
|
||||
hasRefresh: true,
|
||||
hasExport: false,
|
||||
hasImport: false,
|
||||
onCreate: () => {
|
||||
this.currentTemplate = 'AccountPushCreate'
|
||||
this.drawerTitle = this.$t('AccountPushCreate')
|
||||
this.showTableUpdateDrawer = true
|
||||
createRoute: () => {
|
||||
return {
|
||||
name: 'AccountPushCreate'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user