mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-25 17:42:25 +01:00
- Updated timestamp fields across the codebase from `*_ts` to `*_at` for consistency and clarity. - Renamed constants for node status from "on"/"off" to "online"/"offline" to better reflect their meanings. - Enhanced validation and error handling in various components to ensure data integrity. - Refactored test cases to align with the new naming conventions and improve readability.
57 lines
1.1 KiB
Go
57 lines
1.1 KiB
Go
import {
|
|
TASK_MODE_ALL_NODES,
|
|
TASK_MODE_RANDOM,
|
|
TASK_MODE_SELECTED_NODES,
|
|
} from '@/constants/task';
|
|
|
|
export declare global {
|
|
interface Task extends BaseModel {
|
|
spider_id?: string;
|
|
spider_name?: string;
|
|
status?: TaskStatus;
|
|
node_id?: string;
|
|
node_name?: string;
|
|
pid?: number;
|
|
schedule_id?: string;
|
|
schedule_name?: string;
|
|
type?: string;
|
|
mode?: TaskMode;
|
|
parent_id?: string;
|
|
cmd?: string;
|
|
param?: string;
|
|
error?: string;
|
|
stat?: TaskStat;
|
|
priority?: number;
|
|
|
|
// view model
|
|
node?: CNode;
|
|
spider?: Spider;
|
|
schedule?: Schedule;
|
|
}
|
|
|
|
interface TaskStat {
|
|
create_ts?: string;
|
|
started_at?: string;
|
|
ended_at?: string;
|
|
result_count?: number;
|
|
error_log_count?: number;
|
|
wait_duration?: number;
|
|
runtime_duration?: number;
|
|
total_duration?: number;
|
|
}
|
|
|
|
type TaskMode =
|
|
| TASK_MODE_RANDOM
|
|
| TASK_MODE_ALL_NODES
|
|
| TASK_MODE_SELECTED_NODES;
|
|
|
|
type TaskStatus =
|
|
| 'abnormal'
|
|
| 'cancelled'
|
|
| 'error'
|
|
| 'finished'
|
|
| 'running'
|
|
| 'assigned'
|
|
| 'pending';
|
|
}
|