mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-09 02:27:41 +00:00
fix: 简单修改系统用户创建
This commit is contained in:
parent
c9d026b564
commit
1daadcaba0
@ -30,6 +30,7 @@
|
|||||||
},
|
},
|
||||||
"assets": {
|
"assets": {
|
||||||
"Action": "动作",
|
"Action": "动作",
|
||||||
|
"AutoGenerateKey": "自动生成密钥",
|
||||||
"CmdFilter": "命令过滤器",
|
"CmdFilter": "命令过滤器",
|
||||||
"DeactiveSelected": "禁用所选",
|
"DeactiveSelected": "禁用所选",
|
||||||
"ActiveSelected": "激活所选",
|
"ActiveSelected": "激活所选",
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
},
|
},
|
||||||
"assets": {
|
"assets": {
|
||||||
"Action": "Action",
|
"Action": "Action",
|
||||||
|
"AutoGenerateKey": "Auto generate ssh key",
|
||||||
"CmdFilter": "CmdFilter",
|
"CmdFilter": "CmdFilter",
|
||||||
"DeactiveSelected": "Deactive selected",
|
"DeactiveSelected": "Deactive selected",
|
||||||
"ActiveSelected": "Active selected",
|
"ActiveSelected": "Active selected",
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
import GenericCreateUpdatePage from '@/layout/components/GenericCreateUpdatePage'
|
||||||
import UploadKey from '@/components/UploadKey'
|
import UploadKey from '@/components/UploadKey'
|
||||||
import { Select2 } from '@/components'
|
import { Select2 } from '@/components'
|
||||||
|
|
||||||
|
// const asciiProtocols = ['ssh', 'telnet', 'mysql']
|
||||||
|
const graphProtocols = ['vnc', 'rdp']
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'SystemUserCreateUpdate',
|
name: 'SystemUserCreateUpdate',
|
||||||
components: { GenericCreateUpdatePage },
|
components: { GenericCreateUpdatePage },
|
||||||
@ -21,11 +25,10 @@ export default {
|
|||||||
sftp_root: 'tmp',
|
sftp_root: 'tmp',
|
||||||
sudo: '/bin/whoami',
|
sudo: '/bin/whoami',
|
||||||
shell: '/bin/bash'
|
shell: '/bin/bash'
|
||||||
|
|
||||||
},
|
},
|
||||||
fields: [
|
fields: [
|
||||||
[this.$t('common.BasicInfo'), ['name', 'login_mode', 'username', 'username_same_with_user', 'priority', 'protocol']],
|
[this.$t('common.BasicInfo'), ['name', 'login_mode', 'username', 'username_same_with_user', 'priority', 'protocol']],
|
||||||
[this.$t('common.Auth'), ['auto_generate_key', 'password', 'private_key', 'auto_push']],
|
[this.$t('common.Auth'), ['auto_push', 'auto_generate_key', 'password', 'private_key']],
|
||||||
[this.$t('common.Command filter'), ['cmd_filters']],
|
[this.$t('common.Command filter'), ['cmd_filters']],
|
||||||
[this.$t('common.Others'), ['sftp_root', 'sudo', 'shell', 'comment']]
|
[this.$t('common.Others'), ['sftp_root', 'sudo', 'shell', 'comment']]
|
||||||
],
|
],
|
||||||
@ -54,11 +57,16 @@ export default {
|
|||||||
},
|
},
|
||||||
auto_generate_key: {
|
auto_generate_key: {
|
||||||
type: 'switch',
|
type: 'switch',
|
||||||
|
label: this.$t('assets.AutoGenerateKey'),
|
||||||
hidden: form => {
|
hidden: form => {
|
||||||
if (JSON.stringify(this.$route.params) !== '{}') {
|
if (JSON.stringify(this.$route.params) !== '{}') {
|
||||||
return true
|
return true
|
||||||
} else {
|
}
|
||||||
return form.login_mode !== 'auto'
|
if (form.login_mode !== 'auto') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
if (!form.auto_push) {
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -72,6 +80,7 @@ export default {
|
|||||||
},
|
},
|
||||||
cmd_filters: {
|
cmd_filters: {
|
||||||
component: Select2,
|
component: Select2,
|
||||||
|
hidden: (form) => graphProtocols.indexOf(form.protocol) !== -1,
|
||||||
el: {
|
el: {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
value: [],
|
value: [],
|
||||||
@ -94,19 +103,22 @@ export default {
|
|||||||
rules: [
|
rules: [
|
||||||
{ required: true }
|
{ required: true }
|
||||||
],
|
],
|
||||||
helpText: 'SFTP的起始路径,tmp目录, 用户home目录或者自定义'
|
helpText: 'SFTP的起始路径,tmp目录, 用户home目录或者自定义',
|
||||||
|
hidden: (item) => item.protocol !== 'ssh'
|
||||||
},
|
},
|
||||||
sudo: {
|
sudo: {
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true }
|
{ required: true }
|
||||||
],
|
],
|
||||||
helpText: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig'
|
helpText: '使用逗号分隔多个命令,如: /bin/whoami,/sbin/ifconfig',
|
||||||
|
hidden: (item) => item.protocol !== 'ssh'
|
||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
helpText: '密码或密钥密码',
|
helpText: '密码或密钥密码',
|
||||||
hidden: form => form.auto_generate_key === true || form.login_mode !== 'auto'
|
hidden: form => form.auto_generate_key === true || form.login_mode !== 'auto'
|
||||||
},
|
},
|
||||||
shell: {
|
shell: {
|
||||||
|
hidden: (item) => item.protocol !== 'ssh',
|
||||||
rules: [
|
rules: [
|
||||||
{ required: true }
|
{ required: true }
|
||||||
]
|
]
|
||||||
|
Loading…
Reference in New Issue
Block a user