mirror of
https://github.com/jumpserver/lina.git
synced 2025-08-30 22:02:24 +00:00
perf: 修改平台
This commit is contained in:
parent
2669c8fff0
commit
47a423284b
@ -61,6 +61,36 @@ export default {
|
|||||||
hasButtons: !this.disabled,
|
hasButtons: !this.disabled,
|
||||||
url: '',
|
url: '',
|
||||||
fields: [
|
fields: [
|
||||||
|
[this.$t('common.Basic'), [
|
||||||
|
{
|
||||||
|
id: 'primary',
|
||||||
|
label: '主要的',
|
||||||
|
type: 'switch',
|
||||||
|
helpText: '主要的协议, 只能有一个',
|
||||||
|
on: {
|
||||||
|
change: ([event], updateForm) => {
|
||||||
|
if (event) {
|
||||||
|
updateForm({ required: true })
|
||||||
|
} else {
|
||||||
|
updateForm({ required: false })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'required',
|
||||||
|
label: '必需的',
|
||||||
|
type: 'switch',
|
||||||
|
helpText: '必需的协议, 添加资产时必须选择'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'default',
|
||||||
|
label: '默认的',
|
||||||
|
type: 'switch',
|
||||||
|
helpText: '默认的协议, 添加资产时默认会选择'
|
||||||
|
}
|
||||||
|
]],
|
||||||
|
['登录配置', [
|
||||||
{
|
{
|
||||||
id: 'console',
|
id: 'console',
|
||||||
label: 'Console',
|
label: 'Console',
|
||||||
@ -110,6 +140,7 @@ export default {
|
|||||||
type: 'input',
|
type: 'input',
|
||||||
hidden: (form) => this.item.name !== 'http'
|
hidden: (form) => this.item.name !== 'http'
|
||||||
}
|
}
|
||||||
|
]]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -102,6 +102,11 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
choices: {
|
choices: {
|
||||||
handler(value) {
|
handler(value) {
|
||||||
|
if (!this.settingReadonly) {
|
||||||
|
this.value[0].primary = true
|
||||||
|
this.value[0].default = true
|
||||||
|
this.value[0].required = true
|
||||||
|
}
|
||||||
this.setDefaultItems(value)
|
this.setDefaultItems(value)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -115,6 +120,7 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.setDefaultItems(this.choices)
|
this.setDefaultItems(this.choices)
|
||||||
|
console.log('CHoices: ', this.choices)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleDelete(index) {
|
handleDelete(index) {
|
||||||
@ -122,6 +128,9 @@ export default {
|
|||||||
return i !== index
|
return i !== index
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
canDelete(item) {
|
||||||
|
return this.item.primary || this.item.required
|
||||||
|
},
|
||||||
handleAdd(index) {
|
handleAdd(index) {
|
||||||
this.items.push({ ...this.remainProtocols[0] })
|
this.items.push({ ...this.remainProtocols[0] })
|
||||||
},
|
},
|
||||||
|
@ -15,7 +15,7 @@ export const platformFieldsMeta = (vm) => {
|
|||||||
'ping_enabled', 'ping_method',
|
'ping_enabled', 'ping_method',
|
||||||
'gather_facts_enabled', 'gather_facts_method',
|
'gather_facts_enabled', 'gather_facts_method',
|
||||||
'create_account_enabled', 'create_account_method',
|
'create_account_enabled', 'create_account_method',
|
||||||
'change_password_enabled', 'change_password_method',
|
'change_secret_enabled', 'change_secret_method',
|
||||||
'verify_account_enabled', 'verify_account_method'
|
'verify_account_enabled', 'verify_account_method'
|
||||||
],
|
],
|
||||||
fieldsMeta: {
|
fieldsMeta: {
|
||||||
@ -26,7 +26,7 @@ export const platformFieldsMeta = (vm) => {
|
|||||||
ping_method: {},
|
ping_method: {},
|
||||||
gather_facts_method: {},
|
gather_facts_method: {},
|
||||||
create_account_method: {},
|
create_account_method: {},
|
||||||
change_password_method: {},
|
change_secret_method: {},
|
||||||
verify_account_method: {}
|
verify_account_method: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -110,5 +110,6 @@ export const setAutomations = (vm) => {
|
|||||||
autoFieldsMeta[itemMethodKey].options = methods.map(method => {
|
autoFieldsMeta[itemMethodKey].options = methods.map(method => {
|
||||||
return { value: method['id'], label: method['name'] }
|
return { value: method['id'], label: method['name'] }
|
||||||
})
|
})
|
||||||
|
_.set(initial, `${itemMethodKey}`, autoFieldsMeta[itemMethodKey].options[0]?.value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user