Skip to content

Commit

Permalink
Merge pull request #680 from slntopp/dev-sp-plans-update
Browse files Browse the repository at this point in the history
fixed minor bugs
  • Loading branch information
639852 committed Mar 1, 2023
2 parents 390fcb3 + 5633c4f commit 57a3213
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions admin-ui/src/components/modules/ovh/serviceCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -229,7 +229,7 @@ export default {
}
});
plan.addonFamilies.forEach((el) => {
plan?.addonFamilies.forEach((el) => {
if (!this.addons[key]) {
this.addons[key] = {};
}
Expand Down
24 changes: 14 additions & 10 deletions admin-ui/src/components/service-create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

<component :is="templates[currentInstancesGroups.body.type] ?? templates.custom"
:instances-group="JSON.stringify(currentInstancesGroups)"
:plans="{ list: filteredPlans, products: plans.products }" :planRules="planRules" :meta="meta"
:plans="{ list: plans.list, products: plans.products }" :planRules="planRules" :meta="meta"
@update:instances-group="receiveObject" @changeMeta="(value) => meta = value" />
</v-card>
Expand Down Expand Up @@ -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"];
Expand Down Expand Up @@ -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 });
});
});
}
},
};
</script>
Expand Down

0 comments on commit 57a3213

Please sign in to comment.