diff --git a/src/components/AccountCreateForm/index.vue b/src/components/AccountCreateForm/index.vue index d52099f61..e4d5ae978 100644 --- a/src/components/AccountCreateForm/index.vue +++ b/src/components/AccountCreateForm/index.vue @@ -1,7 +1,5 @@ - - diff --git a/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue b/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue index a50b656f8..fd1fea762 100644 --- a/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue +++ b/src/views/assets/Asset/AssetCreateUpdate/HostCreateUpdate.vue @@ -16,7 +16,9 @@ export default { loading: true, platform: {}, initial: { - labels: [] + labels: [], + is_active: true, + nodes: [] }, fields: [ [this.$t('common.Basic'), ['name', 'ip', 'platform', 'domain']], @@ -45,15 +47,15 @@ export default { const url = `/api/v1/assets/platforms/${platformId}/` this.platform = await this.$axios.get(url) const initial = { - is_active: true, platform: parseInt(platformId), - protocols: this.platform.protocols_default, + protocols: this.platform.protocols, nodes: nodesInitial, domain: this.platform.domain_default } + Object.assign(this.initial, initial) + const constraints = this.platform['type_constraints'] this.fieldsMeta.protocols.el.choices = constraints['protocols'] - this.initial = initial this.loading = false } } diff --git a/src/views/assets/Platform/PlatformCreateUpdate.vue b/src/views/assets/Platform/PlatformCreateUpdate.vue index 6fa113b05..f435e90ea 100644 --- a/src/views/assets/Platform/PlatformCreateUpdate.vue +++ b/src/views/assets/Platform/PlatformCreateUpdate.vue @@ -57,9 +57,6 @@ export default { [this.$t('assets.Protocol'), [ 'protocols_enabled', 'protocols' ]], - [this.$t('assets.Domain'), [ - 'domain_enabled', 'domain_default' - ]], [this.$t('assets.Account'), [ 'su_enabled', 'su_method', 'verify_account_enabled', 'verify_account_method', @@ -103,15 +100,6 @@ export default { }, hidden: (formValue) => !formValue['protocols_enabled'] }, - domain_enabled: { - el: { - disabled: false - } - }, - domain_default: { - ...assetMeta.domain, - hidden: (formValue) => !formValue['domain_enabled'] - }, verify_account_method: { hidden: (formValue) => { return !formValue['verify_account_enabled'] @@ -119,12 +107,6 @@ export default { type: 'select', options: [] }, - create_account_method: { - hidden: (formValue) => !formValue['create_account_enabled'], - type: 'select', - options: [], - el: {} - }, change_password_method: { hidden: (formValue) => !formValue['change_password_enabled'], type: 'select', @@ -175,21 +157,18 @@ export default { const type = this.$route.query.type const url = `/api/v1/assets/platforms/type-constraints/?category=${category}&type=${type}` const constraints = await this.$axios.get(url) - const hasDomain = constraints['has_domain'] - this.fieldsMeta.domain_enabled.el.disabled = !hasDomain const protocols = constraints['protocols'] || [] this.fieldsMeta.protocols_enabled.el.disabled = protocols.length === 0 this.fieldsMeta.protocols.el.choices = protocols this.initial.protocols_enabled = !!protocols.length - this.initial.domain_enabled = hasDomain }, async setOpsMethods() { const category = this.$route.query.category const type = this.$route.query.type const allMethods = await this.$axios.get('/api/v1/assets/platforms/ops-methods/') - const items = ['verify_account', 'change_password', 'create_account'] + const items = ['verify_account', 'change_password'] for (const item of items) { const methods = allMethods.filter(method => { const ok = method['method'] === item && method['category'] === category