1
0
mirror of https://github.com/amir20/dozzle.git synced 2025-12-24 06:28:42 +01:00

fix: removes toSorted() for older browsers that do not support it (#2895)

This commit is contained in:
Amir Raminfar
2024-04-14 14:06:11 -07:00
committed by GitHub
parent ec03e93298
commit e4e6903ef3
3 changed files with 7 additions and 7 deletions

View File

@@ -91,8 +91,8 @@ const { results } = useFuse(query, list, {
});
const data = computed(() => {
return results.value
.toSorted((a, b) => {
return [...results.value]
.sort((a, b) => {
if (a.score === b.score) {
if (a.item.state === b.item.state) {
return b.item.created - a.item.created;

View File

@@ -39,15 +39,15 @@ const { container } = useContainerContext();
const nextContainer = computed(
() =>
containers.value
.filter(
[
...containers.value.filter(
(c) =>
c.host === container.value.host &&
c.created > logEntry.date &&
c.name === container.value.name &&
c.state === "running",
)
.toSorted((a, b) => +a.created - +b.created)[0],
),
].sort((a, b) => +a.created - +b.created)[0],
);
function redirectNow() {

View File

@@ -39,7 +39,7 @@ const { containers, ready } = storeToRefs(containerStore) as unknown as {
ready: Ref<boolean>;
};
const mostRecentContainers = $computed(() => containers.value.toSorted((a, b) => +b.created - +a.created));
const mostRecentContainers = $computed(() => [...containers.value].sort((a, b) => +b.created - +a.created));
const runningContainers = $computed(() => mostRecentContainers.filter((c) => c.state === "running"));
let totalCpu = $ref(0);