mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
28 lines
591 B
TypeScript
28 lines
591 B
TypeScript
export class Crontab {
|
|
name?: string;
|
|
command: string;
|
|
schedule: string;
|
|
timestamp?: string;
|
|
created?: number;
|
|
saved?: boolean;
|
|
_id?: string;
|
|
status?: CrontabStatus;
|
|
|
|
constructor(options: Crontab) {
|
|
this.name = options.name;
|
|
this.command = options.command;
|
|
this.schedule = options.schedule;
|
|
this.saved = options.saved;
|
|
this._id = options._id;
|
|
this.created = options.created;
|
|
this.status = options.status || CrontabStatus.idle;
|
|
this.timestamp = new Date().toString();
|
|
}
|
|
}
|
|
|
|
export enum CrontabStatus {
|
|
'idle',
|
|
'running',
|
|
'disabled',
|
|
}
|