mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: 优化系统用户用户名显示禁用
perf: 优化系统用户用户名隐藏与禁用
This commit is contained in:
@@ -28,15 +28,15 @@ function getFields() {
|
||||
hidden: (form) => {
|
||||
if (['mysql', 'postgresql', 'mariadb', 'oracle'].includes(form.protocol)) {
|
||||
this.fieldsMeta.username.rules[0].required = true
|
||||
return
|
||||
}
|
||||
if (['vnc'].includes(form.protocol)) {
|
||||
} else if (['vnc'].includes(form.protocol)) {
|
||||
this.fieldsMeta.username.rules[0].required = false
|
||||
return
|
||||
} else {
|
||||
this.fieldsMeta.username.rules[0].required = !(form.login_mode === 'manual' || form.username_same_with_user)
|
||||
}
|
||||
if (form.username_same_with_user) {
|
||||
this.fieldsMeta.username.el.disabled = true
|
||||
form.username = ''
|
||||
}
|
||||
this.fieldsMeta.username.rules[0].required = !(form.login_mode === 'manual' || form.username_same_with_user)
|
||||
|
||||
this.fieldsMeta.username.el.disabled = !!form.username_same_with_user
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user