mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-08 02:18:44 +00:00
Compare commits
3 Commits
revert-508
...
v2.9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1cbafdf6b7 | ||
|
|
65eda50419 | ||
|
|
9736d94762 |
@@ -15,12 +15,11 @@ export default {
|
||||
initial: {
|
||||
login_mode: 'auto',
|
||||
protocol: this.$route.query.protocol,
|
||||
username_same_with_user: false,
|
||||
auto_generate_key: false,
|
||||
auto_push: false
|
||||
},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), ['name', 'login_mode', 'username', 'username_same_with_user', 'priority', 'protocol']],
|
||||
[this.$t('common.Basic'), ['name', 'login_mode', 'username', 'priority', 'protocol']],
|
||||
[this.$t('common.Auth'), ['update_password', 'password']],
|
||||
[this.$t('common.Other'), ['comment']]
|
||||
],
|
||||
@@ -28,7 +27,6 @@ export default {
|
||||
login_mode: fields.login_mode,
|
||||
username: fields.username,
|
||||
private_key: fields.private_key,
|
||||
username_same_with_user: fields.username_same_with_user,
|
||||
protocol: fields.protocol,
|
||||
update_password: fields.update_password,
|
||||
password: fields.password
|
||||
|
||||
@@ -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