@vef-framework-react/cron 2.13.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.
Files changed (90) hide show
  1. package/LICENSE +201 -0
  2. package/dist/cjs/_internal/_rolldown/runtime.cjs +1 -0
  3. package/dist/cjs/api/index.cjs +1 -0
  4. package/dist/cjs/api/query.cjs +1 -0
  5. package/dist/cjs/api/run-api.cjs +1 -0
  6. package/dist/cjs/api/schedule-api.cjs +1 -0
  7. package/dist/cjs/components/duration.cjs +1 -0
  8. package/dist/cjs/components/format.cjs +1 -0
  9. package/dist/cjs/components/index.cjs +1 -0
  10. package/dist/cjs/components/status/colors.cjs +1 -0
  11. package/dist/cjs/components/status/index.cjs +1 -0
  12. package/dist/cjs/components/status/labels.cjs +1 -0
  13. package/dist/cjs/components/trigger-editor/helpers.cjs +1 -0
  14. package/dist/cjs/components/trigger-editor/index.cjs +1 -0
  15. package/dist/cjs/index.cjs +1 -0
  16. package/dist/cjs/pages/index.cjs +1 -0
  17. package/dist/cjs/pages/run-page/columns.cjs +1 -0
  18. package/dist/cjs/pages/run-page/detail.cjs +1 -0
  19. package/dist/cjs/pages/run-page/index.cjs +1 -0
  20. package/dist/cjs/pages/run-page/search.cjs +1 -0
  21. package/dist/cjs/pages/schedule-page/columns.cjs +1 -0
  22. package/dist/cjs/pages/schedule-page/form.cjs +1 -0
  23. package/dist/cjs/pages/schedule-page/helpers.cjs +1 -0
  24. package/dist/cjs/pages/schedule-page/index.cjs +1 -0
  25. package/dist/cjs/pages/schedule-page/model.cjs +1 -0
  26. package/dist/cjs/pages/schedule-page/search.cjs +1 -0
  27. package/dist/cjs/permissions.cjs +1 -0
  28. package/dist/cjs/types/enums.cjs +1 -0
  29. package/dist/cjs/types/index.cjs +1 -0
  30. package/dist/es/api/index.js +5 -0
  31. package/dist/es/api/query.js +13 -0
  32. package/dist/es/api/run-api.js +18 -0
  33. package/dist/es/api/schedule-api.js +32 -0
  34. package/dist/es/components/duration.js +68 -0
  35. package/dist/es/components/format.js +11 -0
  36. package/dist/es/components/index.js +9 -0
  37. package/dist/es/components/status/colors.js +13 -0
  38. package/dist/es/components/status/index.js +20 -0
  39. package/dist/es/components/status/labels.js +36 -0
  40. package/dist/es/components/trigger-editor/helpers.js +64 -0
  41. package/dist/es/components/trigger-editor/index.js +150 -0
  42. package/dist/es/index.js +19 -0
  43. package/dist/es/pages/index.js +7 -0
  44. package/dist/es/pages/run-page/columns.js +68 -0
  45. package/dist/es/pages/run-page/detail.js +117 -0
  46. package/dist/es/pages/run-page/index.js +36 -0
  47. package/dist/es/pages/run-page/search.js +96 -0
  48. package/dist/es/pages/schedule-page/columns.js +65 -0
  49. package/dist/es/pages/schedule-page/form.js +192 -0
  50. package/dist/es/pages/schedule-page/helpers.js +31 -0
  51. package/dist/es/pages/schedule-page/index.js +136 -0
  52. package/dist/es/pages/schedule-page/model.js +89 -0
  53. package/dist/es/pages/schedule-page/search.js +79 -0
  54. package/dist/es/permissions.js +11 -0
  55. package/dist/es/types/enums.js +17 -0
  56. package/dist/es/types/index.js +3 -0
  57. package/dist/types/api/index.d.ts +3 -0
  58. package/dist/types/api/query.d.ts +16 -0
  59. package/dist/types/api/run-api.d.ts +15 -0
  60. package/dist/types/api/schedule-api.d.ts +24 -0
  61. package/dist/types/components/duration.d.ts +33 -0
  62. package/dist/types/components/format.d.ts +10 -0
  63. package/dist/types/components/index.d.ts +7 -0
  64. package/dist/types/components/status/colors.d.ts +6 -0
  65. package/dist/types/components/status/index.d.ts +13 -0
  66. package/dist/types/components/status/labels.d.ts +24 -0
  67. package/dist/types/components/trigger-editor/helpers.d.ts +41 -0
  68. package/dist/types/components/trigger-editor/index.d.ts +18 -0
  69. package/dist/types/index.d.ts +6 -0
  70. package/dist/types/pages/index.d.ts +7 -0
  71. package/dist/types/pages/run-page/columns.d.ts +3 -0
  72. package/dist/types/pages/run-page/detail.d.ts +9 -0
  73. package/dist/types/pages/run-page/index.d.ts +6 -0
  74. package/dist/types/pages/run-page/props.d.ts +11 -0
  75. package/dist/types/pages/run-page/search.d.ts +9 -0
  76. package/dist/types/pages/schedule-page/columns.d.ts +3 -0
  77. package/dist/types/pages/schedule-page/form.d.ts +4 -0
  78. package/dist/types/pages/schedule-page/helpers.d.ts +29 -0
  79. package/dist/types/pages/schedule-page/index.d.ts +7 -0
  80. package/dist/types/pages/schedule-page/model.d.ts +62 -0
  81. package/dist/types/pages/schedule-page/props.d.ts +16 -0
  82. package/dist/types/pages/schedule-page/search.d.ts +8 -0
  83. package/dist/types/permissions.d.ts +22 -0
  84. package/dist/types/types/base.d.ts +14 -0
  85. package/dist/types/types/enums.d.ts +29 -0
  86. package/dist/types/types/index.d.ts +5 -0
  87. package/dist/types/types/json.d.ts +8 -0
  88. package/dist/types/types/run.d.ts +38 -0
  89. package/dist/types/types/schedule.d.ts +98 -0
  90. package/package.json +66 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__toESM=s;
@@ -0,0 +1 @@
1
+ const e=require("./query.cjs"),t=require("./run-api.cjs"),n=require("./schedule-api.cjs");exports.API_PATH=e.API_PATH,exports.splitQueryParams=e.splitQueryParams,exports.useRunApi=t.useRunApi,exports.useScheduleApi=n.useScheduleApi;
@@ -0,0 +1 @@
1
+ let e=require("@vef-framework-react/components");var t=`/api`;function n(t){let{[e.SYMBOL_PAGINATION]:n,...r}=t;return{params:r,pagination:n}}exports.API_PATH=t,exports.splitQueryParams=n;
@@ -0,0 +1 @@
1
+ const e=require("./query.cjs");let t=require("@vef-framework-react/core"),n=require("react");var r=`sys/cron/run`;function i(){let i=(0,t.useApiClient)();return(0,n.useMemo)(()=>({findPage:i.createQueryFn(`cron_run_find_page`,({post:n})=>async i=>{let{params:a,pagination:o}=e.splitQueryParams(i);return(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`find_page`,a,o)})).data}),findOne:i.createQueryFn(`cron_run_find_one`,({post:n})=>async i=>(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`find_one`,i)})).data)}),[i])}exports.useRunApi=i;
@@ -0,0 +1 @@
1
+ const e=require("./query.cjs");let t=require("@vef-framework-react/core"),n=require("react");var r=`sys/cron/schedule`;function i(){let i=(0,t.useApiClient)();return(0,n.useMemo)(()=>({findPage:i.createQueryFn(`cron_schedule_find_page`,({post:n})=>async i=>{let{params:a,pagination:o}=e.splitQueryParams(i),{isEnabled:s,...c}=a,l=s===`true`?{...c,isEnabled:!0}:s===`false`?{...c,isEnabled:!1}:c;return(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`find_page`,l,o)})).data}),get:i.createQueryFn(`cron_schedule_get`,({post:n})=>async i=>(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`get`,i)})).data),listJobs:i.createQueryFn(`cron_schedule_list_jobs`,({post:n})=>async()=>(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`list_jobs`)})).data),previewFires:i.createQueryFn(`cron_schedule_preview_fires`,({post:n})=>async i=>(await n(e.API_PATH,{data:(0,t.createApiRequest)(r,`preview_fires`,i)})).data),create:i.createMutationFn(`cron_schedule_create`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`create`,i)})),update:i.createMutationFn(`cron_schedule_update`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`update`,i)})),remove:i.createMutationFn(`cron_schedule_delete`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`delete`,{name:i.name})})),pause:i.createMutationFn(`cron_schedule_pause`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`pause`,{name:i.name})})),resume:i.createMutationFn(`cron_schedule_resume`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`resume`,{name:i.name})})),triggerNow:i.createMutationFn(`cron_schedule_trigger_now`,({post:n})=>i=>n(e.API_PATH,{data:(0,t.createApiRequest)(r,`trigger_now`,{name:i.name})}))}),[i])}exports.useScheduleApi=i;
@@ -0,0 +1 @@
1
+ var e=[{label:`秒`,value:`second`,ms:1e3},{label:`分钟`,value:`minute`,ms:6e4},{label:`小时`,value:`hour`,ms:36e5},{label:`天`,value:`day`,ms:864e5}],t=[{label:`毫秒`,value:`ms`,ms:1},{label:`秒`,value:`second`,ms:1e3},{label:`分钟`,value:`minute`,ms:6e4}];function n(e,t,n){let r=(n.find(e=>e.value===t)??n[0])?.ms??1;return Math.max(0,Math.round(e))*r}function r(e,t){let n=Math.max(0,Math.round(e)),r=t[0]??{label:``,value:``,ms:1};if(n===0)return{value:0,unit:r.value};for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.ms<=n&&n%r.ms===0)return{value:n/r.ms,unit:r.value}}return{value:n/r.ms,unit:r.value}}exports.INTERVAL_UNITS=e,exports.TIMEOUT_UNITS=t,exports.combineDurationMs=n,exports.splitDurationMs=r;
@@ -0,0 +1 @@
1
+ const e=require("../_internal/_rolldown/runtime.cjs");let t=require("dayjs");t=e.__toESM(t,1);function n(e){return e?(0,t.default)(e).format(`YYYY-MM-DD HH:mm:ss`):`-`}function r(e){return e==null||e<=0?`-`:e<1e3?`${e} ms`:e<6e4?`${(e/1e3).toFixed(1)} s`:`${(e/6e4).toFixed(1)} min`}exports.formatDuration=r,exports.formatTimestamp=n;
@@ -0,0 +1 @@
1
+ const e=require("./duration.cjs"),t=require("./format.cjs"),n=require("./status/colors.cjs"),r=require("./status/labels.cjs"),i=require("./status/index.cjs"),a=require("./trigger-editor/helpers.cjs"),o=require("./trigger-editor/index.cjs");exports.CONCURRENCY_POLICY_LABELS=r.CONCURRENCY_POLICY_LABELS,exports.CONCURRENCY_POLICY_OPTIONS=r.CONCURRENCY_POLICY_OPTIONS,exports.DEFAULT_TRIGGER=a.DEFAULT_TRIGGER,exports.EnabledTag=i.EnabledTag,exports.INTERVAL_UNITS=e.INTERVAL_UNITS,exports.MISFIRE_POLICY_LABELS=r.MISFIRE_POLICY_LABELS,exports.MISFIRE_POLICY_OPTIONS=r.MISFIRE_POLICY_OPTIONS,exports.RUN_STATUS_COLORS=n.RUN_STATUS_COLORS,exports.RUN_STATUS_LABELS=r.RUN_STATUS_LABELS,exports.RUN_STATUS_OPTIONS=r.RUN_STATUS_OPTIONS,exports.RunStatusBadge=i.RunStatusBadge,exports.TIMEOUT_UNITS=e.TIMEOUT_UNITS,exports.TRIGGER_KIND_LABELS=r.TRIGGER_KIND_LABELS,exports.TRIGGER_KIND_OPTIONS=r.TRIGGER_KIND_OPTIONS,exports.TriggerEditor=o.TriggerEditor,exports.combineDurationMs=e.combineDurationMs,exports.formatDuration=t.formatDuration,exports.formatTimestamp=t.formatTimestamp,exports.formatTriggerSummary=a.formatTriggerSummary,exports.isTriggerComplete=a.isTriggerComplete,exports.splitDurationMs=e.splitDurationMs,exports.triggerFormToParams=a.triggerFormToParams,exports.triggerToFormValues=a.triggerToFormValues;
@@ -0,0 +1 @@
1
+ var e={running:`processing`,succeeded:`success`,failed:`error`,missed:`orange`,skipped:`default`,abandoned:`volcano`,canceled:`default`};exports.RUN_STATUS_COLORS=e;
@@ -0,0 +1 @@
1
+ const e=require("./colors.cjs"),t=require("./labels.cjs");let n=require("@vef-framework-react/components"),r=require("@emotion/react/jsx-runtime");function i({status:i}){return(0,r.jsx)(n.Tag,{color:e.RUN_STATUS_COLORS[i],children:t.RUN_STATUS_LABELS[i]})}function a({enabled:e}){return(0,r.jsx)(n.Tag,{color:e?`success`:`default`,children:e?`启用`:`停用`})}exports.EnabledTag=a,exports.RunStatusBadge=i;
@@ -0,0 +1 @@
1
+ const e=require("../../types/enums.cjs");var t={running:`运行中`,succeeded:`成功`,failed:`失败`,missed:`错过`,skipped:`跳过`,abandoned:`已放弃`,canceled:`已取消`},n=e.RUN_STATUSES.map(e=>({label:t[e],value:e})),r={cron:`Cron 表达式`,interval:`固定间隔`,once:`单次`},i=e.TRIGGER_KINDS.map(e=>({label:r[e],value:e})),a={fire_now:`立即补跑`,skip:`跳过错过`},o=e.MISFIRE_POLICIES.map(e=>({label:a[e],value:e})),s={forbid:`禁止并发`,allow:`允许并发`},c=e.CONCURRENCY_POLICIES.map(e=>({label:s[e],value:e}));exports.CONCURRENCY_POLICY_LABELS=s,exports.CONCURRENCY_POLICY_OPTIONS=c,exports.MISFIRE_POLICY_LABELS=a,exports.MISFIRE_POLICY_OPTIONS=o,exports.RUN_STATUS_LABELS=t,exports.RUN_STATUS_OPTIONS=n,exports.TRIGGER_KIND_LABELS=r,exports.TRIGGER_KIND_OPTIONS=i;
@@ -0,0 +1 @@
1
+ const e=require("../duration.cjs");var t={kind:`cron`,expr:``,timezone:``,intervalValue:1,intervalUnit:`minute`,at:``};function n(n){let r=n.everyMs>0?e.splitDurationMs(n.everyMs,e.INTERVAL_UNITS):{value:t.intervalValue,unit:t.intervalUnit};return{kind:n.kind,expr:n.expr??``,timezone:n.timezone??``,intervalValue:r.value,intervalUnit:r.unit,at:n.fireAt??``}}function r(t){switch(t.kind){case`cron`:return{kind:`cron`,expr:t.expr.trim(),timezone:t.timezone.trim()||void 0};case`interval`:return{kind:`interval`,everyMs:e.combineDurationMs(t.intervalValue,t.intervalUnit,e.INTERVAL_UNITS)};case`once`:return{kind:`once`,at:t.at}}}function i(t){switch(t.kind){case`cron`:return t.expr.trim().length>0;case`interval`:return e.combineDurationMs(t.intervalValue,t.intervalUnit,e.INTERVAL_UNITS)>=1e3;case`once`:return t.at.trim().length>0}}function a(t){switch(t.kind){case`cron`:{let e=t.expr?.trim()||`-`;return t.timezone?`${e}(${t.timezone})`:e}case`interval`:{let{value:n,unit:r}=e.splitDurationMs(t.everyMs,e.INTERVAL_UNITS);return`每 ${n} ${e.INTERVAL_UNITS.find(e=>e.value===r)?.label??``}`}case`once`:return t.fireAt?`单次 · ${t.fireAt}`:`单次`}}exports.DEFAULT_TRIGGER=t,exports.formatTriggerSummary=a,exports.isTriggerComplete=i,exports.triggerFormToParams=r,exports.triggerToFormValues=n;
@@ -0,0 +1 @@
1
+ const e=require("../../_internal/_rolldown/runtime.cjs"),t=require("../../api/schedule-api.cjs"),n=require("../duration.cjs"),r=require("../status/labels.cjs"),i=require("./helpers.cjs");let a=require("@vef-framework-react/components"),o=require("@vef-framework-react/core"),s=require("react"),c=require("dayjs");c=e.__toESM(c,1);let l=require("@emotion/react/jsx-runtime"),u=require("@emotion/react");var d=`YYYY-MM-DD HH:mm:ss`,f=400,p=n.INTERVAL_UNITS.map(e=>({label:e.label,value:e.value})),m=(0,u.css)({minHeight:96,padding:a.globalCssVars.spacingSm,border:`1px solid ${a.globalCssVars.colorBorderSecondary}`,borderRadius:a.globalCssVars.borderRadius,background:a.globalCssVars.colorFillQuaternary},process.env.NODE_ENV===`production`?``:`/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFvQ3NCIiwiZmlsZSI6ImluZGV4LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgUHJldmlld0ZpcmVzUGFyYW1zLCBUcmlnZ2VyS2luZCB9IGZyb20gXCIuLi8uLi90eXBlc1wiO1xuaW1wb3J0IHR5cGUgeyBUcmlnZ2VyRm9ybVZhbHVlcyB9IGZyb20gXCIuL2hlbHBlcnNcIjtcblxuaW1wb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Xt2YWx1ZS5raW5kfVxuICAgICAgICBvbkNoYW5nZT17a2luZCA9PiBwYXRjaCh7IGtpbmQgfSl9XG4gICAgICAvPlxuXG4gICAgICB7dmFsdWUua2luZCA9PT0gXCJjcm9uXCIgJiYgKFxuICAgICAgICA8RmxleCBnYXA9XCJzbWFsbFwiIHdyYXA9XCJ3cmFwXCI+XG4gICAgICAgICAgPGRpdiBzdHlsZT17eyBmbGV4OiAxLCBtaW5XaWR0aDogMjIwIH19PlxuICAgICAgICAgICAgPExhYmVsZWQgbGFiZWw9XCJDcm9uIOihqOi+vuW8j1wiPlxuICAgICAgICAgICAgICA8SW5wdXRcbiAgICAgICAgICAgICAgICBwbGFjZWhvbGRlcj1cIuWmgiAwIDkgKiAqICog5oiWIEBkYWlseVwiXG4gICAgICAgICAgICAgICAgdmFsdWU9e3ZhbHVlLmV4cHJ9XG4gICAgICAgICAgICAgICAgb25DaGFuZ2U9e2V2ZW50ID0+IHBhdGNoKHsgZXhwcjogZXZlbnQudGFyZ2V0LnZhbHVlIH0pfVxuICAgICAgICAgICAgICAvPlxuICAgICAgICAgICAgPC9MYWJlbGVkPlxuICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgPGRpdiBzdHlsZT17eyBmbGV4OiAxLCBtaW5XaWR0aDogMjIwIH19PlxuICAgICAgICAgICAgPExhYmVsZWQgbGFiZWw9XCLml7bljLpcIj5cbiAgICAgICAgICAgICAgPElucHV0XG4gICAgICAgICAgICAgICAgcGxhY2Vob2xkZXI9XCLlpoIgQXNpYS9TaGFuZ2hhae+8jOeVmeepuuS4uuacjeWKoeWZqOaXtuWMulwiXG4gICAgICAgICAgICAgICAgdmFsdWU9e3ZhbHVlLnRpbWV6b25lfVxuICAgICAgICAgICAgICAgIG9uQ2hhbmdlPXtldmVudCA9PiBwYXRjaCh7IHRpbWV6b25lOiBldmVudC50YXJnZXQudmFsdWUgfSl9XG4gICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICA8L0xhYmVsZWQ+XG4gICAgICAgICAgPC9kaXY+XG4gICAgICAgIDwvRmxleD5cbiAgICAgICl9XG5cbiAgICAgIHt2YWx1ZS5raW5kID09PSBcImludGVydmFsXCIgJiYgKFxuICAgICAgICA8TGFiZWxlZCBsYWJlbD1cIumXtOmalFwiPlxuICAgICAgICAgIDxGbGV4IGdhcD1cInNtYWxsXCI+XG4gICAgICAgICAgICA8SW5wdXROdW1iZXJcbiAgICAgICAgICAgICAgbWluPXsxfVxuICAgICAgICAgICAgICBzdHlsZT17eyBmbGV4OiAxIH19XG4gICAgICAgICAgICAgIHZhbHVlPXt2YWx1ZS5pbnRlcnZhbFZhbHVlfVxuICAgICAgICAgICAgICBvbkNoYW5nZT17bmV4dCA9PiBwYXRjaCh7IGludGVydmFsVmFsdWU6IHR5cGVvZiBuZXh0ID09PSBcIm51bWJlclwiID8gbmV4dCA6IDAgfSl9XG4gICAgICAgICAgICAvPlxuXG4gICAgICAgICAgICA8U2VsZWN0XG4gICAgICAgICAgICAgIG9wdGlvbnM9e0lOVEVSVkFMX1VOSVRfT1BUSU9OU31cbiAgICAgICAgICAgICAgc3R5bGU9e3sgd2lkdGg6IDEyMCB9fVxuICAgICAgICAgICAgICB2YWx1ZT17dmFsdWUuaW50ZXJ2YWxVbml0fVxuICAgICAgICAgICAgICBvbkNoYW5nZT17aW50ZXJ2YWxVbml0ID0+IHBhdGNoKHsgaW50ZXJ2YWxVbml0IH0pfVxuICAgICAgICAgICAgLz5cbiAgICAgICAgICA8L0ZsZXg+XG4gICAgICAgIDwvTGFiZWxlZD5cbiAgICAgICl9XG5cbiAgICAgIHt2YWx1ZS5raW5kID09PSBcIm9uY2VcIiAmJiAoXG4gICAgICAgIDxMYWJlbGVkIGxhYmVsPVwi6Kem5Y+R5pe26Ze0XCI+XG4gICAgICAgICAgPERhdGVQaWNrZXJcbiAgICAgICAgICAgIHNob3dUaW1lXG4gICAgICAgICAgICBmb3JtYXQ9e0RBVEVfVElNRV9GT1JNQVR9XG4gICAgICAgICAgICBzdHlsZT17eyB3aWR0aDogXCIxMDAlXCIgfX1cbiAgICAgICAgICAgIHZhbHVlPXt2YWx1ZS5hdCA/IGRheWpzKHZhbHVlLmF0KSA6IHVuZGVmaW5lZH1cbiAgICAgICAgICAgIG9uQ2hhbmdlPXsoXywgZGF0ZVN0cmluZykgPT4gcGF0Y2goeyBhdDogdHlwZW9mIGRhdGVTdHJpbmcgPT09IFwic3RyaW5nXCIgPyBkYXRlU3RyaW5nIDogXCJcIiB9KX1cbiAgICAgICAgICAvPlxuICAgICAgICA8L0xhYmVsZWQ+XG4gICAgICApfVxuXG4gICAgICA8RmlyZXNQcmV2aWV3IGVuZHNBdD17ZW5kc0F0fSBzdGFydHNBdD17c3RhcnRzQXR9IHRyaWdnZXI9e3ZhbHVlfSAvPlxuICAgIDwvU3RhY2s+XG4gICk7XG59XG4iXX0= */`);function h(e,t){let[n,r]=(0,s.useState)(e);return(0,s.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function g({startsAt:e,endsAt:n,trigger:r}){let c=t.useScheduleApi(),u=i.isTriggerComplete(r),d=(0,s.useMemo)(()=>({trigger:i.triggerFormToParams(r),startsAt:e||void 0,endsAt:n||void 0}),[r,e,n]),p=h(JSON.stringify(d),f),g=(0,s.useMemo)(()=>JSON.parse(p),[p]),{data:_,error:v,isFetching:y}=(0,o.useQuery)({enabled:u,queryFn:c.previewFires,queryKey:[c.previewFires.key,g],retry:!1});return(0,l.jsx)(a.Labeled,{label:`下次触发时间`,children:(0,l.jsx)(`div`,{css:m,children:(()=>{if(!u)return(0,l.jsx)(a.Text,{type:`secondary`,children:`完善触发配置后显示下次触发时间`});if(y)return(0,l.jsx)(a.Spin,{size:`small`});if(v)return(0,l.jsx)(a.Alert,{showIcon:!0,title:v.message,type:`error`});let e=_?.nextFires??[];return e.length===0?(0,l.jsx)(a.Empty,{description:`在生效窗口内没有触发时间`}):(0,l.jsx)(a.Flex,{gap:`small`,wrap:`wrap`,children:e.map(e=>(0,l.jsx)(a.Tag,{children:e},e))})})()})})}function _({value:e,onChange:t,startsAt:n,endsAt:i}){let o=n=>t({...e,...n});return(0,l.jsxs)(a.Stack,{gap:`middle`,children:[(0,l.jsx)(a.Segmented,{options:r.TRIGGER_KIND_OPTIONS,value:e.kind,onChange:e=>o({kind:e})}),e.kind===`cron`&&(0,l.jsxs)(a.Flex,{gap:`small`,wrap:`wrap`,children:[(0,l.jsx)(`div`,{style:{flex:1,minWidth:220},children:(0,l.jsx)(a.Labeled,{label:`Cron 表达式`,children:(0,l.jsx)(a.Input,{placeholder:`如 0 9 * * * 或 @daily`,value:e.expr,onChange:e=>o({expr:e.target.value})})})}),(0,l.jsx)(`div`,{style:{flex:1,minWidth:220},children:(0,l.jsx)(a.Labeled,{label:`时区`,children:(0,l.jsx)(a.Input,{placeholder:`如 Asia/Shanghai,留空为服务器时区`,value:e.timezone,onChange:e=>o({timezone:e.target.value})})})})]}),e.kind===`interval`&&(0,l.jsx)(a.Labeled,{label:`间隔`,children:(0,l.jsxs)(a.Flex,{gap:`small`,children:[(0,l.jsx)(a.InputNumber,{min:1,style:{flex:1},value:e.intervalValue,onChange:e=>o({intervalValue:typeof e==`number`?e:0})}),(0,l.jsx)(a.Select,{options:p,style:{width:120},value:e.intervalUnit,onChange:e=>o({intervalUnit:e})})]})}),e.kind===`once`&&(0,l.jsx)(a.Labeled,{label:`触发时间`,children:(0,l.jsx)(a.DatePicker,{showTime:!0,format:d,style:{width:`100%`},value:e.at?(0,c.default)(e.at):void 0,onChange:(e,t)=>o({at:typeof t==`string`?t:``})})}),(0,l.jsx)(g,{endsAt:i,startsAt:n,trigger:e})]})}exports.TriggerEditor=_;
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api/query.cjs"),t=require("./api/run-api.cjs"),n=require("./api/schedule-api.cjs"),r=require("./components/duration.cjs"),i=require("./components/format.cjs"),a=require("./components/status/colors.cjs"),o=require("./types/enums.cjs"),s=require("./components/status/labels.cjs"),c=require("./components/status/index.cjs"),l=require("./components/trigger-editor/helpers.cjs"),u=require("./components/trigger-editor/index.cjs"),d=require("./pages/run-page/detail.cjs"),f=require("./pages/run-page/index.cjs"),p=require("./permissions.cjs"),m=require("./pages/schedule-page/model.cjs"),h=require("./pages/schedule-page/helpers.cjs"),g=require("./pages/schedule-page/index.cjs");exports.API_PATH=e.API_PATH,exports.CONCURRENCY_POLICIES=o.CONCURRENCY_POLICIES,exports.CONCURRENCY_POLICY_LABELS=s.CONCURRENCY_POLICY_LABELS,exports.CONCURRENCY_POLICY_OPTIONS=s.CONCURRENCY_POLICY_OPTIONS,exports.CRON_PERMISSIONS=p.CRON_PERMISSIONS,exports.CronRunPage=f.CronRunPage,exports.CronSchedulePage=g.CronSchedulePage,exports.DEFAULT_TRIGGER=l.DEFAULT_TRIGGER,exports.EnabledTag=c.EnabledTag,exports.INTERVAL_UNITS=r.INTERVAL_UNITS,exports.MISFIRE_POLICIES=o.MISFIRE_POLICIES,exports.MISFIRE_POLICY_LABELS=s.MISFIRE_POLICY_LABELS,exports.MISFIRE_POLICY_OPTIONS=s.MISFIRE_POLICY_OPTIONS,exports.RUN_STATUSES=o.RUN_STATUSES,exports.RUN_STATUS_COLORS=a.RUN_STATUS_COLORS,exports.RUN_STATUS_LABELS=s.RUN_STATUS_LABELS,exports.RUN_STATUS_OPTIONS=s.RUN_STATUS_OPTIONS,exports.RunDetailDrawer=d.RunDetailDrawer,exports.RunStatusBadge=c.RunStatusBadge,exports.SCHEDULE_FORM_DEFAULTS=m.SCHEDULE_FORM_DEFAULTS,exports.TIMEOUT_UNITS=r.TIMEOUT_UNITS,exports.TIMEOUT_UNIT_OPTIONS=m.TIMEOUT_UNIT_OPTIONS,exports.TRIGGER_KINDS=o.TRIGGER_KINDS,exports.TRIGGER_KIND_LABELS=s.TRIGGER_KIND_LABELS,exports.TRIGGER_KIND_OPTIONS=s.TRIGGER_KIND_OPTIONS,exports.TriggerEditor=u.TriggerEditor,exports.combineDurationMs=r.combineDurationMs,exports.formatDuration=i.formatDuration,exports.formatTimestamp=i.formatTimestamp,exports.formatTriggerSummary=l.formatTriggerSummary,exports.isTriggerComplete=l.isTriggerComplete,exports.jsonParamsError=m.jsonParamsError,exports.parseJsonParams=m.parseJsonParams,exports.scheduleToFormValues=m.scheduleToFormValues,exports.scheduleToParams=m.scheduleToParams,exports.splitDurationMs=r.splitDurationMs,exports.splitQueryParams=e.splitQueryParams,exports.triggerFormToParams=l.triggerFormToParams,exports.triggerToFormValues=l.triggerToFormValues,exports.useJobNames=h.useJobNames,exports.useRunApi=t.useRunApi,exports.useScheduleApi=n.useScheduleApi,exports.useScheduleFormMutations=h.useScheduleFormMutations;
@@ -0,0 +1 @@
1
+ const e=require("./run-page/detail.cjs"),t=require("./run-page/index.cjs"),n=require("./schedule-page/model.cjs"),r=require("./schedule-page/helpers.cjs"),i=require("./schedule-page/index.cjs");exports.CronRunPage=t.CronRunPage,exports.CronSchedulePage=i.CronSchedulePage,exports.RunDetailDrawer=e.RunDetailDrawer,exports.SCHEDULE_FORM_DEFAULTS=n.SCHEDULE_FORM_DEFAULTS,exports.TIMEOUT_UNIT_OPTIONS=n.TIMEOUT_UNIT_OPTIONS,exports.jsonParamsError=n.jsonParamsError,exports.parseJsonParams=n.parseJsonParams,exports.scheduleToFormValues=n.scheduleToFormValues,exports.scheduleToParams=n.scheduleToParams,exports.useJobNames=r.useJobNames,exports.useScheduleFormMutations=r.useScheduleFormMutations;
@@ -0,0 +1 @@
1
+ const e=require("../../components/format.cjs"),t=require("../../components/status/index.cjs");let n=require("@vef-framework-react/components"),r=require("@emotion/react/jsx-runtime");var i=[{title:`调度名称`,dataIndex:`scheduleName`,width:180,render:e=>(0,r.jsx)(n.Text,{strong:!0,children:e})},{title:`任务处理器`,dataIndex:`jobName`,width:150},{title:`状态`,dataIndex:`status`,width:100,align:`center`,render:e=>(0,r.jsx)(t.RunStatusBadge,{status:e})},{title:`计划时间`,dataIndex:`scheduledAt`,width:160,render:e.formatTimestamp},{title:`开始时间`,dataIndex:`startedAt`,width:160,render:e.formatTimestamp},{title:`结束时间`,dataIndex:`finishedAt`,width:160,render:e.formatTimestamp},{title:`耗时`,dataIndex:`durationMs`,width:100,align:`right`,render:t=>e.formatDuration(t)},{title:`节点`,dataIndex:`nodeId`,minWidth:140},{title:`错过次数`,dataIndex:`missedCount`,width:90,align:`center`,render:(e,t)=>t.status===`missed`?String(e??0):`-`}];exports.runColumns=i;
@@ -0,0 +1 @@
1
+ const e=require("../../api/run-api.cjs"),t=require("../../components/format.cjs"),n=require("../../components/status/index.cjs");let r=require("@vef-framework-react/components"),i=require("@vef-framework-react/core"),a=require("@emotion/react/jsx-runtime");var o=(0,require("@emotion/react").css)({maxHeight:280,overflow:`auto`,padding:r.globalCssVars.spacingSm,borderRadius:r.globalCssVars.borderRadius,background:r.globalCssVars.colorErrorBg,color:r.globalCssVars.colorText,fontFamily:r.globalCssVars.fontFamilyCode,fontSize:r.globalCssVars.fontSizeSm,whiteSpace:`pre-wrap`,wordBreak:`break-word`},process.env.NODE_ENV===`production`?``:`/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRldGFpbC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBV29CIiwiZmlsZSI6ImRldGFpbC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgdHlwZSB7IERlc2NyaXB0aW9uc0l0ZW0gfSBmcm9tIFwiQHZlZi1mcmFtZXdvcmstcmVhY3QvY29tcG9uZW50c1wiO1xuXG5pbXBvcnQgdHlwZSB7IFJ1biB9IGZyb20gXCIuLi8uLi90eXBlc1wiO1xuXG5pbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vcmVhY3RcIjtcbmltcG9ydCB7IENlbnRlciwgRGVzY3JpcHRpb25zLCBEcmF3ZXIsIGdsb2JhbENzc1ZhcnMsIExhY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RhdGF9IC8+XG4gICAgICAgICAgOiBudWxsfVxuICAgIDwvRHJhd2VyPlxuICApO1xufVxuIl19 */`);function s(e){let r=[{key:`scheduleName`,label:`调度名称`,children:e.scheduleName},{key:`jobName`,label:`任务处理器`,children:e.jobName},{key:`status`,label:`状态`,children:(0,a.jsx)(n.RunStatusBadge,{status:e.status})},{key:`nodeId`,label:`节点`,children:e.nodeId||`-`},{key:`scheduledAt`,label:`计划时间`,children:t.formatTimestamp(e.scheduledAt)},{key:`startedAt`,label:`开始时间`,children:t.formatTimestamp(e.startedAt)},{key:`finishedAt`,label:`结束时间`,children:t.formatTimestamp(e.finishedAt)},{key:`durationMs`,label:`耗时`,children:t.formatDuration(e.durationMs)},{key:`heartbeatAt`,label:`心跳时间`,children:t.formatTimestamp(e.heartbeatAt)},{key:`createdAt`,label:`创建时间`,children:t.formatTimestamp(e.createdAt)}];return e.status===`missed`&&r.push({key:`missedCount`,label:`错过次数`,children:String(e.missedCount??0)}),r}function c({run:e}){return(0,a.jsxs)(r.Stack,{gap:`middle`,children:[(0,a.jsx)(r.Descriptions,{bordered:!0,column:2,items:s(e),size:`small`,styles:{label:{width:96}}}),e.error?(0,a.jsx)(r.Labeled,{label:`错误信息`,children:(0,a.jsx)(`div`,{css:o,children:e.error})}):null]})}function l({runId:t,onClose:n}){let o=e.useRunApi(),{data:s,isFetching:l}=(0,i.useQuery)({enabled:t!==null,queryFn:o.findOne,queryKey:[o.findOne.key,{id:t??``}]});return(0,a.jsx)(r.Drawer,{open:t!==null,size:640,title:`运行详情`,onClose:n,children:l&&!s?(0,a.jsx)(r.Center,{style:{height:160},children:(0,a.jsx)(r.Spin,{})}):s?(0,a.jsx)(c,{run:s}):null})}exports.RunDetailDrawer=l;
@@ -0,0 +1 @@
1
+ const e=require("../../api/run-api.cjs"),t=require("./columns.cjs"),n=require("./detail.cjs"),r=require("./search.cjs");let i=require("@vef-framework-react/components"),a=require("react"),o=require("@emotion/react/jsx-runtime");function s({columnStorageKey:s=`cron.run`,title:c}){let l=e.useRunApi(),[u,d]=(0,a.useState)(null);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.CrudPage,{advancedSearch:(0,o.jsx)(r.RunAdvancedSearchFields,{}),basicSearch:(0,o.jsx)(r.RunSearchFields,{}),columnSettings:{storageKey:s},operationColumn:{width:80,render:e=>(0,o.jsx)(i.Button,{size:`small`,type:`link`,onClick:()=>d(e.id),children:`详情`})},queryFn:l.findPage,rowKey:`id`,tableColumns:t.runColumns,title:c,onRowClick:e=>d(e.id)}),(0,o.jsx)(n.RunDetailDrawer,{runId:u,onClose:()=>d(null)})]})}exports.CronRunPage=s;
@@ -0,0 +1 @@
1
+ const e=require("../../components/status/labels.cjs");let t=require("@vef-framework-react/components"),n=require("@emotion/react/jsx-runtime");var r=`YYYY-MM-DD HH:mm:ss`;function i(){let{AppField:e}=(0,t.useFormContext)();return(0,n.jsx)(e,{name:`scheduleName`,children:e=>(0,n.jsx)(e.Input,{allowClear:!0,noWrapper:!0,placeholder:`调度名称`,style:{width:180}})})}function a(){let{AppField:i}=(0,t.useFormContext)();return(0,n.jsxs)(t.Row,{gutter:[`var(--vef-spacing-md)`,`var(--vef-spacing-md)`],children:[(0,n.jsx)(t.Col,{lg:8,md:12,xs:24,children:(0,n.jsx)(i,{name:`jobName`,children:e=>(0,n.jsx)(e.Input,{allowClear:!0,label:`任务处理器`,placeholder:`任务处理器`})})}),(0,n.jsx)(t.Col,{lg:8,md:12,xs:24,children:(0,n.jsx)(i,{name:`status`,children:t=>(0,n.jsx)(t.Select,{allowClear:!0,label:`状态`,options:e.RUN_STATUS_OPTIONS,placeholder:`状态`})})}),(0,n.jsx)(t.Col,{lg:8,md:12,xs:24,children:(0,n.jsx)(i,{name:`nodeId`,children:e=>(0,n.jsx)(e.Input,{allowClear:!0,label:`节点`,placeholder:`节点`})})}),(0,n.jsx)(t.Col,{lg:8,md:12,xs:24,children:(0,n.jsx)(i,{name:`scheduledAtFrom`,children:e=>(0,n.jsx)(e.DatePicker,{showTime:!0,format:r,label:`计划时间起`,placeholder:`计划时间起`})})}),(0,n.jsx)(t.Col,{lg:8,md:12,xs:24,children:(0,n.jsx)(i,{name:`scheduledAtTo`,children:e=>(0,n.jsx)(e.DatePicker,{showTime:!0,format:r,label:`计划时间止`,placeholder:`计划时间止`})})})]})}exports.RunAdvancedSearchFields=a,exports.RunSearchFields=i;
@@ -0,0 +1 @@
1
+ const e=require("../../components/format.cjs"),t=require("../../components/status/labels.cjs"),n=require("../../components/status/index.cjs"),r=require("../../components/trigger-editor/helpers.cjs");let i=require("@vef-framework-react/components"),a=require("@emotion/react/jsx-runtime");var o={cron:`blue`,interval:`geekblue`,once:`purple`},s=[{title:`名称`,dataIndex:`name`,width:180,render:e=>(0,a.jsx)(i.Text,{strong:!0,children:e})},{title:`任务处理器`,dataIndex:`jobName`,width:160},{title:`触发方式`,dataIndex:`kind`,width:110,align:`center`,render:e=>(0,a.jsx)(i.Tag,{color:o[e],children:t.TRIGGER_KIND_LABELS[e]})},{key:`trigger`,title:`触发规则`,minWidth:220,render:(e,t)=>(0,a.jsx)(i.Text,{children:r.formatTriggerSummary(t)})},{title:`状态`,dataIndex:`isEnabled`,width:90,align:`center`,render:e=>(0,a.jsx)(n.EnabledTag,{enabled:e})},{key:`nextFireAt`,title:`下次触发`,width:160,render:(t,n)=>n.isEnabled?e.formatTimestamp(n.nextFireAt):`-`},{title:`上次触发`,dataIndex:`lastFireAt`,width:160,render:e.formatTimestamp}];exports.scheduleColumns=s;
@@ -0,0 +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;
@@ -0,0 +1 @@
1
+ const e=require("../../api/query.cjs"),t=require("../../api/schedule-api.cjs"),n=require("./model.cjs");let r=require("@vef-framework-react/components"),i=require("@vef-framework-react/core"),a=require("react");var o=`sys/cron/schedule`,s=(0,r.createCrudKit)(),c=s.OperationButtonGroup,l=s.ActionButtonGroup;function u(){let t=(0,i.useApiClient)();return(0,a.useMemo)(()=>({create:t.createMutationFn(`cron_schedule_form_create`,({post:t})=>r=>t(e.API_PATH,{data:(0,i.createApiRequest)(o,`create`,n.scheduleToParams(r))})),update:t.createMutationFn(`cron_schedule_form_update`,({post:t})=>r=>t(e.API_PATH,{data:(0,i.createApiRequest)(o,`update`,n.scheduleToParams(r))}))}),[t])}function d(){let e=t.useScheduleApi(),{data:n,isLoading:r}=(0,i.useQuery)({queryFn:e.listJobs,queryKey:[e.listJobs.key]});return(0,a.useMemo)(()=>({options:(n??[]).map(e=>({label:e,value:e})),loading:r}),[n,r])}exports.ScheduleActionButtonGroup=l,exports.ScheduleOperationButtonGroup=c,exports.useJobNames=d,exports.useScheduleFormMutations=u;
@@ -0,0 +1 @@
1
+ const e=require("../../api/schedule-api.cjs"),t=require("../../permissions.cjs"),n=require("./columns.cjs"),r=require("./model.cjs"),i=require("./helpers.cjs"),a=require("./form.cjs"),o=require("./search.cjs");let s=require("@vef-framework-react/components"),c=require("@vef-framework-react/core"),l=require("@emotion/react/jsx-runtime"),u=require("lucide-react");var d={xxs:`100vw`,md:`80vw`,lg:680};function f({row:t,perms:n}){let a=e.useScheduleApi(),o=(0,c.useMutation)({mutationFn:a.pause}),f=(0,c.useMutation)({mutationFn:a.resume}),p=(0,c.useMutation)({mutationFn:a.triggerNow});return(0,l.jsx)(i.ScheduleOperationButtonGroup,{selector:e=>[e.openForm,e.delete,e.refetchQuery],children:([e,i,a])=>(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(s.OperationButton,{color:`primary`,icon:(0,l.jsx)(s.Icon,{component:u.EditIcon}),requiredPermissions:n.manage,onClick:()=>e({scene:`update`,values:r.scheduleToFormValues(t),title:`编辑调度`,mode:`drawer`,width:d}),children:`编辑`}),t.isEnabled?(0,l.jsx)(s.OperationButton,{color:`orange`,icon:(0,l.jsx)(s.Icon,{component:u.PauseIcon}),requiredPermissions:n.manage,onClick:async()=>{try{await o.mutateAsync({name:t.name}),(0,s.showSuccessMessage)(`已暂停`),a()}catch{}},children:`暂停`}):(0,l.jsx)(s.OperationButton,{color:`primary`,icon:(0,l.jsx)(s.Icon,{component:u.PlayIcon}),requiredPermissions:n.manage,onClick:async()=>{try{await f.mutateAsync({name:t.name}),(0,s.showSuccessMessage)(`已恢复`),a()}catch{}},children:`恢复`}),(0,l.jsx)(s.OperationButton,{confirmable:!0,color:`purple`,confirmDescription:`将通过正常的领取流程立即触发一次执行。`,icon:(0,l.jsx)(s.Icon,{component:u.ZapIcon}),requiredPermissions:n.manage,onClick:async()=>{try{await p.mutateAsync({name:t.name}),(0,s.showSuccessMessage)(`已触发一次执行`),a()}catch{}},children:`立即执行`}),(0,l.jsx)(s.OperationButton,{confirmable:!0,color:`danger`,confirmDescription:`删除后该调度不再触发;历史运行记录仍会保留。`,icon:(0,l.jsx)(s.Icon,{component:u.TrashIcon}),requiredPermissions:n.manage,onClick:async()=>{try{await i(t),a()}catch{}},children:`删除`})]})})}function p({permissions:c,columnStorageKey:p=`cron.schedule`,title:m}){let h=e.useScheduleApi(),g=i.useScheduleFormMutations(),_={...t.CRON_PERMISSIONS.schedule,...c};return(0,l.jsx)(s.CrudPage,{advancedSearch:(0,l.jsx)(o.ScheduleAdvancedSearchFields,{}),basicSearch:(0,l.jsx)(o.ScheduleSearchFields,{}),columnSettings:{storageKey:p},deleteMutationFn:h.remove,formLayout:{layout:`vertical`},formMutationFns:g,operationColumn:{width:280,render:e=>(0,l.jsx)(f,{perms:_,row:e})},queryFn:h.findPage,renderForm:()=>(0,l.jsx)(a.ScheduleForm,{}),rowKey:`id`,sceneDefaultFormValues:{create:r.SCHEDULE_FORM_DEFAULTS},tableColumns:n.scheduleColumns,title:m,toolbarActions:(0,l.jsx)(i.ScheduleActionButtonGroup,{selector:e=>[e.openForm],children:([e])=>(0,l.jsx)(s.PermissionGate,{requiredPermissions:_.manage,children:(0,l.jsx)(s.ActionButton,{icon:(0,l.jsx)(s.Icon,{component:u.PlusIcon}),type:`primary`,onClick:()=>e({scene:`create`,title:`新增调度`,mode:`drawer`,width:d}),children:`新增调度`})})})})}exports.CronSchedulePage=p;
@@ -0,0 +1 @@
1
+ const e=require("../../components/duration.cjs"),t=require("../../components/trigger-editor/helpers.cjs");function n(e){let t=e.trim();if(!t)return{ok:!0,value:void 0};let n;try{n=JSON.parse(t)}catch{return{ok:!1,error:`任务参数不是合法的 JSON`}}return typeof n!=`object`||!n||Array.isArray(n)?{ok:!1,error:`任务参数必须是 JSON 对象`}:{ok:!0,value:n}}function r(e){let t=n(e);return t.ok?void 0:t.error}function i(n){let r=n.timeoutMs>0?e.splitDurationMs(n.timeoutMs,e.TIMEOUT_UNITS):{value:0,unit:`second`};return{id:n.id,originalName:n.name,name:n.name,jobName:n.jobName,trigger:t.triggerToFormValues(n),startsAt:n.startsAt??``,endsAt:n.endsAt??``,misfirePolicy:n.misfirePolicy,concurrencyPolicy:n.concurrencyPolicy,recover:n.recover,timeoutValue:r.value,timeoutUnit:r.unit,paramsText:n.params?JSON.stringify(n.params,null,2):``,enabled:n.isEnabled}}function a(r){let i=!!r.originalName&&r.originalName!==r.name,a=n(r.paramsText);return{name:r.originalName??r.name,newName:i?r.name:void 0,jobName:r.jobName,trigger:t.triggerFormToParams(r.trigger),params:a.ok?a.value:void 0,startsAt:r.startsAt||void 0,endsAt:r.endsAt||void 0,misfirePolicy:r.misfirePolicy,concurrencyPolicy:r.concurrencyPolicy,recover:r.recover,timeoutMs:e.combineDurationMs(r.timeoutValue,r.timeoutUnit,e.TIMEOUT_UNITS),enabled:r.enabled}}var o={name:``,jobName:``,trigger:{...t.DEFAULT_TRIGGER},startsAt:``,endsAt:``,misfirePolicy:`fire_now`,concurrencyPolicy:`forbid`,recover:!1,timeoutValue:0,timeoutUnit:`second`,paramsText:``,enabled:!0},s=e.TIMEOUT_UNITS.map(e=>({label:e.label,value:e.value}));exports.SCHEDULE_FORM_DEFAULTS=o,exports.TIMEOUT_UNIT_OPTIONS=s,exports.jsonParamsError=r,exports.parseJsonParams=n,exports.scheduleToFormValues=i,exports.scheduleToParams=a;
@@ -0,0 +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;
@@ -0,0 +1 @@
1
+ var e={schedule:{query:`cron.schedule.query`,manage:`cron.schedule.manage`},run:{query:`cron.run.query`}};exports.CRON_PERMISSIONS=e;
@@ -0,0 +1 @@
1
+ var e=[`cron`,`interval`,`once`],t=[`fire_now`,`skip`],n=[`forbid`,`allow`],r=[`running`,`succeeded`,`failed`,`missed`,`skipped`,`abandoned`,`canceled`];exports.CONCURRENCY_POLICIES=n,exports.MISFIRE_POLICIES=t,exports.RUN_STATUSES=r,exports.TRIGGER_KINDS=e;
@@ -0,0 +1 @@
1
+ const e=require("./enums.cjs");exports.CONCURRENCY_POLICIES=e.CONCURRENCY_POLICIES,exports.MISFIRE_POLICIES=e.MISFIRE_POLICIES,exports.RUN_STATUSES=e.RUN_STATUSES,exports.TRIGGER_KINDS=e.TRIGGER_KINDS;
@@ -0,0 +1,5 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
+ import { useRunApi as n } from "./run-api.js";
4
+ import { useScheduleApi as r } from "./schedule-api.js";
5
+ export { e as API_PATH, t as splitQueryParams, n as useRunApi, r as useScheduleApi };
@@ -0,0 +1,13 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { SYMBOL_PAGINATION as e } from "@vef-framework-react/components";
3
+ //#region src/api/query.ts
4
+ var t = "/api";
5
+ function n(t) {
6
+ let { [e]: n, ...r } = t;
7
+ return {
8
+ params: r,
9
+ pagination: n
10
+ };
11
+ }
12
+ //#endregion
13
+ export { t as API_PATH, n as splitQueryParams };
@@ -0,0 +1,18 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
+ import { createApiRequest as n, useApiClient as r } from "@vef-framework-react/core";
4
+ import { useMemo as i } from "react";
5
+ //#region src/api/run-api.ts
6
+ var a = "sys/cron/run";
7
+ function o() {
8
+ let o = r();
9
+ return i(() => ({
10
+ findPage: o.createQueryFn("cron_run_find_page", ({ post: r }) => async (i) => {
11
+ let { params: o, pagination: s } = t(i);
12
+ return (await r(e, { data: n(a, "find_page", o, s) })).data;
13
+ }),
14
+ findOne: o.createQueryFn("cron_run_find_one", ({ post: t }) => async (r) => (await t(e, { data: n(a, "find_one", r) })).data)
15
+ }), [o]);
16
+ }
17
+ //#endregion
18
+ export { o as useRunApi };
@@ -0,0 +1,32 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { API_PATH as e, splitQueryParams as t } from "./query.js";
3
+ import { createApiRequest as n, useApiClient as r } from "@vef-framework-react/core";
4
+ import { useMemo as i } from "react";
5
+ //#region src/api/schedule-api.ts
6
+ var a = "sys/cron/schedule";
7
+ function o() {
8
+ let o = r();
9
+ return i(() => ({
10
+ findPage: o.createQueryFn("cron_schedule_find_page", ({ post: r }) => async (i) => {
11
+ let { params: o, pagination: s } = t(i), { isEnabled: c, ...l } = o;
12
+ return (await r(e, { data: n(a, "find_page", c === "true" ? {
13
+ ...l,
14
+ isEnabled: !0
15
+ } : c === "false" ? {
16
+ ...l,
17
+ isEnabled: !1
18
+ } : l, s) })).data;
19
+ }),
20
+ get: o.createQueryFn("cron_schedule_get", ({ post: t }) => async (r) => (await t(e, { data: n(a, "get", r) })).data),
21
+ listJobs: o.createQueryFn("cron_schedule_list_jobs", ({ post: t }) => async () => (await t(e, { data: n(a, "list_jobs") })).data),
22
+ previewFires: o.createQueryFn("cron_schedule_preview_fires", ({ post: t }) => async (r) => (await t(e, { data: n(a, "preview_fires", r) })).data),
23
+ create: o.createMutationFn("cron_schedule_create", ({ post: t }) => (r) => t(e, { data: n(a, "create", r) })),
24
+ update: o.createMutationFn("cron_schedule_update", ({ post: t }) => (r) => t(e, { data: n(a, "update", r) })),
25
+ remove: o.createMutationFn("cron_schedule_delete", ({ post: t }) => (r) => t(e, { data: n(a, "delete", { name: r.name }) })),
26
+ pause: o.createMutationFn("cron_schedule_pause", ({ post: t }) => (r) => t(e, { data: n(a, "pause", { name: r.name }) })),
27
+ resume: o.createMutationFn("cron_schedule_resume", ({ post: t }) => (r) => t(e, { data: n(a, "resume", { name: r.name }) })),
28
+ triggerNow: o.createMutationFn("cron_schedule_trigger_now", ({ post: t }) => (r) => t(e, { data: n(a, "trigger_now", { name: r.name }) }))
29
+ }), [o]);
30
+ }
31
+ //#endregion
32
+ export { o as useScheduleApi };
@@ -0,0 +1,68 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ //#region src/components/duration.ts
3
+ var e = [
4
+ {
5
+ label: "秒",
6
+ value: "second",
7
+ ms: 1e3
8
+ },
9
+ {
10
+ label: "分钟",
11
+ value: "minute",
12
+ ms: 6e4
13
+ },
14
+ {
15
+ label: "小时",
16
+ value: "hour",
17
+ ms: 36e5
18
+ },
19
+ {
20
+ label: "天",
21
+ value: "day",
22
+ ms: 864e5
23
+ }
24
+ ], t = [
25
+ {
26
+ label: "毫秒",
27
+ value: "ms",
28
+ ms: 1
29
+ },
30
+ {
31
+ label: "秒",
32
+ value: "second",
33
+ ms: 1e3
34
+ },
35
+ {
36
+ label: "分钟",
37
+ value: "minute",
38
+ ms: 6e4
39
+ }
40
+ ];
41
+ function n(e, t, n) {
42
+ let r = (n.find((e) => e.value === t) ?? n[0])?.ms ?? 1;
43
+ return Math.max(0, Math.round(e)) * r;
44
+ }
45
+ function r(e, t) {
46
+ let n = Math.max(0, Math.round(e)), r = t[0] ?? {
47
+ label: "",
48
+ value: "",
49
+ ms: 1
50
+ };
51
+ if (n === 0) return {
52
+ value: 0,
53
+ unit: r.value
54
+ };
55
+ for (let e = t.length - 1; e >= 0; e--) {
56
+ let r = t[e];
57
+ if (r && r.ms <= n && n % r.ms === 0) return {
58
+ value: n / r.ms,
59
+ unit: r.value
60
+ };
61
+ }
62
+ return {
63
+ value: n / r.ms,
64
+ unit: r.value
65
+ };
66
+ }
67
+ //#endregion
68
+ export { e as INTERVAL_UNITS, t as TIMEOUT_UNITS, n as combineDurationMs, r as splitDurationMs };
@@ -0,0 +1,11 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import e from "dayjs";
3
+ //#region src/components/format.ts
4
+ function t(t) {
5
+ return t ? e(t).format("YYYY-MM-DD HH:mm:ss") : "-";
6
+ }
7
+ function n(e) {
8
+ return e == null || e <= 0 ? "-" : e < 1e3 ? `${e} ms` : e < 6e4 ? `${(e / 1e3).toFixed(1)} s` : `${(e / 6e4).toFixed(1)} min`;
9
+ }
10
+ //#endregion
11
+ export { n as formatDuration, t as formatTimestamp };
@@ -0,0 +1,9 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { INTERVAL_UNITS as e, TIMEOUT_UNITS as t, combineDurationMs as n, splitDurationMs as r } from "./duration.js";
3
+ import { formatDuration as i, formatTimestamp as a } from "./format.js";
4
+ import { RUN_STATUS_COLORS as o } from "./status/colors.js";
5
+ import { CONCURRENCY_POLICY_LABELS as s, CONCURRENCY_POLICY_OPTIONS as c, MISFIRE_POLICY_LABELS as l, MISFIRE_POLICY_OPTIONS as u, RUN_STATUS_LABELS as d, RUN_STATUS_OPTIONS as f, TRIGGER_KIND_LABELS as p, TRIGGER_KIND_OPTIONS as m } from "./status/labels.js";
6
+ import { EnabledTag as h, RunStatusBadge as g } from "./status/index.js";
7
+ import { DEFAULT_TRIGGER as _, formatTriggerSummary as v, isTriggerComplete as y, triggerFormToParams as b, triggerToFormValues as x } from "./trigger-editor/helpers.js";
8
+ import { TriggerEditor as S } from "./trigger-editor/index.js";
9
+ export { s as CONCURRENCY_POLICY_LABELS, c as CONCURRENCY_POLICY_OPTIONS, _ as DEFAULT_TRIGGER, h as EnabledTag, e as INTERVAL_UNITS, l as MISFIRE_POLICY_LABELS, u as MISFIRE_POLICY_OPTIONS, o as RUN_STATUS_COLORS, d as RUN_STATUS_LABELS, f as RUN_STATUS_OPTIONS, g as RunStatusBadge, t as TIMEOUT_UNITS, p as TRIGGER_KIND_LABELS, m as TRIGGER_KIND_OPTIONS, S as TriggerEditor, n as combineDurationMs, i as formatDuration, a as formatTimestamp, v as formatTriggerSummary, y as isTriggerComplete, r as splitDurationMs, b as triggerFormToParams, x as triggerToFormValues };
@@ -0,0 +1,13 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ //#region src/components/status/colors.ts
3
+ var e = {
4
+ running: "processing",
5
+ succeeded: "success",
6
+ failed: "error",
7
+ missed: "orange",
8
+ skipped: "default",
9
+ abandoned: "volcano",
10
+ canceled: "default"
11
+ };
12
+ //#endregion
13
+ export { e as RUN_STATUS_COLORS };
@@ -0,0 +1,20 @@
1
+ /*! @vef-framework-react/cron v2.13.0 made by Venus | 2026-07-21T07:15:48.744Z */
2
+ import { RUN_STATUS_COLORS as e } from "./colors.js";
3
+ import { RUN_STATUS_LABELS as t } from "./labels.js";
4
+ import { Tag as n } from "@vef-framework-react/components";
5
+ import { jsx as r } from "@emotion/react/jsx-runtime";
6
+ //#region src/components/status/index.tsx
7
+ function i({ status: i }) {
8
+ return /* @__PURE__ */ r(n, {
9
+ color: e[i],
10
+ children: t[i]
11
+ });
12
+ }
13
+ function a({ enabled: e }) {
14
+ return /* @__PURE__ */ r(n, {
15
+ color: e ? "success" : "default",
16
+ children: e ? "启用" : "停用"
17
+ });
18
+ }
19
+ //#endregion
20
+ export { a as EnabledTag, i as RunStatusBadge };