Skip to content

Commit

Permalink
Merge pull request #248 from Support-pl/dev
Browse files Browse the repository at this point in the history
fixed critical bugs
  • Loading branch information
639852 authored Aug 8, 2023
2 parents a6695a0 + af33fb3 commit 678ebcc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default {
setTimeout(() => {
this.$router.replace({ name: 'openCloud_new', params: { uuid: data.uuid } });
location.reload();
}, 100);
}, 300);
} else if (this.$route.name.includes('login')) {
this.$router.replace({ name: 'root' });
location.reload();
Expand Down
2 changes: 1 addition & 1 deletion src/components/appMain/modules/ione/createInstance.vue
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ export default {
const { templates } = this.itemSP.publicData;
const images = {};
Object.entries(templates).forEach(([key, value]) => {
Object.entries(templates ?? {}).forEach(([key, value]) => {
if (value.is_public !== false) {
images[key] = value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/appMain/newPaaS.vue
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ export default {
showcase.locations?.forEach((location) => {
const sp = this.getSP.find(({ locations, type }) =>
locations.find(({ id, type: locationType }) =>
location.id.includes(id) && ((locationType === '') ? true : locationType.includes(type))
location.id.includes(id) && locationType.includes(type)
)
);
Expand Down
4 changes: 1 addition & 3 deletions src/components/services/custom/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,7 @@ export default {
const plan = this.plans.find(({ uuid }) => uuid === value);
this.changeProducts(plan);
this.fetchLoading = false;
}
},
created() {
Expand All @@ -462,9 +463,6 @@ export default {
if (err.response?.data?.code === 16) return;
this.$notification.error({ message: this.$t(message) });
console.error(err);
})
.finally(() => {
this.fetchLoading = false;
});
if (this.$store.getters['nocloud/auth/currencies'].length < 1) {
Expand Down
18 changes: 4 additions & 14 deletions src/components/services/iaas/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export default {
if (Object.keys(this.products).length == 0) return "NAN"
const findedProduct = this.products.find(({ id }) => id === +this.$route.query.product) ??
this.products[this.sizes.indexOf(this.options.size)]
const product = { ...findedProduct }
const product = JSON.parse(JSON.stringify(findedProduct))

if (typeof product.description !== 'string') return product
if (/<\/?[a-z][\s\S]*>/i.test(product.description)) {
Expand Down Expand Up @@ -389,7 +389,7 @@ export default {
product.price.currency = this.currency.code
}

return { ...product, price: +(product.price * this.currency.rate).toFixed(2) }
return { ...product, price: +product.price }
},
slides() {
return 3;
Expand All @@ -401,7 +401,7 @@ export default {

const price = prices.find((el) => el.currency === this.currency.id);
const value = (+price[this.options.period] !== -1)
? +(price[this.options.period] * this.currency.rate).toFixed(2)
? +price[this.options.period]
: 0;

const result = {
Expand All @@ -422,24 +422,14 @@ export default {
return this.$store.getters['nocloud/auth/isLoggedIn'];
},
currency() {
const currencies = this.$store.getters['nocloud/auth/currencies'];
const defaultCurrency = this.$store.getters['nocloud/auth/defaultCurrency'];

const code = (this.isLogged)
? this.user.currency_code ?? defaultCurrency
: this.$store.getters['nocloud/auth/unloginedCurrency'];
const { id = -1 } = this.currencies?.find((currency) => currency.code === code) ?? {};

const { rate } = currencies.find((el) =>
el.to === defaultCurrency && el.from === code
) ?? {};

const { rate: reverseRate } = currencies.find((el) =>
el.from === defaultCurrency && el.to === code
) ?? { rate: 1 };

if (!this.isLogged) return { rate: (rate) ? rate : 1 / reverseRate, code, id };
return { rate: 1, code, id };
return { code, id };
},
baseURL() {
return this.$store.getters['nocloud/auth/getURL'];
Expand Down

0 comments on commit 678ebcc

Please sign in to comment.