diff --git a/2 b/2
new file mode 100644
index 0000000..2d82f0a
--- /dev/null
+++ b/2
@@ -0,0 +1,126 @@
+
+
+
-
-
+
handler.invalidate()}
+ >
+ >Reload
@@ -117,7 +71,7 @@
bind:value={filterState}
on:change={() => {
handler.filter(filterState, 'cron_state');
- reloadData();
+ handler.invalidate();
}}
>
@@ -133,7 +87,7 @@
bind:value={filterEnabled}
on:change={() => {
handler.filter(filterEnabled, 'is_enabled');
- reloadData();
+ handler.invalidate();
}}
>
diff --git a/frontend/src/routes/(loggedin)/app/prober/+page.svelte b/frontend/src/routes/(loggedin)/app/prober/+page.svelte
index 57488f8..5eae831 100644
--- a/frontend/src/routes/(loggedin)/app/prober/+page.svelte
+++ b/frontend/src/routes/(loggedin)/app/prober/+page.svelte
@@ -2,14 +2,15 @@
import { DataHandler } from '@vincjo/datatables/remote';
import { format, formatDistance } from 'date-fns';
import { loadData, createProber, editProber, deleteProber } from './api-handler';
- import { onMount, onDestroy } from 'svelte';
+ import { onMount } from 'svelte';
import { getModalStore, getToastStore } from '@skeletonlabs/skeleton';
import {
DtSrRowsPerPage,
DtSrThSort,
DtSrThFilter,
DtSrRowCount,
- DtSrPagination
+ DtSrPagination,
+ DtSrAutoRefresh
} from '$lib/components/datatables/server';
const modalStore = getModalStore();
const toastStore = getToastStore();
@@ -111,49 +112,6 @@
const handler = new DataHandler([], { rowsPerPage: 10, totalRows: 0 });
let rows = handler.getRows();
- const reloadData = () => {
- handler.invalidate();
- };
-
- /** @type {number | undefined} */
- let intervalId;
- let intervalValue = 0;
-
- const intervalOptions = [
- { value: 0, label: 'No' },
- { value: 5, label: '5s' },
- { value: 10, label: '10s' },
- { value: 30, label: '30s' },
- { value: 60, label: '1m' }
- ];
-
- const startInterval = () => {
- const seconds = intervalValue;
- if (isNaN(seconds) || seconds < 0) {
- return;
- }
-
- if (!intervalOptions.some((option) => option.value === seconds)) {
- return;
- }
-
- if (intervalId) {
- clearInterval(intervalId);
- }
-
- if (seconds > 0) {
- reloadData();
- intervalId = setInterval(() => {
- reloadData();
- }, seconds * 1000);
- }
- };
-
- $: startInterval(); // Automatically start the interval on change
-
- onDestroy(() => {
- clearInterval(intervalId); // Clear the interval when the component is destroyed
- });
onMount(() => {
handler.onChange((state) => loadData(state));
handler.invalidate();
@@ -169,20 +127,15 @@
-
-
+
-