1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 22:39:18 +01:00

feat: sorts most recent containers on top for fuzzy search (#2746)

This commit is contained in:
Amir Raminfar
2024-02-02 09:41:26 -08:00
committed by GitHub
parent bd86b2289b
commit 099c053341

View File

@@ -94,15 +94,15 @@ const data = computed(() => {
return results.value
.toSorted((a, b) => {
if (a.score === b.score) {
if (a.item.state === "running" && b.item.state !== "running") {
if (a.item.state === b.item.state) {
return b.item.created - a.item.created;
} else if (a.item.state === "running" && b.item.state !== "running") {
return -1;
} else {
return 1;
}
} else if (a.score && b.score) {
return a.score - b.score;
} else {
return 0;
return a.score - b.score;
}
})
.slice(0, maxResults);