mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-10-27 22:55:07 +01:00
Migrate and fix filter component and subcomponents
This commit is contained in:
@@ -10,15 +10,7 @@
|
||||
<script>
|
||||
import { Button, Icon, Input, InputGroup } from "@sveltestrap/sveltestrap";
|
||||
|
||||
let refreshInterval = $state(null);
|
||||
let refreshIntervalId = null;
|
||||
|
||||
function refreshIntervalChanged() {
|
||||
if (refreshIntervalId != null) clearInterval(refreshIntervalId);
|
||||
if (refreshInterval == null) return;
|
||||
refreshIntervalId = setInterval(() => dispatch("refresh"), refreshInterval);
|
||||
}
|
||||
|
||||
/* Svelte 5 Props */
|
||||
let {
|
||||
initially = null,
|
||||
onRefresh
|
||||
@@ -28,6 +20,19 @@
|
||||
refreshInterval = initially * 1000;
|
||||
refreshIntervalChanged();
|
||||
}
|
||||
|
||||
/* State Init */
|
||||
let refreshInterval = $state(null);
|
||||
|
||||
/* Var Init */
|
||||
let refreshIntervalId = null;
|
||||
|
||||
/* Functions */
|
||||
function refreshIntervalChanged() {
|
||||
if (refreshIntervalId != null) clearInterval(refreshIntervalId);
|
||||
if (refreshInterval == null) return;
|
||||
refreshIntervalId = setInterval(() => onRefresh(), refreshInterval);
|
||||
}
|
||||
</script>
|
||||
|
||||
<InputGroup>
|
||||
|
||||
Reference in New Issue
Block a user