mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-14 11:55:34 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cbafdf6b7 | ||
|
|
65eda50419 |
@@ -27,17 +27,17 @@ function getFields() {
|
||||
},
|
||||
rules: [Object.assign({}, Required)],
|
||||
hidden: (form) => {
|
||||
if (form.login_mode === 'manual' || form.username_same_with_user) {
|
||||
this.fieldsMeta.username.rules[0].required = false
|
||||
} else {
|
||||
if (['mysql', 'postgresql', 'mariadb', 'oracle'].includes(form.protocol)) {
|
||||
this.fieldsMeta.username.rules[0].required = true
|
||||
return
|
||||
}
|
||||
if (['vnc'].includes(form.protocol)) {
|
||||
this.fieldsMeta.username.rules[0].required = false
|
||||
return
|
||||
}
|
||||
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
|
||||
} else {
|
||||
this.fieldsMeta.username.el.disabled = false
|
||||
}
|
||||
this.fieldsMeta.username.el.disabled = !!form.username_same_with_user
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user