Files
DataMate/frontend/src/pages/DataCollection/collection.model.ts
hefanli 63f4e3e447 refactor: modify data collection to python implementation (#214)
* feature: LabelStudio jumps without login

* refactor: modify data collection to python implementation

* refactor: modify data collection to python implementation

* refactor: modify data collection to python implementation

* refactor: modify data collection to python implementation

* refactor: modify data collection to python implementation

* refactor: modify data collection to python implementation

* fix: remove terrabase dependency

* feature: add the collection task executions page and the collection template page

* fix: fix the collection task creation

* fix: fix the collection task creation
2025-12-30 18:48:43 +08:00

67 lines
1.5 KiB
TypeScript

export enum TaskStatus {
DRAFT = "DRAFT",
PENDING = "PENDING",
RUNNING = "RUNNING",
COMPLETED = "COMPLETED",
FAILED = "FAILED",
STOPPED = "STOPPED",
}
export enum SyncMode {
ONCE = "ONCE",
SCHEDULED = "SCHEDULED",
}
export interface CollectionTask {
id: string;
name: string;
description: string;
config: object; // 具体配置结构根据实际需求定义
status: TaskStatus;
syncMode: SyncMode;
templateName?: string;
scheduleExpression?: string; // 仅当 syncMode 为 SCHEDULED 时存在
timeoutSeconds?: number;
lastExecutionId: string;
createdAt: string; // ISO date string
updatedAt: string; // ISO date string
}
export interface TaskExecution {
id: string;
taskId: string;
taskName: string;
status: string;
logPath: string;
startedAt: string;
completedAt: string;
durationSeconds: number;
errorMessage: string;
}
export enum LogStatus {
RUNNING = "RUNNING",
SUCCESS = "SUCCESS",
FAILED = "FAILED",
}
export enum TriggerType {
MANUAL = "MANUAL",
SCHEDULED = "SCHEDULED",
API = "API",
}
export interface CollectionLog {
id: string;
taskId: string;
taskName: string;
status: TaskStatus; // 任务执行状态
triggerType: TriggerType; // 触发类型,如手动触发、定时触发等
startTime: string; // ISO date string
endTime: string; // ISO date string
duration: string; // 格式化的持续时间字符串
retryCount: number;
processId: string;
errorMessage?: string; // 可选,错误信息
}