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