mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 17:54:32 +08:00
定时任务增加前后规则校验,不能包含 task 命令
This commit is contained in:
@@ -153,11 +153,23 @@ const CronModal = ({
|
||||
tooltip={intl.get(
|
||||
'运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js',
|
||||
)}
|
||||
rules={[
|
||||
{
|
||||
validator(rule, value) {
|
||||
if (value.includes(' task ') || value.startsWith('task ')) {
|
||||
return Promise.reject(intl.get('不能包含 task 命令'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.TextArea
|
||||
rows={4}
|
||||
autoSize={{ minRows: 1, maxRows: 5 }}
|
||||
placeholder={intl.get('请输入运行任务前要执行的命令')}
|
||||
placeholder={intl.get(
|
||||
'请输入运行任务前要执行的命令,不能包含 task 命令',
|
||||
)}
|
||||
/>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
@@ -166,11 +178,23 @@ const CronModal = ({
|
||||
tooltip={intl.get(
|
||||
'运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js',
|
||||
)}
|
||||
rules={[
|
||||
{
|
||||
validator(rule, value) {
|
||||
if (value.includes(' task ') || value.startsWith('task ')) {
|
||||
return Promise.reject(intl.get('不能包含 task 命令'));
|
||||
}
|
||||
return Promise.resolve();
|
||||
},
|
||||
},
|
||||
]}
|
||||
>
|
||||
<Input.TextArea
|
||||
rows={4}
|
||||
autoSize={{ minRows: 1, maxRows: 5 }}
|
||||
placeholder={intl.get('请输入运行任务后要执行的命令')}
|
||||
placeholder={intl.get(
|
||||
'请输入运行任务后要执行的命令,不能包含 task 命令',
|
||||
)}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
@@ -92,7 +92,7 @@ const Dependence = () => {
|
||||
const columns: any = [
|
||||
{
|
||||
title: intl.get('序号'),
|
||||
width: 80,
|
||||
width: 90,
|
||||
render: (text: string, record: any, index: number) => {
|
||||
return <span style={{ cursor: 'text' }}>{index + 1} </span>;
|
||||
},
|
||||
|
||||
@@ -334,7 +334,7 @@ const Setting = () => {
|
||||
dataSource={dataSource}
|
||||
rowKey="id"
|
||||
size="middle"
|
||||
scroll={{ x: 768 }}
|
||||
scroll={{ x: 1000 }}
|
||||
loading={loading}
|
||||
/>
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user