mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
修复 cron-parser import,websocket basepath
This commit is contained in:
@@ -3,7 +3,7 @@ import config from '@/utils/config';
|
||||
import { request } from '@/utils/http';
|
||||
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import { Button, Form, Input, Modal, Select, Space, message } from 'antd';
|
||||
import cronParser from 'cron-parser';
|
||||
import CronExpressionParser from 'cron-parser';
|
||||
import { useEffect, useState } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
import { getScheduleType, scheduleTypeMap } from './const';
|
||||
@@ -92,7 +92,7 @@ const CronModal = ({
|
||||
{
|
||||
validator: (_, value) => {
|
||||
try {
|
||||
if (!value || cronParser.CronExpressionParser.parse(value).hasNext()) {
|
||||
if (!value || CronExpressionParser.parse(value).hasNext()) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(intl.get('Cron表达式格式有误'));
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from 'antd';
|
||||
import { request } from '@/utils/http';
|
||||
import config from '@/utils/config';
|
||||
import cronParser from 'cron-parser';
|
||||
import CronExpressionParser from 'cron-parser';
|
||||
import isNil from 'lodash/isNil';
|
||||
|
||||
const { Option } = Select;
|
||||
@@ -382,7 +382,7 @@ const SubscriptionModal = ({
|
||||
if (
|
||||
scheduleType === 'interval' ||
|
||||
!value ||
|
||||
cronParser.CronExpressionParser.parse(value).hasNext()
|
||||
CronExpressionParser.parse(value).hasNext()
|
||||
) {
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
import intl from 'react-intl-universal';
|
||||
import { LANG_MAP, LOG_END_SYMBOL } from './const';
|
||||
import cronParser from 'cron-parser';
|
||||
import CronExpressionParser from 'cron-parser';
|
||||
import { ICrontab } from '@/pages/crontab/type';
|
||||
|
||||
export default function browserType() {
|
||||
@@ -333,7 +333,7 @@ export function getCommandScript(
|
||||
|
||||
export function parseCrontab(schedule: string): Date | null {
|
||||
try {
|
||||
const time = cronParser.CronExpressionParser.parse(schedule);
|
||||
const time = CronExpressionParser.parse(schedule);
|
||||
if (time) {
|
||||
return time.next().toDate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user