feat: 添加系统用户su_enabled

This commit is contained in:
Michael Bai 2021-11-04 16:29:57 +08:00 committed by 老广
parent d2cd0a2242
commit d62a4ca36e

View File

@ -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/'
}