1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

chore: fixes bugs with auto switching of menu

This commit is contained in:
Amir Raminfar
2024-06-21 12:04:22 -07:00
parent ae960bac05
commit 3d19870b36
4 changed files with 13 additions and 9 deletions

View File

@@ -170,18 +170,14 @@ const menuItems = computed(() => {
const route = useRoute("/container/[id]"); const route = useRoute("/container/[id]");
const updateHostForContainerRoute = (to: RouteLocationNormalizedLoaded) => { watchEffect(() => {
if (to.name === "/container/[id]") { if (route.name === "/container/[id]") {
const container = containerStore.findContainerById(to.params.id as string); const container = containerStore.findContainerById(route.params.id);
if (container) { if (container) {
setHost(container.host); setHost(container.host);
} }
} }
}; });
updateHostForContainerRoute(route);
onBeforeRouteUpdate((to) => updateHostForContainerRoute(to));
</script> </script>
<style scoped lang="postcss"> <style scoped lang="postcss">
.menu { .menu {

View File

@@ -32,7 +32,7 @@ const showSwarm = useSessionStorage<boolean>("DOZZLE_SWARM_MODE", false);
onBeforeRouteLeave((to) => { onBeforeRouteLeave((to) => {
if (to.meta.swarmMode) { if (to.meta.swarmMode) {
showSwarm.value = true; showSwarm.value = true;
} else { } else if (to.meta.containerMode) {
showSwarm.value = false; showSwarm.value = false;
} }
}); });

View File

@@ -31,3 +31,7 @@ watchEffect(() => {
} }
}); });
</script> </script>
<route lang="yaml">
meta:
containerMode: true
</route>

View File

@@ -20,3 +20,7 @@ watchEffect(() => {
} }
}); });
</script> </script>
<route lang="yaml">
meta:
containerMode: true
</route>