diff --git a/HomeUI/src/views/apps/marketplace/AppView.vue b/HomeUI/src/views/apps/marketplace/AppView.vue index 36621b8cf..0b43b8589 100644 --- a/HomeUI/src/views/apps/marketplace/AppView.vue +++ b/HomeUI/src/views/apps/marketplace/AppView.vue @@ -103,6 +103,26 @@ /> + +
+ {{ getExpireLabel }} +
+ +
vm.$store.state.flux.config); const validTill = computed(() => timestamp.value + 60 * 60 * 1000); // 1 hour - const subscribedTill = computed(() => timestamp.value + 30 * 24 * 60 * 60 * 1000 + 60 * 60 * 1000); // 1 month + const subscribedTill = computed(() => { + if (props.appData.version >= 6) { + const auxArray = expireOptions.value; + if (auxArray[expirePosition.value]) { + return Date.now() + auxArray[expirePosition.value].time; + } + } + const expTime = Date.now() + 30 * 24 * 60 * 60 * 1000; // 1 month + return expTime; + }); + const getExpireLabel = computed(() => { + const auxArray = expireOptions.value; + if (auxArray[expirePosition.value]) { + return auxArray[expirePosition.value].label; + } + return null; + }); const callbackValue = () => { const { protocol, hostname, port } = window.location; @@ -1527,7 +1587,8 @@ export default { } } if (props.appData.version >= 6) { - appSpecification.expire = props.appData.expire || 22000; + const auxArray = expireOptions.value; + appSpecification.expire = auxArray[expirePosition.value].value || 22000; } if (props.appData.version >= 7) { appSpecification.staticip = props.appData.staticip; @@ -1645,10 +1706,17 @@ export default { applicationPriceFluxDiscount.value = ''; const auxSpecsFormatted = JSON.parse(JSON.stringify(appSpecFormatted)); auxSpecsFormatted.priceUSD = props.appData.priceUSD; + console.log(auxSpecsFormatted.priceUSD); if (appInstances.value && appInstances.value > 3) { auxSpecsFormatted.priceUSD = Number(((auxSpecsFormatted.priceUSD * appInstances.value) / 3).toFixed(2)); } - + if (expirePosition.value === '1') { + auxSpecsFormatted.priceUSD *= 3; + } else if (expirePosition.value === '2') { + auxSpecsFormatted.priceUSD *= 6; + } else if (expirePosition.value === '3') { + auxSpecsFormatted.priceUSD *= 12; + } const response = await AppsService.appPriceUSDandFlux(auxSpecsFormatted); if (response.data.status === 'error') { throw new Error(response.data.data.message || response.data.data); @@ -2169,6 +2237,8 @@ export default { confirmLaunchDialogCloseShowing, confirmLaunchDialogFinish, confirmLaunchDialogCancel, + expirePosition, + getExpireLabel, currentComponent, componentSelected,