mirror of
https://github.com/whyour/qinglong.git
synced 2026-02-13 06:25:39 +08:00
Add UI support for allow_multiple_instances configuration
- Add allow_multiple_instances field to ICrontab interface - Add instance mode selector in task creation/edit modal - Add translations for instance mode in Chinese and English - Default to single instance mode for backward compatibility Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
e6719a3490
commit
d8483dc696
|
|
@ -533,5 +533,10 @@
|
||||||
"日志名称不能超过100个字符": "Log name cannot exceed 100 characters",
|
"日志名称不能超过100个字符": "Log name cannot exceed 100 characters",
|
||||||
"未启用": "Not enabled",
|
"未启用": "Not enabled",
|
||||||
"默认为 CPU 个数": "Default is the number of CPUs",
|
"默认为 CPU 个数": "Default is the number of CPUs",
|
||||||
"Minimum is 4": "Minimum is 4"
|
"Minimum is 4": "Minimum is 4",
|
||||||
|
"实例模式": "Instance Mode",
|
||||||
|
"单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例": "Single instance mode: automatically stop old task before starting new scheduled task; Multi-instance mode: allow multiple task instances to run simultaneously",
|
||||||
|
"请选择实例模式": "Please select instance mode",
|
||||||
|
"单实例": "Single Instance",
|
||||||
|
"多实例": "Multi-Instance"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -533,5 +533,10 @@
|
||||||
"日志名称不能超过100个字符": "日志名称不能超过100个字符",
|
"日志名称不能超过100个字符": "日志名称不能超过100个字符",
|
||||||
"未启用": "未启用",
|
"未启用": "未启用",
|
||||||
"默认为 CPU 个数": "默认为 CPU 个数",
|
"默认为 CPU 个数": "默认为 CPU 个数",
|
||||||
"最小是 4": "最小是 4"
|
"最小是 4": "最小是 4",
|
||||||
|
"实例模式": "实例模式",
|
||||||
|
"单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例": "单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例",
|
||||||
|
"请选择实例模式": "请选择实例模式",
|
||||||
|
"单实例": "单实例",
|
||||||
|
"多实例": "多实例"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -180,6 +180,18 @@ const CronModal = ({
|
||||||
<Form.Item name="labels" label={intl.get('标签')}>
|
<Form.Item name="labels" label={intl.get('标签')}>
|
||||||
<EditableTagGroup />
|
<EditableTagGroup />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
name="allow_multiple_instances"
|
||||||
|
label={intl.get('实例模式')}
|
||||||
|
tooltip={intl.get(
|
||||||
|
'单实例模式:定时启动新任务前会自动停止旧任务;多实例模式:允许同时运行多个任务实例',
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
<Select placeholder={intl.get('请选择实例模式')}>
|
||||||
|
<Select.Option value={0}>{intl.get('单实例')}</Select.Option>
|
||||||
|
<Select.Option value={1}>{intl.get('多实例')}</Select.Option>
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="log_name"
|
name="log_name"
|
||||||
label={intl.get('日志名称')}
|
label={intl.get('日志名称')}
|
||||||
|
|
@ -194,7 +206,11 @@ const CronModal = ({
|
||||||
if (value.length > 100) {
|
if (value.length > 100) {
|
||||||
return Promise.reject(intl.get('日志名称不能超过100个字符'));
|
return Promise.reject(intl.get('日志名称不能超过100个字符'));
|
||||||
}
|
}
|
||||||
if (!/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?:\/)?(?:[\w.-]+\/)*[\w.-]+\/?$/.test(value)) {
|
if (
|
||||||
|
!/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?:\/)?(?:[\w.-]+\/)*[\w.-]+\/?$/.test(
|
||||||
|
value,
|
||||||
|
)
|
||||||
|
) {
|
||||||
return Promise.reject(
|
return Promise.reject(
|
||||||
intl.get('日志名称只能包含字母、数字、下划线和连字符'),
|
intl.get('日志名称只能包含字母、数字、下划线和连字符'),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export interface ICrontab {
|
||||||
nextRunTime: Date;
|
nextRunTime: Date;
|
||||||
sub_id: number;
|
sub_id: number;
|
||||||
extra_schedules?: Array<{ schedule: string }>;
|
extra_schedules?: Array<{ schedule: string }>;
|
||||||
|
allow_multiple_instances?: 1 | 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum ScheduleType {
|
export enum ScheduleType {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user