diff --git a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue index 6804c9df5..ff144b817 100644 --- a/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue +++ b/src/views/assets/SystemUser/SystemUserCreateUpdate/CommonUser/ssh.vue @@ -34,6 +34,7 @@ export default { [this.$t('common.Auth'), ['login_mode', 'auto_generate_key', 'password', 'private_key']], [this.$t('assets.AutoPush'), ['auto_push', 'sudo', 'shell', 'home', 'system_groups']], [this.$t('common.Command filter'), ['cmd_filters']], + [this.$t('assets.SwitchUser'), ['su_enabled', 'su_from']], [this.$t('common.Other'), ['priority', 'sftp_root', 'comment']] ], fieldsMeta: { @@ -64,7 +65,24 @@ export default { hidden: (item) => item.protocol !== 'ssh' || !item.auto_push || item.username_same_with_user, helpText: this.$t('assets.HomeHelpMessage') }, - system_groups: fields.system_groups + system_groups: fields.system_groups, + su_enabled: { + type: 'switch', + hidden: (item) => item.protocol !== 'ssh' + }, + su_from: { + hidden: (item) => !item.su_enabled, + el: { + multiple: false, + clearable: true, + ajax: { + url: '/api/v1/assets/system-users/su-from/', + transformOption: (item) => { + return { label: item.name + '(' + item.username + ')', value: item.id } + } + } + } + } }, url: '/api/v1/assets/system-users/' }