File tree Expand file tree Collapse file tree 22 files changed +47
-3
lines changed
Expand file tree Collapse file tree 22 files changed +47
-3
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ declare global {
5656 const getCurrentWatcher : typeof import ( 'vue' ) . getCurrentWatcher
5757 const getDeep : typeof import ( './utils/index' ) . getDeep
5858 const globalShowPopup : typeof import ( './composable/popup' ) . globalShowPopup
59+ const groupContainers : typeof import ( './stores/settings' ) . groupContainers
5960 const h : typeof import ( 'vue' ) . h
6061 const hashCode : typeof import ( './utils/index' ) . hashCode
6162 const hourStyle : typeof import ( './stores/settings' ) . hourStyle
@@ -456,6 +457,7 @@ declare module 'vue' {
456457 readonly getCurrentWatcher : UnwrapRef < typeof import ( 'vue' ) [ 'getCurrentWatcher' ] >
457458 readonly getDeep : UnwrapRef < typeof import ( './utils/index' ) [ 'getDeep' ] >
458459 readonly globalShowPopup : UnwrapRef < typeof import ( './composable/popup' ) [ 'globalShowPopup' ] >
460+ readonly groupContainers : UnwrapRef < typeof import ( './stores/settings' ) [ 'groupContainers' ] >
459461 readonly h : UnwrapRef < typeof import ( 'vue' ) [ 'h' ] >
460462 readonly hashCode : UnwrapRef < typeof import ( './utils/index' ) [ 'hashCode' ] >
461463 readonly hourStyle : UnwrapRef < typeof import ( './stores/settings' ) [ 'hourStyle' ] >
Original file line number Diff line number Diff line change 121121<script lang="ts" setup>
122122import { Container } from " @/models/Container" ;
123123import { sessionHost } from " @/composable/storage" ;
124- import { showAllContainers } from " @/stores/settings" ;
124+ import { showAllContainers , groupContainers } from " @/stores/settings" ;
125125
126126// @ts-ignore
127127import Pin from " ~icons/ph/map-pin-simple" ;
@@ -198,10 +198,15 @@ const menuItems = computed(() => {
198198 items .push ({ label: " label.pinned" , containers: pinned , icon: Pin });
199199 }
200200 for (const [label, containers] of Object .entries (namespaced ).sort (([a ], [b ]) => a .localeCompare (b ))) {
201- if (containers .length > 1 ) {
201+ const shouldGroup =
202+ groupContainers .value === " always" || (groupContainers .value === " at-least-2" && containers .length > 1 );
203+
204+ if (shouldGroup ) {
202205 items .push ({ label , containers , icon: Stack });
203206 } else {
204- singular .push (containers [0 ]);
207+ for (const container of containers ) {
208+ singular .push (container );
209+ }
205210 }
206211 }
207212
Original file line number Diff line number Diff line change 158158 />
159159 </template >
160160 </LabeledInput >
161+ <LabeledInput >
162+ <template #label >
163+ {{ $t("settings.group-containers") }}
164+ </template >
165+ <template #input >
166+ <DropdownMenu
167+ v-model =" groupContainers"
168+ :options =" [
169+ { label: 'Always', value: 'always' },
170+ { label: 'At least 2', value: 'at-least-2' },
171+ { label: 'Never', value: 'never' },
172+ ]"
173+ />
174+ </template >
175+ </LabeledInput >
161176
162177 <Toggle v-model =" search" >
163178 {{ $t("settings.search") }} <key-shortcut char =" f" class =" align-top" ></key-shortcut >
@@ -185,6 +200,7 @@ import {
185200 smallerScrollbars ,
186201 softWrap ,
187202 locale ,
203+ groupContainers ,
188204} from " @/stores/settings" ;
189205
190206import { availableLocales , i18n } from " @/modules/i18n" ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export type Settings = {
1616 collapseNav : boolean ;
1717 automaticRedirect : "instant" | "delayed" | "none" ;
1818 locale : string ;
19+ groupContainers : "always" | "at-least-2" | "never" ;
1920} ;
2021export const DEFAULT_SETTINGS : Settings = {
2122 search : true ,
@@ -33,6 +34,7 @@ export const DEFAULT_SETTINGS: Settings = {
3334 collapseNav : false ,
3435 automaticRedirect : "delayed" ,
3536 locale : "" ,
37+ groupContainers : "at-least-2" ,
3638} ;
3739
3840export const settings = useProfileStorage ( "settings" , DEFAULT_SETTINGS ) ;
@@ -61,4 +63,5 @@ export const {
6163 search,
6264 locale,
6365 automaticRedirect,
66+ groupContainers,
6467} = toRefs ( settings . value ) ;
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ type Settings struct {
3535 HourStyle string `json:"hourStyle,omitempty"`
3636 DateLocale string `json:"dateLocale,omitempty"`
3737 Locale string `json:"locale"`
38+ GroupContainers string `json:"groupContainers,omitempty"`
3839}
3940
4041type Profile struct {
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ settings:
9595 color-scheme : Farve skema
9696 options : Muligheder
9797 show-stopped-containers : Vis stoppet containere
98+ group-containers : Gruppér containere efter namespace
9899 about : Omkring
99100 search : Aktiver søgning med Dozzle ved brug af
100101 using-version : Du bruger <a href="https://dozzle.dev/" target="_blank" rel="noreferrer noopener">Dozzle</a> {version}.
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ settings:
9595 color-scheme : Farbschema
9696 options : Optionen
9797 show-stopped-containers : Zeige gestoppte Container
98+ group-containers : Container nach Namespace gruppieren
9899 about : Über
99100 search : Aktiviere die Suche mit Dozzle mit
100101 using-version : Du verwendest <a href="https://dozzle.dev/" target="_blank" rel="noreferrer noopener">Dozzle</a> {version}.
Original file line number Diff line number Diff line change @@ -100,6 +100,7 @@ settings:
100100 color-scheme : Color scheme
101101 options : Options
102102 show-stopped-containers : Show stopped containers
103+ group-containers : Group containers by namespace
103104 about : About
104105 search : Enable searching with Dozzle using
105106 using-version : You are using <a href="https://dozzle.dev/" target="_blank" rel="noreferrer noopener">Dozzle</a> {version}.
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ settings:
9595 color-scheme : Esquema de colores
9696 options : Opciones
9797 show-stopped-containers : Mostrar contenedores parados
98+ group-containers : Agrupar contenedores por namespace
9899 about : Acerca de
99100 search : Activar la búsqueda con Dozzle mediante
100101 using-version : Estás usando <a href="https://dozzle.dev/" target="_blank" rel="noreferrer noopener">Dozzle</a> {version}.
Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ settings:
9595 color-scheme : Schéma de couleurs
9696 options : Options
9797 show-stopped-containers : Afficher les conteneurs arrêtés
98+ group-containers : Regrouper les conteneurs par namespace
9899 about : A propos de
99100 search : Activer la recherche avec Dozzle en utilisant
100101 using-version : Vous utilisez <a href="https://dozzle.dev/" target="_blank" rel="noreferrer noopener">Dozzle</a> {version}.
You can’t perform that action at this time.
0 commit comments