Add initial uninstall view and ensure location hash is updated on tab change

This commit is contained in:
Johannes Zellner
2025-02-21 11:51:52 +01:00
parent 26e8eb8c11
commit 8132920ed8
2 changed files with 79 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ const t = i18n.t;
import { ref, onMounted, useTemplateRef } from 'vue';
import { Button, ButtonGroup, TabView } from 'pankow';
import Info from '../components/app/Info.vue';
import Uninstall from '../components/app/Uninstall.vue';
import AppsModel from '../models/AppsModel.js';
import { APP_TYPES } from '../constants.js';
@@ -40,6 +41,10 @@ const link = ref('');
const infoMenu = ref([]);
const hasLocalStorage = ref(false);
function onTabChanged(tab) {
window.location.hash = `/app/${id.value}/${tab}`;
}
async function refresh() {
const [error, result] = await appsModel.get(id.value);
if (error) return console.error(error);
@@ -137,7 +142,7 @@ onMounted(async () => {
</div>
</div>
<TabView ref="tabView" :tabs="tabs">
<TabView ref="tabView" :tabs="tabs" @changed="onTabChanged">
<template #info><Info :app="app"/></template>
<template #display>Display</template>
<template #location></template>
@@ -154,7 +159,7 @@ onMounted(async () => {
<template #backups></template>
<template #repair></template>
<template #eventlog></template>
<template #uninstall></template>
<template #uninstall><Uninstall :app="app"/></template>
</TabView>
</div>
</template>