Make CloudronAccount view fetch console domain from backend config
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
<script setup>
|
||||
|
||||
import { ref, onMounted, useTemplateRef } from 'vue';
|
||||
import { Button } from 'pankow';
|
||||
import { Button, Spinner } from 'pankow';
|
||||
import { prettyDate } from 'pankow/utils';
|
||||
import Section from '../components/Section.vue';
|
||||
import SettingsItem from '../components/SettingsItem.vue';
|
||||
import CloudronRegistrationDialog from '../components/CloudronRegistrationDialog.vue';
|
||||
import AppstoreModel from '../models/AppstoreModel.js';
|
||||
import DashboardModel from '../models/DashboardModel.js';
|
||||
|
||||
const appstoreModel = AppstoreModel.create();
|
||||
const dashboardModel = DashboardModel.create();
|
||||
|
||||
// TODO maybe support dev.console.cloudron.io
|
||||
const consoleServerOrigin = 'https://console.cloudron.io';
|
||||
const consoleServerOrigin = ref();
|
||||
const busy = ref(true);
|
||||
const hasSubscription = ref(false);
|
||||
const email = ref('');
|
||||
@@ -48,6 +49,11 @@ async function refresh() {
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
const [error, result] = await dashboardModel.config();
|
||||
if (error) return console.error(error);
|
||||
|
||||
consoleServerOrigin.value = result.consoleServerOrigin;
|
||||
|
||||
await refresh();
|
||||
busy.value = false;
|
||||
});
|
||||
@@ -65,7 +71,6 @@ onMounted(async () => {
|
||||
<div v-if="hasSubscription">
|
||||
<p>{{ $t('settings.appstoreAccount.description') }}</p>
|
||||
|
||||
<!-- TODO what is `subscription.externalCustomer` ? -->
|
||||
<div class="info-row">
|
||||
<div class="info-label">{{ $t('settings.appstoreAccount.email') }}</div>
|
||||
<!-- TODO change to setup subscxription -->
|
||||
@@ -103,6 +108,9 @@ onMounted(async () => {
|
||||
</SettingsItem>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<Spinner class="pankow-spinner-large"/>
|
||||
</div>
|
||||
</Section>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -120,7 +120,6 @@ defineExpose({
|
||||
<fieldset :disabled="busy">
|
||||
<input type="submit" style="display: none;" :disabled="!name || !domain"/>
|
||||
|
||||
<!-- TODO only list domains which have incoming enabled -->
|
||||
<FormGroup v-if="!mailbox">
|
||||
<label for="nameInput">{{ $t('email.addMailboxDialog.name') }}</label>
|
||||
<InputGroup>
|
||||
|
||||
Reference in New Issue
Block a user