ui: extract shared ActivityTable and split ModelDetail into components
- Add ActivityTable component consolidating column customization, table rendering, pagination, and capture dialog previously duplicated between Activity.svelte and ModelDetail.svelte - Split ModelDetail tabs into ModelActivityTab, ModelLogsTab, and ModelDetailsTab components under components/model/ - Reduce Activity.svelte and ModelDetail.svelte to thin shells - ModelDetail tabs now reuse ActivityTable instead of duplicating column management, formatting, and capture logic
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
<script lang="ts">
|
||||
import { metrics } from "../../stores/api";
|
||||
import ActivityTable from "../ActivityTable.svelte";
|
||||
|
||||
interface Props {
|
||||
modelId: string;
|
||||
}
|
||||
|
||||
let { modelId }: Props = $props();
|
||||
|
||||
let modelMetrics = $derived(
|
||||
[...$metrics].filter((m) => m.model === modelId).sort((a, b) => b.id - a.id)
|
||||
);
|
||||
</script>
|
||||
|
||||
<ActivityTable
|
||||
metrics={modelMetrics}
|
||||
storagePrefix="model-detail"
|
||||
showModelColumn={false}
|
||||
showPagination={true}
|
||||
compact={true}
|
||||
title="Recent Activity"
|
||||
emptyMessage="No activity recorded for this model"
|
||||
/>
|
||||
Reference in New Issue
Block a user