Skip to content

Commit 989f0f0

Browse files
authored
feat: uses desktop menu instead for mobile menu (#3153)
1 parent ba10c03 commit 989f0f0

File tree

3 files changed

+1
-43
lines changed

3 files changed

+1
-43
lines changed

assets/components/common/MobileMenu.vue

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,61 +21,19 @@
2121

2222
<transition name="fade">
2323
<div v-show="show" class="h-[calc(100vh-60px)] overflow-auto">
24-
<div class="mt-4 flex items-center justify-center gap-2">
25-
<dropdown-menu
26-
v-model="sessionHost"
27-
:options="hosts"
28-
defaultLabel="Hosts"
29-
class="btn-sm"
30-
v-if="config.hosts.length > 1"
31-
/>
32-
</div>
33-
34-
<ul class="menu">
35-
<li class="menu-title">{{ $t("label.containers") }}</li>
36-
<li v-for="item in sortedContainers" :key="item.id" :class="item.state">
37-
<router-link
38-
:to="{ name: '/container/[id]', params: { id: item.id } }"
39-
active-class="active-primary"
40-
class="truncate"
41-
:title="item.name"
42-
>
43-
{{ item.name }}
44-
</router-link>
45-
</li>
46-
</ul>
24+
<SideMenu />
4725
</div>
4826
</transition>
4927
</nav>
5028
</template>
5129

5230
<script lang="ts" setup>
53-
import { sessionHost } from "@/composable/storage";
54-
const store = useContainerStore();
5531
const route = useRoute();
56-
const { visibleContainers } = storeToRefs(store);
5732
5833
const show = ref(false);
59-
6034
watch(route, () => {
6135
show.value = false;
6236
});
63-
64-
const sortedContainers = computed(() =>
65-
visibleContainers.value
66-
.filter((c) => c.host === sessionHost.value)
67-
.sort((a, b) => {
68-
if (a.state === "running" && b.state !== "running") {
69-
return -1;
70-
} else if (a.state !== "running" && b.state === "running") {
71-
return 1;
72-
} else {
73-
return a.name.localeCompare(b.name);
74-
}
75-
}),
76-
);
77-
78-
const hosts = computed(() => config.hosts.map(({ id, name }) => ({ value: id, label: name })));
7937
</script>
8038
<style scoped lang="postcss">
8139
li.exited {
4.88 KB
Loading
4.86 KB
Loading

0 commit comments

Comments
 (0)