mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-13 12:26:07 +00:00
feat: xpack 批量修改密钥
This commit is contained in:
parent
0152ad269b
commit
a0534e0c2e
@ -1115,6 +1115,7 @@
|
|||||||
"NodeAmount": "节点数量",
|
"NodeAmount": "节点数量",
|
||||||
"PasswordLength": "密码长度",
|
"PasswordLength": "密码长度",
|
||||||
"PasswordStrategy": "密码策略",
|
"PasswordStrategy": "密码策略",
|
||||||
|
"SecretKeyStrategy": "密钥策略",
|
||||||
"RegularlyPerform": "定期执行",
|
"RegularlyPerform": "定期执行",
|
||||||
"Result": "结果",
|
"Result": "结果",
|
||||||
"Retry": "重试",
|
"Retry": "重试",
|
||||||
|
@ -24,13 +24,17 @@ export default {
|
|||||||
fields: [
|
fields: [
|
||||||
[this.$t('common.Basic'), ['name']],
|
[this.$t('common.Basic'), ['name']],
|
||||||
[this.$t('xpack.Asset'), ['username', 'assets', 'nodes']],
|
[this.$t('xpack.Asset'), ['username', 'assets', 'nodes']],
|
||||||
[this.$t('xpack.ChangeAuthPlan.PasswordStrategy'), ['password_strategy', 'password', 'password_rules']],
|
[this.$t('xpack.ChangeAuthPlan.PasswordStrategy'), ['is_password', 'password_strategy', 'password', 'password_rules']],
|
||||||
|
[this.$t('xpack.ChangeAuthPlan.SecretKeyStrategy'), ['is_ssh_key', 'ssh_key_strategy', 'private_key']],
|
||||||
[this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']],
|
[this.$t('xpack.Timer'), ['is_periodic', 'crontab', 'interval']],
|
||||||
[this.$t('common.Other'), ['comment']]
|
[this.$t('common.Other'), ['comment']]
|
||||||
],
|
],
|
||||||
initial: {
|
initial: {
|
||||||
password_strategy: 'custom',
|
password_strategy: 'custom',
|
||||||
|
ssh_key_strategy: 'add',
|
||||||
is_periodic: true,
|
is_periodic: true,
|
||||||
|
is_password: true,
|
||||||
|
is_ssh_key: true,
|
||||||
password_rules: {
|
password_rules: {
|
||||||
length: 30
|
length: 30
|
||||||
},
|
},
|
||||||
@ -50,7 +54,7 @@ export default {
|
|||||||
},
|
},
|
||||||
password: {
|
password: {
|
||||||
hidden: (formValue) => {
|
hidden: (formValue) => {
|
||||||
return formValue.password_strategy !== 'custom'
|
return formValue.password_strategy !== 'custom' || formValue.is_password === false
|
||||||
},
|
},
|
||||||
rules: [
|
rules: [
|
||||||
{ required: this.$route.meta.action === 'create', message: this.$t('common.fieldRequiredError'), trigger: 'blur' }
|
{ required: this.$route.meta.action === 'create', message: this.$t('common.fieldRequiredError'), trigger: 'blur' }
|
||||||
@ -60,6 +64,19 @@ export default {
|
|||||||
type: 'group',
|
type: 'group',
|
||||||
items: this.generatePasswordRulesItemsFields()
|
items: this.generatePasswordRulesItemsFields()
|
||||||
},
|
},
|
||||||
|
private_key: {
|
||||||
|
el: {
|
||||||
|
type: 'textarea',
|
||||||
|
placeholder: '-----BEGIN OPENSSH PRIVATE KEY-----',
|
||||||
|
autosize: { minRows: 3 }
|
||||||
|
},
|
||||||
|
hidden: (formValue) => {
|
||||||
|
return formValue.is_ssh_key === false
|
||||||
|
},
|
||||||
|
rules: [
|
||||||
|
{ required: this.$route.meta.action === 'create', message: this.$t('common.fieldRequiredError'), trigger: 'blur' }
|
||||||
|
]
|
||||||
|
},
|
||||||
nodes: {
|
nodes: {
|
||||||
label: this.$t('xpack.Node'),
|
label: this.$t('xpack.Node'),
|
||||||
el: {
|
el: {
|
||||||
@ -75,6 +92,24 @@ export default {
|
|||||||
is_periodic: {
|
is_periodic: {
|
||||||
type: 'switch'
|
type: 'switch'
|
||||||
},
|
},
|
||||||
|
is_password: {
|
||||||
|
type: 'switch'
|
||||||
|
},
|
||||||
|
is_ssh_key: {
|
||||||
|
type: 'switch'
|
||||||
|
},
|
||||||
|
password_strategy: {
|
||||||
|
label: this.$t('xpack.ChangeAuthPlan.PasswordStrategy'),
|
||||||
|
hidden: (formValue) => {
|
||||||
|
return formValue.is_password === false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ssh_key_strategy: {
|
||||||
|
label: this.$t('xpack.ChangeAuthPlan.SecretKeyStrategy'),
|
||||||
|
hidden: (formValue) => {
|
||||||
|
return formValue.is_ssh_key === false
|
||||||
|
}
|
||||||
|
},
|
||||||
crontab: {
|
crontab: {
|
||||||
label: this.$t('xpack.RegularlyPerform'),
|
label: this.$t('xpack.RegularlyPerform'),
|
||||||
hidden: (formValue) => {
|
hidden: (formValue) => {
|
||||||
@ -115,7 +150,7 @@ export default {
|
|||||||
items.forEach((item, index, array) => {
|
items.forEach((item, index, array) => {
|
||||||
itemsFields.push({
|
itemsFields.push({
|
||||||
id: item.id, prop: item.prop, el: {}, attrs: {}, type: 'input', label: item.label, rules: [Required],
|
id: item.id, prop: item.prop, el: {}, attrs: {}, type: 'input', label: item.label, rules: [Required],
|
||||||
hidden: (formValue) => { return ['random_one', 'random_all'].indexOf(formValue.password_strategy) === -1 }
|
hidden: (formValue) => { return ['random_one', 'random_all'].indexOf(formValue.password_strategy) === -1 || formValue.is_password === false }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
return itemsFields
|
return itemsFields
|
||||||
|
@ -11290,11 +11290,6 @@ yargs@^11.0.0:
|
|||||||
y18n "^3.2.1"
|
y18n "^3.2.1"
|
||||||
yargs-parser "^9.0.2"
|
yargs-parser "^9.0.2"
|
||||||
|
|
||||||
yarn@^1.22.10:
|
|
||||||
version "1.22.10"
|
|
||||||
resolved "https://registry.npm.taobao.org/yarn/download/yarn-1.22.10.tgz#c99daa06257c80f8fa2c3f1490724e394c26b18c"
|
|
||||||
integrity sha1-yZ2qBiV8gPj6LD8UkHJOOUwmsYw=
|
|
||||||
|
|
||||||
yorkie@^2.0.0:
|
yorkie@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/yorkie/-/yorkie-2.0.0.tgz#92411912d435214e12c51c2ae1093e54b6bb83d9"
|
resolved "https://registry.yarnpkg.com/yorkie/-/yorkie-2.0.0.tgz#92411912d435214e12c51c2ae1093e54b6bb83d9"
|
||||||
|
Loading…
Reference in New Issue
Block a user