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:
@@ -170,18 +170,14 @@ const menuItems = computed(() => {
|
||||
|
||||
const route = useRoute("/container/[id]");
|
||||
|
||||
const updateHostForContainerRoute = (to: RouteLocationNormalizedLoaded) => {
|
||||
if (to.name === "/container/[id]") {
|
||||
const container = containerStore.findContainerById(to.params.id as string);
|
||||
watchEffect(() => {
|
||||
if (route.name === "/container/[id]") {
|
||||
const container = containerStore.findContainerById(route.params.id);
|
||||
if (container) {
|
||||
setHost(container.host);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
updateHostForContainerRoute(route);
|
||||
|
||||
onBeforeRouteUpdate((to) => updateHostForContainerRoute(to));
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="postcss">
|
||||
.menu {
|
||||
|
||||
@@ -32,7 +32,7 @@ const showSwarm = useSessionStorage<boolean>("DOZZLE_SWARM_MODE", false);
|
||||
onBeforeRouteLeave((to) => {
|
||||
if (to.meta.swarmMode) {
|
||||
showSwarm.value = true;
|
||||
} else {
|
||||
} else if (to.meta.containerMode) {
|
||||
showSwarm.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,3 +31,7 @@ watchEffect(() => {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<route lang="yaml">
|
||||
meta:
|
||||
containerMode: true
|
||||
</route>
|
||||
|
||||
@@ -20,3 +20,7 @@ watchEffect(() => {
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<route lang="yaml">
|
||||
meta:
|
||||
containerMode: true
|
||||
</route>
|
||||
|
||||
Reference in New Issue
Block a user