Remove some event dispatchers

This commit is contained in:
2025-10-14 00:03:48 +02:00
parent 75d9ed3023
commit b409ff009d
23 changed files with 165 additions and 316 deletions

View File

@@ -4,13 +4,16 @@ import Expandable from "util/Expandable.svelte";
import { createEventDispatcher } from "svelte";
let dispatch = createEventDispatcher()
let { report, ip_report_count } = $props();
let {
report,
ip_report_count
} = $props();
let preview = $state(false)
let can_grant = $derived(report.status !== "granted")
let can_reject = $derived(report.status !== "rejected")
let set_status = async (action, report_type) => {
let set_status = async (action: string, report_type: string) => {
dispatch("resolve_report", {action: action, report_type: report_type})
}
</script>

View File

@@ -199,7 +199,7 @@ onDestroy(() => {
</div>
<br/>
<ServerDiagnostics running_since={status.cpu_profile_running_since} on:refresh={() => getStats(lastOrder)}/>
<ServerDiagnostics running_since={status.cpu_profile_running_since} refresh={() => getStats(lastOrder)}/>
<section>
<h3>Process stats</h3>

View File

@@ -1,14 +1,15 @@
<script lang="ts">
import { get_endpoint } from "lib/PixeldrainAPI";
import { createEventDispatcher, onMount } from "svelte";
import { onMount } from "svelte";
import { formatDuration } from "util/Formatting";
let dispatch = createEventDispatcher()
interface Props {
running_since?: string;
}
let { running_since = "" }: Props = $props();
let {
running_since = "",
refresh,
}: {
running_since?: string
refresh?: () => void
} = $props();
let profile_running = $derived(running_since != "0001-01-01T00:00:00Z" && running_since != "")
@@ -25,7 +26,9 @@ const start = async () => {
window.open(get_endpoint()+"/admin/cpu_profile")
}
dispatch("refresh")
if (refresh !== undefined) {
refresh()
}
}
let interval: number