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

feat: adds labels to fuzzy search dialog (#2649)

This commit is contained in:
Amir Raminfar
2024-01-04 07:47:51 -08:00
committed by GitHub
parent ee4f94ce2e
commit a4026e16e8
7 changed files with 22 additions and 15 deletions

View File

@@ -58,22 +58,24 @@ const store = useContainerStore();
const { containers } = storeToRefs(store);
const list = computed(() => {
return containers.value.map(({ id, created, name, state, hostLabel: host }) => {
return containers.value.map(({ id, created, name, state, labels, hostLabel: host }) => {
return {
id,
created,
name,
state,
host,
labels: Object.entries(labels).map(([_, value]) => value),
};
});
});
const { results } = useFuse(query, list, {
fuseOptions: {
keys: ["name", "host"],
keys: ["name", "host", "labels"],
includeScore: true,
useExtendedSearch: true,
threshold: 0.3,
},
resultLimit,
matchAllWhenSearchEmpty: true,