From 99f6073c8effa2dc0136792f83a8279e7c45254a Mon Sep 17 00:00:00 2001 From: whyour Date: Tue, 10 Oct 2023 23:06:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=89=8D=E5=90=8E=E8=A7=84=E5=88=99=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E8=83=BD=E5=8C=85=E5=90=AB=20task=20?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/en-US.json | 5 +++-- src/locales/zh-CN.json | 5 +++-- src/pages/crontab/modal.tsx | 28 ++++++++++++++++++++++++++-- src/pages/dependence/index.tsx | 2 +- src/pages/setting/index.tsx | 2 +- 5 files changed, 34 insertions(+), 8 deletions(-) diff --git a/src/locales/en-US.json b/src/locales/en-US.json index 3fc2f8c6..6d0c8f44 100644 --- a/src/locales/en-US.json +++ b/src/locales/en-US.json @@ -459,6 +459,7 @@ "新增定时规则": "Add Timing Rules", "运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "Run commands before executing the task, e.g., cp/mv/python3 xxx.py/node xxx.js", "运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "Run commands after executing the task, e.g., cp/mv/python3 xxx.py/node xxx.js", - "请输入运行任务前要执行的命令": "Please enter the command to run before executing the task", - "请输入运行任务后要执行的命令": "Please enter the command to run after executing the task" + "请输入运行任务前要执行的命令,不能包含 task 命令": "Please enter the command to run before executing the task, cannot contain task commands", + "请输入运行任务后要执行的命令,不能包含 task 命令": "Please enter the command to run after executing the task, cannot contain task commands", + "不能包含 task 命令": "Cannot contain task commands" } diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json index 65d85d14..541f23db 100644 --- a/src/locales/zh-CN.json +++ b/src/locales/zh-CN.json @@ -459,6 +459,7 @@ "新增定时规则": "新增定时规则", "运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js", "运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js", - "请输入运行任务前要执行的命令": "请输入运行任务前要执行的命令", - "请输入运行任务后要执行的命令": "请输入运行任务后要执行的命令" + "请输入运行任务前要执行的命令,不能包含 task 命令": "请输入运行任务前要执行的命令,不能包含 task 命令", + "请输入运行任务后要执行的命令,不能包含 task 命令": "请输入运行任务后要执行的命令,不能包含 task 命令", + "不能包含 task 命令": "不能包含 task 命令" } diff --git a/src/pages/crontab/modal.tsx b/src/pages/crontab/modal.tsx index 7f5924a9..a950dc43 100644 --- a/src/pages/crontab/modal.tsx +++ b/src/pages/crontab/modal.tsx @@ -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(); + }, + }, + ]} > diff --git a/src/pages/dependence/index.tsx b/src/pages/dependence/index.tsx index 3c3a2fd6..131a189d 100644 --- a/src/pages/dependence/index.tsx +++ b/src/pages/dependence/index.tsx @@ -92,7 +92,7 @@ const Dependence = () => { const columns: any = [ { title: intl.get('序号'), - width: 80, + width: 90, render: (text: string, record: any, index: number) => { return {index + 1} ; }, diff --git a/src/pages/setting/index.tsx b/src/pages/setting/index.tsx index a037dcdf..03a8e035 100644 --- a/src/pages/setting/index.tsx +++ b/src/pages/setting/index.tsx @@ -334,7 +334,7 @@ const Setting = () => { dataSource={dataSource} rowKey="id" size="middle" - scroll={{ x: 768 }} + scroll={{ x: 1000 }} loading={loading} /> ),