Skip to content

Commit

Permalink
Merge pull request #767 from Support-pl/dev-fixes
Browse files Browse the repository at this point in the history
dev fixes
  • Loading branch information
639852 committed Sep 5, 2024
2 parents 39151cc + 34d7007 commit 6eb7249
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions src/components/cloud/modules/ovh vps/openInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ export default defineComponent({
tariffs () {
if (!this.VM?.billingPlan) return {}
const tariffs = {}
const { products } = this.plans.find(({ uuid }) => uuid === this.VM.billingPlan.uuid) ?? {}
const { products = {} } = this.plans.find(({ uuid }) => uuid === this.VM.billingPlan.uuid) ?? {}
const productKey = this.VM.product ?? `${this.VM.config.duration} ${this.VM.config.planCode}`

Object.keys(products).forEach((key) => {
Expand Down Expand Up @@ -1131,7 +1131,21 @@ export default defineComponent({
try {
this.isSwitchLoading = true
const { price, resources } = this.tariffs[this.planCode]
const { price, resources, meta } = this.tariffs[this.planCode] ?? {}
const backupIndex = instance.config.addons.findIndex((key) => key.includes('backup'))
const snapshotIndex = instance.config.addons.findIndex((key) => key.includes('snapshot'))
if (backupIndex !== -1) {
const backup = meta.addons.find((key) => key.includes('backup'))
instance.config.addons.splice(backupIndex, 1, backup)
}
if (snapshotIndex !== -1) {
const snapshot = meta.addons.find((key) => key.includes('snapshot'))
instance.config.addons.splice(snapshotIndex, 1, snapshot)
}
instance.config.planCode = this.planCode.split(' ')[1]
instance.product = this.planCode
Expand Down
2 changes: 1 addition & 1 deletion src/routes/cloud/cloudPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export default {
params: ['networkControl'],
icon: 'GlobalOutlined',
forVNC: true,
modules: ['ione']
modules: []
},
{
title: 'Access manager',
Expand Down

0 comments on commit 6eb7249

Please sign in to comment.