mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-15 06:17:28 +08:00
cron defaults: use cron expression by default in backend and webui
This commit is contained in:
@@ -239,7 +239,7 @@ func gatewayCmd() {
|
||||
}
|
||||
kind := getStr("kind")
|
||||
if kind == "" {
|
||||
kind = "every"
|
||||
kind = "cron"
|
||||
}
|
||||
if kind == "once" {
|
||||
kind = "at"
|
||||
@@ -270,7 +270,7 @@ func gatewayCmd() {
|
||||
if kind == "cron" {
|
||||
expr := getStr("expr")
|
||||
if expr == "" {
|
||||
return nil, fmt.Errorf("expr required for kind=cron")
|
||||
expr = "*/10 * * * *"
|
||||
}
|
||||
schedule.Expr = expr
|
||||
}
|
||||
|
||||
@@ -7,9 +7,9 @@ import { CronJob } from '../types';
|
||||
|
||||
const initialCronForm = {
|
||||
name: '',
|
||||
kind: 'every',
|
||||
kind: 'cron',
|
||||
everyMs: 600000,
|
||||
expr: '',
|
||||
expr: '*/10 * * * *',
|
||||
message: '',
|
||||
deliver: false,
|
||||
channel: 'telegram',
|
||||
@@ -44,7 +44,7 @@ const Cron: React.FC = () => {
|
||||
setEditingCron(details.job);
|
||||
setCronForm({
|
||||
name: details.job.name || '',
|
||||
kind: details.job.kind || 'every',
|
||||
kind: details.job.kind || 'cron',
|
||||
everyMs: details.job.everyMs || 600000,
|
||||
expr: details.job.expr || '',
|
||||
message: details.job.message || '',
|
||||
@@ -215,8 +215,8 @@ const Cron: React.FC = () => {
|
||||
onChange={(e) => setCronForm({...cronForm, kind: e.target.value})}
|
||||
className="w-full bg-zinc-950 border border-zinc-800 rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition-colors"
|
||||
>
|
||||
<option value="every">Every</option>
|
||||
<option value="cron">Cron</option>
|
||||
<option value="every">Every</option>
|
||||
<option value="once">Once</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
Reference in New Issue
Block a user