Fix cloudron appstore link
This commit is contained in:
@@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
|
||||
const i18n = useI18n();
|
||||
const t = i18n.t;
|
||||
|
||||
import { ref, onMounted, onUnmounted, useTemplateRef } from 'vue';
|
||||
import { ref, onMounted, onUnmounted, useTemplateRef, computed } from 'vue';
|
||||
import { Button, ProgressBar, InputDialog } from '@cloudron/pankow';
|
||||
import { prettyLongDate } from '@cloudron/pankow/utils';
|
||||
import Section from '../components/Section.vue';
|
||||
@@ -17,7 +17,6 @@ const dashboardModel = DashboardModel.create();
|
||||
|
||||
const consoleServerOrigin = ref();
|
||||
const busy = ref(true);
|
||||
const hasSubscription = ref(false);
|
||||
const email = ref('');
|
||||
const emailEncoded = ref('');
|
||||
const emailVerified = ref(false);
|
||||
@@ -37,7 +36,6 @@ async function refresh() {
|
||||
return console.error(error);
|
||||
}
|
||||
|
||||
hasSubscription.value = true;
|
||||
email.value = result.email;
|
||||
emailEncoded.value = encodeURIComponent(result.email);;
|
||||
emailVerified.value = result.emailVerified;
|
||||
@@ -48,6 +46,10 @@ async function refresh() {
|
||||
status.value = result.status;
|
||||
}
|
||||
|
||||
const appstoreCloudronLink = computed(() => {
|
||||
return `${consoleServerOrigin.value}/#/${email.value ? 'cloudrons' : 'claim'}/${cloudronId.value}`;
|
||||
});
|
||||
|
||||
const inputDialog = useTemplateRef('inputDialog');
|
||||
async function onAskUnlinkAccount() {
|
||||
const yes = await inputDialog.value.confirm({
|
||||
@@ -101,7 +103,7 @@ onUnmounted(() => {
|
||||
<!-- TODO: Show plan info -->
|
||||
|
||||
<div v-if="!busy">
|
||||
<div v-if="hasSubscription">
|
||||
<div v-if="cloudronId">
|
||||
<div>{{ $t('settings.appstoreAccount.description') }}</div>
|
||||
<br/>
|
||||
|
||||
@@ -123,7 +125,7 @@ onUnmounted(() => {
|
||||
</div>
|
||||
|
||||
<div class="button-bar" style="margin-top: 20px">
|
||||
<Button :href="`${consoleServerOrigin}/#/claim/${cloudronId}`" target="_blank">
|
||||
<Button :href="appstoreCloudronLink" target="_blank">
|
||||
<span v-if="!email">{{ $t('settings.appstoreAccount.setupAction') }}</span>
|
||||
<span v-else-if="cancelAt">{{ $t('settings.appstoreAccount.subscriptionReactivateAction') }}</span>
|
||||
<span v-else>{{ $t('settings.appstoreAccount.subscriptionChangeAction') }}</span>
|
||||
@@ -133,15 +135,6 @@ onUnmounted(() => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<SettingsItem v-else-if="cloudronId">
|
||||
<div style="display: flex; align-items: center;">
|
||||
{{ $t('settings.appstoreAccount.description') }}
|
||||
</div>
|
||||
<div style="display: flex; align-items: center;">
|
||||
<Button :href="`${consoleServerOrigin}/#/claim/${cloudronId}`" target="_blank">{{ $t('settings.appstoreAccount.setupAction') }}</Button>
|
||||
</div>
|
||||
</SettingsItem>
|
||||
|
||||
<SettingsItem v-else>
|
||||
<div style="display: flex; align-items: center;">
|
||||
Unknown Cloudron ID or invalid cloudron.io token.
|
||||
|
||||
Reference in New Issue
Block a user