Preselect dashboard domain in app installation

This commit is contained in:
Johannes Zellner
2025-01-07 12:00:31 +01:00
parent 12d9e6b618
commit a887fc8153
2 changed files with 32 additions and 2 deletions

View File

@@ -66,6 +66,7 @@ import AccessControl from './AccessControl.vue';
import PortBindings from './PortBindings.vue';
import DomainsModel from '../models/DomainsModel.js';
import AppsModel from '../models/AppsModel.js';
import DashboardModel from '../models/DashboardModel.js';
const API_ORIGIN = import.meta.env.VITE_API_ORIGIN ? import.meta.env.VITE_API_ORIGIN : window.location.origin;
@@ -76,6 +77,7 @@ const STEP = Object.freeze({
const domainsModel = DomainsModel.create(API_ORIGIN, localStorage.token);
const appsModel = AppsModel.create(API_ORIGIN, localStorage.token);
const dashboardModel = DashboardModel.create(API_ORIGIN, localStorage.token);
// reactive
const busy = ref(false);
@@ -141,9 +143,10 @@ async function submit() {
onMounted(async () => {
domains.value = await domainsModel.list();
const config = await dashboardModel.getConfig();
// TODO pre-select the adminDomain
domain.value = domains.value[0].domain;
// preselect with dashboard domain
domain.value = config.adminDomain || domains.value[0].domain;
});
defineExpose({