diff --git a/assets/components/LogViewer/ComplexLogItem.vue b/assets/components/LogViewer/ComplexLogItem.vue
index 16412870..c775c3a1 100644
--- a/assets/components/LogViewer/ComplexLogItem.vue
+++ b/assets/components/LogViewer/ComplexLogItem.vue
@@ -16,7 +16,7 @@
@@ -66,6 +69,13 @@
import { Container } from "@/models/Container";
import { sessionHost } from "@/composable/storage";
+// @ts-ignore
+import Pin from "~icons/ph/map-pin-simple";
+// @ts-ignore
+import Stack from "~icons/ph/stack";
+// @ts-ignore
+import Containers from "~icons/octicon/container-24";
+
const store = useContainerStore();
const { activeContainers, visibleContainers, ready } = storeToRefs(store);
@@ -75,7 +85,7 @@ function setHost(host: string | null) {
sessionHost.value = host;
}
-const debouncedIds = debouncedRef(pinnedContainers, 200);
+const debouncedPinnedContainers = debouncedRef(pinnedContainers, 200);
const sortedContainers = computed(() =>
visibleContainers.value
.filter((c) => c.host === sessionHost.value)
@@ -90,32 +100,39 @@ const sortedContainers = computed(() =>
}),
);
-const groupedContainers = computed(() =>
- sortedContainers.value.reduce(
- (acc, item) => {
- if (debouncedIds.value.has(item.name)) {
- acc.pinned.push(item);
- } else {
- acc.unpinned.push(item);
- }
- return acc;
- },
- { pinned: [] as Container[], unpinned: [] as Container[] },
- ),
-);
-
-function isContainer(item: any): item is Container {
- return item.hasOwnProperty("image");
-}
-
const menuItems = computed(() => {
- const pinnedLabel = { keyLabel: "label.pinned" };
- const allLabel = { keyLabel: showAllContainers.value ? "label.all-containers" : "label.running-containers" };
- if (groupedContainers.value.pinned.length > 0) {
- return [pinnedLabel, ...groupedContainers.value.pinned, allLabel, ...groupedContainers.value.unpinned];
- } else {
- return [allLabel, ...groupedContainers.value.unpinned];
+ const namespaced: Record
= {};
+ const pinned = [];
+ const singular = [];
+
+ for (const item of sortedContainers.value) {
+ const namespace = item.labels["com.docker.stack.namespace"] ?? item.labels["com.docker.compose.project"];
+ if (debouncedPinnedContainers.value.has(item.name)) {
+ pinned.push(item);
+ } else if (namespace) {
+ namespaced[namespace] ||= [];
+ namespaced[namespace].push(item);
+ } else {
+ singular.push(item);
+ }
}
+
+ const items = [];
+ if (pinned.length) {
+ items.push({ label: "label.pinned", containers: pinned, icon: Pin });
+ }
+ for (const [label, containers] of Object.entries(namespaced).sort(([a], [b]) => a.localeCompare(b))) {
+ items.push({ label, containers, icon: Stack });
+ }
+ if (singular.length) {
+ items.push({
+ label: showAllContainers.value ? "label.all-containers" : "label.running-containers",
+ containers: singular,
+ icon: Containers,
+ });
+ }
+
+ return items;
});
const activeContainersById = computed(() =>
diff --git a/assets/components/SidePanel.vue b/assets/components/SidePanel.vue
index ead780aa..54e4dbf6 100644
--- a/assets/components/SidePanel.vue
+++ b/assets/components/SidePanel.vue
@@ -12,15 +12,16 @@
-
- Search
-
-
+ {{ $t("placeholder.search") }}
+
+
diff --git a/e2e/default.spec.ts b/e2e/default.spec.ts
index 47f38c2a..1d406e3f 100644
--- a/e2e/default.spec.ts
+++ b/e2e/default.spec.ts
@@ -34,6 +34,6 @@ test.describe("es locale", () => {
test.use({ locale: "es" });
test("translated text", async ({ page }) => {
- await expect(page.getByTestId("label.running-containers")).toHaveText("Contenedores en ejecución");
+ await expect(page.getByTestId("search")).toContainText("Buscar");
});
});
diff --git a/e2e/simple.spec.ts b/e2e/simple.spec.ts
index 6c8c19b6..c45a8f77 100644
--- a/e2e/simple.spec.ts
+++ b/e2e/simple.spec.ts
@@ -5,5 +5,5 @@ test("simple authentication", async ({ page }) => {
await page.locator('input[name="username"]').fill("admin");
await page.locator('input[name="password"]').fill("password");
await page.locator('button[type="submit"]').click();
- await expect(page.getByTestId("label.running-containers")).toHaveText("Running Containers");
+ await expect(page.getByTestId("settings")).toBeVisible();
});
diff --git a/e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Chrome-linux.png b/e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Chrome-linux.png
index d435f104..610ee47f 100644
Binary files a/e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Chrome-linux.png and b/e2e/visual.spec.ts-snapshots/dark-homepage-1-Mobile-Chrome-linux.png differ
diff --git a/e2e/visual.spec.ts-snapshots/dark-homepage-1-chromium-linux.png b/e2e/visual.spec.ts-snapshots/dark-homepage-1-chromium-linux.png
index 7dc404ea..df77642a 100644
Binary files a/e2e/visual.spec.ts-snapshots/dark-homepage-1-chromium-linux.png and b/e2e/visual.spec.ts-snapshots/dark-homepage-1-chromium-linux.png differ
diff --git a/e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Chrome-linux.png b/e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Chrome-linux.png
index ff9b94a2..893d3f64 100644
Binary files a/e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Chrome-linux.png and b/e2e/visual.spec.ts-snapshots/default-homepage-1-Mobile-Chrome-linux.png differ
diff --git a/e2e/visual.spec.ts-snapshots/default-homepage-1-chromium-linux.png b/e2e/visual.spec.ts-snapshots/default-homepage-1-chromium-linux.png
index 0177c9be..0999ad95 100644
Binary files a/e2e/visual.spec.ts-snapshots/default-homepage-1-chromium-linux.png and b/e2e/visual.spec.ts-snapshots/default-homepage-1-chromium-linux.png differ
diff --git a/locales/de.yml b/locales/de.yml
index 365e7589..5511398f 100644
--- a/locales/de.yml
+++ b/locales/de.yml
@@ -62,6 +62,7 @@ button:
settings: Einstellungen
placeholder:
search-containers: Suche Container (⌘ + k, ⌃k)
+ search: Suche
settings:
display: Anzeige
locale: Sprache überschreiben
diff --git a/locales/en.yml b/locales/en.yml
index 369afbc3..71978c14 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -65,6 +65,7 @@ button:
settings: Settings
placeholder:
search-containers: Search containers (⌘ + k, ⌃k)
+ search: Search
settings:
display: Display
locale: Override language
diff --git a/locales/es.yml b/locales/es.yml
index a6aec709..bf69f7f2 100644
--- a/locales/es.yml
+++ b/locales/es.yml
@@ -62,6 +62,7 @@ button:
settings: Configuración
placeholder:
search-containers: Buscar contenedores (⌘ + K, CTRL + K)
+ search: Buscar
settings:
display: Vista
locale: Sobrescribir idioma
diff --git a/locales/fr.yml b/locales/fr.yml
index ff76a416..6853d88c 100644
--- a/locales/fr.yml
+++ b/locales/fr.yml
@@ -1,5 +1,5 @@
toolbar:
- clear: Effacer
+ clear: Effacer
download: Téléchargement
search: Chercher
show: Montrer seulement {std}
@@ -64,6 +64,7 @@ button:
settings: Paramètres
placeholder:
search-containers: Recherche de conteneurs (⌘ + k, ⌃k)
+ search: Recherche
settings:
display: Afficher
locale: Langue de remplacement
diff --git a/locales/it.yml b/locales/it.yml
index 99e3177b..daff542e 100644
--- a/locales/it.yml
+++ b/locales/it.yml
@@ -62,6 +62,7 @@ button:
settings: Configurazione
placeholder:
search-containers: Ricerca container (⌘ + k, ⌃k)
+ search: Cerca
settings:
display: Visualizza
locale: Sovrascrivi Linguaggio
diff --git a/locales/pr.yml b/locales/pr.yml
index 0a4c65c0..5de035c6 100644
--- a/locales/pr.yml
+++ b/locales/pr.yml
@@ -58,6 +58,7 @@ button:
settings: Configurações
placeholder:
search-containers: Pesquisar contentores (⌘ + K, CTRL + K)
+ search: Pesquisa
settings:
display: Visão
locale: Localidade
diff --git a/locales/ru.yml b/locales/ru.yml
index 3a3f69e2..a4e19ac9 100644
--- a/locales/ru.yml
+++ b/locales/ru.yml
@@ -58,6 +58,7 @@ button:
settings: Настройки
placeholder:
search-containers: Поиск контейнеров (⌘ + k, ⌃k)
+ search: Поиск
settings:
display: Вид
locale: Язык
diff --git a/locales/zh-tw.yml b/locales/zh-tw.yml
index bd33a803..3e069f15 100644
--- a/locales/zh-tw.yml
+++ b/locales/zh-tw.yml
@@ -41,6 +41,7 @@ button:
settings: 設定
placeholder:
search-containers: 查詢容器 (⌘ + k, ⌃k)
+ search: 查詢
settings:
display: 顯示
locale: 覆寫語言
diff --git a/locales/zh.yml b/locales/zh.yml
index 55cb165c..7c3e2af9 100644
--- a/locales/zh.yml
+++ b/locales/zh.yml
@@ -58,6 +58,7 @@ button:
settings: 设置
placeholder:
search-containers: 搜索容器 (⌘ + k, ⌃k)
+ search: 搜索
settings:
display: 显示
locale: 覆盖语言