mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-19 17:54:37 +00:00
Perf: Change AccountConnectFormatter To Common Component
This commit is contained in:
@@ -52,7 +52,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { accountOtherActions, accountQuickFilters, connectivityMeta } from './const'
|
import { accountOtherActions, accountQuickFilters, connectivityMeta } from './const'
|
||||||
import { openTaskPage } from '@/utils/jms'
|
import { openTaskPage } from '@/utils/jms'
|
||||||
import { ActionsFormatter, PlatformFormatter, SecretViewerFormatter } from '@/components/Table/TableFormatters'
|
import { ActionsFormatter, PlatformFormatter, SecretViewerFormatter, AccountConnectFormatter } from '@/components/Table/TableFormatters'
|
||||||
import ViewSecret from './ViewSecret.vue'
|
import ViewSecret from './ViewSecret.vue'
|
||||||
import UpdateSecretInfo from './UpdateSecretInfo.vue'
|
import UpdateSecretInfo from './UpdateSecretInfo.vue'
|
||||||
import ResultDialog from './BulkCreateResultDialog.vue'
|
import ResultDialog from './BulkCreateResultDialog.vue'
|
||||||
@@ -191,14 +191,18 @@ export default {
|
|||||||
connect: {
|
connect: {
|
||||||
label: this.$t('Connect'),
|
label: this.$t('Connect'),
|
||||||
width: '80px',
|
width: '80px',
|
||||||
formatter: () => {
|
formatter: AccountConnectFormatter,
|
||||||
return (
|
formatterArgs: {
|
||||||
<span className='connect'>
|
buttonIcon: 'fa fa-desktop',
|
||||||
<el-button type='primary' size='mini' plain>
|
titleText: '可选协议',
|
||||||
<i className='fa fa-desktop'/>
|
url: '/api/v1/assets/assets/{id}',
|
||||||
</el-button>
|
connectUrlTemplate: (row) => `/luna/pam_connect/${row.id}/${row.username}/${row.asset.id}/${row.asset.name}/`,
|
||||||
</span>
|
setMapItem: (id, protocol) => {
|
||||||
)
|
this.$store.commit('table/SET_PROTOCOL_MAP_ITEM', {
|
||||||
|
key: id,
|
||||||
|
value: protocol
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
platform: {
|
platform: {
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import AssetTreeTable from '@/components/Apps/AssetTreeTable/index.vue'
|
import AssetTreeTable from '@/components/Apps/AssetTreeTable/index.vue'
|
||||||
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
||||||
import { AccountConnectFormatter, DetailFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetAccountList',
|
name: 'AssetAccountList',
|
||||||
@@ -39,17 +39,6 @@ export default {
|
|||||||
query: { tab: 'Basic' }
|
query: { tab: 'Basic' }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
connect: {
|
|
||||||
label: this.$t('Connect'),
|
|
||||||
width: '80px',
|
|
||||||
formatter: AccountConnectFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
buttonIcon: 'fa fa-desktop',
|
|
||||||
titleText: '可选协议',
|
|
||||||
url: '/api/v1/assets/assets/{id}',
|
|
||||||
connectUrlTemplate: '/luna/pam_connect/{id}/{username}/{assetId}/{assetName}/{protocol}'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
||||||
import { DetailFormatter, AccountConnectFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetAccountList',
|
name: 'AssetAccountList',
|
||||||
@@ -30,23 +30,6 @@ export default {
|
|||||||
query: { tab: 'Basic' }
|
query: { tab: 'Basic' }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
connect: {
|
|
||||||
label: this.$t('Connect'),
|
|
||||||
width: '80px',
|
|
||||||
formatter: AccountConnectFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
buttonIcon: 'fa fa-desktop',
|
|
||||||
titleText: '可选协议',
|
|
||||||
url: '/api/v1/assets/assets/{id}',
|
|
||||||
connectUrlTemplate: (row) => `/luna/pam_connect/${row.id}/${row.username}/${row.asset.id}/${row.asset.name}/`,
|
|
||||||
setMapItem: (id, protocol) => {
|
|
||||||
this.$store.commit('table/SET_PROTOCOL_MAP_ITEM', {
|
|
||||||
key: id,
|
|
||||||
value: protocol
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
import AccountListTable from '@/components/Apps/AccountListTable/AccountList.vue'
|
||||||
import { DetailFormatter, AccountConnectFormatter } from '@/components/Table/TableFormatters'
|
import { DetailFormatter } from '@/components/Table/TableFormatters'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'AssetAccountList',
|
name: 'AssetAccountList',
|
||||||
@@ -37,23 +37,6 @@ export default {
|
|||||||
query: { tab: 'Basic' }
|
query: { tab: 'Basic' }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
|
||||||
connect: {
|
|
||||||
label: this.$t('Connect'),
|
|
||||||
width: '80px',
|
|
||||||
formatter: AccountConnectFormatter,
|
|
||||||
formatterArgs: {
|
|
||||||
buttonIcon: 'fa fa-desktop',
|
|
||||||
titleText: '可选协议',
|
|
||||||
url: '/api/v1/assets/assets/{id}',
|
|
||||||
connectUrlTemplate: (row) => `/luna/pam_connect/${row.id}/${row.username}/${row.asset.id}/${row.asset.name}/`,
|
|
||||||
setMapItem: (id, protocol) => {
|
|
||||||
this.$store.commit('table/SET_PROTOCOL_MAP_ITEM', {
|
|
||||||
key: id,
|
|
||||||
value: protocol
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -55,7 +55,7 @@ export default {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
username: ''
|
username: ''
|
||||||
},
|
},
|
||||||
columns: ['name', 'username', 'secret', 'asset']
|
columns: ['name', 'username', 'secret', 'asset', 'connect']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
Reference in New Issue
Block a user