refactor(frontend): extract shared TrainingRun type to $lib/types/training.ts
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,27 +1,15 @@
|
||||
<script lang="ts">
|
||||
import TrainingHistory from './TrainingHistory.svelte';
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
|
||||
interface Run {
|
||||
id: string;
|
||||
personId?: string;
|
||||
status: 'RUNNING' | 'DONE' | 'FAILED' | 'QUEUED';
|
||||
blockCount: number;
|
||||
documentCount: number;
|
||||
modelName: string;
|
||||
errorMessage?: string;
|
||||
triggeredBy?: string;
|
||||
createdAt: string;
|
||||
completedAt?: string;
|
||||
}
|
||||
import type { TrainingRun } from '$lib/types/training.js';
|
||||
|
||||
interface TrainingInfo {
|
||||
availableBlocks?: number;
|
||||
totalOcrBlocks?: number;
|
||||
availableDocuments?: number;
|
||||
ocrServiceAvailable?: boolean;
|
||||
lastRun?: Run | null;
|
||||
runs?: Run[];
|
||||
lastRun?: TrainingRun | null;
|
||||
runs?: TrainingRun[];
|
||||
personNames?: Record<string, string>;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,9 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
|
||||
interface Run {
|
||||
id: string;
|
||||
status: 'QUEUED' | 'RUNNING' | 'DONE' | 'FAILED';
|
||||
blockCount: number;
|
||||
documentCount: number;
|
||||
modelName: string;
|
||||
errorMessage?: string;
|
||||
triggeredBy?: string;
|
||||
createdAt: string;
|
||||
completedAt?: string;
|
||||
cer?: number;
|
||||
personId?: string;
|
||||
}
|
||||
import type { TrainingRun } from '$lib/types/training.js';
|
||||
|
||||
interface Props {
|
||||
runs: Run[];
|
||||
runs: TrainingRun[];
|
||||
personNames?: Record<string, string>;
|
||||
}
|
||||
|
||||
|
||||
13
frontend/src/lib/types/training.ts
Normal file
13
frontend/src/lib/types/training.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export interface TrainingRun {
|
||||
id: string;
|
||||
status: 'QUEUED' | 'RUNNING' | 'DONE' | 'FAILED';
|
||||
personId?: string;
|
||||
blockCount: number;
|
||||
documentCount: number;
|
||||
modelName: string;
|
||||
errorMessage?: string;
|
||||
triggeredBy?: string;
|
||||
createdAt: string;
|
||||
completedAt?: string;
|
||||
cer?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user