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">
|
<script lang="ts">
|
||||||
import TrainingHistory from './TrainingHistory.svelte';
|
import TrainingHistory from './TrainingHistory.svelte';
|
||||||
import { m } from '$lib/paraglide/messages.js';
|
import { m } from '$lib/paraglide/messages.js';
|
||||||
|
import type { TrainingRun } from '$lib/types/training.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface TrainingInfo {
|
interface TrainingInfo {
|
||||||
availableBlocks?: number;
|
availableBlocks?: number;
|
||||||
totalOcrBlocks?: number;
|
totalOcrBlocks?: number;
|
||||||
availableDocuments?: number;
|
availableDocuments?: number;
|
||||||
ocrServiceAvailable?: boolean;
|
ocrServiceAvailable?: boolean;
|
||||||
lastRun?: Run | null;
|
lastRun?: TrainingRun | null;
|
||||||
runs?: Run[];
|
runs?: TrainingRun[];
|
||||||
personNames?: Record<string, string>;
|
personNames?: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +1,9 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { m } from '$lib/paraglide/messages.js';
|
import { m } from '$lib/paraglide/messages.js';
|
||||||
|
import type { TrainingRun } from '$lib/types/training.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;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
runs: Run[];
|
runs: TrainingRun[];
|
||||||
personNames?: Record<string, string>;
|
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