@whyour/qinglong 2.25.0-rc.0 → 2.25.0-rc.1

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 (752) hide show
  1. package/cli/README.en.md +2 -2
  2. package/cli/README.md +2 -2
  3. package/cli/src/internal/maintenance/panelUpgrade.cjs +9 -3
  4. package/cli/src/internal/maintenance/upgradePrestart.cjs +21 -15
  5. package/package.json +7 -3
  6. package/shell/api.sh +58 -8
  7. package/shell/cron-command.py +127 -0
  8. package/shell/otask.sh +2 -1
  9. package/shell/preload/client.js +18 -10
  10. package/shell/preload/script-start.cjs +26 -0
  11. package/shell/preload/sitecustomize.js +6 -0
  12. package/shell/preload/sitecustomize.py +25 -0
  13. package/shell/share.sh +3 -3
  14. package/shell/subscription-files.py +171 -0
  15. package/shell/system-cron.sh +42 -0
  16. package/shell/task-timeout.sh +19 -1
  17. package/shell/task.sh +25 -3
  18. package/shell/update.sh +115 -147
  19. package/shell/upgrade-lock.yaml +2186 -1050
  20. package/static/build/api/cron.js +134 -17
  21. package/static/build/api/cron.js.map +1 -1
  22. package/static/build/api/dashboard.js +42 -50
  23. package/static/build/api/dashboard.js.map +1 -1
  24. package/static/build/api/log.js +10 -1
  25. package/static/build/api/log.js.map +1 -1
  26. package/static/build/api/script.js +11 -8
  27. package/static/build/api/script.js.map +1 -1
  28. package/static/build/api/system.js +2 -1
  29. package/static/build/api/system.js.map +1 -1
  30. package/static/build/app.js +41 -0
  31. package/static/build/app.js.map +1 -1
  32. package/static/build/bootstrap/systemCron.js +70 -0
  33. package/static/build/bootstrap/systemCron.js.map +1 -0
  34. package/static/build/config/util.js +75 -15
  35. package/static/build/config/util.js.map +1 -1
  36. package/static/build/data/cron.js +9 -0
  37. package/static/build/data/cron.js.map +1 -1
  38. package/static/build/data/cronStats.js +7 -0
  39. package/static/build/data/cronStats.js.map +1 -1
  40. package/static/build/data/index.js +23 -0
  41. package/static/build/data/index.js.map +1 -1
  42. package/static/build/data/runningInstance.js +2 -1
  43. package/static/build/data/runningInstance.js.map +1 -1
  44. package/static/build/loaders/express.js +1 -1
  45. package/static/build/loaders/express.js.map +1 -1
  46. package/static/build/loaders/initData.js +7 -9
  47. package/static/build/loaders/initData.js.map +1 -1
  48. package/static/build/protos/cron.js +83 -3
  49. package/static/build/protos/cron.js.map +1 -1
  50. package/static/build/schedule/addCron.js +62 -21
  51. package/static/build/schedule/addCron.js.map +1 -1
  52. package/static/build/schedule/client.js +1 -1
  53. package/static/build/schedule/client.js.map +1 -1
  54. package/static/build/schedule/registeredPlans.js +46 -0
  55. package/static/build/schedule/registeredPlans.js.map +1 -0
  56. package/static/build/services/cron.js +603 -256
  57. package/static/build/services/cron.js.map +1 -1
  58. package/static/build/services/grpc.js +2 -3
  59. package/static/build/services/grpc.js.map +1 -1
  60. package/static/build/services/retention.js +50 -18
  61. package/static/build/services/retention.js.map +1 -1
  62. package/static/build/services/system.js +3 -0
  63. package/static/build/services/system.js.map +1 -1
  64. package/static/build/shared/containerResources.js +80 -0
  65. package/static/build/shared/containerResources.js.map +1 -0
  66. package/static/build/shared/cronCommandProcess.js +39 -0
  67. package/static/build/shared/cronCommandProcess.js.map +1 -0
  68. package/static/build/shared/cronOperand.js +67 -0
  69. package/static/build/shared/cronOperand.js.map +1 -0
  70. package/static/build/shared/cronPreview.js +45 -0
  71. package/static/build/shared/cronPreview.js.map +1 -0
  72. package/static/build/shared/cronProcess.js +207 -0
  73. package/static/build/shared/cronProcess.js.map +1 -0
  74. package/static/build/shared/cronRecovery.js +24 -0
  75. package/static/build/shared/cronRecovery.js.map +1 -0
  76. package/static/build/shared/cronScheduler.js +71 -14
  77. package/static/build/shared/cronScheduler.js.map +1 -1
  78. package/static/build/shared/cronStatistics.js +53 -0
  79. package/static/build/shared/cronStatistics.js.map +1 -0
  80. package/static/build/shared/cronWaitQueue.js +38 -0
  81. package/static/build/shared/cronWaitQueue.js.map +1 -0
  82. package/static/build/shared/directoryPage.js +175 -0
  83. package/static/build/shared/directoryPage.js.map +1 -0
  84. package/static/build/shared/directoryPageRoute.js +40 -0
  85. package/static/build/shared/directoryPageRoute.js.map +1 -0
  86. package/static/build/shared/errors.js +9 -1
  87. package/static/build/shared/errors.js.map +1 -1
  88. package/static/build/shared/executionIdentity.js +19 -0
  89. package/static/build/shared/executionIdentity.js.map +1 -0
  90. package/static/build/shared/i18n.js +5 -0
  91. package/static/build/shared/i18n.js.map +1 -1
  92. package/static/build/shared/legacyDailyStatistics.js +159 -0
  93. package/static/build/shared/legacyDailyStatistics.js.map +1 -0
  94. package/static/build/shared/logReader.js +47 -15
  95. package/static/build/shared/logReader.js.map +1 -1
  96. package/static/build/shared/managedExit.cjs +462 -0
  97. package/static/build/shared/managedExit.cjs.map +1 -0
  98. package/static/build/shared/pLimit.js +34 -6
  99. package/static/build/shared/pLimit.js.map +1 -1
  100. package/static/build/shared/queueDiagnostics.js +100 -0
  101. package/static/build/shared/queueDiagnostics.js.map +1 -0
  102. package/static/build/shared/runCron.js +123 -20
  103. package/static/build/shared/runCron.js.map +1 -1
  104. package/static/build/shared/scheduleAudit.js +208 -0
  105. package/static/build/shared/scheduleAudit.js.map +1 -0
  106. package/static/build/shared/schemaMigrations.js +46 -1
  107. package/static/build/shared/schemaMigrations.js.map +1 -1
  108. package/static/build/shared/systemScheduleAudit.js +224 -0
  109. package/static/build/shared/systemScheduleAudit.js.map +1 -0
  110. package/static/build/shared/triggerHistory.js +1338 -0
  111. package/static/build/shared/triggerHistory.js.map +1 -0
  112. package/static/build/validation/schedule.js +5 -4
  113. package/static/build/validation/schedule.js.map +1 -1
  114. package/static/build-info.json +458 -402
  115. package/static/dist/{5876.93680102.async.js → 1013.f391f663.async.js} +1 -1
  116. package/static/dist/1042.79a1b7b9.async.js +1 -0
  117. package/static/dist/1042.79a1b7b9.async.js.gz +0 -0
  118. package/static/dist/1049.ce652253.async.js +1 -0
  119. package/static/dist/1088.a08a989c.async.js +1 -0
  120. package/static/dist/1088.a08a989c.async.js.gz +0 -0
  121. package/static/dist/1425.4f8f8a22.async.js +1 -0
  122. package/static/dist/1425.4f8f8a22.async.js.gz +0 -0
  123. package/static/dist/1470.f2ea8437.async.js +1 -0
  124. package/static/dist/1470.f2ea8437.async.js.gz +0 -0
  125. package/static/dist/{2783.0787fd60.async.js → 1493.d4855779.async.js} +1 -1
  126. package/static/dist/1498.9cbd5bb9.async.js +1 -0
  127. package/static/dist/1498.9cbd5bb9.async.js.gz +0 -0
  128. package/static/dist/1515.6153a790.async.js +1 -0
  129. package/static/dist/1515.6153a790.async.js.gz +0 -0
  130. package/static/dist/1535.e9e477b3.async.js +1 -0
  131. package/static/dist/1535.e9e477b3.async.js.gz +0 -0
  132. package/static/dist/1544.9287da56.async.js +1 -0
  133. package/static/dist/1666.70721323.async.js +1 -0
  134. package/static/dist/1666.70721323.async.js.gz +0 -0
  135. package/static/dist/{5878.32535c39.async.js → 1739.62d88535.async.js} +1 -1
  136. package/static/dist/1782.1157c5a1.async.js +1 -0
  137. package/static/dist/1782.1157c5a1.async.js.gz +0 -0
  138. package/static/dist/1817.b289fb2e.async.js +1 -0
  139. package/static/dist/{6841.e92e9802.async.js → 1821.30f17ea7.async.js} +1 -1
  140. package/static/dist/1834.4c8d8590.async.js +1 -0
  141. package/static/dist/1834.4c8d8590.async.js.gz +0 -0
  142. package/static/dist/{7661.6684ddda.async.js → 1965.7049837c.async.js} +1 -1
  143. package/static/dist/2021.17d1b18c.async.js +1 -0
  144. package/static/dist/2021.17d1b18c.async.js.gz +0 -0
  145. package/static/dist/{4462.02fd0a33.async.js → 2133.4f1a8aa3.async.js} +1 -1
  146. package/static/dist/{3730.3654e8fa.async.js → 2165.4f689026.async.js} +1 -1
  147. package/static/dist/{2506.a6334794.async.js → 2171.06fa2587.async.js} +1 -1
  148. package/static/dist/219.6cd1eb3b.async.js +1 -0
  149. package/static/dist/219.6cd1eb3b.async.js.gz +0 -0
  150. package/static/dist/2213.d93a456d.async.js +1 -0
  151. package/static/dist/2213.d93a456d.async.js.gz +0 -0
  152. package/static/dist/{591.1c6b5df7.async.js → 2237.d999da2f.async.js} +1 -1
  153. package/static/dist/2276.370615e4.chunk.css +1 -0
  154. package/static/dist/2276.370615e4.chunk.css.gz +0 -0
  155. package/static/dist/2276.8300bac5.async.js +1 -0
  156. package/static/dist/2276.8300bac5.async.js.gz +0 -0
  157. package/static/dist/2324.20bd306f.async.js +1 -0
  158. package/static/dist/2324.20bd306f.async.js.gz +0 -0
  159. package/static/dist/2326.c2d87fc3.async.js +1 -0
  160. package/static/dist/2326.c2d87fc3.async.js.gz +0 -0
  161. package/static/dist/2373.02455a57.async.js +1 -0
  162. package/static/dist/2424.3f14675e.async.js +1 -0
  163. package/static/dist/2424.3f14675e.async.js.gz +0 -0
  164. package/static/dist/2497.b8f4f24c.async.js +1 -0
  165. package/static/dist/263.a1f04da7.async.js +1 -0
  166. package/static/dist/263.a1f04da7.async.js.gz +0 -0
  167. package/static/dist/{4821.64537e48.async.js → 2733.9e525e7d.async.js} +1 -1
  168. package/static/dist/{8416.69691e31.async.js → 2773.ab860583.async.js} +1 -1
  169. package/static/dist/2789.0f375c90.async.js +1 -0
  170. package/static/dist/2789.0f375c90.async.js.gz +0 -0
  171. package/static/dist/2805.ab342353.async.js +1 -0
  172. package/static/dist/2805.ab342353.async.js.gz +0 -0
  173. package/static/dist/2835.bf469780.async.js +1 -0
  174. package/static/dist/2835.bf469780.async.js.gz +0 -0
  175. package/static/dist/2840.bd6bfc2f.async.js +1 -0
  176. package/static/dist/2840.bd6bfc2f.async.js.gz +0 -0
  177. package/static/dist/{5363.2fedc735.async.js → 2953.5bf0d335.async.js} +1 -1
  178. package/static/dist/2985.0dcb5919.async.js +1 -0
  179. package/static/dist/305.bda7c12a.async.js +1 -0
  180. package/static/dist/305.bda7c12a.async.js.gz +0 -0
  181. package/static/dist/314.a83f680b.async.js +1 -0
  182. package/static/dist/{5325.54777fe5.async.js → 3141.3981e6db.async.js} +1 -1
  183. package/static/dist/325.76b96b5f.async.js +1 -0
  184. package/static/dist/{4756.64d6d0a4.async.js → 3333.4f9d1af4.async.js} +1 -1
  185. package/static/dist/{7540.6bb57f5f.async.js → 3394.b3df0cfe.async.js} +1 -1
  186. package/static/dist/{6638.87a163d2.async.js → 3456.edb5cb58.async.js} +1 -1
  187. package/static/dist/3456.edb5cb58.async.js.gz +0 -0
  188. package/static/dist/{1969.d61ba5fb.async.js → 3679.83e4f620.async.js} +1 -1
  189. package/static/dist/{5759.45438497.async.js → 3765.0fae92bd.async.js} +1 -1
  190. package/static/dist/3875.f1302872.async.js +1 -0
  191. package/static/dist/3875.f1302872.async.js.gz +0 -0
  192. package/static/dist/{5232.f4b06476.async.js → 3877.8ee12c42.async.js} +1 -1
  193. package/static/dist/4069.dbfcdd8a.async.js +1 -0
  194. package/static/dist/4210.b6c5d985.async.js +1 -0
  195. package/static/dist/4210.b6c5d985.async.js.gz +0 -0
  196. package/static/dist/4293.6d8f5759.async.js +1 -0
  197. package/static/dist/{9082.9f6c6520.async.js → 4319.856b86a6.async.js} +1 -1
  198. package/static/dist/{8060.8b699029.async.js → 4351.2ba3f7f8.async.js} +1 -1
  199. package/static/dist/{4944.3be3e188.async.js → 4357.b7e15ffb.async.js} +1 -1
  200. package/static/dist/4427.fbb31d76.async.js +1 -0
  201. package/static/dist/4428.24e59f1f.async.js +1 -0
  202. package/static/dist/4428.24e59f1f.async.js.gz +0 -0
  203. package/static/dist/4429.66d7e41f.async.js +1 -0
  204. package/static/dist/{3617.b7d4b2ed.async.js → 4609.286111c5.async.js} +1 -1
  205. package/static/dist/4659.0597a258.async.js +1 -0
  206. package/static/dist/{9187.4bacb25e.async.js → 4719.cc69b2f2.async.js} +1 -1
  207. package/static/dist/{4507.8541bc6d.async.js → 4725.3fd118d4.async.js} +1 -1
  208. package/static/dist/{7846.7d689939.async.js → 4754.dad00196.async.js} +1 -1
  209. package/static/dist/4898.826fa9f5.async.js +1 -0
  210. package/static/dist/4898.826fa9f5.async.js.gz +0 -0
  211. package/static/dist/4956.38e3a6c2.async.js +1 -0
  212. package/static/dist/4956.38e3a6c2.async.js.gz +0 -0
  213. package/static/dist/4994.ef6ca2ba.async.js +1 -0
  214. package/static/dist/4994.ef6ca2ba.async.js.gz +0 -0
  215. package/static/dist/5029.322132ca.async.js +1 -0
  216. package/static/dist/5101.2d8cc112.async.js +1 -0
  217. package/static/dist/5177.19a47f75.async.js +1 -0
  218. package/static/dist/5307.b95ee226.async.js +1 -0
  219. package/static/dist/{8394.452e865e.async.js → 5323.a4649b86.async.js} +1 -1
  220. package/static/dist/5420.13afeb19.async.js +1 -0
  221. package/static/dist/5420.13afeb19.async.js.gz +0 -0
  222. package/static/dist/5456.c828e5b4.async.js +1 -0
  223. package/static/dist/5456.c828e5b4.async.js.gz +0 -0
  224. package/static/dist/{7272.1c73bcc5.async.js → 5573.2b4c3f53.async.js} +1 -1
  225. package/static/dist/5646.f0ebc19e.async.js +1 -0
  226. package/static/dist/5646.f0ebc19e.async.js.gz +0 -0
  227. package/static/dist/5672.0a858802.async.js +1 -0
  228. package/static/dist/5677.7969d6a6.async.js +1 -0
  229. package/static/dist/5677.7969d6a6.async.js.gz +0 -0
  230. package/static/dist/{2843.e968a7af.async.js → 5735.5ac81392.async.js} +1 -1
  231. package/static/dist/{3711.9814cb8c.async.js → 5829.858a67a0.async.js} +1 -1
  232. package/static/dist/5888.2e92bdee.async.js +1 -0
  233. package/static/dist/5888.2e92bdee.async.js.gz +0 -0
  234. package/static/dist/5904.f23cb541.async.js +1 -0
  235. package/static/dist/5904.f23cb541.async.js.gz +0 -0
  236. package/static/dist/5979.41d8d93d.async.js +1 -0
  237. package/static/dist/5979.41d8d93d.async.js.gz +0 -0
  238. package/static/dist/{4481.4d51cf36.async.js → 5983.843a4e79.async.js} +1 -1
  239. package/static/dist/{1212.f87fd07a.async.js → 5985.de461b85.async.js} +1 -1
  240. package/static/dist/5985.de461b85.async.js.gz +0 -0
  241. package/static/dist/6049.f95bb9f8.async.js +1 -0
  242. package/static/dist/6049.f95bb9f8.async.js.gz +0 -0
  243. package/static/dist/6070.b1fcc5b4.async.js +1 -0
  244. package/static/dist/6070.b1fcc5b4.async.js.gz +0 -0
  245. package/static/dist/6107.f62df6ae.async.js +1 -0
  246. package/static/dist/6107.f62df6ae.async.js.gz +0 -0
  247. package/static/dist/615.2c53dc81.async.js +1 -0
  248. package/static/dist/615.2c53dc81.async.js.gz +0 -0
  249. package/static/dist/617.d89eb389.async.js +1 -0
  250. package/static/dist/617.d89eb389.async.js.gz +0 -0
  251. package/static/dist/6186.b1eb8fa3.async.js +1 -0
  252. package/static/dist/6186.b1eb8fa3.async.js.gz +0 -0
  253. package/static/dist/{9853.695fdd64.async.js → 6262.d9fc0702.async.js} +1 -1
  254. package/static/dist/6397.cf1917b0.async.js +1 -0
  255. package/static/dist/64.5fe1900f.async.js +1 -0
  256. package/static/dist/{8526.bb556c43.async.js → 6413.3f27247d.async.js} +1 -1
  257. package/static/dist/{8038.58b0571f.async.js → 6437.65f88a1e.async.js} +1 -1
  258. package/static/dist/6457.ef8eb546.async.js +1 -0
  259. package/static/dist/6457.ef8eb546.async.js.gz +0 -0
  260. package/static/dist/6508.59f796e6.async.js +1 -0
  261. package/static/dist/6508.59f796e6.async.js.gz +0 -0
  262. package/static/dist/6511.b01e1a63.async.js +1 -0
  263. package/static/dist/6552.e15660f5.async.js +1 -0
  264. package/static/dist/6552.e15660f5.async.js.gz +0 -0
  265. package/static/dist/6593.6b4cc432.async.js +1 -0
  266. package/static/dist/{8025.7dc65c6a.async.js → 6661.13953d0c.async.js} +1 -1
  267. package/static/dist/667.1018a7d1.async.js +1 -0
  268. package/static/dist/667.1018a7d1.async.js.gz +0 -0
  269. package/static/dist/{9308.3202ac13.async.js → 6674.3f6cbfb7.async.js} +1 -1
  270. package/static/dist/6674.3f6cbfb7.async.js.gz +0 -0
  271. package/static/dist/{3714.8d6dba9e.async.js → 672.09e440db.async.js} +1 -1
  272. package/static/dist/672.09e440db.async.js.gz +0 -0
  273. package/static/dist/{8315.3c15bde0.async.js → 6773.f0165234.async.js} +1 -1
  274. package/static/dist/6956.954dcb7f.async.js +1 -0
  275. package/static/dist/6956.954dcb7f.async.js.gz +0 -0
  276. package/static/dist/6991.000de5eb.async.js +1 -0
  277. package/static/dist/6991.000de5eb.async.js.gz +0 -0
  278. package/static/dist/6999.333d97b6.async.js +1 -0
  279. package/static/dist/7045.45a9b0c4.async.js +1 -0
  280. package/static/dist/7045.45a9b0c4.async.js.gz +0 -0
  281. package/static/dist/7112.45d46596.async.js +1 -0
  282. package/static/dist/7112.45d46596.async.js.gz +0 -0
  283. package/static/dist/7158.f154d91b.async.js +1 -0
  284. package/static/dist/7171.8fba4715.async.js +1 -0
  285. package/static/dist/7171.8fba4715.async.js.gz +0 -0
  286. package/static/dist/{7993.ed86bf44.async.js → 7205.b5ce4f28.async.js} +1 -1
  287. package/static/dist/{5662.678b0cfb.async.js → 7247.28497f87.async.js} +1 -1
  288. package/static/dist/7247.28497f87.async.js.gz +0 -0
  289. package/static/dist/7329.4451ada2.async.js +1 -0
  290. package/static/dist/743.f9b3f021.async.js +1 -0
  291. package/static/dist/7468.f78fdcfa.async.js +1 -0
  292. package/static/dist/7468.f78fdcfa.async.js.gz +0 -0
  293. package/static/dist/7508.11799658.async.js +1 -0
  294. package/static/dist/7508.11799658.async.js.gz +0 -0
  295. package/static/dist/{2635.d4c59d23.async.js → 7559.eed2c5b6.async.js} +1 -1
  296. package/static/dist/7559.eed2c5b6.async.js.gz +0 -0
  297. package/static/dist/7573.6892e238.async.js +1 -0
  298. package/static/dist/7607.ac9cb836.async.js +1 -0
  299. package/static/dist/7607.ac9cb836.async.js.gz +0 -0
  300. package/static/dist/{2958.1a7daa3c.async.js → 7653.f22931b8.async.js} +1 -1
  301. package/static/dist/7681.cffb8dab.async.js +1 -0
  302. package/static/dist/7681.cffb8dab.async.js.gz +0 -0
  303. package/static/dist/{9974.c867bc89.async.js → 7701.fac6a316.async.js} +1 -1
  304. package/static/dist/7728.500760a1.async.js +1 -0
  305. package/static/dist/7728.500760a1.async.js.gz +0 -0
  306. package/static/dist/7783.d4562c70.async.js +1 -0
  307. package/static/dist/7783.d4562c70.async.js.gz +0 -0
  308. package/static/dist/{6431.c50479be.async.js → 7797.c5a79206.async.js} +1 -1
  309. package/static/dist/7845.fda583de.async.js +1 -0
  310. package/static/dist/7857.dbe75770.async.js +1 -0
  311. package/static/dist/7857.dbe75770.async.js.gz +0 -0
  312. package/static/dist/7869.2a318fd5.async.js +1 -0
  313. package/static/dist/7889.ba30e2bc.async.js +1 -0
  314. package/static/dist/7889.ba30e2bc.async.js.gz +0 -0
  315. package/static/dist/7901.7726d37e.async.js +1 -0
  316. package/static/dist/7907.b2699834.async.js +1 -0
  317. package/static/dist/{8878.8367da80.async.js → 7913.2f69ee1c.async.js} +1 -1
  318. package/static/dist/{6598.01b8b308.async.js → 8095.baec2da2.async.js} +1 -1
  319. package/static/dist/8111.d0c7a451.async.js +1 -0
  320. package/static/dist/8111.d0c7a451.async.js.gz +0 -0
  321. package/static/dist/8165.ff0c01a7.async.js +1 -0
  322. package/static/dist/{5580.48b4722f.async.js → 8357.907fff49.async.js} +1 -1
  323. package/static/dist/842.63fc6c73.async.js +1 -0
  324. package/static/dist/842.63fc6c73.async.js.gz +0 -0
  325. package/static/dist/8504.9cc2ad4b.async.js +1 -0
  326. package/static/dist/8504.9cc2ad4b.async.js.gz +0 -0
  327. package/static/dist/8516.636f0e95.async.js +1 -0
  328. package/static/dist/8516.636f0e95.async.js.gz +0 -0
  329. package/static/dist/8644.e25c61fa.async.js +1 -0
  330. package/static/dist/8644.e25c61fa.async.js.gz +0 -0
  331. package/static/dist/8703.1b747c44.async.js +1 -0
  332. package/static/dist/8703.1b747c44.async.js.gz +0 -0
  333. package/static/dist/8867.d6253060.async.js +1 -0
  334. package/static/dist/{5436.f2e37c36.async.js → 8893.8ead5819.async.js} +1 -1
  335. package/static/dist/{6437.91ff515b.async.js → 8917.9c54ed03.async.js} +1 -1
  336. package/static/dist/892.47158183.async.js +1 -0
  337. package/static/dist/892.47158183.async.js.gz +0 -0
  338. package/static/dist/9015.5b231e77.async.js +1 -0
  339. package/static/dist/9020.3a396f11.async.js +1 -0
  340. package/static/dist/9020.3a396f11.async.js.gz +0 -0
  341. package/static/dist/{6711.84451b08.async.js → 9081.437dcaea.async.js} +1 -1
  342. package/static/dist/{7647.e9446154.async.js → 9185.7591ccab.async.js} +1 -1
  343. package/static/dist/9211.c58d5083.async.js +1 -0
  344. package/static/dist/9211.c58d5083.async.js.gz +0 -0
  345. package/static/dist/{7036.fdeb74d0.async.js → 9219.c5962724.async.js} +1 -1
  346. package/static/dist/{1571.94ddca13.async.js → 9380.df4bce3e.async.js} +1 -1
  347. package/static/dist/9380.df4bce3e.async.js.gz +0 -0
  348. package/static/dist/9384.e0c1d949.async.js +1 -0
  349. package/static/dist/9384.e0c1d949.async.js.gz +0 -0
  350. package/static/dist/{8080.056470f6.async.js → 9445.3647dcaa.async.js} +1 -1
  351. package/static/dist/951.3aac61ca.async.js +1 -0
  352. package/static/dist/9541.8e2bab43.async.js +1 -0
  353. package/static/dist/9541.8e2bab43.async.js.gz +0 -0
  354. package/static/dist/9621.3a1a2777.async.js +1 -0
  355. package/static/dist/9645.d470c417.async.js +1 -0
  356. package/static/dist/9753.f947eb7b.async.js +1 -0
  357. package/static/dist/9816.1e9930f6.async.js +1 -0
  358. package/static/dist/9816.1e9930f6.async.js.gz +0 -0
  359. package/static/dist/{8682.597beedb.async.js → 9829.e4ba1956.async.js} +1 -1
  360. package/static/dist/{2905.a8f810e1.async.js → 9979.5f051cb4.async.js} +1 -1
  361. package/static/dist/index.html +3 -3
  362. package/static/dist/layouts__index.1f483079.async.js +1 -0
  363. package/static/dist/layouts__index.1f483079.async.js.gz +0 -0
  364. package/static/dist/layouts__index.32b9042a.chunk.css +1 -0
  365. package/static/dist/layouts__index.32b9042a.chunk.css.gz +0 -0
  366. package/static/dist/preload_helper.aed13b44.js +1 -0
  367. package/static/dist/{src__pages__404.3fd8332e.async.js → src__pages__404.c72d5253.async.js} +1 -1
  368. package/static/dist/src__pages__config__index.acb8e7a8.async.js +1 -0
  369. package/static/dist/src__pages__config__index.acb8e7a8.async.js.gz +0 -0
  370. package/static/dist/{src__pages__crontab__const.aba07deb.async.js → src__pages__crontab__const.3b7b55ae.async.js} +1 -1
  371. package/static/dist/src__pages__crontab__dailyResults.746e53f8.async.js +1 -0
  372. package/static/dist/src__pages__crontab__detail.a33259f9.async.js +1 -0
  373. package/static/dist/src__pages__crontab__detail.a33259f9.async.js.gz +0 -0
  374. package/static/dist/{src__pages__crontab__index.5bbea517.chunk.css → src__pages__crontab__index.9f12d3bf.chunk.css} +1 -1
  375. package/static/dist/src__pages__crontab__index.c3c551ca.async.js +1 -0
  376. package/static/dist/src__pages__crontab__index.c3c551ca.async.js.gz +0 -0
  377. package/static/dist/src__pages__crontab__instanceHistory.52c7b4b0.async.js +1 -0
  378. package/static/dist/src__pages__crontab__instanceHistory.52c7b4b0.async.js.gz +0 -0
  379. package/static/dist/src__pages__crontab__logModal.c95ea819.async.js +1 -0
  380. package/static/dist/src__pages__crontab__logModal.c95ea819.async.js.gz +0 -0
  381. package/static/dist/src__pages__crontab__modal.245ba7a7.async.js +1 -0
  382. package/static/dist/src__pages__crontab__modal.245ba7a7.async.js.gz +0 -0
  383. package/static/dist/src__pages__crontab__stopRequest.6a8d77ea.async.js +1 -0
  384. package/static/dist/src__pages__crontab__triggerList.33437e6a.async.js +1 -0
  385. package/static/dist/src__pages__crontab__triggerList.33437e6a.async.js.gz +0 -0
  386. package/static/dist/src__pages__crontab__triggerTiming.38d328c7.async.js +1 -0
  387. package/static/dist/src__pages__crontab__triggerTiming.38d328c7.async.js.gz +0 -0
  388. package/static/dist/src__pages__crontab__triggerUpdates.e1ddc531.async.js +1 -0
  389. package/static/dist/{src__pages__crontab__type.d7af36e5.async.js → src__pages__crontab__type.19dd8dd9.async.js} +1 -1
  390. package/static/dist/src__pages__crontab__viewCreateModal.ef74528f.async.js +1 -0
  391. package/static/dist/src__pages__crontab__viewCreateModal.ef74528f.async.js.gz +0 -0
  392. package/static/dist/src__pages__crontab__viewManageModal.8cc7f6c6.async.js +1 -0
  393. package/static/dist/src__pages__crontab__viewManageModal.8cc7f6c6.async.js.gz +0 -0
  394. package/static/dist/src__pages__dashboard__index.4f6a65e5.async.js +1 -0
  395. package/static/dist/src__pages__dashboard__index.4f6a65e5.async.js.gz +0 -0
  396. package/static/dist/src__pages__dashboard__index.de756a4f.chunk.css +1 -0
  397. package/static/dist/src__pages__dashboard__taskResultModal.971b6793.async.js +1 -0
  398. package/static/dist/src__pages__dashboard__timingStatistic.8edabcf4.async.js +1 -0
  399. package/static/dist/src__pages__dependence__index.ff16abd8.async.js +1 -0
  400. package/static/dist/src__pages__dependence__index.ff16abd8.async.js.gz +0 -0
  401. package/static/dist/src__pages__dependence__logModal.306e7477.async.js +1 -0
  402. package/static/dist/src__pages__dependence__logModal.306e7477.async.js.gz +0 -0
  403. package/static/dist/src__pages__dependence__modal.2e575a7d.async.js +1 -0
  404. package/static/dist/src__pages__dependence__modal.2e575a7d.async.js.gz +0 -0
  405. package/static/dist/{src__pages__dependence__type.e48c5c88.async.js → src__pages__dependence__type.20aded90.async.js} +1 -1
  406. package/static/dist/src__pages__diff__index.7e1f8cd9.async.js +1 -0
  407. package/static/dist/src__pages__diff__index.7e1f8cd9.async.js.gz +0 -0
  408. package/static/dist/src__pages__env__editNameModal.74e8a956.async.js +1 -0
  409. package/static/dist/src__pages__env__index.8e3c5a16.async.js +1 -0
  410. package/static/dist/src__pages__env__index.8e3c5a16.async.js.gz +0 -0
  411. package/static/dist/src__pages__env__modal.58e12beb.async.js +1 -0
  412. package/static/dist/src__pages__env__modal.58e12beb.async.js.gz +0 -0
  413. package/static/dist/src__pages__error__index.f943122d.async.js +1 -0
  414. package/static/dist/src__pages__initialization__index.163202cc.chunk.css +1 -0
  415. package/static/dist/src__pages__initialization__index.fa306f0a.async.js +1 -0
  416. package/static/dist/src__pages__initialization__index.fa306f0a.async.js.gz +0 -0
  417. package/static/dist/src__pages__log__index.c209ed9b.chunk.css +1 -0
  418. package/static/dist/src__pages__log__index.fc1b1063.async.js +1 -0
  419. package/static/dist/src__pages__log__index.fc1b1063.async.js.gz +0 -0
  420. package/static/dist/src__pages__login__index.65d17582.chunk.css +1 -0
  421. package/static/dist/src__pages__login__index.f8e99429.async.js +1 -0
  422. package/static/dist/src__pages__login__index.f8e99429.async.js.gz +0 -0
  423. package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.de7e61ca.async.js +1 -0
  424. package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.de7e61ca.async.js.gz +0 -0
  425. package/static/dist/src__pages__script__editModal.030adb78.async.js +1 -0
  426. package/static/dist/src__pages__script__editModal.030adb78.async.js.gz +0 -0
  427. package/static/dist/src__pages__script__editModal.0557fafc.chunk.css +1 -0
  428. package/static/dist/src__pages__script__editNameModal.0557fafc.chunk.css +1 -0
  429. package/static/dist/src__pages__script__editNameModal.4e4fad4a.async.js +1 -0
  430. package/static/dist/src__pages__script__editNameModal.4e4fad4a.async.js.gz +0 -0
  431. package/static/dist/{src__pages__script__historyDrawer.a449193a.chunk.css → src__pages__script__historyDrawer.0ab71b73.chunk.css} +1 -1
  432. package/static/dist/src__pages__script__historyDrawer.a6420226.async.js +1 -0
  433. package/static/dist/src__pages__script__historyDrawer.a6420226.async.js.gz +0 -0
  434. package/static/dist/src__pages__script__index.d4564ccf.chunk.css +1 -0
  435. package/static/dist/src__pages__script__index.f8d1b03e.async.js +1 -0
  436. package/static/dist/src__pages__script__index.f8d1b03e.async.js.gz +0 -0
  437. package/static/dist/src__pages__script__renameModal.640c223b.async.js +1 -0
  438. package/static/dist/src__pages__script__saveModal.2e5a1cda.async.js +1 -0
  439. package/static/dist/{src__pages__script__saveWithHistory.99ece830.async.js → src__pages__script__saveWithHistory.6e81e493.async.js} +1 -1
  440. package/static/dist/src__pages__script__setting.9b1efd4f.async.js +1 -0
  441. package/static/dist/src__pages__setting__about.96833c94.async.js +1 -0
  442. package/static/dist/src__pages__setting__about.96833c94.async.js.gz +0 -0
  443. package/static/dist/src__pages__setting__appModal.d52d8964.async.js +1 -0
  444. package/static/dist/src__pages__setting__checkUpdate.535b3f37.async.js +1 -0
  445. package/static/dist/src__pages__setting__checkUpdate.535b3f37.async.js.gz +0 -0
  446. package/static/dist/src__pages__setting__clientIp.bdec4d8d.async.js +1 -0
  447. package/static/dist/src__pages__setting__clientIp.bdec4d8d.async.js.gz +0 -0
  448. package/static/dist/src__pages__setting__dependence.5f2591d8.async.js +1 -0
  449. package/static/dist/src__pages__setting__dependence.5f2591d8.async.js.gz +0 -0
  450. package/static/dist/src__pages__setting__index.ef633884.async.js +1 -0
  451. package/static/dist/src__pages__setting__index.ef633884.async.js.gz +0 -0
  452. package/static/dist/src__pages__setting__loginLog.16ba8e6b.async.js +1 -0
  453. package/static/dist/src__pages__setting__loginLog.16ba8e6b.async.js.gz +0 -0
  454. package/static/dist/src__pages__setting__notification.f53f8d1e.async.js +1 -0
  455. package/static/dist/src__pages__setting__notifyLog.521431ce.async.js +1 -0
  456. package/static/dist/src__pages__setting__notifyLog.521431ce.async.js.gz +0 -0
  457. package/static/dist/src__pages__setting__other.e0a48d72.async.js +1 -0
  458. package/static/dist/src__pages__setting__other.e0a48d72.async.js.gz +0 -0
  459. package/static/dist/src__pages__setting__progress.354d7a2f.async.js +1 -0
  460. package/static/dist/src__pages__setting__security.2e8fd144.async.js +1 -0
  461. package/static/dist/src__pages__setting__security.2e8fd144.async.js.gz +0 -0
  462. package/static/dist/src__pages__setting__systemLog.7b116796.async.js +1 -0
  463. package/static/dist/src__pages__setting__systemLog.7b116796.async.js.gz +0 -0
  464. package/static/dist/src__pages__subscription__index.03e373fc.async.js +1 -0
  465. package/static/dist/src__pages__subscription__index.03e373fc.async.js.gz +0 -0
  466. package/static/dist/src__pages__subscription__logModal.903b015e.async.js +1 -0
  467. package/static/dist/src__pages__subscription__logModal.903b015e.async.js.gz +0 -0
  468. package/static/dist/src__pages__subscription__modal.6dec80af.async.js +1 -0
  469. package/static/dist/umi.70238455.css +1 -0
  470. package/static/dist/umi.70238455.css.gz +0 -0
  471. package/static/dist/umi.e0bcb75b.js +1 -0
  472. package/static/dist/umi.e0bcb75b.js.gz +0 -0
  473. package/version.yaml +7 -9
  474. package/static/dist/1089.0ecc5383.async.js +0 -1
  475. package/static/dist/1089.0ecc5383.async.js.gz +0 -0
  476. package/static/dist/1134.b851963c.async.js +0 -1
  477. package/static/dist/1174.41a43fee.async.js +0 -1
  478. package/static/dist/1174.41a43fee.async.js.gz +0 -0
  479. package/static/dist/119.89e2d610.async.js +0 -1
  480. package/static/dist/119.89e2d610.async.js.gz +0 -0
  481. package/static/dist/1192.4e5740f2.async.js +0 -1
  482. package/static/dist/1212.f87fd07a.async.js.gz +0 -0
  483. package/static/dist/1214.c6469b53.async.js +0 -1
  484. package/static/dist/1352.96a77e1d.async.js +0 -1
  485. package/static/dist/1352.96a77e1d.async.js.gz +0 -0
  486. package/static/dist/1379.f91563a1.async.js +0 -1
  487. package/static/dist/1379.f91563a1.async.js.gz +0 -0
  488. package/static/dist/1571.94ddca13.async.js.gz +0 -0
  489. package/static/dist/1706.ac98cb3f.async.js +0 -1
  490. package/static/dist/1706.ac98cb3f.async.js.gz +0 -0
  491. package/static/dist/1765.5ac01a93.async.js +0 -1
  492. package/static/dist/1765.5ac01a93.async.js.gz +0 -0
  493. package/static/dist/1836.f0b74cf1.async.js +0 -1
  494. package/static/dist/1836.f0b74cf1.async.js.gz +0 -0
  495. package/static/dist/1885.b8f427bf.async.js +0 -1
  496. package/static/dist/1885.b8f427bf.async.js.gz +0 -0
  497. package/static/dist/1887.9e0d3da8.async.js +0 -1
  498. package/static/dist/1887.9e0d3da8.async.js.gz +0 -0
  499. package/static/dist/198.db47fc1a.async.js +0 -1
  500. package/static/dist/198.db47fc1a.async.js.gz +0 -0
  501. package/static/dist/2003.8eafeca8.async.js +0 -1
  502. package/static/dist/2031.6af40025.async.js +0 -1
  503. package/static/dist/2231.29b754cf.async.js +0 -1
  504. package/static/dist/2325.dfa32834.async.js +0 -1
  505. package/static/dist/2325.dfa32834.async.js.gz +0 -0
  506. package/static/dist/2336.0756f45f.async.js +0 -1
  507. package/static/dist/2338.d678967d.async.js +0 -1
  508. package/static/dist/2338.d678967d.async.js.gz +0 -0
  509. package/static/dist/2372.b5a50ee7.async.js +0 -1
  510. package/static/dist/2372.b5a50ee7.async.js.gz +0 -0
  511. package/static/dist/2476.4e9b0992.async.js +0 -1
  512. package/static/dist/2476.4e9b0992.async.js.gz +0 -0
  513. package/static/dist/2537.2b262ee0.async.js +0 -1
  514. package/static/dist/2537.2b262ee0.async.js.gz +0 -0
  515. package/static/dist/2577.aa8fe709.async.js +0 -1
  516. package/static/dist/2577.aa8fe709.async.js.gz +0 -0
  517. package/static/dist/2635.d4c59d23.async.js.gz +0 -0
  518. package/static/dist/2636.70ece391.async.js +0 -1
  519. package/static/dist/2664.e69530fb.async.js +0 -1
  520. package/static/dist/2664.e69530fb.async.js.gz +0 -0
  521. package/static/dist/2693.51c2636b.async.js +0 -1
  522. package/static/dist/2693.51c2636b.async.js.gz +0 -0
  523. package/static/dist/2750.7aa38add.async.js +0 -1
  524. package/static/dist/2808.cdc0995c.async.js +0 -1
  525. package/static/dist/2808.cdc0995c.async.js.gz +0 -0
  526. package/static/dist/2821.651f31e5.async.js +0 -1
  527. package/static/dist/2821.651f31e5.async.js.gz +0 -0
  528. package/static/dist/2890.add55e85.async.js +0 -1
  529. package/static/dist/2890.add55e85.async.js.gz +0 -0
  530. package/static/dist/2901.6d0de54e.async.js +0 -1
  531. package/static/dist/2901.6d0de54e.async.js.gz +0 -0
  532. package/static/dist/292.27ce781f.async.js +0 -1
  533. package/static/dist/292.27ce781f.async.js.gz +0 -0
  534. package/static/dist/293.80d14a4f.async.js +0 -1
  535. package/static/dist/2986.4c49eef7.async.js +0 -1
  536. package/static/dist/300.08ac9875.async.js +0 -1
  537. package/static/dist/300.08ac9875.async.js.gz +0 -0
  538. package/static/dist/3055.a99f8e4c.async.js +0 -1
  539. package/static/dist/3191.3b7e4b42.async.js +0 -1
  540. package/static/dist/3191.3b7e4b42.async.js.gz +0 -0
  541. package/static/dist/3382.a584a111.async.js +0 -1
  542. package/static/dist/3382.a584a111.async.js.gz +0 -0
  543. package/static/dist/3383.041eee73.async.js +0 -1
  544. package/static/dist/3383.041eee73.async.js.gz +0 -0
  545. package/static/dist/3390.fb4b6851.async.js +0 -1
  546. package/static/dist/3481.333c2962.async.js +0 -1
  547. package/static/dist/3512.95e41255.async.js +0 -1
  548. package/static/dist/3512.95e41255.async.js.gz +0 -0
  549. package/static/dist/3714.8d6dba9e.async.js.gz +0 -0
  550. package/static/dist/3840.801ded2b.async.js +0 -1
  551. package/static/dist/3906.a5eee612.async.js +0 -1
  552. package/static/dist/3906.a5eee612.async.js.gz +0 -0
  553. package/static/dist/3948.4fe809fd.async.js +0 -1
  554. package/static/dist/3948.4fe809fd.async.js.gz +0 -0
  555. package/static/dist/4324.5a5887d1.async.js +0 -1
  556. package/static/dist/4324.5a5887d1.async.js.gz +0 -0
  557. package/static/dist/4559.faab3673.async.js +0 -1
  558. package/static/dist/4559.faab3673.async.js.gz +0 -0
  559. package/static/dist/4573.16f19278.async.js +0 -1
  560. package/static/dist/4573.16f19278.async.js.gz +0 -0
  561. package/static/dist/4736.7c4c489b.async.js +0 -1
  562. package/static/dist/4736.7c4c489b.async.js.gz +0 -0
  563. package/static/dist/4818.c83facd7.async.js +0 -1
  564. package/static/dist/4887.8e3ae573.async.js +0 -1
  565. package/static/dist/4887.8e3ae573.async.js.gz +0 -0
  566. package/static/dist/4934.f3539d08.async.js +0 -1
  567. package/static/dist/4934.f3539d08.async.js.gz +0 -0
  568. package/static/dist/5.3ebdd181.async.js +0 -1
  569. package/static/dist/5077.cbd111cd.async.js +0 -1
  570. package/static/dist/5077.cbd111cd.async.js.gz +0 -0
  571. package/static/dist/5157.7c5af144.async.js +0 -1
  572. package/static/dist/540.19ddf020.async.js +0 -1
  573. package/static/dist/5481.e2945a63.async.js +0 -1
  574. package/static/dist/5481.e2945a63.async.js.gz +0 -0
  575. package/static/dist/5662.678b0cfb.async.js.gz +0 -0
  576. package/static/dist/5970.5862e59e.async.js +0 -1
  577. package/static/dist/5970.5862e59e.async.js.gz +0 -0
  578. package/static/dist/6013.db535339.async.js +0 -1
  579. package/static/dist/6013.db535339.async.js.gz +0 -0
  580. package/static/dist/6016.1e6574b6.async.js +0 -1
  581. package/static/dist/6035.32ebfad9.async.js +0 -1
  582. package/static/dist/6035.32ebfad9.async.js.gz +0 -0
  583. package/static/dist/6212.e056fb2d.async.js +0 -1
  584. package/static/dist/6212.e056fb2d.async.js.gz +0 -0
  585. package/static/dist/6341.673fb65c.async.js +0 -1
  586. package/static/dist/6341.673fb65c.async.js.gz +0 -0
  587. package/static/dist/6367.8b0e838c.async.js +0 -1
  588. package/static/dist/6367.8b0e838c.async.js.gz +0 -0
  589. package/static/dist/6569.55177f6a.async.js +0 -1
  590. package/static/dist/6569.55177f6a.async.js.gz +0 -0
  591. package/static/dist/6610.c111af7e.async.js +0 -1
  592. package/static/dist/6610.c111af7e.async.js.gz +0 -0
  593. package/static/dist/6636.fed84003.async.js +0 -1
  594. package/static/dist/6636.fed84003.async.js.gz +0 -0
  595. package/static/dist/6638.87a163d2.async.js.gz +0 -0
  596. package/static/dist/6646.95e92533.async.js +0 -1
  597. package/static/dist/6646.95e92533.async.js.gz +0 -0
  598. package/static/dist/6665.1d099ad1.async.js +0 -1
  599. package/static/dist/685.2419bacf.async.js +0 -1
  600. package/static/dist/6872.fcc9ce17.async.js +0 -1
  601. package/static/dist/6872.fcc9ce17.async.js.gz +0 -0
  602. package/static/dist/691.187a388c.async.js +0 -1
  603. package/static/dist/691.187a388c.async.js.gz +0 -0
  604. package/static/dist/7146.4dc150b1.async.js +0 -1
  605. package/static/dist/7146.4dc150b1.async.js.gz +0 -0
  606. package/static/dist/7231.f7e5b668.async.js +0 -1
  607. package/static/dist/7231.f7e5b668.async.js.gz +0 -0
  608. package/static/dist/7253.4b9bf133.async.js +0 -1
  609. package/static/dist/7253.4b9bf133.async.js.gz +0 -0
  610. package/static/dist/7278.96bf439f.async.js +0 -1
  611. package/static/dist/7278.96bf439f.async.js.gz +0 -0
  612. package/static/dist/7285.d561cf26.async.js +0 -1
  613. package/static/dist/7355.fca746f5.async.js +0 -1
  614. package/static/dist/7355.fca746f5.async.js.gz +0 -0
  615. package/static/dist/7384.1bb449d5.async.js +0 -1
  616. package/static/dist/7384.1bb449d5.async.js.gz +0 -0
  617. package/static/dist/7441.ee1bf2bb.async.js +0 -1
  618. package/static/dist/7508.3fffed15.chunk.css +0 -1
  619. package/static/dist/7508.3fffed15.chunk.css.gz +0 -0
  620. package/static/dist/7508.d90eac63.async.js +0 -1
  621. package/static/dist/7508.d90eac63.async.js.gz +0 -0
  622. package/static/dist/752.66fdc531.async.js +0 -1
  623. package/static/dist/7714.1e826854.async.js +0 -1
  624. package/static/dist/7802.34255805.async.js +0 -1
  625. package/static/dist/7802.34255805.async.js.gz +0 -0
  626. package/static/dist/7984.eaac7402.async.js +0 -1
  627. package/static/dist/7984.eaac7402.async.js.gz +0 -0
  628. package/static/dist/8033.5cb31493.async.js +0 -1
  629. package/static/dist/8033.5cb31493.async.js.gz +0 -0
  630. package/static/dist/8078.8586c875.async.js +0 -1
  631. package/static/dist/8078.8586c875.async.js.gz +0 -0
  632. package/static/dist/8142.a074ddf1.async.js +0 -1
  633. package/static/dist/8147.2fb55202.async.js +0 -1
  634. package/static/dist/8147.2fb55202.async.js.gz +0 -0
  635. package/static/dist/8187.48c130d6.async.js +0 -1
  636. package/static/dist/8187.48c130d6.async.js.gz +0 -0
  637. package/static/dist/831.9756b44d.async.js +0 -1
  638. package/static/dist/8495.d53e15ca.async.js +0 -1
  639. package/static/dist/8495.d53e15ca.async.js.gz +0 -0
  640. package/static/dist/8587.315b06c0.async.js +0 -1
  641. package/static/dist/8776.e8798a5a.async.js +0 -1
  642. package/static/dist/8779.3e755010.async.js +0 -1
  643. package/static/dist/8844.a0fef08e.async.js +0 -1
  644. package/static/dist/8844.a0fef08e.async.js.gz +0 -0
  645. package/static/dist/8865.ed665d31.async.js +0 -1
  646. package/static/dist/901.7ee5c6d3.async.js +0 -1
  647. package/static/dist/9033.f2e29d04.async.js +0 -1
  648. package/static/dist/9095.816eeb1a.async.js +0 -1
  649. package/static/dist/9271.231db2ce.async.js +0 -1
  650. package/static/dist/9308.3202ac13.async.js.gz +0 -0
  651. package/static/dist/9323.a33f47da.async.js +0 -1
  652. package/static/dist/9323.a33f47da.async.js.gz +0 -0
  653. package/static/dist/965.8d9b1fbd.async.js +0 -1
  654. package/static/dist/965.8d9b1fbd.async.js.gz +0 -0
  655. package/static/dist/9730.801665a3.async.js +0 -1
  656. package/static/dist/9761.360a19d8.async.js +0 -1
  657. package/static/dist/9761.360a19d8.async.js.gz +0 -0
  658. package/static/dist/layouts__index.86b6bcbe.chunk.css +0 -1
  659. package/static/dist/layouts__index.86b6bcbe.chunk.css.gz +0 -0
  660. package/static/dist/layouts__index.c8e9788e.async.js +0 -1
  661. package/static/dist/layouts__index.c8e9788e.async.js.gz +0 -0
  662. package/static/dist/preload_helper.a71416e6.js +0 -1
  663. package/static/dist/src__pages__config__index.088ddd9d.async.js +0 -1
  664. package/static/dist/src__pages__config__index.088ddd9d.async.js.gz +0 -0
  665. package/static/dist/src__pages__crontab__detail.88729e8f.async.js +0 -1
  666. package/static/dist/src__pages__crontab__detail.88729e8f.async.js.gz +0 -0
  667. package/static/dist/src__pages__crontab__index.b0ae0f99.async.js +0 -1
  668. package/static/dist/src__pages__crontab__index.b0ae0f99.async.js.gz +0 -0
  669. package/static/dist/src__pages__crontab__logModal.930535e2.async.js +0 -1
  670. package/static/dist/src__pages__crontab__logModal.930535e2.async.js.gz +0 -0
  671. package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js +0 -1
  672. package/static/dist/src__pages__crontab__modal.a2c8fdcc.async.js.gz +0 -0
  673. package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js +0 -1
  674. package/static/dist/src__pages__crontab__viewCreateModal.7b4f9cbe.async.js.gz +0 -0
  675. package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js +0 -1
  676. package/static/dist/src__pages__crontab__viewManageModal.cd454ea0.async.js.gz +0 -0
  677. package/static/dist/src__pages__dashboard__index.c05ce904.async.js +0 -1
  678. package/static/dist/src__pages__dashboard__index.c05ce904.async.js.gz +0 -0
  679. package/static/dist/src__pages__dashboard__taskResultModal.7795d6e1.async.js +0 -1
  680. package/static/dist/src__pages__dependence__index.edad6a53.async.js +0 -1
  681. package/static/dist/src__pages__dependence__index.edad6a53.async.js.gz +0 -0
  682. package/static/dist/src__pages__dependence__logModal.01729f63.async.js +0 -1
  683. package/static/dist/src__pages__dependence__logModal.01729f63.async.js.gz +0 -0
  684. package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js +0 -1
  685. package/static/dist/src__pages__dependence__modal.ef7ae53b.async.js.gz +0 -0
  686. package/static/dist/src__pages__diff__index.4233ea93.async.js +0 -1
  687. package/static/dist/src__pages__diff__index.4233ea93.async.js.gz +0 -0
  688. package/static/dist/src__pages__env__editNameModal.c13d47d2.async.js +0 -1
  689. package/static/dist/src__pages__env__index.c236a754.async.js +0 -1
  690. package/static/dist/src__pages__env__index.c236a754.async.js.gz +0 -0
  691. package/static/dist/src__pages__env__modal.4d71adb3.async.js +0 -1
  692. package/static/dist/src__pages__env__modal.4d71adb3.async.js.gz +0 -0
  693. package/static/dist/src__pages__error__index.66605c72.async.js +0 -1
  694. package/static/dist/src__pages__initialization__index.66819338.chunk.css +0 -1
  695. package/static/dist/src__pages__initialization__index.d4d89bf9.async.js +0 -1
  696. package/static/dist/src__pages__initialization__index.d4d89bf9.async.js.gz +0 -0
  697. package/static/dist/src__pages__log__index.71250e0d.async.js +0 -1
  698. package/static/dist/src__pages__log__index.71250e0d.async.js.gz +0 -0
  699. package/static/dist/src__pages__log__index.9f2eae80.chunk.css +0 -1
  700. package/static/dist/src__pages__login__index.58bb4b38.async.js +0 -1
  701. package/static/dist/src__pages__login__index.58bb4b38.async.js.gz +0 -0
  702. package/static/dist/src__pages__login__index.d00b91e8.chunk.css +0 -1
  703. package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js +0 -1
  704. package/static/dist/src__pages__script__components__UnsupportedFilePreview__index.c347a13a.async.js.gz +0 -0
  705. package/static/dist/src__pages__script__editModal.785f8431.async.js +0 -1
  706. package/static/dist/src__pages__script__editModal.785f8431.async.js.gz +0 -0
  707. package/static/dist/src__pages__script__editNameModal.789ad87b.async.js +0 -1
  708. package/static/dist/src__pages__script__editNameModal.789ad87b.async.js.gz +0 -0
  709. package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js +0 -1
  710. package/static/dist/src__pages__script__historyDrawer.8c58d958.async.js.gz +0 -0
  711. package/static/dist/src__pages__script__index.3e142045.async.js +0 -1
  712. package/static/dist/src__pages__script__index.3e142045.async.js.gz +0 -0
  713. package/static/dist/src__pages__script__index.ab360776.chunk.css +0 -1
  714. package/static/dist/src__pages__script__renameModal.0ab029e7.async.js +0 -1
  715. package/static/dist/src__pages__script__saveModal.8fca1a22.async.js +0 -1
  716. package/static/dist/src__pages__script__setting.35ad4f02.async.js +0 -1
  717. package/static/dist/src__pages__setting__about.3d3c019f.async.js +0 -1
  718. package/static/dist/src__pages__setting__about.3d3c019f.async.js.gz +0 -0
  719. package/static/dist/src__pages__setting__appModal.7eaeb9d3.async.js +0 -1
  720. package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js +0 -1
  721. package/static/dist/src__pages__setting__checkUpdate.429a42f3.async.js.gz +0 -0
  722. package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js +0 -1
  723. package/static/dist/src__pages__setting__clientIp.3a8711ed.async.js.gz +0 -0
  724. package/static/dist/src__pages__setting__dependence.c227c0f5.async.js +0 -1
  725. package/static/dist/src__pages__setting__dependence.c227c0f5.async.js.gz +0 -0
  726. package/static/dist/src__pages__setting__index.c5615182.async.js +0 -1
  727. package/static/dist/src__pages__setting__index.c5615182.async.js.gz +0 -0
  728. package/static/dist/src__pages__setting__loginLog.ef135f19.async.js +0 -1
  729. package/static/dist/src__pages__setting__loginLog.ef135f19.async.js.gz +0 -0
  730. package/static/dist/src__pages__setting__notification.2ffe4e5a.async.js +0 -1
  731. package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js +0 -1
  732. package/static/dist/src__pages__setting__notifyLog.5ef5b578.async.js.gz +0 -0
  733. package/static/dist/src__pages__setting__other.e744c0d1.async.js +0 -1
  734. package/static/dist/src__pages__setting__other.e744c0d1.async.js.gz +0 -0
  735. package/static/dist/src__pages__setting__progress.2ccae3d7.async.js +0 -1
  736. package/static/dist/src__pages__setting__security.e2d71ebb.async.js +0 -1
  737. package/static/dist/src__pages__setting__security.e2d71ebb.async.js.gz +0 -0
  738. package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js +0 -1
  739. package/static/dist/src__pages__setting__systemLog.000bcb5e.async.js.gz +0 -0
  740. package/static/dist/src__pages__subscription__index.f556ae4c.async.js +0 -1
  741. package/static/dist/src__pages__subscription__index.f556ae4c.async.js.gz +0 -0
  742. package/static/dist/src__pages__subscription__logModal.cdba5139.async.js +0 -1
  743. package/static/dist/src__pages__subscription__logModal.cdba5139.async.js.gz +0 -0
  744. package/static/dist/src__pages__subscription__modal.8f04f506.async.js +0 -1
  745. package/static/dist/umi.a4d14b92.css +0 -1
  746. package/static/dist/umi.a4d14b92.css.gz +0 -0
  747. package/static/dist/umi.cf08844a.js +0 -1
  748. package/static/dist/umi.cf08844a.js.gz +0 -0
  749. /package/static/dist/{1883.675b6a18.chunk.css → 3012.675b6a18.chunk.css} +0 -0
  750. /package/static/dist/{1883.675b6a18.chunk.css.gz → 3012.675b6a18.chunk.css.gz} +0 -0
  751. /package/static/dist/{292.1b962b29.chunk.css → 6049.1b962b29.chunk.css} +0 -0
  752. /package/static/dist/{292.1b962b29.chunk.css.gz → 6049.1b962b29.chunk.css.gz} +0 -0
@@ -15,6 +15,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  return (mod && mod.__esModule) ? mod : { "default": mod };
16
16
  };
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
+ const systemScheduleAudit_1 = require("../shared/systemScheduleAudit");
19
+ const cronOperand_1 = require("../shared/cronOperand");
20
+ const errors_1 = require("../shared/errors");
21
+ const shellQuote_1 = require("../shared/shellQuote");
22
+ const cronProcess_1 = require("../shared/cronProcess");
23
+ const triggerHistory_1 = require("../shared/triggerHistory");
18
24
  const crypto_1 = require("crypto");
19
25
  const cronSchedule_1 = require("../shared/cronSchedule");
20
26
  const schedulerMutationLock_1 = require("../shared/schedulerMutationLock");
@@ -32,28 +38,72 @@ const path_1 = __importDefault(require("path"));
32
38
  const const_1 = require("../config/const");
33
39
  const client_1 = __importDefault(require("../schedule/client"));
34
40
  const pLimit_1 = __importDefault(require("../shared/pLimit"));
35
- const cross_spawn_1 = require("cross-spawn");
36
41
  const dayjs_1 = __importDefault(require("dayjs"));
37
42
  const pickBy_1 = __importDefault(require("lodash/pickBy"));
38
- const omit_1 = __importDefault(require("lodash/omit"));
39
43
  const utils_1 = require("../shared/utils");
40
44
  const i18n_1 = require("../shared/i18n");
41
45
  const schedule_1 = require("../interface/schedule");
42
46
  const logStreamManager_1 = require("../shared/logStreamManager");
47
+ const cronCommandProcess_1 = require("../shared/cronCommandProcess");
43
48
  const childProcess_1 = require("../shared/childProcess");
44
49
  const lodash_1 = require("lodash");
45
50
  const logReader_1 = require("../shared/logReader");
46
51
  const fileAccess_1 = require("../shared/fileAccess");
52
+ // Queue membership belongs to the trigger. Expose it for list/detail reads
53
+ // without writing it into the manual-run reservation used by the scheduler.
54
+ const visibleStatus = (0, sequelize_1.literal)(`CASE
55
+ WHEN EXISTS (SELECT 1 FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'running') THEN 0
56
+ WHEN "Crontab"."status" = 1 AND EXISTS (
57
+ SELECT 1 FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'queued'
58
+ ) THEN 3
59
+ ELSE "Crontab"."status" END`);
60
+ const visibleAttributes = {
61
+ exclude: ['status'], include: [[visibleStatus, 'status']],
62
+ };
63
+ // Resolve status and log ownership in one SQLite snapshot. A running trigger
64
+ // can be visible before its shell has published the file for this execution.
65
+ const activeLogTrigger = `FROM CronTriggers WHERE cron_id = "Crontab"."id"
66
+ AND state = 'running' ORDER BY started_at DESC, rowid DESC LIMIT 1`;
67
+ const logAttributes = [
68
+ 'log_name', [visibleStatus, 'status'],
69
+ [(0, sequelize_1.literal)(`CASE WHEN EXISTS (SELECT 1 ${activeLogTrigger})
70
+ THEN (SELECT log_path ${activeLogTrigger}) ELSE "Crontab"."log_path" END`), 'log_path'],
71
+ [(0, sequelize_1.literal)(`CASE WHEN allow_multiple_instances = 1 THEN COALESCE(
72
+ (SELECT id ${activeLogTrigger}),
73
+ (SELECT id FROM CronTriggers WHERE cron_id = "Crontab"."id" AND state = 'queued'
74
+ ORDER BY observed_at DESC, rowid DESC LIMIT 1)
75
+ ) END`), 'logTriggerId'],
76
+ ];
77
+ function shellValue(value) {
78
+ return /^[a-zA-Z0-9_./-]+$/.test(value) ? value : (0, shellQuote_1.shellQuote)(value);
79
+ }
80
+ function statusFilter(values, exclude, forDisplay) {
81
+ const column = forDisplay ? visibleStatus : (0, sequelize_1.col)('status');
82
+ const disabled = values.includes(cron_1.CrontabStatus.disabled);
83
+ if (exclude) {
84
+ return { [sequelize_1.Op.and]: [
85
+ { [sequelize_1.Op.or]: [(0, sequelize_1.where)(column, { [sequelize_1.Op.notIn]: values }), (0, sequelize_1.where)(column, { [sequelize_1.Op.is]: null })] },
86
+ ...(disabled ? [{ isDisabled: { [sequelize_1.Op.ne]: 1 } }] : []),
87
+ ] };
88
+ }
89
+ const matches = (0, sequelize_1.where)(column, { [sequelize_1.Op.in]: values });
90
+ return disabled
91
+ ? { [sequelize_1.Op.or]: [matches, { isDisabled: 1 }] }
92
+ : { [sequelize_1.Op.and]: [matches, { isDisabled: 0 }] };
93
+ }
47
94
  let CronService = class CronService {
48
95
  constructor(logger) {
49
96
  this.logger = logger;
97
+ this.stoppingBatches = new Map();
98
+ this.stoppingInstances = new Map();
50
99
  }
51
100
  isNodeCron(cron) {
52
101
  const { schedule, extra_schedules } = cron;
53
102
  const fields = (schedule === null || schedule === void 0 ? void 0 : schedule.trim().split(/\s+/)) || [];
54
103
  // System crontab only receives portable numeric five-field expressions.
55
104
  // Extended syntax, macros and legacy shorthand use the Node scheduler.
56
- return (fields.length !== 5 ||
105
+ return (Boolean(cron.max_queue_wait || cron.catchup_seconds || cron.skip_if_pending) ||
106
+ fields.length !== 5 ||
57
107
  /[^\d\s*,/\-]/.test(schedule || '') ||
58
108
  Boolean(extra_schedules === null || extra_schedules === void 0 ? void 0 : extra_schedules.length) ||
59
109
  // BusyBox treats N/step as a single value and doesn't support Sunday=7.
@@ -98,23 +148,17 @@ let CronService = class CronService {
98
148
  if (log_name === '/dev/null') {
99
149
  return log_name;
100
150
  }
101
- let uniqPath = await (0, util_1.getUniqPath)(command, `${id}`);
102
- if (log_name) {
103
- const normalizedLogName = log_name.startsWith('/')
104
- ? log_name
105
- : path_1.default.join(config_1.default.logPath, log_name);
106
- if (normalizedLogName.startsWith(config_1.default.logPath)) {
107
- uniqPath = log_name;
108
- }
109
- }
110
- const logDirPath = path_1.default.resolve(config_1.default.logPath, `${uniqPath}`);
151
+ const candidate = log_name || await (0, util_1.getUniqPath)(command, `${id}`);
152
+ const logDirPath = (0, logPath_1.resolveLogPath)(config_1.default.logPath, candidate);
111
153
  await promises_1.default.mkdir(logDirPath, { recursive: true });
112
- return uniqPath;
154
+ // Shell joins the returned value to dir_log. Normalize old absolute names once.
155
+ return path_1.default.relative(config_1.default.logPath, logDirPath);
113
156
  }
114
157
  async create(payload) {
115
158
  return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
116
159
  const tab = new cron_1.Crontab(payload);
117
160
  tab.saved = false;
161
+ tab.recovery_from = Date.now();
118
162
  tab.log_name = await this.getLogName(tab);
119
163
  const doc = await this.insert(tab);
120
164
  if ((0, util_1.isDemoEnv)()) {
@@ -129,6 +173,10 @@ let CronService = class CronService {
129
173
  schedule: doc.schedule,
130
174
  command: this.makeCommand(doc),
131
175
  extra_schedules: doc.extra_schedules || [],
176
+ max_queue_wait: doc.max_queue_wait,
177
+ skip_if_pending: Boolean(doc.skip_if_pending),
178
+ catchup_seconds: doc.catchup_seconds,
179
+ recovery_from: doc.recovery_from,
132
180
  },
133
181
  ]);
134
182
  }
@@ -140,7 +188,16 @@ let CronService = class CronService {
140
188
  throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务创建已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
141
189
  }
142
190
  }
143
- await this.setCrontab();
191
+ try {
192
+ await this.setCrontab(undefined, [doc.id]);
193
+ }
194
+ catch (error) {
195
+ if (error.status === 503) {
196
+ throw new errors_1.PendingCronInstall(doc.id, (0, childProcess_1.asError)(error).message);
197
+ }
198
+ throw error;
199
+ }
200
+ doc.saved = true;
144
201
  return doc;
145
202
  });
146
203
  }
@@ -152,118 +209,133 @@ let CronService = class CronService {
152
209
  const doc = await this.getDb({ id: payload.id });
153
210
  const tab = new cron_1.Crontab(Object.assign(Object.assign({}, doc), payload));
154
211
  tab.saved = false;
212
+ tab.recovery_from = Math.max(Date.now(), Number(doc.recovery_from || 0) + 1);
155
213
  tab.log_name = await this.getLogName(tab);
156
- if (doc.isDisabled === 1 || (0, util_1.isDemoEnv)()) {
214
+ if ((0, util_1.isDemoEnv)()) {
215
+ tab.saved = doc.saved;
157
216
  return await this.updateDb(tab);
158
217
  }
159
- // Keep the DB snapshot unchanged if deletion has an uncertain outcome.
160
- // Recovery uses that snapshot after this mutation releases its lock.
161
- await client_1.default.delCron([String(doc.id)]);
162
- const newDoc = await this.updateDb(tab);
163
- if (this.shouldUseCronClient(newDoc)) {
218
+ if (doc.isDisabled === 1) {
219
+ const updated = await this.updateDb(tab);
220
+ await this.setCrontab(undefined, [doc.id]);
221
+ updated.saved = true;
222
+ return updated;
223
+ }
224
+ const register = (row) => client_1.default.addCron([{
225
+ name: row.name || '', id: String(row.id), schedule: row.schedule,
226
+ command: this.makeCommand(row), extra_schedules: row.extra_schedules || [],
227
+ max_queue_wait: row.max_queue_wait, skip_if_pending: Boolean(row.skip_if_pending),
228
+ catchup_seconds: row.catchup_seconds, recovery_from: row.recovery_from,
229
+ }]);
230
+ const restoreTimer = async () => {
231
+ if (!this.shouldUseCronClient(doc))
232
+ return;
164
233
  try {
165
- await client_1.default.addCron([
166
- {
167
- name: doc.name || '',
168
- id: String(newDoc.id),
169
- schedule: newDoc.schedule,
170
- command: this.makeCommand(newDoc),
171
- extra_schedules: newDoc.extra_schedules || [],
172
- },
173
- ]);
234
+ await register(doc);
235
+ }
236
+ catch (error) {
237
+ client_1.default.readiness.invalidate();
238
+ await cron_1.CrontabModel.update({ saved: false }, { where: { id: doc.id } });
239
+ throw Object.assign(new Error((0, i18n_1.t)('原调度未能恢复,正在重试'), { cause: error }), { status: 503 });
240
+ }
241
+ };
242
+ // addCron stages and atomically replaces a Node timer. Never tear down the
243
+ // old timer for a Node-to-Node edit that the database may still reject.
244
+ const handOff = this.shouldUseCronClient(doc) && !this.shouldUseCronClient(tab);
245
+ if (handOff)
246
+ await client_1.default.delCron([String(doc.id)]);
247
+ let newDoc;
248
+ try {
249
+ newDoc = await this.updateDb(tab);
250
+ }
251
+ catch (error) {
252
+ if (handOff)
253
+ await restoreTimer();
254
+ throw error;
255
+ }
256
+ const useNode = this.shouldUseCronClient(newDoc);
257
+ const movingFromSystem = useNode && !this.shouldUseCronClient(doc) && !this.isSpecialSchedule(doc.schedule);
258
+ // Remove the previous system entry before the new Node timer can fire.
259
+ if (movingFromSystem)
260
+ await this.setCrontab();
261
+ if (useNode) {
262
+ try {
263
+ await register(newDoc);
174
264
  }
175
265
  catch (error) {
176
266
  // gRPC 注册新任务失败 → 回滚 DB 到旧数据,并尝试恢复旧调度注册
177
- await cron_1.CrontabModel.update((0, omit_1.default)(doc, ['queued_token']), {
178
- where: { id: doc.id },
179
- });
180
- if (this.shouldUseCronClient(doc)) {
181
- try {
182
- await client_1.default.addCron([
183
- {
184
- name: doc.name || '',
185
- id: String(doc.id),
186
- schedule: doc.schedule,
187
- command: this.makeCommand(doc),
188
- extra_schedules: doc.extra_schedules || [],
189
- },
190
- ]);
191
- }
192
- catch (_recoveryError) {
193
- this.logger.warn('[crontab] Failed to restore old cron job in scheduler after rollback:', (_recoveryError === null || _recoveryError === void 0 ? void 0 : _recoveryError.message) || _recoveryError);
194
- }
267
+ await this.updateDb(doc);
268
+ await restoreTimer();
269
+ if (movingFromSystem) {
270
+ await cron_1.CrontabModel.update({ saved: false }, { where: { id: doc.id } });
271
+ await this.setCrontab(undefined, [doc.id]);
195
272
  }
196
273
  this.logger.error('[crontab] Failed to register updated cron job in scheduler, update rolled back:', (error === null || error === void 0 ? void 0 : error.message) || error);
197
274
  throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务更新已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
198
275
  }
199
276
  }
200
- await this.setCrontab();
277
+ if (movingFromSystem)
278
+ await cron_1.CrontabModel.update({ saved: true }, { where: { id: doc.id } });
279
+ else
280
+ await this.setCrontab(undefined, [doc.id]);
281
+ newDoc.saved = true;
201
282
  return newDoc;
202
283
  });
203
284
  }
204
285
  async updateDb(payload) {
205
- await cron_1.CrontabModel.update(payload, { where: { id: payload.id } });
286
+ // A concurrent dispatch owns the runtime fields, including during rollback.
287
+ await cron_1.CrontabModel.update(payload, {
288
+ where: { id: payload.id },
289
+ fields: ['name', 'command', 'schedule', 'timestamp', 'saved', 'labels', 'sub_id',
290
+ 'extra_schedules', 'task_before', 'task_after', 'log_name', 'work_dir',
291
+ 'allow_multiple_instances', 'skip_if_pending', 'max_queue_wait', 'catchup_seconds', 'recovery_from'],
292
+ });
206
293
  return await this.getDb({ id: payload.id });
207
294
  }
208
- async status({ ids, status, pid, log_path, last_running_time = 0, last_execution_time = 0, exit_code, }) {
295
+ async status({ ids, status, pid, log_path, last_running_time, last_execution_time = 0, exit_code, trigger_id, trigger_stopped, finished_at, }) {
209
296
  if (log_path && log_path !== '/dev/null') {
210
297
  (0, logPath_1.resolveLogPath)(config_1.default.logPath, log_path);
211
298
  }
212
- let options = {
299
+ const options = {
213
300
  status,
214
301
  pid,
215
302
  log_path,
216
303
  last_execution_time,
217
304
  };
218
- if (last_running_time > 0) {
305
+ if (last_running_time != null && last_running_time > 0) {
219
306
  options.last_running_time = last_running_time;
220
307
  }
221
308
  for (const id of ids) {
222
- let cron;
223
- try {
224
- cron = await this.getDb({ id });
225
- }
226
- catch (err) { }
227
- if (!cron) {
309
+ if (!await cron_1.CrontabModel.findByPk(id, { attributes: ['id'] }))
310
+ continue;
311
+ if (trigger_id && [cron_1.CrontabStatus.running, cron_1.CrontabStatus.idle].includes(status)) {
312
+ await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).reportInstance(trigger_id, id, status === cron_1.CrontabStatus.running, pid, log_path, last_execution_time, last_running_time, exit_code, trigger_stopped, finished_at);
228
313
  continue;
229
314
  }
230
- if (status === cron_1.CrontabStatus.idle && log_path !== cron.log_path) {
231
- options = (0, omit_1.default)(options, ['status', 'log_path', 'pid']);
232
- }
233
- // Manage RunningInstance records for status transitions from shell scripts
234
- if (status === cron_1.CrontabStatus.running) {
235
- // Create a new running instance record
236
- await runningInstance_1.RunningInstanceModel.create({
237
- cron_id: id,
238
- pid: pid || undefined,
239
- log_path: log_path || undefined,
240
- started_at: last_execution_time || (0, dayjs_1.default)().unix(),
241
- status: runningInstance_1.InstanceStatus.running,
242
- });
243
- }
244
- else if (status === cron_1.CrontabStatus.idle) {
245
- // Mark the matching running instance as finished
246
- const finishedAt = (0, dayjs_1.default)().unix();
247
- const instanceStatus = exit_code !== undefined && exit_code !== null && exit_code !== 0
248
- ? runningInstance_1.InstanceStatus.error
249
- : runningInstance_1.InstanceStatus.finished;
250
- await runningInstance_1.RunningInstanceModel.update({
251
- finished_at: finishedAt,
252
- status: instanceStatus,
253
- exit_code: exit_code !== null && exit_code !== void 0 ? exit_code : undefined,
254
- }, {
255
- where: {
256
- cron_id: id,
257
- pid: pid || undefined,
258
- status: runningInstance_1.InstanceStatus.running,
259
- },
260
- });
315
+ if (status === cron_1.CrontabStatus.running || status === cron_1.CrontabStatus.idle) {
316
+ if (Number.isSafeInteger(pid) && pid > 0 && Number.isSafeInteger(last_execution_time) && last_execution_time > 0) {
317
+ await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).reportLegacy(id, status === cron_1.CrontabStatus.running, pid, log_path, last_execution_time, last_running_time !== null && last_running_time !== void 0 ? last_running_time : 0, exit_code);
318
+ }
319
+ continue;
261
320
  }
262
321
  await cron_1.CrontabModel.update(Object.assign({}, (0, pickBy_1.default)(options, (v) => v === 0 || !!v)), { where: { id } });
263
322
  }
264
323
  }
265
- async remove(ids) {
324
+ async remove(targets) {
266
325
  return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
326
+ var _a;
327
+ const ids = targets.map(target => typeof target === 'number' ? target : target.id);
328
+ for (const target of targets) {
329
+ if (typeof target === 'number')
330
+ continue;
331
+ const current = await cron_1.CrontabModel.findByPk(target.id);
332
+ if (!current || (0, cronOperand_1.cronOperand)(current.command, true) !== target.script ||
333
+ (target.command !== undefined && current.command !== target.command) ||
334
+ (target.revision !== undefined && current.recovery_from !== target.revision) ||
335
+ (target.sub_id !== undefined && ((_a = current.sub_id) !== null && _a !== void 0 ? _a : null) !== target.sub_id)) {
336
+ throw Object.assign(new Error((0, i18n_1.t)('任务已修改,请刷新后重试')), { status: 409 });
337
+ }
338
+ }
267
339
  await client_1.default.delCron(ids.map(String));
268
340
  await cron_1.CrontabModel.destroy({ where: { id: ids } });
269
341
  await this.setCrontab();
@@ -291,7 +363,7 @@ let CronService = class CronService {
291
363
  }, { where: { id: doc.id } });
292
364
  }
293
365
  }
294
- formatViewQuery(query, viewQuery) {
366
+ formatViewQuery(query, viewQuery, forDisplay) {
295
367
  if (viewQuery.filters && viewQuery.filters.length > 0) {
296
368
  const primaryOperate = viewQuery.filterRelation === 'or' ? sequelize_1.Op.or : sequelize_1.Op.and;
297
369
  if (!query[primaryOperate]) {
@@ -302,6 +374,10 @@ let CronService = class CronService {
302
374
  let q = {};
303
375
  let operate2 = null;
304
376
  let operate = null;
377
+ if (property === 'status' && (operation === 'In' || operation === 'Nin')) {
378
+ query[primaryOperate].push(statusFilter(Array.isArray(value) ? value : [value], operation === 'Nin', forDisplay));
379
+ continue;
380
+ }
305
381
  switch (operation) {
306
382
  case 'Reg':
307
383
  operate = sequelize_1.Op.like;
@@ -312,41 +388,12 @@ let CronService = class CronService {
312
388
  operate2 = sequelize_1.Op.and;
313
389
  break;
314
390
  case 'In':
315
- if (property === 'status' &&
316
- !value.includes(cron_1.CrontabStatus.disabled)) {
317
- q[sequelize_1.Op.and] = [
318
- { [property]: Array.isArray(value) ? value : [value] },
319
- { isDisabled: 0 },
320
- ];
321
- }
322
- else {
323
- q[sequelize_1.Op.or] = [
324
- {
325
- [property]: Array.isArray(value) ? value : [value],
326
- },
327
- property === 'status' && value.includes(cron_1.CrontabStatus.disabled)
328
- ? { isDisabled: 1 }
329
- : {},
330
- ];
331
- }
391
+ q[property] = Array.isArray(value) ? value : [value];
332
392
  break;
333
393
  case 'Nin':
334
- q[sequelize_1.Op.and] = [
335
- {
336
- [sequelize_1.Op.or]: [
337
- {
338
- [property]: {
339
- [sequelize_1.Op.notIn]: Array.isArray(value) ? value : [value],
340
- },
341
- },
342
- {
343
- [property]: { [sequelize_1.Op.is]: null },
344
- },
345
- ],
346
- },
347
- property === 'status' && value.includes(2)
348
- ? { isDisabled: { [sequelize_1.Op.ne]: 1 } }
349
- : {},
394
+ q[sequelize_1.Op.or] = [
395
+ { [property]: { [sequelize_1.Op.notIn]: Array.isArray(value) ? value : [value] } },
396
+ { [property]: { [sequelize_1.Op.is]: null } },
350
397
  ];
351
398
  break;
352
399
  default:
@@ -420,7 +467,7 @@ let CronService = class CronService {
420
467
  query[sequelize_1.Op.and].push(q);
421
468
  }
422
469
  }
423
- formatFilterQuery(query, filterQuery) {
470
+ formatFilterQuery(query, filterQuery, forDisplay) {
424
471
  if (!(0, lodash_1.isEmpty)(filterQuery)) {
425
472
  if (!query[sequelize_1.Op.and]) {
426
473
  query[sequelize_1.Op.and] = [];
@@ -431,12 +478,7 @@ let CronService = class CronService {
431
478
  if (!filterQuery[key])
432
479
  continue;
433
480
  if (key === 'status') {
434
- if (filterQuery[key].includes(cron_1.CrontabStatus.disabled)) {
435
- q = { [sequelize_1.Op.or]: [{ [key]: filterQuery[key] }, { isDisabled: 1 }] };
436
- }
437
- else {
438
- q = { [sequelize_1.Op.and]: [{ [key]: filterQuery[key] }, { isDisabled: 0 }] };
439
- }
481
+ q = statusFilter(filterQuery[key], false, forDisplay);
440
482
  }
441
483
  else {
442
484
  q[key] = filterQuery[key];
@@ -461,7 +503,7 @@ let CronService = class CronService {
461
503
  throw error;
462
504
  }
463
505
  }
464
- async crontabs(params) {
506
+ async crontabs(params, forDisplay = false) {
465
507
  const searchText = params === null || params === void 0 ? void 0 : params.searchValue;
466
508
  const page = Number((params === null || params === void 0 ? void 0 : params.page) || '0');
467
509
  const size = Number((params === null || params === void 0 ? void 0 : params.size) || '0');
@@ -475,9 +517,9 @@ let CronService = class CronService {
475
517
  ['status', 'ASC'],
476
518
  ['createdAt', 'DESC'],
477
519
  ];
478
- this.formatViewQuery(query, viewQuery);
520
+ this.formatViewQuery(query, viewQuery, forDisplay);
479
521
  this.formatSearchText(query, searchText);
480
- this.formatFilterQuery(query, filterQuery);
522
+ this.formatFilterQuery(query, filterQuery, forDisplay);
481
523
  this.formatViewSort(order, viewQuery);
482
524
  if (sorterQuery) {
483
525
  const { field, type } = sorterQuery;
@@ -485,10 +527,7 @@ let CronService = class CronService {
485
527
  order.unshift([field, type]);
486
528
  }
487
529
  }
488
- let condition = {
489
- where: query,
490
- order: order,
491
- };
530
+ let condition = Object.assign({ where: query, order: (forDisplay ? order.map(([field, dir]) => [field === 'status' ? visibleStatus : field, dir]) : order) }, (forDisplay ? { attributes: visibleAttributes } : {}));
492
531
  if (page && size) {
493
532
  condition.offset = (page - 1) * size;
494
533
  condition.limit = size;
@@ -502,72 +541,119 @@ let CronService = class CronService {
502
541
  throw error;
503
542
  }
504
543
  }
505
- async getDb(query) {
506
- const doc = await cron_1.CrontabModel.findOne({ where: Object.assign({}, query) });
544
+ async getDb(query, projection = false) {
545
+ const attributes = projection === true ? visibleAttributes : projection;
546
+ const doc = await cron_1.CrontabModel.findOne(Object.assign({ where: Object.assign({}, query) }, (attributes && { attributes })));
507
547
  if (!doc) {
508
548
  throw new Error(`Cron ${JSON.stringify(query)} not found`);
509
549
  }
510
550
  return doc.get({ plain: true });
511
551
  }
512
- async run(ids) {
513
- const queuedToken = (0, crypto_1.randomUUID)();
514
- await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.queued, queued_token: queuedToken }, { where: { id: ids } });
515
- ids.forEach((id) => {
516
- this.runSingle(id, queuedToken);
552
+ async run(ids, source = 'manual') {
553
+ const token = (0, crypto_1.randomUUID)();
554
+ const database = cron_1.CrontabModel.sequelize;
555
+ const history = new triggerHistory_1.TriggerHistory(database);
556
+ const queued = await database.transaction(async (transaction) => {
557
+ const rows = await cron_1.CrontabModel.findAll({ where: { id: ids }, transaction });
558
+ const accepted = [];
559
+ for (const row of rows) {
560
+ const id = row.id;
561
+ const trigger = token + '-' + id;
562
+ await history.enqueue(trigger, id, source, null, Date.now(), transaction);
563
+ if (!row.allow_multiple_instances && ((0, cronProcess_1.hasLiveCronProcess)(row.status, row.pid) || await history.isRunning(id, transaction))) {
564
+ await history.finish(trigger, 'skipped', 'overlap', null, transaction);
565
+ }
566
+ else {
567
+ accepted.push(row.get({ plain: true }));
568
+ }
569
+ }
570
+ await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.queued, queued_token: token }, {
571
+ where: { id: accepted.map(row => row.id) }, transaction,
572
+ });
573
+ return accepted;
517
574
  });
575
+ for (const row of queued) {
576
+ const id = row.id;
577
+ void this.runSingle(id, token, token + '-' + id, row).catch((err) => this.logger.error(String(err)));
578
+ }
518
579
  }
519
- async stop(ids) {
580
+ async stop(ids, requestId) {
581
+ if (!ids.length && !requestId)
582
+ return;
583
+ const targets = [...new Set(ids)].sort((a, b) => a - b);
584
+ const cronIds = JSON.stringify(targets);
585
+ if (!requestId)
586
+ return this.stopBatch(targets, cronIds);
587
+ const key = requestId + '/' + cronIds;
588
+ const pending = this.stoppingBatches.get(key);
589
+ if (pending)
590
+ return pending;
591
+ // The database arbitrates different payloads and competing workers.
592
+ const done = this.stopBatch(targets, cronIds, requestId).finally(() => this.stoppingBatches.delete(key));
593
+ this.stoppingBatches.set(key, done);
594
+ return done;
595
+ }
596
+ async stopBatch(ids, cronIds, requestId) {
520
597
  var _a, _b, _c, _d, _e;
521
- const docs = await cron_1.CrontabModel.findAll({ where: { id: ids } });
522
- // Cancel the queued snapshot first, so a late spawn cannot claim it.
523
- for (const doc of docs) {
524
- if (doc.status === cron_1.CrontabStatus.queued) {
525
- const [cancelled] = await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: null, queued_token: null }, {
526
- where: {
527
- id: doc.id,
528
- status: cron_1.CrontabStatus.queued,
529
- [sequelize_1.Op.and]: [
530
- (0, sequelize_1.where)((0, sequelize_1.col)('log_path'), { [sequelize_1.Op.eq]: (_a = doc.log_path) !== null && _a !== void 0 ? _a : null }),
531
- (0, sequelize_1.where)((0, sequelize_1.col)('queued_token'), {
532
- [sequelize_1.Op.eq]: (_b = doc.queued_token) !== null && _b !== void 0 ? _b : null,
533
- }),
534
- ],
535
- },
536
- });
537
- // A concurrent claim may have won; capture its PID before signalling.
538
- if (!cancelled)
539
- await doc.reload();
598
+ const database = cron_1.CrontabModel.sequelize;
599
+ const history = new triggerHistory_1.TriggerHistory(database);
600
+ const snapshot = await database.transaction({ type: sequelize_1.Transaction.TYPES.IMMEDIATE }, async (transaction) => {
601
+ if (requestId) {
602
+ const [existing] = await database.query('SELECT cron_ids,snapshot,status_code FROM CronStopBatches WHERE request_id=$requestId', { transaction, bind: { requestId }, type: sequelize_1.QueryTypes.SELECT });
603
+ if (existing) {
604
+ if (existing.cron_ids !== cronIds)
605
+ throw Object.assign(new Error('Idempotency-Key already used for different tasks'), { status: 409 });
606
+ if (existing.status_code === 409)
607
+ throw Object.assign(new Error((0, i18n_1.t)('实例不存在或已停止')), { status: 409 });
608
+ return existing.snapshot ? JSON.parse(existing.snapshot) : null;
609
+ }
540
610
  }
541
- }
542
- const stoppingInstances = await runningInstance_1.RunningInstanceModel.findAll({
543
- attributes: ['id', 'pid', 'cron_id'],
544
- where: { cron_id: ids, status: runningInstance_1.InstanceStatus.running },
611
+ const docs = await cron_1.CrontabModel.findAll({
612
+ attributes: ['id', 'status', 'pid', 'log_path', 'queued_token', 'last_execution_time'],
613
+ where: { id: ids }, transaction, raw: true,
614
+ });
615
+ const cancelled = await history.cancelQueuedInTransaction(ids, transaction);
616
+ const instances = await runningInstance_1.RunningInstanceModel.findAll({
617
+ attributes: ['id', 'cron_id', 'pid'], where: { cron_id: ids, status: runningInstance_1.InstanceStatus.running }, transaction, raw: true,
618
+ });
619
+ const { missingTargets, identityConflict } = await this.attachLegacyStopTargets(docs, instances, history, transaction);
620
+ for (const instance of instances) {
621
+ if (instance.pid)
622
+ await history.queueInstanceStop(instance.id, instance.cron_id, instance.pid, transaction);
623
+ }
624
+ for (const doc of docs) {
625
+ if (doc.status === cron_1.CrontabStatus.queued) {
626
+ await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: null, queued_token: null }, { where: { id: doc.id, status: cron_1.CrontabStatus.queued }, transaction });
627
+ }
628
+ }
629
+ const batch = { docs, cancelled, instances, missingTargets, identityConflict };
630
+ if (requestId) {
631
+ await database.query('INSERT INTO CronStopBatches(request_id,cron_ids,snapshot) VALUES ($requestId,$cronIds,$snapshot)', { transaction, bind: { requestId, cronIds, snapshot: JSON.stringify(batch) } });
632
+ }
633
+ return batch;
545
634
  });
546
- const targets = new Set([
547
- ...stoppingInstances.map((instance) => instance.pid),
548
- ...docs
549
- .filter((doc) => doc.status === cron_1.CrontabStatus.running)
550
- .map((doc) => doc.pid),
551
- ].filter((pid) => typeof pid === 'number' && pid > 0));
552
- const stopped = new Set();
553
- for (const pid of targets) {
635
+ if (!snapshot)
636
+ return;
637
+ const { docs, cancelled, instances, missingPids, missingTargets, identityConflict } = snapshot;
638
+ if (cancelled.length)
639
+ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, { type: 'cancel-queued-triggers', ids: cancelled });
640
+ const stopped = new Set(missingTargets);
641
+ let failure;
642
+ for (const instance of instances) {
554
643
  try {
555
- await (0, util_1.killTask)(pid, true);
556
- stopped.add(pid);
644
+ const result = await this.stopInstance(instance.cron_id, instance.id);
645
+ if (result.code === 409)
646
+ failure !== null && failure !== void 0 ? failure : (failure = Object.assign(new Error(result.message), { status: 409 }));
647
+ if (instance.pid && 'data' in result && ((_b = result.data) === null || _b === void 0 ? void 0 : _b.outcome) === 'stopped')
648
+ stopped.add(instance.cron_id + '/' + instance.pid);
557
649
  }
558
650
  catch (error) {
559
- this.logger.error((0, i18n_1.t)('[panel][停止任务失败] PID: %s, 错误: %s'), pid, (0, childProcess_1.asError)(error).message);
651
+ failure !== null && failure !== void 0 ? failure : (failure = (0, childProcess_1.asError)(error));
560
652
  }
561
653
  }
562
- const stoppedIds = stoppingInstances
563
- .filter((instance) => instance.pid && stopped.has(instance.pid))
564
- .map((instance) => instance.id);
565
- if (stoppedIds.length) {
566
- await runningInstance_1.RunningInstanceModel.update({ status: runningInstance_1.InstanceStatus.stopped, finished_at: (0, dayjs_1.default)().unix() }, { where: { id: stoppedIds } });
567
- }
568
654
  for (const doc of docs) {
569
655
  if (doc.status !== cron_1.CrontabStatus.running ||
570
- (doc.pid && !stopped.has(doc.pid)))
656
+ (doc.pid && !(missingPids === null || missingPids === void 0 ? void 0 : missingPids.includes(doc.pid)) && !stopped.has(doc.id + '/' + doc.pid)))
571
657
  continue;
572
658
  const remaining = await runningInstance_1.RunningInstanceModel.count({
573
659
  where: { cron_id: doc.id, status: runningInstance_1.InstanceStatus.running },
@@ -586,33 +672,203 @@ let CronService = class CronService {
586
672
  },
587
673
  });
588
674
  }
675
+ if (failure)
676
+ throw failure;
677
+ // Retain the key after success. Even a much later retry must never take a new snapshot.
678
+ if (requestId)
679
+ await database.query('UPDATE CronStopBatches SET snapshot=NULL,status_code=$status WHERE request_id=$requestId AND snapshot IS NOT NULL', { bind: { requestId, status: identityConflict ? 409 : 200 } });
680
+ if (identityConflict)
681
+ throw Object.assign(new Error((0, i18n_1.t)('实例不存在或已停止')), { status: 409 });
589
682
  }
590
- async stopInstance(instanceId) {
683
+ // Older databases can have a PID or a command receipt without an instance.
684
+ // Give verified targets an instance before releasing the same snapshot transaction.
685
+ async attachLegacyStopTargets(docs, instances, history, transaction) {
686
+ const commands = await history.activeCommands(docs.map(doc => doc.id), transaction);
687
+ const registered = new Set(instances.map(row => row.cron_id + '/' + row.pid));
688
+ const registeredPids = new Set(instances.map(row => row.pid));
689
+ const legacy = new Map();
690
+ for (const doc of docs) {
691
+ const key = doc.id + '/' + doc.pid;
692
+ if (doc.status === cron_1.CrontabStatus.running && doc.pid && !registered.has(key))
693
+ legacy.set(key, { pid: doc.pid, cronId: doc.id, started: doc.last_execution_time, log: doc.log_path });
694
+ }
695
+ for (const command of commands) {
696
+ const pid = Number(command.command_identity.split(':')[1]);
697
+ const key = command.cron_id + '/' + pid;
698
+ if (!registered.has(key))
699
+ legacy.set(key, { pid, cronId: command.cron_id, trigger: command.id,
700
+ identity: command.command_identity, started: Math.floor(command.started_at / 1000), log: command.log_path });
701
+ }
702
+ let identityConflict = false;
703
+ const missingTargets = [];
704
+ for (const target of legacy.values()) {
705
+ const { pid } = target;
706
+ // A different task already owns this PID in the snapshot.
707
+ if (registeredPids.has(pid)) {
708
+ identityConflict = true;
709
+ continue;
710
+ }
711
+ let identity;
712
+ try {
713
+ identity = (0, cronProcess_1.systemOwner)(pid);
714
+ (0, cronProcess_1.verifyCronProcess)(pid, target.cronId, target.identity, target.started);
715
+ }
716
+ catch (error) {
717
+ if (['ENOENT', 'ESRCH'].includes(error.code))
718
+ missingTargets.push(target.cronId + '/' + pid);
719
+ else if (error.status === 409)
720
+ identityConflict = true;
721
+ else
722
+ throw error;
723
+ continue;
724
+ }
725
+ const row = await runningInstance_1.RunningInstanceModel.create({ cron_id: target.cronId, pid, status: runningInstance_1.InstanceStatus.running,
726
+ started_at: target.started || (0, dayjs_1.default)().unix(), log_path: target.log }, { transaction });
727
+ if (target.trigger)
728
+ await cron_1.CrontabModel.sequelize.query("UPDATE CronTriggers SET instance_id=$id,process_identity=$identity WHERE id=$trigger AND state='running'", { transaction, bind: { id: row.id, identity, trigger: target.trigger } });
729
+ await history.queueInstanceStop(row.id, target.cronId, pid, transaction, identity);
730
+ instances.push({ id: row.id, cron_id: target.cronId, pid });
731
+ }
732
+ return { missingTargets, identityConflict };
733
+ }
734
+ async resumePendingStops(history, requests, batches = []) {
735
+ for (const row of requests) {
736
+ try {
737
+ const result = await this.stopInstance(row.cron_id, row.instance_id);
738
+ if (result.code !== 200)
739
+ this.logger.warn(result.message);
740
+ }
741
+ catch (error) {
742
+ this.logger.error((0, i18n_1.t)('[panel][停止实例失败] 实例ID: %s, PID: %s, 错误: %s'), row.instance_id, row.pid, (0, childProcess_1.asError)(error).message);
743
+ }
744
+ }
745
+ for (const batch of batches) {
746
+ try {
747
+ await this.stop(JSON.parse(batch.cron_ids), batch.request_id);
748
+ }
749
+ catch (error) {
750
+ this.logger.error((0, childProcess_1.asError)(error).message);
751
+ }
752
+ }
753
+ await history.recoverSystemOwners();
754
+ }
755
+ stopInstance(cronId, instanceId) {
756
+ const key = `${cronId}/${instanceId}`;
757
+ const pending = this.stoppingInstances.get(key);
758
+ if (pending)
759
+ return pending;
760
+ const stop = this.stopOneInstance(cronId, instanceId).finally(() => this.stoppingInstances.delete(key));
761
+ this.stoppingInstances.set(key, stop);
762
+ return stop;
763
+ }
764
+ async stopOneInstance(cronId, instanceId) {
765
+ var _a, _b;
766
+ const ended = { code: 200, data: { outcome: 'ended' }, message: (0, i18n_1.t)('实例已结束') };
767
+ const stopped = { code: 200, data: { outcome: 'stopped' }, message: (0, i18n_1.t)('实例已停止') };
768
+ const history = new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize);
591
769
  const instance = await runningInstance_1.RunningInstanceModel.findOne({
592
- where: { id: instanceId, status: runningInstance_1.InstanceStatus.running },
770
+ where: { id: instanceId, cron_id: cronId },
593
771
  });
594
772
  if (!instance) {
595
- return { code: 400, message: (0, i18n_1.t)('实例不存在或已停止') };
773
+ await cron_1.CrontabModel.sequelize.query('DELETE FROM CronStopRequests WHERE instance_id=$instanceId AND cron_id=$cronId', { bind: { instanceId, cronId } });
774
+ return { code: 404, message: (0, i18n_1.t)('实例不存在或已停止') };
596
775
  }
597
- if (instance.pid) {
598
- try {
599
- await (0, util_1.killTask)(instance.pid);
776
+ const pending = await history.pendingStop(instanceId);
777
+ const savedTargets = (pending === null || pending === void 0 ? void 0 : pending.targets) ? JSON.parse(pending.targets) : [];
778
+ const settle = () => history.stopVerifiedInstance(instanceId, transaction => this.settleLegacyStop(instanceId, cronId, instance.pid, transaction));
779
+ const finishClaim = async (claim) => {
780
+ await (0, cronProcess_1.finishStoppedTree)(claim.targets ? JSON.parse(claim.targets) : [], claim.signalled_at);
781
+ return await settle() ? stopped : ended;
782
+ };
783
+ const releaseUnsignalled = async (recoverEnded = false) => {
784
+ const claimed = await history.forgetStop(instanceId, recoverEnded ? async (tx) => {
785
+ await history.recoverSystemOwners(cronId, tx, instanceId);
786
+ if (await history.instanceStopRequested(instanceId, tx) === undefined)
787
+ await this.settleLegacyStop(instanceId, cronId, instance.pid, tx, runningInstance_1.InstanceStatus.unknown);
788
+ } : undefined);
789
+ if (claimed)
790
+ return finishClaim(claimed);
791
+ };
792
+ if (pending === null || pending === void 0 ? void 0 : pending.signalled)
793
+ return finishClaim(pending);
794
+ if (instance.status !== runningInstance_1.InstanceStatus.running) {
795
+ if (savedTargets.length)
796
+ await (0, cronProcess_1.finishStoppedTree)(savedTargets);
797
+ const claimed = pending && await releaseUnsignalled();
798
+ return claimed !== null && claimed !== void 0 ? claimed : (instance.status === runningInstance_1.InstanceStatus.stopped ? stopped : ended);
799
+ }
800
+ // A cold restart destroys the old process tree. The same numeric PIDs
801
+ // may already belong to another execution, even when script and log match.
802
+ if ((pending === null || pending === void 0 ? void 0 : pending.namespace_owner) && pending.namespace_owner !== (0, cronProcess_1.pidNamespaceOwner)()) {
803
+ return (_a = await releaseUnsignalled(true)) !== null && _a !== void 0 ? _a : ended;
804
+ }
805
+ if (!instance.pid || instance.pid < 1) {
806
+ return { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
807
+ }
808
+ let identity = (pending === null || pending === void 0 ? void 0 : pending.root_identity) || await history.instanceIdentity(instanceId)
809
+ || savedTargets.find(birth => birth.startsWith(`crond:${instance.pid}:`));
810
+ const verify = () => (0, cronProcess_1.verifyCronProcess)(instance.pid, cronId, identity, instance.started_at, { logPath: instance.log_path });
811
+ if (!identity && await runningInstance_1.RunningInstanceModel.count({ where: {
812
+ id: { [sequelize_1.Op.ne]: instanceId }, status: runningInstance_1.InstanceStatus.running, pid: instance.pid,
813
+ } })) {
814
+ const claimed = await releaseUnsignalled();
815
+ return claimed !== null && claimed !== void 0 ? claimed : { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
816
+ }
817
+ try {
818
+ identity = (_b = verify()) !== null && _b !== void 0 ? _b : identity;
819
+ // Traversing the process tree is asynchronous. Persist the individual
820
+ // request before traversal so a restart here also resumes this stop.
821
+ if (!pending || (!pending.root_identity && identity))
822
+ await history.queueInstanceStop(instanceId, cronId, instance.pid, undefined, identity !== null && identity !== void 0 ? identity : undefined);
823
+ await (0, util_1.killTask)(instance.pid, true, verify, (signal, targets) => history.requestInstanceStop(instanceId, instance.pid, signal, targets));
824
+ return await settle() ? stopped : ended;
825
+ }
826
+ catch (error) {
827
+ const cause = error.code;
828
+ if (cause === 'ESRCH' || cause === 'PID_REUSED') {
829
+ if (savedTargets.length)
830
+ await (0, cronProcess_1.finishStoppedTree)(savedTargets);
831
+ const claimed = await releaseUnsignalled(true);
832
+ if (claimed)
833
+ return claimed;
834
+ const latest = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: instanceId, cron_id: cronId } });
835
+ if ((latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.stopped)
836
+ return stopped;
837
+ if ((latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.running) {
838
+ const requested = await history.instanceStopRequested(instanceId);
839
+ if (requested)
840
+ return stopped;
841
+ if (cause === 'PID_REUSED' || requested === undefined)
842
+ return { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
843
+ }
844
+ return ended;
600
845
  }
601
- catch (error) {
602
- this.logger.error((0, i18n_1.t)("[panel][停止实例失败] 实例ID: %s, PID: %s, 错误: %s"), instanceId, instance.pid, error);
846
+ if (error.status === 409) {
847
+ if (savedTargets.length)
848
+ await (0, cronProcess_1.finishStoppedTree)(savedTargets);
849
+ const claimed = await releaseUnsignalled();
850
+ return claimed !== null && claimed !== void 0 ? claimed : { code: 409, message: (0, i18n_1.t)('实例不存在或已停止') };
603
851
  }
852
+ this.logger.error((0, i18n_1.t)("[panel][停止实例失败] 实例ID: %s, PID: %s, 错误: %s"), instanceId, instance.pid, error);
853
+ throw error;
854
+ }
855
+ }
856
+ async settleLegacyStop(instanceId, cronId, pid, transaction, status = runningInstance_1.InstanceStatus.stopped) {
857
+ const [updated] = await runningInstance_1.RunningInstanceModel.update({ status, finished_at: (0, dayjs_1.default)().unix() }, { where: { id: instanceId, cron_id: cronId, status: runningInstance_1.InstanceStatus.running }, transaction });
858
+ if (!updated) {
859
+ const latest = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: instanceId, cron_id: cronId }, transaction });
860
+ return (latest === null || latest === void 0 ? void 0 : latest.status) === runningInstance_1.InstanceStatus.stopped;
604
861
  }
605
- await runningInstance_1.RunningInstanceModel.update({ status: runningInstance_1.InstanceStatus.stopped, finished_at: (0, dayjs_1.default)().unix(), exit_code: 143 }, { where: { id: instanceId } });
606
862
  // Check if there are still other running instances for this cron
607
863
  const otherRunning = await runningInstance_1.RunningInstanceModel.count({
608
- where: { cron_id: instance.cron_id, status: runningInstance_1.InstanceStatus.running },
864
+ where: { cron_id: cronId, status: runningInstance_1.InstanceStatus.running }, transaction,
609
865
  });
610
866
  if (otherRunning === 0) {
611
- await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: undefined }, { where: { id: instance.cron_id } });
867
+ await cron_1.CrontabModel.update({ status: cron_1.CrontabStatus.idle, pid: null }, { where: { id: cronId, status: cron_1.CrontabStatus.running, pid }, transaction });
612
868
  }
613
- return { code: 200, message: (0, i18n_1.t)('实例已停止') };
869
+ return status === runningInstance_1.InstanceStatus.stopped;
614
870
  }
615
- async runSingle(cronId, expectedToken) {
871
+ async runSingle(cronId, expectedToken, triggerId, submitted) {
616
872
  return pLimit_1.default.manualRunWithCronLimit(async () => {
617
873
  var _a, _b;
618
874
  let absolutePath;
@@ -620,57 +876,88 @@ let CronService = class CronService {
620
876
  let queuedLogPath;
621
877
  let queuedToken = null;
622
878
  let claimed = false;
879
+ const history = new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize);
880
+ let state = 'skipped';
881
+ let reason = 'changed';
882
+ let exitCode = null;
623
883
  try {
624
884
  const cron = await this.getDb({ id: cronId });
625
- if (cron.status !== cron_1.CrontabStatus.queued ||
626
- (expectedToken !== undefined && cron.queued_token !== expectedToken))
885
+ const independent = Boolean(triggerId && (submitted === null || submitted === void 0 ? void 0 : submitted.allow_multiple_instances) && cron.allow_multiple_instances);
886
+ if (!independent && (cron.status !== cron_1.CrontabStatus.queued ||
887
+ (expectedToken !== undefined && cron.queued_token !== expectedToken)))
627
888
  return;
628
- queuedToken = (_a = cron.queued_token) !== null && _a !== void 0 ? _a : null;
629
- queuedLogPath = (_b = cron.log_path) !== null && _b !== void 0 ? _b : null;
889
+ queuedLogPath = (_a = cron.log_path) !== null && _a !== void 0 ? _a : null;
890
+ if (submitted && (submitted.recovery_from !== cron.recovery_from ||
891
+ submitted.isDisabled !== cron.isDisabled || submitted.command !== cron.command)) {
892
+ queuedToken = expectedToken !== null && expectedToken !== void 0 ? expectedToken : null;
893
+ return;
894
+ }
895
+ queuedToken = (_b = cron.queued_token) !== null && _b !== void 0 ? _b : null;
630
896
  const { id, command, log_name } = cron;
631
- const uniqPath = log_name === '/dev/null' || !log_name
632
- ? await (0, util_1.getUniqPath)(command, `${id}`)
633
- : log_name;
634
- const logTime = (0, dayjs_1.default)().format('YYYY-MM-DD-HH-mm-ss-SSS');
635
- logPath = `${uniqPath}/${logTime}.log`;
636
- absolutePath = (0, fileAccess_1.resolveFileAccess)(config_1.default.logPath, [logPath]);
637
- if (!absolutePath)
638
- throw new Error('Log path is outside the log directory');
639
- await promises_1.default.mkdir(path_1.default.dirname(absolutePath), { recursive: true });
897
+ if (log_name === '/dev/null') {
898
+ logPath = '/dev/null';
899
+ }
900
+ else {
901
+ const uniqPath = log_name
902
+ ? path_1.default.relative(config_1.default.logPath, (0, logPath_1.resolveLogPath)(config_1.default.logPath, log_name))
903
+ : await (0, util_1.getUniqPath)(command, `${id}`);
904
+ const logTime = (0, dayjs_1.default)().format('YYYY-MM-DD-HH-mm-ss-SSS');
905
+ logPath = `${uniqPath}/${logTime}${independent ? '-' + expectedToken : ''}.log`;
906
+ absolutePath = (0, fileAccess_1.resolveFileAccess)(config_1.default.logPath, [logPath]);
907
+ if (!absolutePath)
908
+ throw new Error('Log path is outside the log directory');
909
+ await promises_1.default.mkdir(path_1.default.dirname(absolutePath), { recursive: true });
910
+ }
640
911
  const outputPath = absolutePath;
641
- const cp = (0, cross_spawn_1.spawn)(`real_log_path=${logPath} no_delay=true ${this.makeCommand(cron, true)}`, { shell: '/bin/bash' });
912
+ if (triggerId && submitted) {
913
+ const claim = await history.claimManual(triggerId, submitted, expectedToken, independent);
914
+ if (claim !== 'started') {
915
+ reason = claim;
916
+ queuedToken = expectedToken;
917
+ return;
918
+ }
919
+ }
920
+ const cp = (0, cronCommandProcess_1.spawnCronCommand)(`real_log_path=${shellValue(logPath)} no_delay=true ${this.makeCommand(cron, true)}`, triggerId);
642
921
  // Install observers before the first await: very short children may already exit.
643
922
  const { completed } = (0, childProcess_1.observeChildProcess)(cp, {
644
923
  onStart: async () => {
645
924
  try {
646
- const [count] = await cron_1.CrontabModel.update({
647
- status: cron_1.CrontabStatus.running,
648
- pid: cp.pid,
649
- log_path: logPath,
650
- }, {
651
- where: {
652
- id,
925
+ if (triggerId && !await history.bindCommand(triggerId, cp.pid, logPath))
926
+ throw new Error('Task was cancelled before startup');
927
+ const [count] = await cron_1.CrontabModel.update(Object.assign({ status: cron_1.CrontabStatus.running, pid: cp.pid, log_path: logPath }, (!triggerId && { last_execution_time: (0, dayjs_1.default)().unix(), last_running_time: null })), {
928
+ where: Object.assign({ id }, (independent ? {} : {
653
929
  status: cron_1.CrontabStatus.queued,
654
930
  [sequelize_1.Op.and]: [
655
931
  (0, sequelize_1.where)((0, sequelize_1.col)('queued_token'), { [sequelize_1.Op.eq]: queuedToken }),
656
932
  (0, sequelize_1.where)((0, sequelize_1.col)('log_path'), { [sequelize_1.Op.eq]: queuedLogPath }),
657
933
  ],
658
- },
934
+ })),
659
935
  });
660
936
  if (count !== 1)
661
937
  throw new Error('Task was stopped or superseded before startup');
662
938
  claimed = true;
939
+ if (triggerId) {
940
+ if (await history.shouldStop(triggerId))
941
+ cp.stdin.end();
942
+ else
943
+ await (0, cronCommandProcess_1.releaseCronCommand)(cp);
944
+ }
663
945
  }
664
946
  catch (error) {
665
- if (cp.pid)
947
+ if (triggerId)
948
+ cp.stdin.destroy();
949
+ else if (cp.pid)
666
950
  await (0, util_1.killTask)(cp.pid, true);
667
951
  throw error;
668
952
  }
669
953
  },
670
- onStdout: (message) => logStreamManager_1.logStreamManager.write(outputPath, message),
671
- onStderr: (message) => logStreamManager_1.logStreamManager.write(outputPath, message),
954
+ onStdout: outputPath ? (message) => logStreamManager_1.logStreamManager.write(outputPath, message) : undefined,
955
+ onStderr: outputPath ? (message) => logStreamManager_1.logStreamManager.write(outputPath, message) : undefined,
672
956
  });
673
957
  const result = await completed;
958
+ state = result.signal ? 'stopped' : result.error || result.code !== 0 ? 'failed' : 'finished';
959
+ reason = result.error ? 'spawn' : result.signal || null;
960
+ exitCode = result.code;
674
961
  if (result.error) {
675
962
  this.logger.error((0, i18n_1.t)('[panel][执行任务失败] 任务ID: %s, 错误: %s'), id, result.error.message);
676
963
  }
@@ -678,6 +965,8 @@ let CronService = class CronService {
678
965
  return Object.assign(Object.assign(Object.assign({}, cron), { pid: cp.pid }), result);
679
966
  }
680
967
  catch (error) {
968
+ state = 'failed';
969
+ reason = 'spawn';
681
970
  this.logger.error((0, i18n_1.t)('[panel][创建任务失败] 任务ID: %s, 错误: %s'), cronId, (0, childProcess_1.asError)(error).message);
682
971
  }
683
972
  finally {
@@ -715,19 +1004,21 @@ let CronService = class CronService {
715
1004
  catch (error) {
716
1005
  this.logger.error((0, i18n_1.t)('[panel][清理任务状态失败] %s'), (0, childProcess_1.asError)(error).message);
717
1006
  }
1007
+ if (triggerId)
1008
+ await history.complete(triggerId, state, reason, exitCode);
718
1009
  }
719
- });
1010
+ }, undefined, { id: triggerId, name: (submitted === null || submitted === void 0 ? void 0 : submitted.name) || (submitted === null || submitted === void 0 ? void 0 : submitted.command) || String(cronId) }, cron_1.CrontabModel.sequelize);
720
1011
  }
721
1012
  async disabled(ids) {
722
1013
  return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
723
1014
  await client_1.default.delCron(ids.map(String));
724
- await cron_1.CrontabModel.update({ isDisabled: 1 }, { where: { id: ids } });
725
- await this.setCrontab();
1015
+ await cron_1.CrontabModel.update({ isDisabled: 1, saved: false }, { where: { id: ids } });
1016
+ await this.setCrontab(undefined, ids);
726
1017
  });
727
1018
  }
728
1019
  async enabled(ids) {
729
1020
  return (0, schedulerMutationLock_1.withSchedulerMutation)(async () => {
730
- await cron_1.CrontabModel.update({ isDisabled: 0 }, { where: { id: ids } });
1021
+ await cron_1.CrontabModel.update({ isDisabled: 0, recovery_from: Date.now() }, { where: { id: ids } });
731
1022
  const docs = await cron_1.CrontabModel.findAll({ where: { id: ids } });
732
1023
  const crons = docs
733
1024
  .filter((x) => this.shouldUseCronClient(x))
@@ -737,6 +1028,10 @@ let CronService = class CronService {
737
1028
  schedule: doc.schedule,
738
1029
  command: this.makeCommand(doc),
739
1030
  extra_schedules: doc.extra_schedules || [],
1031
+ max_queue_wait: doc.max_queue_wait,
1032
+ skip_if_pending: Boolean(doc.skip_if_pending),
1033
+ catchup_seconds: doc.catchup_seconds,
1034
+ recovery_from: doc.recovery_from,
740
1035
  }));
741
1036
  if ((0, util_1.isDemoEnv)()) {
742
1037
  return;
@@ -750,40 +1045,59 @@ let CronService = class CronService {
750
1045
  this.logger.error('[crontab] Failed to register cron job in scheduler, enable rolled back:', (error === null || error === void 0 ? void 0 : error.message) || error);
751
1046
  throw (0, schedulerMutationLock_1.schedulerRegistrationError)(`${(0, i18n_1.t)('调度器注册失败,任务启用已回滚')}: ${(error === null || error === void 0 ? void 0 : error.details) || (error === null || error === void 0 ? void 0 : error.message)}`, error);
752
1047
  }
753
- await this.setCrontab();
1048
+ await cron_1.CrontabModel.update({ saved: false }, { where: { id: ids } });
1049
+ await this.setCrontab(undefined, ids);
754
1050
  });
755
1051
  }
756
1052
  async log(id, options = {}) {
757
- const doc = await this.getDb({ id });
758
- if (!doc) {
759
- return {
760
- content: '',
761
- status: 'empty',
762
- offset: 0,
763
- nextOffset: 0,
764
- total: 0,
765
- truncated: false,
1053
+ var _a, _b;
1054
+ let doc;
1055
+ if (options.instanceId !== undefined) {
1056
+ const instance = await runningInstance_1.RunningInstanceModel.findOne({ where: { id: options.instanceId, cron_id: id },
1057
+ attributes: ['status', 'log_path'], raw: true });
1058
+ doc = { status: (instance === null || instance === void 0 ? void 0 : instance.status) === runningInstance_1.InstanceStatus.running ? cron_1.CrontabStatus.running : cron_1.CrontabStatus.idle,
1059
+ log_path: instance === null || instance === void 0 ? void 0 : instance.log_path };
1060
+ }
1061
+ else if (options.triggerId) {
1062
+ const [trigger] = await new triggerHistory_1.TriggerHistory(cron_1.CrontabModel.sequelize).visibleTriggers(id, [options.triggerId]);
1063
+ // A retained viewer must never fall back to a sibling if its receipt was removed.
1064
+ doc = {
1065
+ logTriggerId: options.triggerId,
1066
+ log_path: (_a = trigger === null || trigger === void 0 ? void 0 : trigger.log_path) !== null && _a !== void 0 ? _a : undefined,
1067
+ status: (trigger === null || trigger === void 0 ? void 0 : trigger.state) === 'running' ? cron_1.CrontabStatus.running
1068
+ : (trigger === null || trigger === void 0 ? void 0 : trigger.state) === 'queued' ? cron_1.CrontabStatus.queued : cron_1.CrontabStatus.idle,
766
1069
  };
767
1070
  }
768
- if (doc.log_name === '/dev/null') {
1071
+ else {
1072
+ doc = await this.getDb({ id }, logAttributes);
1073
+ }
1074
+ const triggerId = (_b = doc.logTriggerId) !== null && _b !== void 0 ? _b : undefined;
1075
+ if (doc.log_name === '/dev/null' || doc.log_path === '/dev/null') {
769
1076
  return {
770
1077
  content: (0, i18n_1.t)('日志设置为忽略'),
771
1078
  status: 'ignored',
1079
+ triggerId,
772
1080
  offset: 0,
773
1081
  nextOffset: 0,
774
1082
  total: 0,
775
1083
  truncated: false,
776
1084
  };
777
1085
  }
1086
+ if (typeof doc.status === 'number' && doc.status === cron_1.CrontabStatus.queued) {
1087
+ // The next run has reserved a slot but has not published its own path yet.
1088
+ return { triggerId, content: '', status: 'running', offset: 0, nextOffset: 0, total: 0, truncated: false };
1089
+ }
778
1090
  const absolutePath = doc.log_path
779
1091
  ? (0, logPath_1.resolveLogPath)(config_1.default.logPath, doc.log_path)
780
1092
  : '';
781
1093
  const logFileExist = doc.log_path && (await (0, util_1.fileExist)(absolutePath));
782
1094
  if (logFileExist) {
783
- const chunk = await (0, logReader_1.readLogChunk)(`${absolutePath}`, options);
1095
+ const changed = options.previousPath !== undefined && options.previousPath !== doc.log_path;
1096
+ const chunk = await (0, logReader_1.readLogChunk)(absolutePath, changed
1097
+ ? Object.assign(Object.assign({}, options), { cursor: undefined, offset: 0, tail: !options.follow }) : options);
784
1098
  const isRunning = typeof doc.status === 'number' &&
785
1099
  [cron_1.CrontabStatus.running, cron_1.CrontabStatus.queued].includes(doc.status);
786
- return Object.assign(Object.assign({}, chunk), { status: isRunning ? 'running' : 'completed' });
1100
+ return Object.assign(Object.assign({}, chunk), { triggerId, logPath: doc.log_path, status: isRunning ? 'running' : 'completed' });
787
1101
  }
788
1102
  else {
789
1103
  const status = typeof doc.status === 'number' &&
@@ -791,6 +1105,7 @@ let CronService = class CronService {
791
1105
  ? 'running'
792
1106
  : 'notFound';
793
1107
  return {
1108
+ triggerId,
794
1109
  content: status === 'running' ? (0, i18n_1.t)('运行中...') : (0, i18n_1.t)('日志不存在...'),
795
1110
  status,
796
1111
  offset: 0,
@@ -825,10 +1140,10 @@ let CronService = class CronService {
825
1140
  if (!command.startsWith(const_1.TASK_PREFIX) && !command.startsWith(const_1.QL_PREFIX)) {
826
1141
  command = `${const_1.TASK_PREFIX}${tab.command}`;
827
1142
  }
828
- let commandVariable = `real_time=${Boolean(realTime)} no_tee=true ID=${tab.id} `;
1143
+ let commandVariable = `${tab.recovery_from ? `QL_CRON_REVISION=${Number(tab.recovery_from)} ` : ''}real_time=${Boolean(realTime)} no_tee=true ID=${tab.id} `;
829
1144
  // Only include log_name if it has a truthy value to avoid passing null/undefined to shell
830
1145
  if (tab.log_name) {
831
- commandVariable += `log_name=${tab.log_name} `;
1146
+ commandVariable += `log_name=${shellValue(tab.log_name)} `;
832
1147
  }
833
1148
  if (tab.task_before) {
834
1149
  commandVariable += `task_before='${tab.task_before
@@ -848,8 +1163,10 @@ let CronService = class CronService {
848
1163
  const crontab_job_string = `${commandVariable}${command}`;
849
1164
  return crontab_job_string;
850
1165
  }
851
- async setCrontab(data) {
1166
+ async setCrontab(data, appliedIds = []) {
1167
+ var _a;
852
1168
  const tabs = data !== null && data !== void 0 ? data : (await this.crontabs());
1169
+ const rules = [];
853
1170
  var crontab_string = '';
854
1171
  tabs.data.forEach((tab) => {
855
1172
  if (tab.isDisabled === 1 ||
@@ -864,21 +1181,46 @@ let CronService = class CronService {
864
1181
  else {
865
1182
  crontab_string += tab.schedule;
866
1183
  crontab_string += ' ';
867
- crontab_string += this.makeCommand(tab);
1184
+ rules.push({ id: tab.id, schedule: tab.schedule, name: tab.name || tab.command });
1185
+ crontab_string += `QL_SYSTEM_DISPATCHED=$(date +\\%s) QL_SYSTEM_RULE=${(0, shellQuote_1.shellQuote)(tab.schedule)} ID=${tab.id} QL_TRIGGER_SOURCE=system bash "$QL_DIR/shell/system-cron.sh" ${(0, shellQuote_1.shellQuote)(this.makeCommand(tab))}`;
868
1186
  crontab_string += '\n';
869
1187
  }
870
1188
  });
871
- await (0, utils_1.writeFileWithLock)(config_1.default.crontabFile, crontab_string);
872
- if (this.schedulerMode === 'system') {
873
- try {
874
- (0, child_process_1.execSync)(`crontab ${config_1.default.crontabFile}`);
1189
+ try {
1190
+ const system = this.schedulerMode === 'system';
1191
+ const db = cron_1.CrontabModel.sequelize;
1192
+ const plan = system ? await (0, systemScheduleAudit_1.stageSystemPlan)(db, rules) : undefined;
1193
+ if (!system)
1194
+ await (0, systemScheduleAudit_1.suspendSystemPlan)(db);
1195
+ await (0, utils_1.writeFileWithLock)(config_1.default.crontabFile, crontab_string);
1196
+ if (plan !== undefined) {
1197
+ (0, child_process_1.execFileSync)('crontab', [config_1.default.crontabFile]);
1198
+ await (0, systemScheduleAudit_1.confirmSystemPlan)(db, plan);
875
1199
  }
876
- catch (error) {
877
- const errorMsg = error.message || String(error);
878
- this.logger.error('[crontab] Failed to update system crontab:', errorMsg);
1200
+ }
1201
+ catch (error) {
1202
+ this.logger.error('[crontab] Failed to publish crontab:', (0, childProcess_1.asError)(error).message);
1203
+ client_1.default.readiness.invalidate();
1204
+ if (process.env.SERVICE_TYPE === 'grpc')
1205
+ (_a = process.send) === null || _a === void 0 ? void 0 : _a.call(process, 'crontab-install-failed');
1206
+ // A fresh host may have no installed crontab at all. A previous boot's
1207
+ // saved flag does not confirm any portable rule in the failed snapshot.
1208
+ if (this.schedulerMode === 'system') {
1209
+ const ids = tabs.data
1210
+ .filter((row) => !this.isNodeCron(row) && !this.isSpecialSchedule(row.schedule))
1211
+ .map((row) => row.id);
1212
+ if (ids.length)
1213
+ await cron_1.CrontabModel.update({ saved: false }, { where: { id: ids } });
879
1214
  }
1215
+ throw Object.assign(new Error((0, i18n_1.t)('系统定时规则安装失败,旧规则可能仍在运行,正在重试')), { status: 503 });
880
1216
  }
881
- await cron_1.CrontabModel.update({ saved: true }, { where: {} });
1217
+ // Only these registrations were acknowledged by this mutation. An unrelated
1218
+ // file install cannot confirm a pending Node registration.
1219
+ if (appliedIds.length)
1220
+ await this.markSchedulesSaved(appliedIds);
1221
+ }
1222
+ async markSchedulesSaved(ids) {
1223
+ await cron_1.CrontabModel.update({ saved: true }, { where: { id: ids, saved: false } });
882
1224
  }
883
1225
  importCrontab() {
884
1226
  (0, child_process_1.exec)('crontab -l', (error, stdout) => {
@@ -935,6 +1277,10 @@ let CronService = class CronService {
935
1277
  schedule: doc.schedule,
936
1278
  command: this.makeCommand(doc),
937
1279
  extra_schedules: doc.extra_schedules || [],
1280
+ max_queue_wait: doc.max_queue_wait,
1281
+ skip_if_pending: Boolean(doc.skip_if_pending),
1282
+ catchup_seconds: doc.catchup_seconds,
1283
+ recovery_from: doc.recovery_from,
938
1284
  }));
939
1285
  if ((0, util_1.isDemoEnv)()) {
940
1286
  await (0, utils_1.writeFileWithLock)(config_1.default.crontabFile, '');
@@ -946,6 +1292,7 @@ let CronService = class CronService {
946
1292
  await this.setCrontab(tabs);
947
1293
  try {
948
1294
  await client_1.default.addCron(regularCrons, requireScheduler);
1295
+ await this.markSchedulesSaved(tabs.data.map((row) => row.id));
949
1296
  }
950
1297
  catch (error) {
951
1298
  this.logger.warn('[crontab] Failed to register cron job in scheduler: %s', (error === null || error === void 0 ? void 0 : error.message) || error);
@@ -958,7 +1305,7 @@ let CronService = class CronService {
958
1305
  const tabs = await this.crontabs();
959
1306
  const bootTasks = tabs.data.filter((x) => !x.isDisabled && this.isBootSchedule(x.schedule));
960
1307
  if (bootTasks.length > 0) {
961
- await this.run(bootTasks.map((task) => task.id));
1308
+ await this.run(bootTasks.map((task) => task.id), 'boot');
962
1309
  }
963
1310
  }
964
1311
  };