1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-21 13:23:07 +01:00

feat: uses desktop menu instead for mobile menu (#3153)

This commit is contained in:
Amir Raminfar
2024-07-26 11:18:05 -07:00
committed by GitHub
parent ba10c03a90
commit 989f0f03ee
3 changed files with 1 additions and 43 deletions

View File

@@ -21,61 +21,19 @@
<transition name="fade"> <transition name="fade">
<div v-show="show" class="h-[calc(100vh-60px)] overflow-auto"> <div v-show="show" class="h-[calc(100vh-60px)] overflow-auto">
<div class="mt-4 flex items-center justify-center gap-2"> <SideMenu />
<dropdown-menu
v-model="sessionHost"
:options="hosts"
defaultLabel="Hosts"
class="btn-sm"
v-if="config.hosts.length > 1"
/>
</div>
<ul class="menu">
<li class="menu-title">{{ $t("label.containers") }}</li>
<li v-for="item in sortedContainers" :key="item.id" :class="item.state">
<router-link
:to="{ name: '/container/[id]', params: { id: item.id } }"
active-class="active-primary"
class="truncate"
:title="item.name"
>
{{ item.name }}
</router-link>
</li>
</ul>
</div> </div>
</transition> </transition>
</nav> </nav>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { sessionHost } from "@/composable/storage";
const store = useContainerStore();
const route = useRoute(); const route = useRoute();
const { visibleContainers } = storeToRefs(store);
const show = ref(false); const show = ref(false);
watch(route, () => { watch(route, () => {
show.value = false; show.value = false;
}); });
const sortedContainers = computed(() =>
visibleContainers.value
.filter((c) => c.host === sessionHost.value)
.sort((a, b) => {
if (a.state === "running" && b.state !== "running") {
return -1;
} else if (a.state !== "running" && b.state === "running") {
return 1;
} else {
return a.name.localeCompare(b.name);
}
}),
);
const hosts = computed(() => config.hosts.map(({ id, name }) => ({ value: id, label: name })));
</script> </script>
<style scoped lang="postcss"> <style scoped lang="postcss">
li.exited { li.exited {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 15 KiB