ran prettier
This commit is contained in:
@@ -1,48 +1,46 @@
|
||||
<script lang="ts">
|
||||
import { createEventDispatcher } from "svelte";
|
||||
import type { Model } from "./+page.svelte";
|
||||
import ModelData from "./ModelData.svelte";
|
||||
import { post } from "src/lib/requests.svelte";
|
||||
import ModelDataPageStatsGraph from "./ModelDataPageStatsGraph.svelte";
|
||||
import type { ModelStats } from "./types";
|
||||
import DeleteZip from "./DeleteZip.svelte";
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import type { Model } from './+page.svelte';
|
||||
import ModelData from './ModelData.svelte';
|
||||
import { post } from 'src/lib/requests.svelte';
|
||||
import ModelDataPageStatsGraph from './ModelDataPageStatsGraph.svelte';
|
||||
import type { ModelStats } from './types';
|
||||
import DeleteZip from './DeleteZip.svelte';
|
||||
|
||||
let { model, active } = $props<{model: Model, active?: boolean}>()
|
||||
|
||||
const dispatch = createEventDispatcher<{ reload: void }>();
|
||||
let { model, active } = $props<{ model: Model; active?: boolean }>();
|
||||
|
||||
$effect(() => {
|
||||
if (active)
|
||||
getData();
|
||||
});
|
||||
const dispatch = createEventDispatcher<{ reload: void }>();
|
||||
|
||||
let stats: ModelStats | undefined = $state();
|
||||
$effect(() => {
|
||||
if (active) getData();
|
||||
});
|
||||
|
||||
async function getData() {
|
||||
if (!model) return;
|
||||
try {
|
||||
stats = await post(`models/class/stats`, { id: model.id });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
let stats: ModelStats | undefined = $state();
|
||||
|
||||
async function getData() {
|
||||
if (!model) return;
|
||||
try {
|
||||
stats = await post(`models/class/stats`, { id: model.id });
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="content" class:selected={active}>
|
||||
|
||||
{#if stats}
|
||||
<ModelDataPageStatsGraph data={stats} />
|
||||
{/if}
|
||||
{#if stats}
|
||||
<ModelDataPageStatsGraph data={stats} />
|
||||
{/if}
|
||||
|
||||
{#if [-6, -2].includes(model.status)}
|
||||
<DeleteZip {model} on:reload={() => dispatch('reload')} expand />
|
||||
{/if}
|
||||
|
||||
{#if [-6, -2].includes(model.status)}
|
||||
<DeleteZip model={model} on:reload={() => dispatch('reload')} expand />
|
||||
{/if}
|
||||
|
||||
<ModelData model={model} on:reload={() => {
|
||||
getData();
|
||||
dispatch('reload');
|
||||
}} />
|
||||
<ModelData
|
||||
{model}
|
||||
on:reload={() => {
|
||||
getData();
|
||||
dispatch('reload');
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user