mirror of
https://github.com/amir20/dozzle.git
synced 2025-12-21 13:23:07 +01:00
feat: sorts homepage every 10 seconds (#2929)
This commit is contained in:
@@ -116,13 +116,10 @@ const storage = useStorage<{ column: keys; direction: 1 | -1 }>("DOZZLE_TABLE_CO
|
|||||||
direction: -1,
|
direction: -1,
|
||||||
});
|
});
|
||||||
const { column: sortField, direction } = toRefs(storage);
|
const { column: sortField, direction } = toRefs(storage);
|
||||||
|
const counter = useInterval(10000);
|
||||||
const sortedContainers = computedWithControl(
|
const sortedContainers = computedWithControl(
|
||||||
() => [containers.length, sortField.value, direction.value],
|
() => [containers.length, sortField.value, direction.value, counter.value],
|
||||||
() => {
|
() => containers.sort((a, b) => fields[sortField.value].sortFunc(a, b)),
|
||||||
return containers.sort((a, b) => {
|
|
||||||
return fields[sortField.value].sortFunc(a, b);
|
|
||||||
});
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const totalPages = computed(() => Math.ceil(sortedContainers.value.length / perPage.value));
|
const totalPages = computed(() => Math.ceil(sortedContainers.value.length / perPage.value));
|
||||||
|
|||||||
Reference in New Issue
Block a user