Improve CloudronAccount section
This commit is contained in:
@@ -20,15 +20,16 @@ const emailVerified = ref(false);
|
||||
const cloudronId = ref('');
|
||||
const planId = ref('');
|
||||
const planName = ref('');
|
||||
const cancelAt = ref(1234);
|
||||
const cancelAt = ref(0);
|
||||
const status = ref('');
|
||||
|
||||
onMounted(async () => {
|
||||
const [error, result] = await appstoreModel.getSubscription();
|
||||
if (error) return console.error(error);
|
||||
|
||||
// if (error && error.statusCode === 402) return $scope.subscriptionBusy = false; // not yet registered
|
||||
// if (error && error.statusCode === 412) return $scope.subscriptionBusy = false; // invalid appstore token
|
||||
if (error) {
|
||||
if (error.status === 402) return busy.value = false; // not yet registered
|
||||
if (error.status === 412) return busy.value = false; // invalid appstore token
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
console.log(result)
|
||||
|
||||
@@ -73,9 +74,11 @@ onMounted(async () => {
|
||||
|
||||
<p class="text-danger" v-show="cancelAt">{{ $t('settings.appstoreAccount.subscriptionEndsAt') }} {{ prettyDate(cancelAt*1000) }}</p>
|
||||
|
||||
<Button @click="onSubscriptionSetup()" v-show="planName === 'free'">{{ $t('settings.appstoreAccount.subscriptionSetupAction') }}</Button>
|
||||
<Button @click="onSubscriptionSetup()" v-show="cancelAt">{{ $t('settings.appstoreAccount.subscriptionReactivateAction') }}</Button>
|
||||
<Button @click="onSubscriptionSetup()" v-show="!cancelAt">{{ $t('settings.appstoreAccount.subscriptionChangeAction') }}</Button>
|
||||
<Button v-show="!busy" :href="`${consoleServerOrigin}/#/cloudron/${cloudronId}?email=${encodeURIComponent(email)}`" target="_blank">
|
||||
<span v-show="planName === 'free'">{{ $t('settings.appstoreAccount.subscriptionSetupAction') }}</span>
|
||||
<span v-show="cancelAt">{{ $t('settings.appstoreAccount.subscriptionReactivateAction') }}</span>
|
||||
<span v-show="!cancelAt">{{ $t('settings.appstoreAccount.subscriptionChangeAction') }}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</Section>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user