|
|
@ -202,7 +202,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
|
|
|
|
!Number.isInteger(item.second) ||
|
|
|
|
!Number.isInteger(item.second) ||
|
|
|
|
!Number.isInteger(item.week)
|
|
|
|
!Number.isInteger(item.week)
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
switch (item.specType) {
|
|
|
|
switch (item.specType) {
|
|
|
@ -215,7 +215,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute > 59
|
|
|
|
item.minute > 59
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -228,7 +228,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute > 59
|
|
|
|
item.minute > 59
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -241,36 +241,36 @@ const verifySpec = (rule: any, value: any, callback: any) => {
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute < 0 ||
|
|
|
|
item.minute > 59
|
|
|
|
item.minute > 59
|
|
|
|
) {
|
|
|
|
) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'perDay':
|
|
|
|
case 'perDay':
|
|
|
|
if (item.hour < 0 || item.hour > 23 || item.minute < 0 || item.minute > 59) {
|
|
|
|
if (item.hour < 0 || item.hour > 23 || item.minute < 0 || item.minute > 59) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'perNHour':
|
|
|
|
case 'perNHour':
|
|
|
|
if (item.hour < 0 || item.hour > 8784 || item.minute < 0 || item.minute > 59) {
|
|
|
|
if (item.hour < 0 || item.hour > 8784 || item.minute < 0 || item.minute > 59) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'perHour':
|
|
|
|
case 'perHour':
|
|
|
|
if (item.minute < 0 || item.minute > 59) {
|
|
|
|
if (item.minute < 0 || item.minute > 59) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case 'perNMinute':
|
|
|
|
case 'perNMinute':
|
|
|
|
if (item.minute < 0 || item.minute > 527040) {
|
|
|
|
if (item.minute < 0 || item.minute > 527040) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 'perNSecond':
|
|
|
|
case 'perNSecond':
|
|
|
|
if (item.second < 0 || item.second > 31622400) {
|
|
|
|
if (item.second < 0 || item.second > 31622400) {
|
|
|
|
callback(new Error(i18n.global.t('cronjob.specErr')));
|
|
|
|
callback(new Error(i18n.global.t('toolbox.clam.specErr')));
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|