From 5633c4fb7f6b03b2339661ed1b557fb1718e132f Mon Sep 17 00:00:00 2001 From: 639852 Date: Wed, 1 Mar 2023 20:20:21 +0400 Subject: [PATCH] - Fixed minor bugs --- .../components/modules/ovh/serviceCreate.vue | 4 ++-- admin-ui/src/components/service-create.vue | 24 +++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/admin-ui/src/components/modules/ovh/serviceCreate.vue b/admin-ui/src/components/modules/ovh/serviceCreate.vue index 22f33c38a..252549335 100644 --- a/admin-ui/src/components/modules/ovh/serviceCreate.vue +++ b/admin-ui/src/components/modules/ovh/serviceCreate.vue @@ -219,7 +219,7 @@ export default { const plans = (meta) ? meta : this.meta; const plan = plans.catalog.plans.find(({ planCode }) => planCode === key); - plan.configurations.forEach((el) => { + plan?.configurations.forEach((el) => { el.values.sort(); if (el.name.includes('os')) { this.$set(this.images, key, el.values); @@ -229,7 +229,7 @@ export default { } }); - plan.addonFamilies.forEach((el) => { + plan?.addonFamilies.forEach((el) => { if (!this.addons[key]) { this.addons[key] = {}; } diff --git a/admin-ui/src/components/service-create.vue b/admin-ui/src/components/service-create.vue index 4296e0fd9..f11cfbb47 100644 --- a/admin-ui/src/components/service-create.vue +++ b/admin-ui/src/components/service-create.vue @@ -85,7 +85,7 @@ @@ -373,15 +373,6 @@ export default { } }); - api.plans.list().then((res) => - res.pool.forEach((plan) => { - const end = (plan.uuid.length > 8) ? '...' : ''; - const title = `${plan.title} (${plan.uuid.slice(0, 8)}${end})`; - - this.plans.list.push({ ...plan, title }); - }) - ); - api.settings.get(["instance-billing-plan-settings"]).then((res) => { const key = res["instance-billing-plan-settings"]; @@ -410,6 +401,19 @@ export default { this.currentInstancesGroups.body.instances = []; this.currentInstancesGroups.sp = ""; }, + "currentInstancesGroups.sp"(sp_uuid) { + if (!sp_uuid) return; + api.plans.list({ sp_uuid, anonymously: false, }) + .then((res) => { + res.pool.forEach((plan) => { + const end = (plan.uuid.length > 8) ? '...' : ''; + const title = `${plan.title} (${plan.uuid.slice(0, 8)}${end})`; + + this.plans.list = []; + this.plans.list.push({ ...plan, title }); + }); + }); + } }, };