Ensure the app install dialog is properly reset now that we keep the components alive

This commit is contained in:
Johannes Zellner
2025-09-29 22:46:05 +02:00
parent 5c6ceb2307
commit cafacf4748
2 changed files with 26 additions and 15 deletions
+18 -9
View File
@@ -32,6 +32,7 @@ const dialog = useTemplateRef('dialogHandle');
const locationInput = useTemplateRef('locationInput');
const description = computed(() => marked.parse(manifest.value.description || ''));
const domains = ref([]);
const dashboardDomain = ref('');
const formValid = computed(() => {
if (!domain.value) return false;
@@ -141,16 +142,10 @@ function onClose() {
}
onMounted(async () => {
let [error, result] = await domainsModel.list();
const [error, result] = await dashboardModel.config();
if (error) return console.error(error);
domains.value = result;
[error, result] = await dashboardModel.config();
if (error) return console.error(error);
// preselect with dashboard domain
domain.value = (domains.value.find(d => d.domain === result.adminDomain) || domains.value[0]).domain;
dashboardDomain.value = result.adminDomain;
});
const screenshotsContainer = useTemplateRef('screenshotsContainer');
@@ -172,11 +167,25 @@ function onScreenshotNext() {
}
defineExpose({
open(a, appCountExceeded) {
open: async function(a, appCountExceeded) {
busy.value = false;
step.value = STEP.DETAILS;
app.value = a;
appMaxCountExceeded.value = appCountExceeded;
manifest.value = a.manifest;
location.value = '';
accessRestrictionOption.value = ACL_OPTIONS.ANY;
accessRestrictionAcl.value = { users: [], groups: [] };
domainProvider.value = '';
upstreamUri.value = '';
const [error, result] = await domainsModel.list();
if (error) return console.error(error);
domains.value = result;
// preselect with dashboard domain
domain.value = (domains.value.find(d => d.domain === dashboardDomain.value) || domains.value[0]).domain;
tcpPorts.value = a.manifest.tcpPorts;
udpPorts.value = a.manifest.udpPorts;