@vef-framework-react/cron 2.19.0 → 2.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const e=require("../../components/status/labels.cjs"),t=require("../../components/trigger-editor/helpers.cjs"),n=require("../../components/trigger-editor/index.cjs"),r=require("./model.cjs"),i=require("./helpers.cjs");let a=require("@vef-framework-react/components"),o=require("@emotion/react/jsx-runtime"),s=require("@vef-framework-react/shared");var c=`YYYY-MM-DD HH:mm:ss`,l=s.z.string(`请输入调度名称`).min(1,`请输入调度名称`).max(128,`最多 128 个字符`),u=s.z.string(`请选择任务处理器`).min(1,`请选择任务处理器`),d={fire_now:`错过后立即补跑一次`,skip:`跳过错过的触发`},f={forbid:`上次未结束则跳过`,allow:`允许并行`};function p(){let s=(0,a.useFormContext)(),p=i.useJobNames();return(0,o.jsx)(a.Stack,{gap:`middle`,children:(0,o.jsxs)(a.Grid,{columnGap:`small`,children:[(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`name`,validators:{onBlur:l},children:e=>(0,o.jsx)(e.Input,{required:!0,extra:`唯一标识;编辑时修改即为重命名`,label:`名称`,placeholder:`如 nightly-sync`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`jobName`,validators:{onChange:u},children:e=>(0,o.jsx)(e.Select,{required:!0,showSearch:!0,label:`任务处理器`,loading:p.loading,options:p.options,placeholder:`选择已注册的任务处理器`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.Subscribe,{selector:e=>({startsAt:e.values.startsAt,endsAt:e.values.endsAt}),children:({startsAt:e,endsAt:r})=>(0,o.jsx)(s.AppField,{name:`trigger`,validators:{onChange:({value:e})=>t.isTriggerComplete(e)?void 0:`请完善触发配置`},children:i=>(0,o.jsxs)(a.Labeled,{required:!0,label:`触发规则`,children:[(0,o.jsx)(n.TriggerEditor,{endsAt:r,startsAt:e,value:i.state.value,onChange:i.handleChange}),i.state.meta.isTouched&&!t.isTriggerComplete(i.state.value)?(0,o.jsx)(a.Text,{style:{fontSize:a.globalCssVars.fontSizeSm},type:`danger`,children:`请完善触发配置后再保存`}):null]})})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`startsAt`,children:e=>(0,o.jsx)(e.DatePicker,{showTime:!0,format:c,label:`生效开始`,placeholder:`留空则立即生效`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`endsAt`,children:e=>(0,o.jsx)(e.DatePicker,{showTime:!0,format:c,label:`生效结束`,placeholder:`留空则长期有效`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`misfirePolicy`,children:t=>(0,o.jsx)(t.Select,{extra:d[t.state.value],label:`错过策略`,options:e.MISFIRE_POLICY_OPTIONS})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`concurrencyPolicy`,children:t=>(0,o.jsx)(t.Select,{extra:f[t.state.value],label:`并发策略`,options:e.CONCURRENCY_POLICY_OPTIONS})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(a.Labeled,{hint:`0 表示使用全局默认`,label:`执行超时`,children:(0,o.jsxs)(a.Flex,{gap:`small`,children:[(0,o.jsx)(s.AppField,{name:`timeoutValue`,children:e=>(0,o.jsx)(e.InputNumber,{noWrapper:!0,min:0,style:{flex:1}})}),(0,o.jsx)(s.AppField,{name:`timeoutUnit`,children:e=>(0,o.jsx)(e.Select,{noWrapper:!0,options:r.TIMEOUT_UNIT_OPTIONS,style:{width:100}})})]})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`recover`,children:e=>(0,o.jsx)(e.Bool,{extra:`节点崩溃后重新触发,处理器需保证幂等`,label:`崩溃恢复`,variant:`switch`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.AppField,{name:`paramsText`,validators:{onChange:({value:e})=>r.jsonParamsError(e)},children:e=>(0,o.jsx)(e.CodeEditor,{showLineNumbers:!0,extra:`JSON 对象,留空表示无参数`,height:140,label:`任务参数`,language:`json`,placeholder:`如 { "batchSize": 100 }`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.AppField,{name:`enabled`,children:e=>(0,o.jsx)(e.Bool,{label:`启用`,variant:`switch`})})})]})})}exports.ScheduleForm=p;
1
+ const e=require("../../components/status/labels.cjs"),t=require("../../components/trigger-editor/helpers.cjs"),n=require("../../components/trigger-editor/index.cjs"),r=require("./model.cjs"),i=require("./helpers.cjs");let a=require("@vef-framework-react/components"),o=require("@emotion/react/jsx-runtime"),s=require("@vef-framework-react/shared");var c=`YYYY-MM-DD HH:mm:ss`,l=s.z.string(`请输入调度名称`).min(1,`请输入调度名称`).max(128,`最多 128 个字符`),u=s.z.string(`请选择任务处理器`).min(1,`请选择任务处理器`),d={fire_now:`错过后立即补跑一次`,skip:`跳过错过的触发`},f={forbid:`上次未结束则跳过`,allow:`允许并行`};function p(){let s=(0,a.useFormContext)(),p=i.useJobNames();return(0,o.jsx)(a.Stack,{gap:`middle`,children:(0,o.jsxs)(a.Grid,{columnGap:`small`,children:[(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`name`,validators:{onBlur:l},children:e=>(0,o.jsx)(e.Input,{required:!0,extra:`唯一标识;编辑时修改即为重命名`,label:`名称`,placeholder:`如 nightly-sync`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`jobName`,validators:{onChange:u},children:e=>(0,o.jsx)(e.Select,{required:!0,showSearch:!0,filterOption:a.filterOptionByLabel,label:`任务处理器`,loading:p.loading,options:p.options,placeholder:`选择已注册的任务处理器`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.Subscribe,{selector:e=>({startsAt:e.values.startsAt,endsAt:e.values.endsAt}),children:({startsAt:e,endsAt:r})=>(0,o.jsx)(s.AppField,{name:`trigger`,validators:{onChange:({value:e})=>t.isTriggerComplete(e)?void 0:`请完善触发配置`},children:i=>(0,o.jsxs)(a.Labeled,{required:!0,label:`触发规则`,children:[(0,o.jsx)(n.TriggerEditor,{endsAt:r,startsAt:e,value:i.state.value,onChange:i.handleChange}),i.state.meta.isTouched&&!t.isTriggerComplete(i.state.value)?(0,o.jsx)(a.Text,{style:{fontSize:a.globalCssVars.fontSizeSm},type:`danger`,children:`请完善触发配置后再保存`}):null]})})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`startsAt`,children:e=>(0,o.jsx)(e.DatePicker,{showTime:!0,format:c,label:`生效开始`,placeholder:`留空则立即生效`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`endsAt`,children:e=>(0,o.jsx)(e.DatePicker,{showTime:!0,format:c,label:`生效结束`,placeholder:`留空则长期有效`})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`misfirePolicy`,children:t=>(0,o.jsx)(t.Select,{extra:d[t.state.value],label:`错过策略`,options:e.MISFIRE_POLICY_OPTIONS})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`concurrencyPolicy`,children:t=>(0,o.jsx)(t.Select,{extra:f[t.state.value],label:`并发策略`,options:e.CONCURRENCY_POLICY_OPTIONS})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(a.Labeled,{hint:`0 表示使用全局默认`,label:`执行超时`,children:(0,o.jsxs)(a.Flex,{gap:`small`,children:[(0,o.jsx)(s.AppField,{name:`timeoutValue`,children:e=>(0,o.jsx)(e.InputNumber,{noWrapper:!0,min:0,style:{flex:1}})}),(0,o.jsx)(s.AppField,{name:`timeoutUnit`,children:e=>(0,o.jsx)(e.Select,{noWrapper:!0,options:r.TIMEOUT_UNIT_OPTIONS,style:{width:100}})})]})})}),(0,o.jsx)(a.Grid.Item,{span:12,children:(0,o.jsx)(s.AppField,{name:`recover`,children:e=>(0,o.jsx)(e.Bool,{extra:`节点崩溃后重新触发,处理器需保证幂等`,label:`崩溃恢复`,variant:`switch`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.AppField,{name:`paramsText`,validators:{onChange:({value:e})=>r.jsonParamsError(e)},children:e=>(0,o.jsx)(e.CodeEditor,{showLineNumbers:!0,extra:`JSON 对象,留空表示无参数`,height:140,label:`任务参数`,language:`json`,placeholder:`如 { "batchSize": 100 }`})})}),(0,o.jsx)(a.Grid.Item,{span:24,children:(0,o.jsx)(s.AppField,{name:`enabled`,children:e=>(0,o.jsx)(e.Bool,{label:`启用`,variant:`switch`})})})]})})}exports.ScheduleForm=p;
@@ -1 +1 @@
1
- const e=require("../../components/status/labels.cjs"),t=require("./helpers.cjs");let n=require("@vef-framework-react/components"),r=require("@emotion/react/jsx-runtime");var i=[{label:`启用`,value:`true`},{label:`停用`,value:`false`}];function a(){let{AppField:e}=(0,n.useFormContext)();return(0,r.jsx)(e,{name:`name`,children:e=>(0,r.jsx)(e.Input,{allowClear:!0,noWrapper:!0,placeholder:`名称`,style:{width:160}})})}function o(){let{AppField:a}=(0,n.useFormContext)(),o=t.useJobNames();return(0,r.jsxs)(n.Row,{gutter:[`var(--vef-spacing-md)`,`var(--vef-spacing-md)`],children:[(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`jobName`,children:e=>(0,r.jsx)(e.Select,{allowClear:!0,showSearch:!0,label:`任务处理器`,loading:o.loading,options:o.options,placeholder:`任务处理器`})})}),(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`kind`,children:t=>(0,r.jsx)(t.Select,{allowClear:!0,label:`触发方式`,options:e.TRIGGER_KIND_OPTIONS,placeholder:`触发方式`})})}),(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`isEnabled`,children:e=>(0,r.jsx)(e.Select,{allowClear:!0,label:`状态`,options:i,placeholder:`状态`})})})]})}exports.ScheduleAdvancedSearchFields=o,exports.ScheduleSearchFields=a;
1
+ const e=require("../../components/status/labels.cjs"),t=require("./helpers.cjs");let n=require("@vef-framework-react/components"),r=require("@emotion/react/jsx-runtime");var i=[{label:`启用`,value:`true`},{label:`停用`,value:`false`}];function a(){let{AppField:e}=(0,n.useFormContext)();return(0,r.jsx)(e,{name:`name`,children:e=>(0,r.jsx)(e.Input,{allowClear:!0,noWrapper:!0,placeholder:`名称`,style:{width:160}})})}function o(){let{AppField:a}=(0,n.useFormContext)(),o=t.useJobNames();return(0,r.jsxs)(n.Row,{gutter:[`var(--vef-spacing-md)`,`var(--vef-spacing-md)`],children:[(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`jobName`,children:e=>(0,r.jsx)(e.Select,{allowClear:!0,showSearch:!0,filterOption:n.filterOptionByLabel,label:`任务处理器`,loading:o.loading,options:o.options,placeholder:`任务处理器`})})}),(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`kind`,children:t=>(0,r.jsx)(t.Select,{allowClear:!0,label:`触发方式`,options:e.TRIGGER_KIND_OPTIONS,placeholder:`触发方式`})})}),(0,r.jsx)(n.Col,{lg:8,md:12,xs:24,children:(0,r.jsx)(a,{name:`isEnabled`,children:e=>(0,r.jsx)(e.Select,{allowClear:!0,label:`状态`,options:i,placeholder:`状态`})})})]})}exports.ScheduleAdvancedSearchFields=o,exports.ScheduleSearchFields=a;
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
3
  import { useRunApi as n } from "./run-api.js";
4
4
  import { useScheduleApi as r } from "./schedule-api.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { SYMBOL_PAGINATION as e } from "@vef-framework-react/components";
3
3
  //#region src/api/query.ts
4
4
  var t = "/api";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
3
  import { createApiRequest as n, useApiClient as r } from "@vef-framework-react/core";
4
4
  import { useMemo as i } from "react";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
3
  import { createApiRequest as n, useApiClient as r } from "@vef-framework-react/core";
4
4
  import { useMemo as i } from "react";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  //#region src/components/duration.ts
3
3
  var e = [
4
4
  {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import e from "dayjs";
3
3
  //#region src/components/format.ts
4
4
  function t(t) {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { INTERVAL_UNITS as e, TIMEOUT_UNITS as t, combineDurationMs as n, splitDurationMs as r } from "./duration.js";
3
3
  import { formatDuration as i, formatTimestamp as a } from "./format.js";
4
4
  import { RUN_STATUS_COLORS as o } from "./status/colors.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  //#region src/components/status/colors.ts
3
3
  var e = {
4
4
  running: "processing",
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { RUN_STATUS_COLORS as e } from "./colors.js";
3
3
  import { RUN_STATUS_LABELS as t } from "./labels.js";
4
4
  import { Tag as n } from "@vef-framework-react/components";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { CONCURRENCY_POLICIES as e, MISFIRE_POLICIES as t, RUN_STATUSES as n, TRIGGER_KINDS as r } from "../../types/enums.js";
3
3
  //#region src/components/status/labels.ts
4
4
  var i = {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { INTERVAL_UNITS as e, combineDurationMs as t, splitDurationMs as n } from "../duration.js";
3
3
  //#region src/components/trigger-editor/helpers.ts
4
4
  var r = {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { useScheduleApi as e } from "../../api/schedule-api.js";
3
3
  import { INTERVAL_UNITS as t } from "../duration.js";
4
4
  import { TRIGGER_KIND_OPTIONS as n } from "../status/labels.js";
package/dist/es/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { API_PATH as e, splitQueryParams as t } from "./api/query.js";
3
3
  import { useRunApi as n } from "./api/run-api.js";
4
4
  import { useScheduleApi as r } from "./api/schedule-api.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { RunDetailDrawer as e } from "./run-page/detail.js";
3
3
  import { CronRunPage as t } from "./run-page/index.js";
4
4
  import { SCHEDULE_FORM_DEFAULTS as n, TIMEOUT_UNIT_OPTIONS as r, jsonParamsError as i, parseJsonParams as a, scheduleToFormValues as o, scheduleToParams as s } from "./schedule-page/model.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { formatDuration as e, formatTimestamp as t } from "../../components/format.js";
3
3
  import { RunStatusBadge as n } from "../../components/status/index.js";
4
4
  import { Text as r } from "@vef-framework-react/components";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { useRunApi as e } from "../../api/run-api.js";
3
3
  import { formatDuration as t, formatTimestamp as n } from "../../components/format.js";
4
4
  import { RunStatusBadge as r } from "../../components/status/index.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { useRunApi as e } from "../../api/run-api.js";
3
3
  import { runColumns as t } from "./columns.js";
4
4
  import { RunDetailDrawer as n } from "./detail.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { RUN_STATUS_OPTIONS as e } from "../../components/status/labels.js";
3
3
  import { Col as t, Row as n, useFormContext as r } from "@vef-framework-react/components";
4
4
  import { jsx as i, jsxs as a } from "@emotion/react/jsx-runtime";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { formatTimestamp as e } from "../../components/format.js";
3
3
  import { TRIGGER_KIND_LABELS as t } from "../../components/status/labels.js";
4
4
  import { EnabledTag as n } from "../../components/status/index.js";
@@ -1,33 +1,33 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { CONCURRENCY_POLICY_OPTIONS as e, MISFIRE_POLICY_OPTIONS as t } from "../../components/status/labels.js";
3
3
  import { isTriggerComplete as n } from "../../components/trigger-editor/helpers.js";
4
4
  import { TriggerEditor as r } from "../../components/trigger-editor/index.js";
5
5
  import { TIMEOUT_UNIT_OPTIONS as i, jsonParamsError as a } from "./model.js";
6
6
  import { useJobNames as o } from "./helpers.js";
7
- import { Flex as s, Grid as c, Labeled as l, Stack as u, Text as d, globalCssVars as f, useFormContext as p } from "@vef-framework-react/components";
8
- import { jsx as m, jsxs as h } from "@emotion/react/jsx-runtime";
9
- import { z as g } from "@vef-framework-react/shared";
7
+ import { Flex as s, Grid as c, Labeled as l, Stack as u, Text as d, filterOptionByLabel as f, globalCssVars as p, useFormContext as m } from "@vef-framework-react/components";
8
+ import { jsx as h, jsxs as g } from "@emotion/react/jsx-runtime";
9
+ import { z as _ } from "@vef-framework-react/shared";
10
10
  //#region src/pages/schedule-page/form.tsx
11
- var _ = "YYYY-MM-DD HH:mm:ss", v = g.string("请输入调度名称").min(1, "请输入调度名称").max(128, "最多 128 个字符"), y = g.string("请选择任务处理器").min(1, "请选择任务处理器"), b = {
11
+ var v = "YYYY-MM-DD HH:mm:ss", y = _.string("请输入调度名称").min(1, "请输入调度名称").max(128, "最多 128 个字符"), b = _.string("请选择任务处理器").min(1, "请选择任务处理器"), x = {
12
12
  fire_now: "错过后立即补跑一次",
13
13
  skip: "跳过错过的触发"
14
- }, x = {
14
+ }, S = {
15
15
  forbid: "上次未结束则跳过",
16
16
  allow: "允许并行"
17
17
  };
18
- function S() {
19
- let g = p(), S = o();
20
- return /* @__PURE__ */ m(u, {
18
+ function C() {
19
+ let _ = m(), C = o();
20
+ return /* @__PURE__ */ h(u, {
21
21
  gap: "middle",
22
- children: /* @__PURE__ */ h(c, {
22
+ children: /* @__PURE__ */ g(c, {
23
23
  columnGap: "small",
24
24
  children: [
25
- /* @__PURE__ */ m(c.Item, {
25
+ /* @__PURE__ */ h(c.Item, {
26
26
  span: 12,
27
- children: /* @__PURE__ */ m(g.AppField, {
27
+ children: /* @__PURE__ */ h(_.AppField, {
28
28
  name: "name",
29
- validators: { onBlur: v },
30
- children: (e) => /* @__PURE__ */ m(e.Input, {
29
+ validators: { onBlur: y },
30
+ children: (e) => /* @__PURE__ */ h(e.Input, {
31
31
  required: !0,
32
32
  extra: "唯一标识;编辑时修改即为重命名",
33
33
  label: "名称",
@@ -35,41 +35,42 @@ function S() {
35
35
  })
36
36
  })
37
37
  }),
38
- /* @__PURE__ */ m(c.Item, {
38
+ /* @__PURE__ */ h(c.Item, {
39
39
  span: 12,
40
- children: /* @__PURE__ */ m(g.AppField, {
40
+ children: /* @__PURE__ */ h(_.AppField, {
41
41
  name: "jobName",
42
- validators: { onChange: y },
43
- children: (e) => /* @__PURE__ */ m(e.Select, {
42
+ validators: { onChange: b },
43
+ children: (e) => /* @__PURE__ */ h(e.Select, {
44
44
  required: !0,
45
45
  showSearch: !0,
46
+ filterOption: f,
46
47
  label: "任务处理器",
47
- loading: S.loading,
48
- options: S.options,
48
+ loading: C.loading,
49
+ options: C.options,
49
50
  placeholder: "选择已注册的任务处理器"
50
51
  })
51
52
  })
52
53
  }),
53
- /* @__PURE__ */ m(c.Item, {
54
+ /* @__PURE__ */ h(c.Item, {
54
55
  span: 24,
55
- children: /* @__PURE__ */ m(g.Subscribe, {
56
+ children: /* @__PURE__ */ h(_.Subscribe, {
56
57
  selector: (e) => ({
57
58
  startsAt: e.values.startsAt,
58
59
  endsAt: e.values.endsAt
59
60
  }),
60
- children: ({ startsAt: e, endsAt: t }) => /* @__PURE__ */ m(g.AppField, {
61
+ children: ({ startsAt: e, endsAt: t }) => /* @__PURE__ */ h(_.AppField, {
61
62
  name: "trigger",
62
63
  validators: { onChange: ({ value: e }) => n(e) ? void 0 : "请完善触发配置" },
63
- children: (i) => /* @__PURE__ */ h(l, {
64
+ children: (i) => /* @__PURE__ */ g(l, {
64
65
  required: !0,
65
66
  label: "触发规则",
66
- children: [/* @__PURE__ */ m(r, {
67
+ children: [/* @__PURE__ */ h(r, {
67
68
  endsAt: t,
68
69
  startsAt: e,
69
70
  value: i.state.value,
70
71
  onChange: i.handleChange
71
- }), i.state.meta.isTouched && !n(i.state.value) ? /* @__PURE__ */ m(d, {
72
- style: { fontSize: f.fontSizeSm },
72
+ }), i.state.meta.isTouched && !n(i.state.value) ? /* @__PURE__ */ h(d, {
73
+ style: { fontSize: p.fontSizeSm },
73
74
  type: "danger",
74
75
  children: "请完善触发配置后再保存"
75
76
  }) : null]
@@ -77,69 +78,69 @@ function S() {
77
78
  })
78
79
  })
79
80
  }),
80
- /* @__PURE__ */ m(c.Item, {
81
+ /* @__PURE__ */ h(c.Item, {
81
82
  span: 12,
82
- children: /* @__PURE__ */ m(g.AppField, {
83
+ children: /* @__PURE__ */ h(_.AppField, {
83
84
  name: "startsAt",
84
- children: (e) => /* @__PURE__ */ m(e.DatePicker, {
85
+ children: (e) => /* @__PURE__ */ h(e.DatePicker, {
85
86
  showTime: !0,
86
- format: _,
87
+ format: v,
87
88
  label: "生效开始",
88
89
  placeholder: "留空则立即生效"
89
90
  })
90
91
  })
91
92
  }),
92
- /* @__PURE__ */ m(c.Item, {
93
+ /* @__PURE__ */ h(c.Item, {
93
94
  span: 12,
94
- children: /* @__PURE__ */ m(g.AppField, {
95
+ children: /* @__PURE__ */ h(_.AppField, {
95
96
  name: "endsAt",
96
- children: (e) => /* @__PURE__ */ m(e.DatePicker, {
97
+ children: (e) => /* @__PURE__ */ h(e.DatePicker, {
97
98
  showTime: !0,
98
- format: _,
99
+ format: v,
99
100
  label: "生效结束",
100
101
  placeholder: "留空则长期有效"
101
102
  })
102
103
  })
103
104
  }),
104
- /* @__PURE__ */ m(c.Item, {
105
+ /* @__PURE__ */ h(c.Item, {
105
106
  span: 12,
106
- children: /* @__PURE__ */ m(g.AppField, {
107
+ children: /* @__PURE__ */ h(_.AppField, {
107
108
  name: "misfirePolicy",
108
- children: (e) => /* @__PURE__ */ m(e.Select, {
109
- extra: b[e.state.value],
109
+ children: (e) => /* @__PURE__ */ h(e.Select, {
110
+ extra: x[e.state.value],
110
111
  label: "错过策略",
111
112
  options: t
112
113
  })
113
114
  })
114
115
  }),
115
- /* @__PURE__ */ m(c.Item, {
116
+ /* @__PURE__ */ h(c.Item, {
116
117
  span: 12,
117
- children: /* @__PURE__ */ m(g.AppField, {
118
+ children: /* @__PURE__ */ h(_.AppField, {
118
119
  name: "concurrencyPolicy",
119
- children: (t) => /* @__PURE__ */ m(t.Select, {
120
- extra: x[t.state.value],
120
+ children: (t) => /* @__PURE__ */ h(t.Select, {
121
+ extra: S[t.state.value],
121
122
  label: "并发策略",
122
123
  options: e
123
124
  })
124
125
  })
125
126
  }),
126
- /* @__PURE__ */ m(c.Item, {
127
+ /* @__PURE__ */ h(c.Item, {
127
128
  span: 12,
128
- children: /* @__PURE__ */ m(l, {
129
+ children: /* @__PURE__ */ h(l, {
129
130
  hint: "0 表示使用全局默认",
130
131
  label: "执行超时",
131
- children: /* @__PURE__ */ h(s, {
132
+ children: /* @__PURE__ */ g(s, {
132
133
  gap: "small",
133
- children: [/* @__PURE__ */ m(g.AppField, {
134
+ children: [/* @__PURE__ */ h(_.AppField, {
134
135
  name: "timeoutValue",
135
- children: (e) => /* @__PURE__ */ m(e.InputNumber, {
136
+ children: (e) => /* @__PURE__ */ h(e.InputNumber, {
136
137
  noWrapper: !0,
137
138
  min: 0,
138
139
  style: { flex: 1 }
139
140
  })
140
- }), /* @__PURE__ */ m(g.AppField, {
141
+ }), /* @__PURE__ */ h(_.AppField, {
141
142
  name: "timeoutUnit",
142
- children: (e) => /* @__PURE__ */ m(e.Select, {
143
+ children: (e) => /* @__PURE__ */ h(e.Select, {
143
144
  noWrapper: !0,
144
145
  options: i,
145
146
  style: { width: 100 }
@@ -148,23 +149,23 @@ function S() {
148
149
  })
149
150
  })
150
151
  }),
151
- /* @__PURE__ */ m(c.Item, {
152
+ /* @__PURE__ */ h(c.Item, {
152
153
  span: 12,
153
- children: /* @__PURE__ */ m(g.AppField, {
154
+ children: /* @__PURE__ */ h(_.AppField, {
154
155
  name: "recover",
155
- children: (e) => /* @__PURE__ */ m(e.Bool, {
156
+ children: (e) => /* @__PURE__ */ h(e.Bool, {
156
157
  extra: "节点崩溃后重新触发,处理器需保证幂等",
157
158
  label: "崩溃恢复",
158
159
  variant: "switch"
159
160
  })
160
161
  })
161
162
  }),
162
- /* @__PURE__ */ m(c.Item, {
163
+ /* @__PURE__ */ h(c.Item, {
163
164
  span: 24,
164
- children: /* @__PURE__ */ m(g.AppField, {
165
+ children: /* @__PURE__ */ h(_.AppField, {
165
166
  name: "paramsText",
166
167
  validators: { onChange: ({ value: e }) => a(e) },
167
- children: (e) => /* @__PURE__ */ m(e.CodeEditor, {
168
+ children: (e) => /* @__PURE__ */ h(e.CodeEditor, {
168
169
  showLineNumbers: !0,
169
170
  extra: "JSON 对象,留空表示无参数",
170
171
  height: 140,
@@ -174,11 +175,11 @@ function S() {
174
175
  })
175
176
  })
176
177
  }),
177
- /* @__PURE__ */ m(c.Item, {
178
+ /* @__PURE__ */ h(c.Item, {
178
179
  span: 24,
179
- children: /* @__PURE__ */ m(g.AppField, {
180
+ children: /* @__PURE__ */ h(_.AppField, {
180
181
  name: "enabled",
181
- children: (e) => /* @__PURE__ */ m(e.Bool, {
182
+ children: (e) => /* @__PURE__ */ h(e.Bool, {
182
183
  label: "启用",
183
184
  variant: "switch"
184
185
  })
@@ -189,4 +190,4 @@ function S() {
189
190
  });
190
191
  }
191
192
  //#endregion
192
- export { S as ScheduleForm };
193
+ export { C as ScheduleForm };
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { API_PATH as e } from "../../api/query.js";
3
3
  import { useScheduleApi as t } from "../../api/schedule-api.js";
4
4
  import { scheduleToParams as n } from "./model.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { useScheduleApi as e } from "../../api/schedule-api.js";
3
3
  import { CRON_PERMISSIONS as t } from "../../permissions.js";
4
4
  import { scheduleColumns as n } from "./columns.js";
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { TIMEOUT_UNITS as e, combineDurationMs as t, splitDurationMs as n } from "../../components/duration.js";
3
3
  import { DEFAULT_TRIGGER as r, triggerFormToParams as i, triggerToFormValues as a } from "../../components/trigger-editor/helpers.js";
4
4
  //#region src/pages/schedule-page/model.ts
@@ -1,21 +1,21 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { TRIGGER_KIND_OPTIONS as e } from "../../components/status/labels.js";
3
3
  import { useJobNames as t } from "./helpers.js";
4
- import { Col as n, Row as r, useFormContext as i } from "@vef-framework-react/components";
5
- import { jsx as a, jsxs as o } from "@emotion/react/jsx-runtime";
4
+ import { Col as n, Row as r, filterOptionByLabel as i, useFormContext as a } from "@vef-framework-react/components";
5
+ import { jsx as o, jsxs as s } from "@emotion/react/jsx-runtime";
6
6
  //#region src/pages/schedule-page/search.tsx
7
- var s = [{
7
+ var c = [{
8
8
  label: "启用",
9
9
  value: "true"
10
10
  }, {
11
11
  label: "停用",
12
12
  value: "false"
13
13
  }];
14
- function c() {
15
- let { AppField: e } = i();
16
- return /* @__PURE__ */ a(e, {
14
+ function l() {
15
+ let { AppField: e } = a();
16
+ return /* @__PURE__ */ o(e, {
17
17
  name: "name",
18
- children: (e) => /* @__PURE__ */ a(e.Input, {
18
+ children: (e) => /* @__PURE__ */ o(e.Input, {
19
19
  allowClear: !0,
20
20
  noWrapper: !0,
21
21
  placeholder: "名称",
@@ -23,34 +23,35 @@ function c() {
23
23
  })
24
24
  });
25
25
  }
26
- function l() {
27
- let { AppField: c } = i(), l = t();
28
- return /* @__PURE__ */ o(r, {
26
+ function u() {
27
+ let { AppField: l } = a(), u = t();
28
+ return /* @__PURE__ */ s(r, {
29
29
  gutter: ["var(--vef-spacing-md)", "var(--vef-spacing-md)"],
30
30
  children: [
31
- /* @__PURE__ */ a(n, {
31
+ /* @__PURE__ */ o(n, {
32
32
  lg: 8,
33
33
  md: 12,
34
34
  xs: 24,
35
- children: /* @__PURE__ */ a(c, {
35
+ children: /* @__PURE__ */ o(l, {
36
36
  name: "jobName",
37
- children: (e) => /* @__PURE__ */ a(e.Select, {
37
+ children: (e) => /* @__PURE__ */ o(e.Select, {
38
38
  allowClear: !0,
39
39
  showSearch: !0,
40
+ filterOption: i,
40
41
  label: "任务处理器",
41
- loading: l.loading,
42
- options: l.options,
42
+ loading: u.loading,
43
+ options: u.options,
43
44
  placeholder: "任务处理器"
44
45
  })
45
46
  })
46
47
  }),
47
- /* @__PURE__ */ a(n, {
48
+ /* @__PURE__ */ o(n, {
48
49
  lg: 8,
49
50
  md: 12,
50
51
  xs: 24,
51
- children: /* @__PURE__ */ a(c, {
52
+ children: /* @__PURE__ */ o(l, {
52
53
  name: "kind",
53
- children: (t) => /* @__PURE__ */ a(t.Select, {
54
+ children: (t) => /* @__PURE__ */ o(t.Select, {
54
55
  allowClear: !0,
55
56
  label: "触发方式",
56
57
  options: e,
@@ -58,16 +59,16 @@ function l() {
58
59
  })
59
60
  })
60
61
  }),
61
- /* @__PURE__ */ a(n, {
62
+ /* @__PURE__ */ o(n, {
62
63
  lg: 8,
63
64
  md: 12,
64
65
  xs: 24,
65
- children: /* @__PURE__ */ a(c, {
66
+ children: /* @__PURE__ */ o(l, {
66
67
  name: "isEnabled",
67
- children: (e) => /* @__PURE__ */ a(e.Select, {
68
+ children: (e) => /* @__PURE__ */ o(e.Select, {
68
69
  allowClear: !0,
69
70
  label: "状态",
70
- options: s,
71
+ options: c,
71
72
  placeholder: "状态"
72
73
  })
73
74
  })
@@ -76,4 +77,4 @@ function l() {
76
77
  });
77
78
  }
78
79
  //#endregion
79
- export { l as ScheduleAdvancedSearchFields, c as ScheduleSearchFields };
80
+ export { u as ScheduleAdvancedSearchFields, l as ScheduleSearchFields };
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  //#region src/permissions.ts
3
3
  var e = {
4
4
  schedule: {
@@ -1,4 +1,4 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  //#region src/types/enums.ts
3
3
  var e = [
4
4
  "cron",
@@ -1,3 +1,3 @@
1
- /*! @vef-framework-react/cron v2.19.0 made by Venus | 2026-09-01T08:49:01.346Z */
1
+ /*! @vef-framework-react/cron v2.20.0 made by Venus | 2026-09-07T11:07:17.033Z */
2
2
  import { CONCURRENCY_POLICIES as e, MISFIRE_POLICIES as t, RUN_STATUSES as n, TRIGGER_KINDS as r } from "./enums.js";
3
3
  export { e as CONCURRENCY_POLICIES, t as MISFIRE_POLICIES, n as RUN_STATUSES, r as TRIGGER_KINDS };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vef-framework-react/cron",
3
- "version": "2.19.0",
3
+ "version": "2.20.0",
4
4
  "private": false,
5
5
  "description": "Durable cron schedule management pages for VEF framework",
6
6
  "keywords": [
@@ -42,9 +42,9 @@
42
42
  "@emotion/react": "^11.14.0",
43
43
  "dayjs": "^1.11.0",
44
44
  "lucide-react": "^1.23.0",
45
- "@vef-framework-react/components": "2.19.0",
46
- "@vef-framework-react/core": "2.19.0",
47
- "@vef-framework-react/shared": "2.19.0"
45
+ "@vef-framework-react/components": "2.20.0",
46
+ "@vef-framework-react/shared": "2.20.0",
47
+ "@vef-framework-react/core": "2.20.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "react": "^19.2.7"