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 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 {
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -31,3 +31,7 @@ watchEffect(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<route lang="yaml">
|
||||||
|
meta:
|
||||||
|
containerMode: true
|
||||||
|
</route>
|
||||||
|
|||||||
@@ -20,3 +20,7 @@ watchEffect(() => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<route lang="yaml">
|
||||||
|
meta:
|
||||||
|
containerMode: true
|
||||||
|
</route>
|
||||||
|
|||||||
Reference in New Issue
Block a user