mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
升级 cron-parser
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
} from 'antd';
|
||||
import { request } from '@/utils/http';
|
||||
import config from '@/utils/config';
|
||||
import cron_parser from 'cron-parser';
|
||||
import { CronExpressionParser } from 'cron-parser';
|
||||
import isNil from 'lodash/isNil';
|
||||
|
||||
const { Option } = Select;
|
||||
@@ -224,8 +224,8 @@ const SubscriptionModal = ({
|
||||
type === 'raw'
|
||||
? 'file'
|
||||
: url.startsWith('http')
|
||||
? 'public-repo'
|
||||
: 'private-repo';
|
||||
? 'public-repo'
|
||||
: 'private-repo';
|
||||
|
||||
form.setFieldsValue({
|
||||
type: _type,
|
||||
@@ -381,7 +381,7 @@ const SubscriptionModal = ({
|
||||
if (
|
||||
scheduleType === 'interval' ||
|
||||
!value ||
|
||||
cron_parser.parseExpression(value).hasNext()
|
||||
CronExpressionParser.parse(value).hasNext()
|
||||
) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import { LANG_MAP, LOG_END_SYMBOL } from './const';
|
||||
import cron_parser from 'cron-parser';
|
||||
import { CronExpressionParser } from 'cron-parser';
|
||||
import { ICrontab } from '@/pages/crontab/type';
|
||||
|
||||
export default function browserType() {
|
||||
@@ -155,9 +155,9 @@ export default function browserType() {
|
||||
shell === 'none'
|
||||
? {}
|
||||
: {
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs,
|
||||
},
|
||||
shell, // wechat qq uc 360 2345 sougou liebao maxthon
|
||||
shellVs,
|
||||
},
|
||||
);
|
||||
|
||||
console.log(
|
||||
@@ -333,11 +333,11 @@ export function getCommandScript(
|
||||
|
||||
export function parseCrontab(schedule: string): Date | null {
|
||||
try {
|
||||
const time = cron_parser.parseExpression(schedule);
|
||||
const time = CronExpressionParser.parse(schedule);
|
||||
if (time) {
|
||||
return time.next().toDate();
|
||||
}
|
||||
} catch (error) {}
|
||||
} catch (error) { }
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user