mirror of
https://github.com/jumpserver/lina.git
synced 2025-09-28 15:55:24 +00:00
Merge pull request #2964 from jumpserver/pr@dev@device_for_su_from
perf: device 支持账号切换
This commit is contained in:
@@ -13,7 +13,7 @@ import { UpdateToken, UploadSecret } from '@/components/FormFields'
|
||||
import Select2 from '@/components/FormFields/Select2'
|
||||
import AssetSelect from '@/components/AssetSelect'
|
||||
import { encryptPassword } from '@/utils/crypto'
|
||||
import { RequiredChange, Required } from '@/components/DataForm/rules'
|
||||
import { Required, RequiredChange } from '@/components/DataForm/rules'
|
||||
|
||||
export default {
|
||||
name: 'AccountCreateForm',
|
||||
@@ -46,6 +46,7 @@ export default {
|
||||
defaultPrivilegedAccounts: ['root', 'administrator'],
|
||||
iPlatform: {
|
||||
automation: {},
|
||||
su_enabled: false,
|
||||
protocols: [
|
||||
{
|
||||
name: 'ssh',
|
||||
@@ -58,7 +59,7 @@ export default {
|
||||
encryptedFields: ['secret'],
|
||||
fields: [
|
||||
[this.$t('assets.Asset'), ['assets']],
|
||||
[this.$t('common.Basic'), ['name', 'username', ...this.controlShowField()]],
|
||||
[this.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from']],
|
||||
[this.$t('assets.Secret'), [
|
||||
'secret_type', 'secret', 'ssh_key', 'token',
|
||||
'api_key', 'passphrase'
|
||||
@@ -120,7 +121,7 @@ export default {
|
||||
su_from: {
|
||||
component: Select2,
|
||||
hidden: (formValue) => {
|
||||
return !this.asset?.id
|
||||
return !this.asset?.id || !this.iPlatform.su_enabled
|
||||
},
|
||||
el: {
|
||||
multiple: false,
|
||||
|
@@ -1,11 +1,12 @@
|
||||
<template>
|
||||
<Dialog
|
||||
:title="title"
|
||||
:visible.sync="iVisible"
|
||||
v-if="iVisible"
|
||||
:close-on-click-modal="false"
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:close-on-click-modal="false"
|
||||
:title="title"
|
||||
:visible.sync="iVisible"
|
||||
v-bind="$attrs"
|
||||
width="70%"
|
||||
v-on="$listeners"
|
||||
|
Reference in New Issue
Block a user