mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-18 15:58:04 +00:00
perf: 资产平台http协议页面显示为http(s)
This commit is contained in:
committed by
Jiangjie.Bai
parent
bce328a440
commit
9dbdc559cd
@@ -10,7 +10,7 @@
|
||||
>
|
||||
<el-select
|
||||
slot="prepend"
|
||||
v-model="item.name"
|
||||
:value="item.display_name ? item.display_name : item.name"
|
||||
:disabled="disableSelect(item)"
|
||||
class="prepend"
|
||||
@change="handleProtocolChange($event, item)"
|
||||
|
||||
@@ -140,8 +140,15 @@ export default {
|
||||
},
|
||||
async setPlatformConstrains() {
|
||||
const { platform } = this
|
||||
let protocols = platform?.protocols || []
|
||||
protocols = protocols.map(i => {
|
||||
if (i.name === 'http') {
|
||||
i.display_name = 'http(s)'
|
||||
}
|
||||
return i
|
||||
})
|
||||
const protocolChoices = this.defaultConfig.fieldsMeta.protocols.el.choices
|
||||
protocolChoices.splice(0, protocolChoices.length, ...platform.protocols)
|
||||
protocolChoices.splice(0, protocolChoices.length, ...protocols)
|
||||
this.defaultConfig.fieldsMeta.accounts.el.platform = platform
|
||||
const hiddenCheckFields = ['protocols', 'domain']
|
||||
|
||||
|
||||
@@ -39,8 +39,7 @@ export default {
|
||||
category_type: ['host', 'linux'],
|
||||
automation: {
|
||||
ansible_enabled: true
|
||||
},
|
||||
su_method: ''
|
||||
}
|
||||
},
|
||||
fields: [
|
||||
[this.$t('common.Basic'), [
|
||||
@@ -133,12 +132,20 @@ export default {
|
||||
this.defaultOptions = constraints
|
||||
|
||||
const fieldsCheck = ['domain_enabled', 'su_enabled']
|
||||
let protocols = constraints?.protocols || []
|
||||
protocols = protocols.map(i => {
|
||||
if (i.name === 'http') {
|
||||
i.display_name = 'http(s)'
|
||||
}
|
||||
return i
|
||||
})
|
||||
|
||||
for (const field of fieldsCheck) {
|
||||
const disabled = constraints[field] === false
|
||||
this.initial[field] = !disabled
|
||||
_.set(this.fieldsMeta, `${field}.el.disabled`, disabled)
|
||||
}
|
||||
this.fieldsMeta.protocols.el.choices = constraints['protocols'] || []
|
||||
this.fieldsMeta.protocols.el.choices = protocols
|
||||
|
||||
if (constraints['charset_enabled'] === false) {
|
||||
this.fieldsMeta.charset.hidden = () => true
|
||||
|
||||
Reference in New Issue
Block a user