mirror of
https://github.com/whyour/qinglong.git
synced 2025-05-22 22:36:06 +08:00
修复更新任务、环境变量、依赖、订阅状态丢失
This commit is contained in:
parent
db564d1add
commit
b705ad6ee8
|
@ -26,7 +26,7 @@ export class Crontab {
|
|||
this.saved = options.saved;
|
||||
this.id = options.id;
|
||||
this.status =
|
||||
options.status && CrontabStatus[options.status]
|
||||
typeof options.status === 'number' && CrontabStatus[options.status]
|
||||
? options.status
|
||||
: CrontabStatus.idle;
|
||||
this.timestamp = new Date().toString();
|
||||
|
|
|
@ -12,7 +12,10 @@ export class Dependence {
|
|||
|
||||
constructor(options: Dependence) {
|
||||
this.id = options.id;
|
||||
this.status = options.status || DependenceStatus.installing;
|
||||
this.status =
|
||||
typeof options.status === 'number' && DependenceStatus[options.status]
|
||||
? options.status
|
||||
: DependenceStatus.installing;
|
||||
this.type = options.type || DependenceTypes.nodejs;
|
||||
this.timestamp = new Date().toString();
|
||||
this.name = options.name;
|
||||
|
|
|
@ -13,7 +13,10 @@ export class Env {
|
|||
constructor(options: Env) {
|
||||
this.value = options.value;
|
||||
this.id = options.id;
|
||||
this.status = options.status || EnvStatus.normal;
|
||||
this.status =
|
||||
typeof options.status === 'number' && EnvStatus[options.status]
|
||||
? options.status
|
||||
: EnvStatus.normal;
|
||||
this.timestamp = new Date().toString();
|
||||
this.position = options.position;
|
||||
this.name = options.name;
|
||||
|
|
|
@ -37,8 +37,8 @@ export class Subscription {
|
|||
this.name = options.name || options.alias;
|
||||
this.type = options.type;
|
||||
this.schedule = options.schedule;
|
||||
this.status =
|
||||
options.status && SubscriptionStatus[options.status]
|
||||
this.status = this.status =
|
||||
typeof options.status === 'number' && SubscriptionStatus[options.status]
|
||||
? options.status
|
||||
: SubscriptionStatus.idle;
|
||||
this.url = options.url;
|
||||
|
|
Loading…
Reference in New Issue
Block a user