Remove some event dispatchers
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user