prefect 3.6.15__py3-none-any.whl → 3.6.16.dev3__py3-none-any.whl
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.
- prefect/__init__.py +20 -0
- prefect/_build_info.py +3 -3
- prefect/_internal/analytics/__init__.py +80 -0
- prefect/_internal/analytics/_config.py +2 -0
- prefect/_internal/analytics/ci_detection.py +39 -0
- prefect/_internal/analytics/client.py +132 -0
- prefect/_internal/analytics/device_id.py +55 -0
- prefect/_internal/analytics/emit.py +90 -0
- prefect/_internal/analytics/enabled.py +33 -0
- prefect/_internal/analytics/events.py +14 -0
- prefect/_internal/analytics/milestones.py +177 -0
- prefect/_internal/analytics/notice.py +60 -0
- prefect/_internal/analytics/service.py +238 -0
- prefect/analytics/__init__.py +67 -0
- prefect/deployments/runner.py +20 -0
- prefect/flow_engine.py +16 -0
- prefect/flows.py +8 -0
- prefect/logging/formatters.py +24 -1
- prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js → artifact-card-BclosG8t.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-BBzQR-Cj.js.map → artifact-card-BclosG8t.js.map} +1 -1
- prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js +2 -0
- prefect/server/ui-v2/assets/artifact._id-C0r4BJr2.js.map +1 -0
- prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js → automation-wizard-Bmgt6nn8.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-EYSfXlQ7.js.map → automation-wizard-Bmgt6nn8.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-Ccke3KJz.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-Dn7jABys.js.map → automation._id-Ccke3KJz.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js → automation_._id.edit-BlKPUTVf.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-COrqswD3.js.map → automation_._id.edit-BlKPUTVf.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js → automations-header-Df2zw3SC.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-DN_dmMXW.js.map → automations-header-Df2zw3SC.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js → base-job-template-form-section-oZD6U-RW.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-De2ACYbw.js.map → base-job-template-form-section-oZD6U-RW.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js → block-type-details-CYrdaLot.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-Cklc7TkK.js.map → block-type-details-CYrdaLot.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js +2 -0
- prefect/server/ui-v2/assets/block-type-logo-CyAWq7mC.js.map +1 -0
- prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js → block._id-CBgHrpTP.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-tuz1Bcj2.js.map → block._id-CBgHrpTP.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js → block_._id.edit-CW-kdi4O.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-CFEYhF5R.js.map → block_._id.edit-CW-kdi4O.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js → catalog-Brh0kn1I.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-CCPRo7nY.js.map → catalog-Brh0kn1I.js.map} +1 -1
- prefect/server/ui-v2/assets/catalog_._slug-MCgzguIZ.js +2 -0
- prefect/server/ui-v2/assets/{catalog_._slug-Bl2J2oI3.js.map → catalog_._slug-MCgzguIZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js → catalog_._slug_.create-DBaeHi9Q.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-9UD_SxDN.js.map → catalog_._slug_.create-DBaeHi9Q.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js → collapsible-B_NJS0uJ.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-BVQTBG_U.js.map → collapsible-B_NJS0uJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js → concurrency-limit._id-qzNUQzQa.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-CsgRxA0a.js.map → concurrency-limit._id-qzNUQzQa.js.map} +1 -1
- prefect/server/ui-v2/assets/create-BwXG6EIb.js +2 -0
- prefect/server/ui-v2/assets/{create-D--LHaji.js.map → create-BwXG6EIb.js.map} +1 -1
- prefect/server/ui-v2/assets/{create-BycfZHGQ.js → create-MoiIE9Ms.js} +2 -2
- prefect/server/ui-v2/assets/{create-BycfZHGQ.js.map → create-MoiIE9Ms.js.map} +1 -1
- prefect/server/ui-v2/assets/data-table-CPkppyg6.js +2 -0
- prefect/server/ui-v2/assets/data-table-CPkppyg6.js.map +1 -0
- prefect/server/ui-v2/assets/delete-confirmation-dialog-CwDK_2QS.js +2 -0
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-DHkm2p8m.js.map → delete-confirmation-dialog-CwDK_2QS.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js → deployment-action-header-Vp9YsCJO.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-action-header-D5GOooPm.js.map → deployment-action-header-Vp9YsCJO.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js → deployment-form-CJcg_6DJ.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-wfg6HeAJ.js.map → deployment-form-CJcg_6DJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js → deployment-links-CIkJIuHh.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-6iugOgDh.js.map → deployment-links-CIkJIuHh.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment._id-C6XrGMp_.js +2 -0
- prefect/server/ui-v2/assets/{deployment._id-Ci9zge5n.js.map → deployment._id-C6XrGMp_.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js → deployment._id-CWgTYmTG.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-whsGcHdu.js.map → deployment._id-CWgTYmTG.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate-Bg0s0ZJn.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-D9ZWkh8H.js.map → deployment_._id.duplicate-Bg0s0ZJn.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-CnoB0UeG.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-CS7sObzC.js.map → deployment_._id.edit-CnoB0UeG.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js → deployment_._id.run-BqPK6rTB.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-g7SZuDFi.js.map → deployment_._id.run-BqPK6rTB.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js → dropdown-menu-D7Gwbd15.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-0atiOSFo.js.map → dropdown-menu-D7Gwbd15.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js → event-resource-display-CDRgVKd4.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-DHiAb1Up.js.map → event-resource-display-CDRgVKd4.js.map} +1 -1
- prefect/server/ui-v2/assets/event._eventDate._eventId-C73GMDkK.js +2 -0
- prefect/server/ui-v2/assets/{event._eventDate._eventId-D7Twzb22.js.map → event._eventDate._eventId-C73GMDkK.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js → flow-run-graph-ckiE3mA9.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run-graph-BhzuSJLm.js.map → flow-run-graph-ckiE3mA9.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js → flow-run._id-BukrNCAq.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-CqpH6bvx.js.map → flow-run._id-BukrNCAq.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js → flow-run._id-CtI5VZ2M.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run._id-lIIQBD7H.js.map → flow-run._id-CtI5VZ2M.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-s1UJuakA.js +4 -0
- prefect/server/ui-v2/assets/{flow-run._id-RLy2kBh0.js.map → flow-run._id-s1UJuakA.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js → flow-runs-pagination-SLbYtvaR.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-BATUweRV.js.map → flow-runs-pagination-SLbYtvaR.js.map} +1 -1
- prefect/server/ui-v2/assets/flow._id-CZ5P0v4N.js +2 -0
- prefect/server/ui-v2/assets/{flow._id-BdQGWPKP.js.map → flow._id-CZ5P0v4N.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-DLrbC7rV.js → form-mws4law8.js} +2 -2
- prefect/server/ui-v2/assets/{form-DLrbC7rV.js.map → form-mws4law8.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-BTAWyeXv.js → header-Bes1LmY7.js} +2 -2
- prefect/server/ui-v2/assets/{header-BTAWyeXv.js.map → header-Bes1LmY7.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-ChFAx5uR.js → header-Bj_zBR-a.js} +2 -2
- prefect/server/ui-v2/assets/{header-ChFAx5uR.js.map → header-Bj_zBR-a.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-CyQqOj1w.js → header-CPxTHSvz.js} +2 -2
- prefect/server/ui-v2/assets/{header-CyQqOj1w.js.map → header-CPxTHSvz.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-m48E4KcG.js → index-B8vo2Lrg.js} +5 -5
- prefect/server/ui-v2/assets/{index-m48E4KcG.js.map → index-B8vo2Lrg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-D5RT-SAp.js → index-BBeh-3Nh.js} +2 -2
- prefect/server/ui-v2/assets/{index-D5RT-SAp.js.map → index-BBeh-3Nh.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BLnEvHia.js +2 -0
- prefect/server/ui-v2/assets/{index-7i4X9TeK.js.map → index-BLnEvHia.js.map} +1 -1
- prefect/server/ui-v2/assets/index-BpKoubXu.js +2 -0
- prefect/server/ui-v2/assets/index-BpKoubXu.js.map +1 -0
- prefect/server/ui-v2/assets/index-By6YGqR3.js +2 -0
- prefect/server/ui-v2/assets/index-By6YGqR3.js.map +1 -0
- prefect/server/ui-v2/assets/index-CEi3BlKI.js +2 -0
- prefect/server/ui-v2/assets/index-CEi3BlKI.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BaWDC4da.js → index-CS-zxv7Z.js} +2 -2
- prefect/server/ui-v2/assets/{index-BaWDC4da.js.map → index-CS-zxv7Z.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-kP_I5Qfd.js → index-CToHKh4q.js} +2 -2
- prefect/server/ui-v2/assets/{index-kP_I5Qfd.js.map → index-CToHKh4q.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CKGj5lSu.js → index-CUVvZndW.js} +2 -2
- prefect/server/ui-v2/assets/{index-CKGj5lSu.js.map → index-CUVvZndW.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CxUfZRkN.js → index-CYVn-I3i.js} +2 -2
- prefect/server/ui-v2/assets/{index-CxUfZRkN.js.map → index-CYVn-I3i.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CnlN-VC_.js → index-Cun0JN4t.js} +2 -2
- prefect/server/ui-v2/assets/{index-CnlN-VC_.js.map → index-Cun0JN4t.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BwCLKpNb.js → index-D6ynV6U7.js} +2 -2
- prefect/server/ui-v2/assets/{index-BwCLKpNb.js.map → index-D6ynV6U7.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CHf6xi9j.js → index-DdNUJLRW.js} +2 -2
- prefect/server/ui-v2/assets/{index-CHf6xi9j.js.map → index-DdNUJLRW.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CQnWiUE5.js → index-DlHOXQhu.js} +2 -2
- prefect/server/ui-v2/assets/{index-CQnWiUE5.js.map → index-DlHOXQhu.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js → index-DyVw8YE8.js} +2 -2
- prefect/server/ui-v2/assets/{index-Eqdr6Ff7.js.map → index-DyVw8YE8.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Btb_-PDp.js → index-DzRz7D2P.js} +2 -2
- prefect/server/ui-v2/assets/{index-Btb_-PDp.js.map → index-DzRz7D2P.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DQGif3jm.js → index-DzUcVNZg.js} +2 -2
- prefect/server/ui-v2/assets/{index-DQGif3jm.js.map → index-DzUcVNZg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DNh9ZBy4.js → index-IBvMMs6S.js} +2 -2
- prefect/server/ui-v2/assets/{index-DNh9ZBy4.js.map → index-IBvMMs6S.js.map} +1 -1
- prefect/server/ui-v2/assets/index-_kpA__te.js +2 -0
- prefect/server/ui-v2/assets/{index-CiSFHkhI.js.map → index-_kpA__te.js.map} +1 -1
- prefect/server/ui-v2/assets/index-m9O-nIOl.css +1 -0
- prefect/server/ui-v2/assets/{index-lyQav_XM.js → index-wOvyf10b.js} +2 -2
- prefect/server/ui-v2/assets/{index-lyQav_XM.js.map → index-wOvyf10b.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js → json-input-Ce-HlRqa.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-Ba-BeBcw.js.map → json-input-Ce-HlRqa.js.map} +1 -1
- prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js → key-value-XHEZOtZX.js} +2 -2
- prefect/server/ui-v2/assets/{key-value-DkSKn6jE.js.map → key-value-XHEZOtZX.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js → key._key-LpsMf3zD.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-Cjx57ymg.js.map → key._key-LpsMf3zD.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js → lazy-markdown-1Hz0xzca.js} +2 -2
- prefect/server/ui-v2/assets/{lazy-markdown-Du2Xu3Yp.js.map → lazy-markdown-1Hz0xzca.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-DxMF9Jvj.js → login-D5uepl9L.js} +2 -2
- prefect/server/ui-v2/assets/{login-DxMF9Jvj.js.map → login-D5uepl9L.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js → markdown-input-CG6M9zD0.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-DPi8zyRr.js.map → markdown-input-CG6M9zD0.js.map} +1 -1
- prefect/server/ui-v2/assets/python-example-snippet-DRHcUlCX.js +3 -0
- prefect/server/ui-v2/assets/{python-example-snippet-DfCFYPN_.js.map → python-example-snippet-DRHcUlCX.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-mr6GD840.js → python-input-BsUS8fw1.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-mr6GD840.js.map → python-input-BsUS8fw1.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js → radio-group-BUsmwdrt.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-Co3cN0Kv.js.map → radio-group-BUsmwdrt.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js → route-error-state-BFBpiIhD.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-DnBaNT2T.js.map → route-error-state-BFBpiIhD.js.map} +1 -1
- prefect/server/ui-v2/assets/{schema-form-CWDHSME9.js → schema-form-BwTmkvJk.js} +2 -2
- prefect/server/ui-v2/assets/schema-form-BwTmkvJk.js.map +1 -0
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js → schema-form-input-string-format-datetime-nrb3g-JJ.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-BSWlW_aQ.js.map → schema-form-input-string-format-datetime-nrb3g-JJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-DU5y6tJE.js → settings-CUBtK5aW.js} +2 -2
- prefect/server/ui-v2/assets/{settings-DU5y6tJE.js.map → settings-CUBtK5aW.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js → sort-filter-Cv8zAXMp.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-DpuWNkQo.js.map → sort-filter-Cv8zAXMp.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-bBL6C0ZK.js → table-BBNGfPra.js} +2 -2
- prefect/server/ui-v2/assets/{table-bBL6C0ZK.js.map → table-BBNGfPra.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js → tags-input-DHrnkwjQ.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-BLPMVWpZ.js.map → tags-input-DHrnkwjQ.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js +2 -0
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-S69sih55.js.map → task-run-concurrency-limits-reset-dialog-Z8-yFZ2_.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js → task-run._id-BY58gqs2.js} +2 -2
- prefect/server/ui-v2/assets/{task-run._id-Dl3Azs8t.js.map → task-run._id-BY58gqs2.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js → task-run._id-u73Jxfqw.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-B_tIDm4K.js.map → task-run._id-u73Jxfqw.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-DUy3147A.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-VdR-LO4r.js.map → task-runs-pagination-DUy3147A.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js → textarea-DUhh6-kq.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-B3_TtPRi.js.map → textarea-DUhh6-kq.js.map} +1 -1
- prefect/server/ui-v2/assets/timezone-select-D4Q6VBtD.js +2 -0
- prefect/server/ui-v2/assets/{timezone-select-BuPYznge.js.map → timezone-select-D4Q6VBtD.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js → toggle-group-7WUJn2Tx.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-Cn07UIim.js.map → toggle-group-7WUJn2Tx.js.map} +1 -1
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-D4AD5Ndf.js +2 -0
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DpdsLH4t.js.map → use-delete-automation-confirmation-dialog-D4AD5Ndf.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js → use-delete-block-document-confirmation-dialog-DnwWEGUY.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-Cq5nGhzr.js.map → use-delete-block-document-confirmation-dialog-DnwWEGUY.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js → use-flow-runs-selected-rows-C-tehPRB.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DmQSWBTu.js.map → use-flow-runs-selected-rows-C-tehPRB.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js → use-get-artifacts-flow-task-runs-DRWRrmrb.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DTwcWiqW.js.map → use-get-artifacts-flow-task-runs-DRWRrmrb.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js → use-quick-run-B4Xj-YQQ.js} +2 -2
- prefect/server/ui-v2/assets/{use-quick-run-CPempwLh.js.map → use-quick-run-B4Xj-YQQ.js.map} +1 -1
- prefect/server/ui-v2/assets/use-state-favicon-au2TZdMV.js +2 -0
- prefect/server/ui-v2/assets/{use-state-favicon-M09DmrNy.js.map → use-state-favicon-au2TZdMV.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js → use-stepper-DyIb3vlq.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-CDucnvzp.js.map → use-stepper-DyIb3vlq.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js → utilities-D9Y2wo66.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-BRCNRcQl.js.map → utilities-D9Y2wo66.js.map} +1 -1
- prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js +34 -0
- prefect/server/ui-v2/assets/vendor-recharts-BvvJP9Po.js.map +1 -0
- prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js → work-pool-filter-CSOATj2D.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js.map → work-pool-filter-CSOATj2D.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-Dh7B1zMo.js +2 -0
- prefect/server/ui-v2/assets/{work-pool-queue-toggle-BQ9b-Wxy.js.map → work-pool-queue-toggle-Dh7B1zMo.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool._workPoolName-B_NFWXKS.js +2 -0
- prefect/server/ui-v2/assets/{work-pool._workPoolName-C_LiL3SE.js.map → work-pool._workPoolName-B_NFWXKS.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js → work-pool_._workPoolName.edit-Cyzn8g-S.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-DBHlrVVx.js.map → work-pool_._workPoolName.edit-Cyzn8g-S.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-DkITxJOP.js.map → work-pool_._workPoolName.queue._workQueueName-DQzqQWPT.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js → work-queue-icon-text-BOpcJ8YU.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-D4BWBVDN.js.map → work-queue-icon-text-BOpcJ8YU.js.map} +1 -1
- prefect/server/ui-v2/index.html +3 -3
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/METADATA +2 -1
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/RECORD +223 -211
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js +0 -2
- prefect/server/ui-v2/assets/artifact._id-BFdf1WUA.js.map +0 -1
- prefect/server/ui-v2/assets/automation._id-Dn7jABys.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-Cbpfxded.js.map +0 -1
- prefect/server/ui-v2/assets/catalog_._slug-Bl2J2oI3.js +0 -2
- prefect/server/ui-v2/assets/create-D--LHaji.js +0 -2
- prefect/server/ui-v2/assets/data-table-rlbkLcrY.js +0 -2
- prefect/server/ui-v2/assets/data-table-rlbkLcrY.js.map +0 -1
- prefect/server/ui-v2/assets/delete-confirmation-dialog-DHkm2p8m.js +0 -2
- prefect/server/ui-v2/assets/deployment._id-Ci9zge5n.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-D9ZWkh8H.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-CS7sObzC.js +0 -2
- prefect/server/ui-v2/assets/event._eventDate._eventId-D7Twzb22.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-RLy2kBh0.js +0 -4
- prefect/server/ui-v2/assets/flow._id-BdQGWPKP.js +0 -2
- prefect/server/ui-v2/assets/index-7i4X9TeK.js +0 -2
- prefect/server/ui-v2/assets/index-BkiGTHwU.js +0 -2
- prefect/server/ui-v2/assets/index-BkiGTHwU.js.map +0 -1
- prefect/server/ui-v2/assets/index-COouj_0-.css +0 -1
- prefect/server/ui-v2/assets/index-CiSFHkhI.js +0 -2
- prefect/server/ui-v2/assets/index-DATPYZfT.js +0 -2
- prefect/server/ui-v2/assets/index-DATPYZfT.js.map +0 -1
- prefect/server/ui-v2/assets/index-VH4TnZ4e.js +0 -2
- prefect/server/ui-v2/assets/index-VH4TnZ4e.js.map +0 -1
- prefect/server/ui-v2/assets/python-example-snippet-DfCFYPN_.js +0 -3
- prefect/server/ui-v2/assets/schema-form-CWDHSME9.js.map +0 -1
- prefect/server/ui-v2/assets/task-run-concurrency-limits-reset-dialog-S69sih55.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-VdR-LO4r.js +0 -2
- prefect/server/ui-v2/assets/timezone-select-BuPYznge.js +0 -2
- prefect/server/ui-v2/assets/use-delete-automation-confirmation-dialog-DpdsLH4t.js +0 -2
- prefect/server/ui-v2/assets/use-state-favicon-M09DmrNy.js +0 -2
- prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js +0 -34
- prefect/server/ui-v2/assets/vendor-recharts-BAN776s_.js.map +0 -1
- prefect/server/ui-v2/assets/work-pool-queue-toggle-BQ9b-Wxy.js +0 -2
- prefect/server/ui-v2/assets/work-pool._workPoolName-C_LiL3SE.js +0 -2
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/WHEEL +0 -0
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.15.dist-info → prefect-3.6.16.dev3.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o,t as S,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{
|
|
2
|
-
//# sourceMappingURL=work-pool-filter-
|
|
1
|
+
import{r as o,t as S,j as e}from"./vendor-tanstack-BcZfOOfy.js";import{d0 as C,ag as A,ah as w,ai as N,aj as g,ak as y,al as k,am as z,an as h,ao as x,ap as E,T as L}from"./index-B8vo2Lrg.js";const _=2,D=({selectedDeployments:s,onSelectDeployments:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=S(C({deployments:n?{operator:"and_",name:{like_:n}}:void 0,limit:100,offset:0,sort:"NAME_ASC"})),{data:f=[]}=S(C({deployments:s.size>0?{operator:"and_",id:{any_:Array.from(s)}}:void 0,limit:s.size||1,offset:0,sort:"NAME_ASC"},{enabled:s.size>0})),j=a=>{const r=new Set(s);s.has(a)?r.delete(a):r.add(a),t(r)},p=()=>{t(new Set)},b=()=>{if(s.size===0)return"All deployments";const a=f.filter(d=>s.has(d.id)).map(d=>d.name),r=a.slice(0,_),m=a.length-_;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:r.join(", ")})}),m>0&&e.jsxs(E,{variant:"bodySmall",className:"shrink-0",children:["+ ",m]})]})},l=o.useMemo(()=>c.filter(a=>!n||a.name.toLowerCase().includes(n.toLowerCase())),[c,n]);return e.jsxs(A,{children:[e.jsx(w,{"aria-label":"Filter by deployment",selected:s.size===0,children:b()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search deployments..."}),e.jsxs(y,{children:[e.jsx(k,{children:"No deployments found"}),e.jsxs(z,{children:[e.jsxs(h,{"aria-label":"All deployments",onSelect:p,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:s.size===0}),"All deployments"]}),l.map(a=>e.jsxs(h,{"aria-label":a.name,onSelect:()=>j(a.id),closeOnSelect:!1,value:a.id,children:[e.jsx(x,{checked:s.has(a.id)}),a.name]},a.id))]})]})]})]})},v=2,F=({selectedWorkPools:s,onSelectWorkPools:t})=>{const[i,u]=o.useState(""),n=o.useDeferredValue(i),{data:c=[]}=S(L({limit:100,offset:0})),f=l=>{const a=new Set(s);s.has(l)?a.delete(l):a.add(l),t(a)},j=()=>{t(new Set)},p=()=>{if(s.size===0)return"All work pools";const l=Array.from(s).sort((m,d)=>m.localeCompare(d)),a=l.slice(0,v),r=l.length-v;return e.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[e.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:e.jsx("span",{className:"truncate",children:a.join(", ")})}),r>0&&e.jsxs(E,{variant:"bodySmall",className:"shrink-0",children:["+ ",r]})]})},b=o.useMemo(()=>c.filter(l=>!n||l.name.toLowerCase().includes(n.toLowerCase())).sort((l,a)=>l.name.localeCompare(a.name)),[c,n]);return e.jsxs(A,{children:[e.jsx(w,{"aria-label":"Filter by work pool",selected:s.size===0,children:p()}),e.jsxs(N,{children:[e.jsx(g,{value:i,onValueChange:u,placeholder:"Search work pools..."}),e.jsxs(y,{children:[e.jsx(k,{children:"No work pools found"}),e.jsxs(z,{children:[e.jsxs(h,{"aria-label":"All work pools",onSelect:j,closeOnSelect:!1,value:"__all__",children:[e.jsx(x,{checked:s.size===0}),"All work pools"]}),b.map(l=>e.jsxs(h,{"aria-label":l.name,onSelect:()=>f(l.name),closeOnSelect:!1,value:l.name,children:[e.jsx(x,{checked:s.has(l.name)}),l.name]},l.name))]})]})]})]})};export{D,F as W};
|
|
2
|
+
//# sourceMappingURL=work-pool-filter-CSOATj2D.js.map
|
prefect/server/ui-v2/assets/{work-pool-filter-C2tpSS-w.js.map → work-pool-filter-CSOATj2D.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-pool-filter-C2tpSS-w.js","sources":["../../src/components/flow-runs/flow-runs-list/flow-runs-filters/deployment-filter.tsx","../../src/components/flow-runs/flow-runs-list/flow-runs-filters/work-pool-filter.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterDeploymentsQuery,\n\ttype Deployment,\n} from \"@/api/deployments\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_DEPLOYMENTS_DISPLAYED = 2;\n\ntype DeploymentFilterProps = {\n\tselectedDeployments: Set<string>;\n\tonSelectDeployments: (deployments: Set<string>) => void;\n};\n\nexport const DeploymentFilter = ({\n\tselectedDeployments,\n\tonSelectDeployments,\n}: DeploymentFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: deployments = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery({\n\t\t\tdeployments: deferredSearch\n\t\t\t\t? {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tname: { like_: deferredSearch },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst { data: selectedDeploymentsData = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery(\n\t\t\t{\n\t\t\t\tdeployments:\n\t\t\t\t\tselectedDeployments.size > 0\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\tid: { any_: Array.from(selectedDeployments) },\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\tlimit: selectedDeployments.size || 1,\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t},\n\t\t\t{ enabled: selectedDeployments.size > 0 },\n\t\t),\n\t);\n\n\tconst handleSelectDeployment = (deploymentId: string) => {\n\t\tconst updatedDeployments = new Set(selectedDeployments);\n\t\tif (selectedDeployments.has(deploymentId)) {\n\t\t\tupdatedDeployments.delete(deploymentId);\n\t\t} else {\n\t\t\tupdatedDeployments.add(deploymentId);\n\t\t}\n\t\tonSelectDeployments(updatedDeployments);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectDeployments(new Set());\n\t};\n\n\tconst renderSelectedDeployments = () => {\n\t\tif (selectedDeployments.size === 0) {\n\t\t\treturn \"All deployments\";\n\t\t}\n\n\t\tconst selectedDeploymentNames = selectedDeploymentsData\n\t\t\t.filter((deployment) => selectedDeployments.has(deployment.id))\n\t\t\t.map((deployment) => deployment.name);\n\n\t\tconst visible = selectedDeploymentNames.slice(0, MAX_DEPLOYMENTS_DISPLAYED);\n\t\tconst extraCount =\n\t\t\tselectedDeploymentNames.length - MAX_DEPLOYMENTS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredDeployments = useMemo(() => {\n\t\treturn deployments.filter(\n\t\t\t(deployment: Deployment) =>\n\t\t\t\t!deferredSearch ||\n\t\t\t\tdeployment.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [deployments, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by deployment\"\n\t\t\t\tselected={selectedDeployments.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedDeployments()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search deployments...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No deployments found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All deployments\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.size === 0} />\n\t\t\t\t\t\t\tAll deployments\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredDeployments.map((deployment: Deployment) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={deployment.id}\n\t\t\t\t\t\t\t\taria-label={deployment.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectDeployment(deployment.id)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={deployment.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.has(deployment.id)} />\n\t\t\t\t\t\t\t\t{deployment.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterWorkPoolsQuery,\n\ttype WorkPool,\n} from \"@/api/work-pools/work-pools\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_WORK_POOLS_DISPLAYED = 2;\n\ntype WorkPoolFilterProps = {\n\tselectedWorkPools: Set<string>;\n\tonSelectWorkPools: (workPools: Set<string>) => void;\n};\n\nexport const WorkPoolFilter = ({\n\tselectedWorkPools,\n\tonSelectWorkPools,\n}: WorkPoolFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery({\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst handleSelectWorkPool = (workPoolName: string) => {\n\t\tconst updatedWorkPools = new Set(selectedWorkPools);\n\t\tif (selectedWorkPools.has(workPoolName)) {\n\t\t\tupdatedWorkPools.delete(workPoolName);\n\t\t} else {\n\t\t\tupdatedWorkPools.add(workPoolName);\n\t\t}\n\t\tonSelectWorkPools(updatedWorkPools);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectWorkPools(new Set());\n\t};\n\n\tconst renderSelectedWorkPools = () => {\n\t\tif (selectedWorkPools.size === 0) {\n\t\t\treturn \"All work pools\";\n\t\t}\n\n\t\tconst selectedWorkPoolNames = Array.from(selectedWorkPools).sort((a, b) =>\n\t\t\ta.localeCompare(b),\n\t\t);\n\n\t\tconst visible = selectedWorkPoolNames.slice(0, MAX_WORK_POOLS_DISPLAYED);\n\t\tconst extraCount = selectedWorkPoolNames.length - MAX_WORK_POOLS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredWorkPools = useMemo(() => {\n\t\treturn workPools\n\t\t\t.filter(\n\t\t\t\t(workPool: WorkPool) =>\n\t\t\t\t\t!deferredSearch ||\n\t\t\t\t\tworkPool.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t\t)\n\t\t\t.sort((a: WorkPool, b: WorkPool) => a.name.localeCompare(b.name));\n\t}, [workPools, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by work pool\"\n\t\t\t\tselected={selectedWorkPools.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedWorkPools()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search work pools...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No work pools found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All work pools\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.size === 0} />\n\t\t\t\t\t\t\tAll work pools\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredWorkPools.map((workPool: WorkPool) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={workPool.name}\n\t\t\t\t\t\t\t\taria-label={workPool.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectWorkPool(workPool.name)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={workPool.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.has(workPool.name)} />\n\t\t\t\t\t\t\t\t{workPool.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n"],"names":["MAX_DEPLOYMENTS_DISPLAYED","DeploymentFilter","selectedDeployments","onSelectDeployments","search","setSearch","useState","deferredSearch","useDeferredValue","deployments","useQuery","buildFilterDeploymentsQuery","selectedDeploymentsData","handleSelectDeployment","deploymentId","updatedDeployments","handleClearAll","renderSelectedDeployments","selectedDeploymentNames","deployment","visible","extraCount","jsxs","jsx","Typography","filteredDeployments","useMemo","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandList","ComboboxCommandEmtpy","ComboboxCommandGroup","ComboboxCommandItem","Checkbox","MAX_WORK_POOLS_DISPLAYED","WorkPoolFilter","selectedWorkPools","onSelectWorkPools","workPools","buildFilterWorkPoolsQuery","handleSelectWorkPool","workPoolName","updatedWorkPools","renderSelectedWorkPools","selectedWorkPoolNames","a","b","filteredWorkPools","workPool"],"mappings":"gMAmBA,MAAMA,EAA4B,EAOrBC,EAAmB,CAAC,CAChC,oBAAAC,EACA,oBAAAC,CACD,IAA6B,CAC5B,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAA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AA,CAAAN,EAAAA,IAACO,EAAA,CACA,MAAO1B,EACP,cAAeC,EACf,YAAY,sBAAA,CAAA,SAEZ0B,EAAA,CACA,SAAA,CAAAR,EAAAA,IAACS,GAAqB,SAAA,qBAAA,CAAmB,SACxCC,EAAA,CACA,SAAA,CAAAX,EAAAA,KAACY,EAAA,CACA,aAAW,iBACX,SAAUlB,EACV,cAAe,GACf,MAAM,UAEN,SAAA,CAAAO,EAAAA,IAACY,EAAA,CAAS,QAASG,EAAkB,OAAS,EAAG,EAAE,gBAAA,CAAA,CAAA,EAGnDW,EAAkB,IAAKC,GACvB5B,EAAAA,KAACY,EAAA,CAEA,aAAYgB,EAAS,KACrB,SAAU,IAAMR,EAAqBQ,EAAS,IAAI,EAClD,cAAe,GACf,MAAOA,EAAS,KAEhB,SAAA,CAAA3B,MAACY,GAAS,QAASG,EAAkB,IAAIY,EAAS,IAAI,EAAG,EACxDA,EAAS,IAAA,CAAA,EAPLA,EAAS,IAAA,CASf,CAAA,CAAA,CACF,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF"}
|
|
1
|
+
{"version":3,"file":"work-pool-filter-CSOATj2D.js","sources":["../../src/components/flow-runs/flow-runs-list/flow-runs-filters/deployment-filter.tsx","../../src/components/flow-runs/flow-runs-list/flow-runs-filters/work-pool-filter.tsx"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterDeploymentsQuery,\n\ttype Deployment,\n} from \"@/api/deployments\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_DEPLOYMENTS_DISPLAYED = 2;\n\ntype DeploymentFilterProps = {\n\tselectedDeployments: Set<string>;\n\tonSelectDeployments: (deployments: Set<string>) => void;\n};\n\nexport const DeploymentFilter = ({\n\tselectedDeployments,\n\tonSelectDeployments,\n}: DeploymentFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: deployments = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery({\n\t\t\tdeployments: deferredSearch\n\t\t\t\t? {\n\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\tname: { like_: deferredSearch },\n\t\t\t\t\t}\n\t\t\t\t: undefined,\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t\tsort: \"NAME_ASC\",\n\t\t}),\n\t);\n\n\tconst { data: selectedDeploymentsData = [] } = useQuery(\n\t\tbuildFilterDeploymentsQuery(\n\t\t\t{\n\t\t\t\tdeployments:\n\t\t\t\t\tselectedDeployments.size > 0\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\toperator: \"and_\",\n\t\t\t\t\t\t\t\tid: { any_: Array.from(selectedDeployments) },\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: undefined,\n\t\t\t\tlimit: selectedDeployments.size || 1,\n\t\t\t\toffset: 0,\n\t\t\t\tsort: \"NAME_ASC\",\n\t\t\t},\n\t\t\t{ enabled: selectedDeployments.size > 0 },\n\t\t),\n\t);\n\n\tconst handleSelectDeployment = (deploymentId: string) => {\n\t\tconst updatedDeployments = new Set(selectedDeployments);\n\t\tif (selectedDeployments.has(deploymentId)) {\n\t\t\tupdatedDeployments.delete(deploymentId);\n\t\t} else {\n\t\t\tupdatedDeployments.add(deploymentId);\n\t\t}\n\t\tonSelectDeployments(updatedDeployments);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectDeployments(new Set());\n\t};\n\n\tconst renderSelectedDeployments = () => {\n\t\tif (selectedDeployments.size === 0) {\n\t\t\treturn \"All deployments\";\n\t\t}\n\n\t\tconst selectedDeploymentNames = selectedDeploymentsData\n\t\t\t.filter((deployment) => selectedDeployments.has(deployment.id))\n\t\t\t.map((deployment) => deployment.name);\n\n\t\tconst visible = selectedDeploymentNames.slice(0, MAX_DEPLOYMENTS_DISPLAYED);\n\t\tconst extraCount =\n\t\t\tselectedDeploymentNames.length - MAX_DEPLOYMENTS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredDeployments = useMemo(() => {\n\t\treturn deployments.filter(\n\t\t\t(deployment: Deployment) =>\n\t\t\t\t!deferredSearch ||\n\t\t\t\tdeployment.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [deployments, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by deployment\"\n\t\t\t\tselected={selectedDeployments.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedDeployments()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search deployments...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No deployments found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All deployments\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.size === 0} />\n\t\t\t\t\t\t\tAll deployments\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredDeployments.map((deployment: Deployment) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={deployment.id}\n\t\t\t\t\t\t\t\taria-label={deployment.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectDeployment(deployment.id)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={deployment.id}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedDeployments.has(deployment.id)} />\n\t\t\t\t\t\t\t\t{deployment.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { useDeferredValue, useMemo, useState } from \"react\";\nimport {\n\tbuildFilterWorkPoolsQuery,\n\ttype WorkPool,\n} from \"@/api/work-pools/work-pools\";\nimport { Checkbox } from \"@/components/ui/checkbox\";\nimport {\n\tCombobox,\n\tComboboxCommandEmtpy,\n\tComboboxCommandGroup,\n\tComboboxCommandInput,\n\tComboboxCommandItem,\n\tComboboxCommandList,\n\tComboboxContent,\n\tComboboxTrigger,\n} from \"@/components/ui/combobox\";\nimport { Typography } from \"@/components/ui/typography\";\n\nconst MAX_WORK_POOLS_DISPLAYED = 2;\n\ntype WorkPoolFilterProps = {\n\tselectedWorkPools: Set<string>;\n\tonSelectWorkPools: (workPools: Set<string>) => void;\n};\n\nexport const WorkPoolFilter = ({\n\tselectedWorkPools,\n\tonSelectWorkPools,\n}: WorkPoolFilterProps) => {\n\tconst [search, setSearch] = useState(\"\");\n\tconst deferredSearch = useDeferredValue(search);\n\n\tconst { data: workPools = [] } = useQuery(\n\t\tbuildFilterWorkPoolsQuery({\n\t\t\tlimit: 100,\n\t\t\toffset: 0,\n\t\t}),\n\t);\n\n\tconst handleSelectWorkPool = (workPoolName: string) => {\n\t\tconst updatedWorkPools = new Set(selectedWorkPools);\n\t\tif (selectedWorkPools.has(workPoolName)) {\n\t\t\tupdatedWorkPools.delete(workPoolName);\n\t\t} else {\n\t\t\tupdatedWorkPools.add(workPoolName);\n\t\t}\n\t\tonSelectWorkPools(updatedWorkPools);\n\t};\n\n\tconst handleClearAll = () => {\n\t\tonSelectWorkPools(new Set());\n\t};\n\n\tconst renderSelectedWorkPools = () => {\n\t\tif (selectedWorkPools.size === 0) {\n\t\t\treturn \"All work pools\";\n\t\t}\n\n\t\tconst selectedWorkPoolNames = Array.from(selectedWorkPools).sort((a, b) =>\n\t\t\ta.localeCompare(b),\n\t\t);\n\n\t\tconst visible = selectedWorkPoolNames.slice(0, MAX_WORK_POOLS_DISPLAYED);\n\t\tconst extraCount = selectedWorkPoolNames.length - MAX_WORK_POOLS_DISPLAYED;\n\n\t\treturn (\n\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2\">\n\t\t\t\t<div className=\"flex flex-1 min-w-0 items-center gap-2 overflow-hidden\">\n\t\t\t\t\t<span className=\"truncate\">{visible.join(\", \")}</span>\n\t\t\t\t</div>\n\t\t\t\t{extraCount > 0 && (\n\t\t\t\t\t<Typography variant=\"bodySmall\" className=\"shrink-0\">\n\t\t\t\t\t\t+ {extraCount}\n\t\t\t\t\t</Typography>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t);\n\t};\n\n\tconst filteredWorkPools = useMemo(() => {\n\t\treturn workPools\n\t\t\t.filter(\n\t\t\t\t(workPool: WorkPool) =>\n\t\t\t\t\t!deferredSearch ||\n\t\t\t\t\tworkPool.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t\t)\n\t\t\t.sort((a: WorkPool, b: WorkPool) => a.name.localeCompare(b.name));\n\t}, [workPools, deferredSearch]);\n\n\treturn (\n\t\t<Combobox>\n\t\t\t<ComboboxTrigger\n\t\t\t\taria-label=\"Filter by work pool\"\n\t\t\t\tselected={selectedWorkPools.size === 0}\n\t\t\t>\n\t\t\t\t{renderSelectedWorkPools()}\n\t\t\t</ComboboxTrigger>\n\t\t\t<ComboboxContent>\n\t\t\t\t<ComboboxCommandInput\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonValueChange={setSearch}\n\t\t\t\t\tplaceholder=\"Search work pools...\"\n\t\t\t\t/>\n\t\t\t\t<ComboboxCommandList>\n\t\t\t\t\t<ComboboxCommandEmtpy>No work pools found</ComboboxCommandEmtpy>\n\t\t\t\t\t<ComboboxCommandGroup>\n\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\taria-label=\"All work pools\"\n\t\t\t\t\t\t\tonSelect={handleClearAll}\n\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\tvalue=\"__all__\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.size === 0} />\n\t\t\t\t\t\t\tAll work pools\n\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t{filteredWorkPools.map((workPool: WorkPool) => (\n\t\t\t\t\t\t\t<ComboboxCommandItem\n\t\t\t\t\t\t\t\tkey={workPool.name}\n\t\t\t\t\t\t\t\taria-label={workPool.name}\n\t\t\t\t\t\t\t\tonSelect={() => handleSelectWorkPool(workPool.name)}\n\t\t\t\t\t\t\t\tcloseOnSelect={false}\n\t\t\t\t\t\t\t\tvalue={workPool.name}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Checkbox checked={selectedWorkPools.has(workPool.name)} />\n\t\t\t\t\t\t\t\t{workPool.name}\n\t\t\t\t\t\t\t</ComboboxCommandItem>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ComboboxCommandGroup>\n\t\t\t\t</ComboboxCommandList>\n\t\t\t</ComboboxContent>\n\t\t</Combobox>\n\t);\n};\n"],"names":["MAX_DEPLOYMENTS_DISPLAYED","DeploymentFilter","selectedDeployments","onSelectDeployments","search","setSearch","useState","deferredSearch","useDeferredValue","deployments","useQuery","buildFilterDeploymentsQuery","selectedDeploymentsData","handleSelectDeployment","deploymentId","updatedDeployments","handleClearAll","renderSelectedDeployments","selectedDeploymentNames","deployment","visible","extraCount","jsxs","jsx","Typography","filteredDeployments","useMemo","Combobox","ComboboxTrigger","ComboboxContent","ComboboxCommandInput","ComboboxCommandList","ComboboxCommandEmtpy","ComboboxCommandGroup","ComboboxCommandItem","Checkbox","MAX_WORK_POOLS_DISPLAYED","WorkPoolFilter","selectedWorkPools","onSelectWorkPools","workPools","buildFilterWorkPoolsQuery","handleSelectWorkPool","workPoolName","updatedWorkPools","renderSelectedWorkPools","selectedWorkPoolNames","a","b","filteredWorkPools","workPool"],"mappings":"gMAmBA,MAAMA,EAA4B,EAOrBC,EAAmB,CAAC,CAChC,oBAAAC,EACA,oBAAAC,CACD,IAA6B,CAC5B,KAAM,CAACC,EAAQC,CAAS,EAAIC,EAAAA,SAAS,EAAE,EACjCC,EAAiBC,EAAAA,iBAAiBJ,CAAM,EAExC,CAAE,KAAMK,EAAc,CAAA,GAAOC,EAClCC,EAA4B,CAC3B,YAAaJ,EACV,CACA,SAAU,OACV,KAAM,CAAE,MAAOA,CAAA,CAAe,EAE9B,OACH,MAAO,IACP,OAAQ,EACR,KAAM,UAAA,CACN,CAAA,EAGI,CAAE,KAAMK,EAA0B,CAAA,GAAOF,EAC9CC,EACC,CACC,YACCT,EAAoB,KAAO,EACxB,CACA,SAAU,OACV,GAAI,CAAE,KAAM,MAAM,KAAKA,CAAmB,CAAA,CAAE,EAE5C,OACJ,MAAOA,EAAoB,MAAQ,EACnC,OAAQ,EACR,KAAM,UAAA,EAEP,CAAE,QAASA,EAAoB,KAAO,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ACf,MAAOA,EAAS,KAEhB,SAAA,CAAA3B,MAACY,GAAS,QAASG,EAAkB,IAAIY,EAAS,IAAI,EAAG,EACxDA,EAAS,IAAA,CAAA,EAPLA,EAAS,IAAA,CASf,CAAA,CAAA,CACF,CAAA,CAAA,CACD,CAAA,CAAA,CACD,CAAA,EACD,CAEF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as e,r as y,d as T}from"./vendor-tanstack-BcZfOOfy.js";import{bL as E,bX as S,bU as v,bV as C,H as M,a_ as g,bN as F,bW as W,dr as I,ds as L,y as d,a2 as A,a3 as U,a4 as O,a5 as R,p as P,I as z,a7 as B,bl as V,q as N,dt as $,bM as q,bR as H,bS as Y,bT as Z,du as G,dv as X,G as J}from"./index-B8vo2Lrg.js";import{D as K,a as ee,b as oe,d as se}from"./dropdown-menu-D7Gwbd15.js";import{a as re}from"./zod-Cuos7J7w.js";import{c as ne,o as ae,k as _,b as te,s as x,n as Q}from"./vendor-forms-ClCIacbh.js";import{F as ie,a as h,b as j,c as b,d as w,e as k}from"./form-mws4law8.js";import{T as le}from"./textarea-DUhh6-kq.js";import{D as ce}from"./delete-confirmation-dialog-CwDK_2QS.js";const ue=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],de=E("square-pen",ue),me={READY:{label:"Ready",color:"bg-green-500",tooltip:"Work queue has at least one actively polling worker ready to execute work."},PAUSED:{label:"Paused",color:"bg-yellow-500",tooltip:"Work queue is paused. No work will be executed."},NOT_READY:{label:"Not Ready",color:"bg-red-500",tooltip:"Work queue does not have any actively polling workers ready to execute work."}},Ce=({status:o,className:s})=>{const r=me[o];return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsxs(M,{variant:"secondary",className:g("flex items-center space-x-1 cursor-help",s),children:[o==="PAUSED"?e.jsx(F,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:g("h-2 w-2 rounded-full",r.color)}),e.jsx("span",{children:r.label})]})}),e.jsx(W,{children:e.jsx("p",{children:r.tooltip})})]})})},pe=ae({name:x().min(1,{message:"Name is required"}).regex(/^[a-zA-Z0-9_-]+$/,{message:"Name can only contain letters, numbers, hyphens, and underscores"}),description:x().nullable().optional(),is_paused:te().default(!1),concurrency_limit:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Flow run concurrency must be greater than 0");return s}),Q().positive({message:"Flow run concurrency must be greater than 0"}).nullable()]).nullable().optional(),priority:_([x().transform(o=>{if(o===""||o===null||o===void 0)return null;const s=Number(o);if(Number.isNaN(s))return null;if(s<=0)throw new Error("Priority must be greater than 0");if(!Number.isInteger(s))throw new Error("Priority must be a whole number");return s}),Q().int({message:"Priority must be a whole number"}).positive({message:"Priority must be greater than 0"}).nullable()]).nullable().optional()}),f={name:"",description:"",is_paused:!1,concurrency_limit:null,priority:null},he=({workPoolName:o,queueToEdit:s,onSubmit:r})=>{const{mutate:i,isPending:l}=I(),{mutate:n,isPending:c}=L(),a=ne({resolver:re(pe),defaultValues:f});return y.useEffect(()=>{s?a.reset({name:s.name,description:s.description??"",is_paused:s.is_paused??!1,concurrency_limit:s.concurrency_limit??null,priority:s.priority??null}):a.reset(f)},[a,s]),{form:a,saveOrUpdate:u=>{const m={...u,description:u.description||null};s?n({workPoolName:o,queueName:s.name,workQueueData:{...m,is_paused:m.is_paused??s.is_paused??!1}},{onSuccess:()=>{d.success("Work queue updated"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while updating work queue.";a.setError("root",{message:D})}}):i({workPoolName:o,workQueueData:m},{onSuccess:()=>{d.success("Work queue created"),a.reset(f),r()},onError:t=>{const D=t.message||"Unknown error while creating work queue.";a.setError("root",{message:D})}})},isLoading:l||c}},ge=({workPoolName:o,queueToEdit:s,open:r,onOpenChange:i,onSubmit:l})=>{const{form:n,isLoading:c,saveOrUpdate:a}=he({workPoolName:o,queueToEdit:s,onSubmit:l}),p=!!s,u=p?"Edit Work Queue":"Create Work Queue",m=p?"Save":"Create Work Queue";return e.jsx(A,{open:r,onOpenChange:i,children:e.jsxs(U,{"aria-describedby":void 0,children:[e.jsx(O,{children:e.jsx(R,{children:u})}),e.jsx(ie,{...n,children:e.jsxs("form",{onSubmit:t=>{n.handleSubmit(a)(t)},className:"space-y-4",children:[e.jsx(h,{children:n.formState.errors.root?.message}),e.jsx(j,{control:n.control,name:"name",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Name"}),e.jsx(k,{children:e.jsx(P,{type:"text",autoComplete:"off",...t})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"description",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Description"}),e.jsx(k,{children:e.jsx(le,{...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"concurrency_limit",render:({field:t})=>e.jsxs(b,{children:[e.jsx(w,{children:"Flow Run Concurrency"}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsx(j,{control:n.control,name:"priority",render:({field:t})=>e.jsxs(b,{children:[e.jsxs(w,{className:"flex items-center gap-2",children:["Priority",e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("button",{type:"button",className:"cursor-help",children:e.jsx(z,{id:"Info",className:"size-4"})})}),e.jsx(W,{children:e.jsx("p",{className:"text-xs",children:"Work on higher priority queues is executed first. Lower numbers have higher priority."})})]})]}),e.jsx(k,{children:e.jsx(P,{type:"number",...t,value:t.value||""})}),e.jsx(h,{})]})}),e.jsxs(B,{children:[e.jsx(V,{asChild:!0,children:e.jsx(N,{variant:"outline",children:"Cancel"})}),e.jsx(N,{type:"submit",loading:c,children:m})]})]})})]})})},xe=({queue:o,open:s,onOpenChange:r,onDeleted:i})=>{const l=$(),n=()=>{if(!o.work_pool_name){d.error("Work pool name is required");return}l.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success("Work pool queue deleted successfully"),i?.(),r(!1)},onError:()=>{d.error("Failed to delete work pool queue")}})};return e.jsx(ce,{isOpen:s,title:"Delete Work Pool Queue",description:`Are you sure you want to delete the work pool queue "${o.name}"? This action cannot be undone.`,confirmText:o.name,isLoading:l.isPending,loadingText:"Deleting...",onConfirm:n,onClose:()=>r(!1)})},je=o=>{const s=T(),[r,i]=y.useState(!1),[l,n]=y.useState(!1),c=()=>{navigator.clipboard.writeText(o.id),d.success("ID copied to clipboard")},a=()=>{n(!0)},p=()=>{s({to:"/automations/create"})},u=o.name==="default";return{menuItems:[{label:"Copy ID",icon:q,action:c,show:!0},{label:"Edit",icon:de,action:a,show:!0},{label:"Delete",icon:H,action:()=>i(!0),show:!u,variant:"destructive"},{label:"Automate",icon:Y,action:p,show:!0}].filter(t=>t.show),showDeleteDialog:r,setShowDeleteDialog:i,showEditDialog:l,setShowEditDialog:n,triggerIcon:Z}},We=({queue:o,onUpdate:s,className:r})=>{const{menuItems:i,showDeleteDialog:l,setShowDeleteDialog:n,showEditDialog:c,setShowEditDialog:a,triggerIcon:p}=je(o);return e.jsxs(e.Fragment,{children:[e.jsxs(K,{children:[e.jsx(ee,{asChild:!0,children:e.jsxs(N,{variant:"outline",size:"icon",className:g("size-8",r),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(p,{className:"size-4"})]})}),e.jsx(oe,{align:"end",children:i.map(u=>{const m=u.icon;return e.jsxs(se,{onClick:u.action,className:g(u.variant==="destructive"&&"text-destructive"),children:[e.jsx(m,{className:"mr-2 h-4 w-4"}),u.label]},u.label)})})]}),e.jsx(xe,{queue:o,open:l,onOpenChange:n,onDeleted:s}),e.jsx(ge,{workPoolName:o.work_pool_name??"",queueToEdit:o,open:c,onOpenChange:a,onSubmit:()=>{a(!1),s?.()}})]})},be=(o,s)=>{const r=G(),i=X();return{handleToggle:y.useCallback(n=>{if(!o.work_pool_name){d.error("Work pool name is required");return}const c=n?i:r,a=n?"resumed":"paused";c.mutate({workPoolName:o.work_pool_name,queueName:o.name},{onSuccess:()=>{d.success(`Queue ${a} successfully`),s?.()},onError:()=>{d.error(`Failed to ${a.slice(0,-1)} queue`)}})},[o,r,i,s]),isLoading:r.isPending||i.isPending}},_e=({queue:o,onUpdate:s,disabled:r=!1,className:i})=>{const{handleToggle:l,isLoading:n}=be(o,s),c=o.status==="PAUSED",a=r||n;return e.jsx(S,{children:e.jsxs(v,{children:[e.jsx(C,{asChild:!0,children:e.jsx("div",{children:e.jsx(J,{checked:!c,onCheckedChange:l,disabled:a,"aria-label":c?"Resume work pool queue":"Pause work pool queue",className:g(i)})})}),e.jsx(W,{children:e.jsx("p",{children:"Pause or resume this work pool queue"})})]})})};export{de as S,Ce as W,_e as a,We as b,ge as c};
|
|
2
|
+
//# sourceMappingURL=work-pool-queue-toggle-Dh7B1zMo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"work-pool-queue-toggle-BQ9b-Wxy.js","sources":["../../node_modules/lucide-react/dist/esm/icons/square-pen.js","../../src/components/work-pools/work-pool-queue-status-badge/work-pool-queue-status-badge.tsx","../../src/components/work-pools/work-pool-queue-create-dialog/use-create-work-pool-queue-form.ts","../../src/components/work-pools/work-pool-queue-create-dialog/work-pool-queue-create-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/components/delete-work-pool-queue-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/hooks/use-work-pool-queue-menu.ts","../../src/components/work-pools/work-pool-queue-menu/work-pool-queue-menu.tsx","../../src/components/work-pools/work-pool-queue-toggle/hooks/use-work-pool-queue-toggle.ts","../../src/components/work-pools/work-pool-queue-toggle/work-pool-queue-toggle.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\", key: \"1m0v6g\" }],\n [\n \"path\",\n {\n d: \"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\",\n key: \"ohrbg2\"\n }\n ]\n];\nconst SquarePen = createLucideIcon(\"square-pen\", __iconNode);\n\nexport { __iconNode, SquarePen as default };\n//# sourceMappingURL=square-pen.js.map\n","import { Pause } from \"lucide-react\";\nimport type { WorkPoolQueueStatus } from \"@/api/work-pool-queues\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\n\ntype WorkPoolQueueStatusBadgeProps = {\n\tstatus: WorkPoolQueueStatus;\n\tclassName?: string;\n};\n\nconst statusConfig = {\n\tREADY: {\n\t\tlabel: \"Ready\",\n\t\tcolor: \"bg-green-500\",\n\t\ttooltip:\n\t\t\t\"Work queue has at least one actively polling worker ready to execute work.\",\n\t},\n\tPAUSED: {\n\t\tlabel: \"Paused\",\n\t\tcolor: \"bg-yellow-500\",\n\t\ttooltip: \"Work queue is paused. No work will be executed.\",\n\t},\n\tNOT_READY: {\n\t\tlabel: \"Not Ready\",\n\t\tcolor: \"bg-red-500\",\n\t\ttooltip:\n\t\t\t\"Work queue does not have any actively polling workers ready to execute work.\",\n\t},\n};\n\nexport const WorkPoolQueueStatusBadge = ({\n\tstatus,\n\tclassName,\n}: WorkPoolQueueStatusBadgeProps) => {\n\tconst config = statusConfig[status];\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<Badge\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName={cn(\"flex items-center space-x-1 cursor-help\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{status === \"PAUSED\" ? (\n\t\t\t\t\t\t\t<Pause className=\"h-2 w-2 text-muted-foreground\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className={cn(\"h-2 w-2 rounded-full\", config.color)} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span>{config.label}</span>\n\t\t\t\t\t</Badge>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>{config.tooltip}</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\tuseCreateWorkPoolQueueMutation,\n\tuseUpdateWorkPoolQueueMutation,\n\ttype WorkPoolQueue,\n} from \"@/api/work-pool-queues\";\n\nconst formSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.min(1, { message: \"Name is required\" })\n\t\t.regex(/^[a-zA-Z0-9_-]+$/, {\n\t\t\tmessage:\n\t\t\t\t\"Name can only contain letters, numbers, hyphens, and underscores\",\n\t\t}),\n\tdescription: z.string().nullable().optional(),\n\tis_paused: z.boolean().default(false),\n\tconcurrency_limit: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0)\n\t\t\t\t\tthrow new Error(\"Flow run concurrency must be greater than 0\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.positive({ message: \"Flow run concurrency must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n\tpriority: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0) throw new Error(\"Priority must be greater than 0\");\n\t\t\t\tif (!Number.isInteger(num))\n\t\t\t\t\tthrow new Error(\"Priority must be a whole number\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.int({ message: \"Priority must be a whole number\" })\n\t\t\t\t.positive({ message: \"Priority must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n});\n\nexport const DEFAULT_VALUES = {\n\tname: \"\",\n\tdescription: \"\",\n\tis_paused: false,\n\tconcurrency_limit: null,\n\tpriority: null,\n} as const;\n\ntype UseCreateOrEditWorkPoolQueueFormOptions = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditWorkPoolQueueForm = ({\n\tworkPoolName,\n\tqueueToEdit,\n\tonSubmit,\n}: UseCreateOrEditWorkPoolQueueFormOptions) => {\n\tconst { mutate: createWorkPoolQueue, isPending: isCreateLoading } =\n\t\tuseCreateWorkPoolQueueMutation();\n\tconst { mutate: updateWorkPoolQueue, isPending: isUpdateLoading } =\n\t\tuseUpdateWorkPoolQueueMutation();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with queue-to-edit data\n\tuseEffect(() => {\n\t\tif (queueToEdit) {\n\t\t\tform.reset({\n\t\t\t\tname: queueToEdit.name,\n\t\t\t\tdescription: queueToEdit.description ?? \"\",\n\t\t\t\tis_paused: queueToEdit.is_paused ?? false,\n\t\t\t\tconcurrency_limit: queueToEdit.concurrency_limit ?? null,\n\t\t\t\tpriority: queueToEdit.priority ?? null,\n\t\t\t});\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, queueToEdit]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst workQueueData = {\n\t\t\t...values,\n\t\t\tdescription: values.description || null,\n\t\t};\n\n\t\tif (queueToEdit) {\n\t\t\tupdateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tqueueName: queueToEdit.name,\n\t\t\t\t\tworkQueueData: {\n\t\t\t\t\t\t...workQueueData,\n\t\t\t\t\t\tis_paused:\n\t\t\t\t\t\t\tworkQueueData.is_paused ?? queueToEdit.is_paused ?? false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue updated\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while updating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tworkQueueData,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue created\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while creating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: isCreateLoading || isUpdateLoading,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Input } from \"@/components/ui/input\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nimport { useCreateOrEditWorkPoolQueueForm } from \"./use-create-work-pool-queue-form\";\n\ntype WorkPoolQueueCreateOrEditDialogProps = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const WorkPoolQueueCreateOrEditDialog = ({\n\tworkPoolName,\n\tqueueToEdit,\n\topen,\n\tonOpenChange,\n\tonSubmit,\n}: WorkPoolQueueCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } = useCreateOrEditWorkPoolQueueForm({\n\t\tworkPoolName,\n\t\tqueueToEdit,\n\t\tonSubmit,\n\t});\n\n\tconst isEditMode = !!queueToEdit;\n\tconst dialogTitle = isEditMode ? \"Edit Work Queue\" : \"Create Work Queue\";\n\tconst submitButtonText = isEditMode ? \"Save\" : \"Create Work Queue\";\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Description</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Textarea {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Flow Run Concurrency</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"priority\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t\t\tPriority\n\t\t\t\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" className=\"cursor-help\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon id=\"Info\" className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t\t\t\t\t<p className=\"text-xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\tWork on higher priority queues is executed first.\n\t\t\t\t\t\t\t\t\t\t\t\t\tLower numbers have higher priority.\n\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Cancel</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{submitButtonText}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { useDeleteWorkPoolQueueMutation } from \"@/api/work-pool-queues\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\ntype DeleteWorkPoolQueueDialogProps = {\n\tqueue: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonDeleted?: () => void;\n};\n\nexport const DeleteWorkPoolQueueDialog = ({\n\tqueue,\n\topen,\n\tonOpenChange,\n\tonDeleted,\n}: DeleteWorkPoolQueueDialogProps) => {\n\tconst deleteQueueMutation = useDeleteWorkPoolQueueMutation();\n\n\tconst handleDelete = () => {\n\t\tif (!queue.work_pool_name) {\n\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\treturn;\n\t\t}\n\n\t\tdeleteQueueMutation.mutate(\n\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Work pool queue deleted successfully\");\n\t\t\t\t\tonDeleted?.();\n\t\t\t\t\tonOpenChange(false);\n\t\t\t\t},\n\t\t\t\tonError: () => {\n\t\t\t\t\ttoast.error(\"Failed to delete work pool queue\");\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<DeleteConfirmationDialog\n\t\t\tisOpen={open}\n\t\t\ttitle=\"Delete Work Pool Queue\"\n\t\t\tdescription={`Are you sure you want to delete the work pool queue \"${queue.name}\"? This action cannot be undone.`}\n\t\t\tconfirmText={queue.name}\n\t\t\tisLoading={deleteQueueMutation.isPending}\n\t\t\tloadingText=\"Deleting...\"\n\t\t\tonConfirm={handleDelete}\n\t\t\tonClose={() => onOpenChange(false)}\n\t\t/>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { Copy, Edit, MoreVertical, Trash2, Zap } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueMenu = (queue: WorkPoolQueue) => {\n\tconst navigate = useNavigate();\n\tconst [showDeleteDialog, setShowDeleteDialog] = useState(false);\n\tconst [showEditDialog, setShowEditDialog] = useState(false);\n\n\tconst handleCopyId = () => {\n\t\tvoid navigator.clipboard.writeText(queue.id);\n\t\ttoast.success(\"ID copied to clipboard\");\n\t};\n\n\tconst handleEdit = () => {\n\t\tsetShowEditDialog(true);\n\t};\n\n\tconst handleAutomate = () => {\n\t\tvoid navigate({\n\t\t\tto: \"/automations/create\",\n\t\t});\n\t};\n\n\tconst isDefaultQueue = queue.name === \"default\";\n\n\tconst menuItems = [\n\t\t{\n\t\t\tlabel: \"Copy ID\",\n\t\t\ticon: Copy,\n\t\t\taction: handleCopyId,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Edit\",\n\t\t\ticon: Edit,\n\t\t\taction: handleEdit,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Delete\",\n\t\t\ticon: Trash2,\n\t\t\taction: () => setShowDeleteDialog(true),\n\t\t\tshow: !isDefaultQueue, // Default queue cannot be deleted\n\t\t\tvariant: \"destructive\" as const,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Automate\",\n\t\t\ticon: Zap,\n\t\t\taction: handleAutomate,\n\t\t\tshow: true,\n\t\t},\n\t].filter((item) => item.show);\n\n\treturn {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: MoreVertical,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { WorkPoolQueueCreateOrEditDialog } from \"@/components/work-pools/work-pool-queue-create-dialog\";\nimport { cn } from \"@/utils\";\nimport { DeleteWorkPoolQueueDialog } from \"./components/delete-work-pool-queue-dialog\";\nimport { useWorkPoolQueueMenu } from \"./hooks/use-work-pool-queue-menu\";\n\ntype WorkPoolQueueMenuProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueMenu = ({\n\tqueue,\n\tonUpdate,\n\tclassName,\n}: WorkPoolQueueMenuProps) => {\n\tconst {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: TriggerIcon,\n\t} = useWorkPoolQueueMenu(queue);\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName={cn(\"size-8\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<TriggerIcon className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t{menuItems.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\t\t\tonClick={item.action}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\titem.variant === \"destructive\" && \"text-destructive\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t\t<DeleteWorkPoolQueueDialog\n\t\t\t\tqueue={queue}\n\t\t\t\topen={showDeleteDialog}\n\t\t\t\tonOpenChange={setShowDeleteDialog}\n\t\t\t\tonDeleted={onUpdate}\n\t\t\t/>\n\t\t\t<WorkPoolQueueCreateOrEditDialog\n\t\t\t\tworkPoolName={queue.work_pool_name ?? \"\"}\n\t\t\t\tqueueToEdit={queue}\n\t\t\t\topen={showEditDialog}\n\t\t\t\tonOpenChange={setShowEditDialog}\n\t\t\t\tonSubmit={() => {\n\t\t\t\t\tsetShowEditDialog(false);\n\t\t\t\t\tonUpdate?.();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n};\n","import { useCallback } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport {\n\tusePauseWorkPoolQueueMutation,\n\tuseResumeWorkPoolQueueMutation,\n} from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueToggle = (\n\tqueue: WorkPoolQueue,\n\tonUpdate?: () => void,\n) => {\n\tconst pauseMutation = usePauseWorkPoolQueueMutation();\n\tconst resumeMutation = useResumeWorkPoolQueueMutation();\n\n\tconst handleToggle = useCallback(\n\t\t(isResumed: boolean) => {\n\t\t\tif (!queue.work_pool_name) {\n\t\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mutation = isResumed ? resumeMutation : pauseMutation;\n\t\t\tconst action = isResumed ? \"resumed\" : \"paused\";\n\n\t\t\tmutation.mutate(\n\t\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(`Queue ${action} successfully`);\n\t\t\t\t\t\tonUpdate?.();\n\t\t\t\t\t},\n\t\t\t\t\tonError: () => {\n\t\t\t\t\t\ttoast.error(`Failed to ${action.slice(0, -1)} queue`);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\t[queue, pauseMutation, resumeMutation, onUpdate],\n\t);\n\n\treturn {\n\t\thandleToggle,\n\t\tisLoading: pauseMutation.isPending || resumeMutation.isPending,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Switch } from \"@/components/ui/switch\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\nimport { useWorkPoolQueueToggle } from \"./hooks/use-work-pool-queue-toggle\";\n\ntype WorkPoolQueueToggleProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueToggle = ({\n\tqueue,\n\tonUpdate,\n\tdisabled = false,\n\tclassName,\n}: WorkPoolQueueToggleProps) => {\n\tconst { handleToggle, isLoading } = useWorkPoolQueueToggle(queue, onUpdate);\n\tconst isPaused = queue.status === \"PAUSED\";\n\n\tconst isDisabled = disabled || isLoading;\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\tchecked={!isPaused}\n\t\t\t\t\t\t\tonCheckedChange={handleToggle}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tisPaused ? \"Resume work pool queue\" : \"Pause work pool queue\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName={cn(className)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>Pause or resume this work pool queue</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n"],"names":["__iconNode","SquarePen","createLucideIcon","statusConfig","WorkPoolQueueStatusBadge","status","className","config","jsx","TooltipProvider","jsxs","Tooltip","TooltipTrigger","Badge","cn","Pause","TooltipContent","formSchema","z.object","z.string","z.boolean","z.union","val","num","z.number","DEFAULT_VALUES","useCreateOrEditWorkPoolQueueForm","workPoolName","queueToEdit","onSubmit","createWorkPoolQueue","isCreateLoading","useCreateWorkPoolQueueMutation","updateWorkPoolQueue","isUpdateLoading","useUpdateWorkPoolQueueMutation","form","useForm","zodResolver","useEffect","values","workQueueData","toast","error","message","WorkPoolQueueCreateOrEditDialog","open","onOpenChange","isLoading","saveOrUpdate","isEditMode","dialogTitle","submitButtonText","Dialog","DialogContent","DialogHeader","DialogTitle","Form","e","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","Textarea","Icon","DialogFooter","DialogTrigger","Button","DeleteWorkPoolQueueDialog","queue","onDeleted","deleteQueueMutation","useDeleteWorkPoolQueueMutation","handleDelete","DeleteConfirmationDialog","useWorkPoolQueueMenu","navigate","useNavigate","showDeleteDialog","setShowDeleteDialog","useState","showEditDialog","setShowEditDialog","handleCopyId","handleEdit","handleAutomate","isDefaultQueue","Copy","Edit","Trash2","Zap","item","MoreVertical","WorkPoolQueueMenu","onUpdate","menuItems","TriggerIcon","Fragment","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","useWorkPoolQueueToggle","pauseMutation","usePauseWorkPoolQueueMutation","resumeMutation","useResumeWorkPoolQueueMutation","useCallback","isResumed","mutation","action","WorkPoolQueueToggle","disabled","handleToggle","isPaused","isDisabled","Switch"],"mappings":"krBASA,MAAMA,GAAa,CACjB,CAAC,OAAQ,CAAE,EAAG,6DAA8D,IAAK,QAAQ,CAAE,EAC3F,CACE,OACA,CACE,EAAG,0HACH,IAAK,QACX,CACA,CACA,EACMC,GAAYC,EAAiB,aAAcF,EAAU,ECHrDG,GAAe,CACpB,MAAO,CACN,MAAO,QACP,MAAO,eACP,QACC,4EAAA,EAEF,OAAQ,CACP,MAAO,SACP,MAAO,gBACP,QAAS,iDAAA,EAEV,UAAW,CACV,MAAO,YACP,MAAO,aACP,QACC,8EAAA,CAEH,EAEaC,GAA2B,CAAC,CACxC,OAAAC,EACA,UAAAC,CACD,IAAqC,CACpC,MAAMC,EAASJ,GAAaE,CAAM,EAElC,OACCG,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,EAAAA,IAACI,EAAA,CAAe,QAAO,GACtB,SAAAF,EAAAA,KAACG,EAAA,CACA,QAAQ,YACR,UAAWC,EAAG,0CAA2CR,CAAS,EAEjE,SAAA,CAAAD,IAAW,SACXG,EAAAA,IAACO,EAAA,CAAM,UAAU,gCAAgC,EAEjDP,EAAAA,IAAC,MAAA,CAAI,UAAWM,EAAG,uBAAwBP,EAAO,KAAK,EAAG,EAE3DC,EAAAA,IAAC,OAAA,CAAM,SAAAD,EAAO,KAAA,CAAM,CAAA,CAAA,CAAA,EAEtB,QACCS,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAG,SAAAD,EAAO,QAAQ,CAAA,CACpB,CAAA,CAAA,CACD,CAAA,CACD,CAEF,ECrDMU,GAAaC,GAAS,CAC3B,KAAMC,IAEJ,IAAI,EAAG,CAAE,QAAS,kBAAA,CAAoB,E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AA,CACA,QAAS,CAACF,EACV,gBAAiBD,EACjB,SAAUE,EACV,aACCD,EAAW,yBAA2B,wBAEvC,UAAWvG,EAAGR,CAAS,CAAA,CAAA,EAEzB,CAAA,CACD,EACAE,MAACQ,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAE,gDAAoC,CAAA,CACxC,CAAA,CAAA,CACD,CAAA,CACD,CAEF","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"work-pool-queue-toggle-Dh7B1zMo.js","sources":["../../node_modules/lucide-react/dist/esm/icons/square-pen.js","../../src/components/work-pools/work-pool-queue-status-badge/work-pool-queue-status-badge.tsx","../../src/components/work-pools/work-pool-queue-create-dialog/use-create-work-pool-queue-form.ts","../../src/components/work-pools/work-pool-queue-create-dialog/work-pool-queue-create-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/components/delete-work-pool-queue-dialog.tsx","../../src/components/work-pools/work-pool-queue-menu/hooks/use-work-pool-queue-menu.ts","../../src/components/work-pools/work-pool-queue-menu/work-pool-queue-menu.tsx","../../src/components/work-pools/work-pool-queue-toggle/hooks/use-work-pool-queue-toggle.ts","../../src/components/work-pools/work-pool-queue-toggle/work-pool-queue-toggle.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.563.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"path\", { d: \"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7\", key: \"1m0v6g\" }],\n [\n \"path\",\n {\n d: \"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z\",\n key: \"ohrbg2\"\n }\n ]\n];\nconst SquarePen = createLucideIcon(\"square-pen\", __iconNode);\n\nexport { __iconNode, SquarePen as default };\n//# sourceMappingURL=square-pen.js.map\n","import { Pause } from \"lucide-react\";\nimport type { WorkPoolQueueStatus } from \"@/api/work-pool-queues\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\n\ntype WorkPoolQueueStatusBadgeProps = {\n\tstatus: WorkPoolQueueStatus;\n\tclassName?: string;\n};\n\nconst statusConfig = {\n\tREADY: {\n\t\tlabel: \"Ready\",\n\t\tcolor: \"bg-green-500\",\n\t\ttooltip:\n\t\t\t\"Work queue has at least one actively polling worker ready to execute work.\",\n\t},\n\tPAUSED: {\n\t\tlabel: \"Paused\",\n\t\tcolor: \"bg-yellow-500\",\n\t\ttooltip: \"Work queue is paused. No work will be executed.\",\n\t},\n\tNOT_READY: {\n\t\tlabel: \"Not Ready\",\n\t\tcolor: \"bg-red-500\",\n\t\ttooltip:\n\t\t\t\"Work queue does not have any actively polling workers ready to execute work.\",\n\t},\n};\n\nexport const WorkPoolQueueStatusBadge = ({\n\tstatus,\n\tclassName,\n}: WorkPoolQueueStatusBadgeProps) => {\n\tconst config = statusConfig[status];\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<Badge\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName={cn(\"flex items-center space-x-1 cursor-help\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{status === \"PAUSED\" ? (\n\t\t\t\t\t\t\t<Pause className=\"h-2 w-2 text-muted-foreground\" />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className={cn(\"h-2 w-2 rounded-full\", config.color)} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span>{config.label}</span>\n\t\t\t\t\t</Badge>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>{config.tooltip}</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useEffect } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport {\n\tuseCreateWorkPoolQueueMutation,\n\tuseUpdateWorkPoolQueueMutation,\n\ttype WorkPoolQueue,\n} from \"@/api/work-pool-queues\";\n\nconst formSchema = z.object({\n\tname: z\n\t\t.string()\n\t\t.min(1, { message: \"Name is required\" })\n\t\t.regex(/^[a-zA-Z0-9_-]+$/, {\n\t\t\tmessage:\n\t\t\t\t\"Name can only contain letters, numbers, hyphens, and underscores\",\n\t\t}),\n\tdescription: z.string().nullable().optional(),\n\tis_paused: z.boolean().default(false),\n\tconcurrency_limit: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0)\n\t\t\t\t\tthrow new Error(\"Flow run concurrency must be greater than 0\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.positive({ message: \"Flow run concurrency must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n\tpriority: z\n\t\t.union([\n\t\t\tz.string().transform((val) => {\n\t\t\t\tif (val === \"\" || val === null || val === undefined) return null;\n\t\t\t\tconst num = Number(val);\n\t\t\t\tif (Number.isNaN(num)) return null;\n\t\t\t\tif (num <= 0) throw new Error(\"Priority must be greater than 0\");\n\t\t\t\tif (!Number.isInteger(num))\n\t\t\t\t\tthrow new Error(\"Priority must be a whole number\");\n\t\t\t\treturn num;\n\t\t\t}),\n\t\t\tz\n\t\t\t\t.number()\n\t\t\t\t.int({ message: \"Priority must be a whole number\" })\n\t\t\t\t.positive({ message: \"Priority must be greater than 0\" })\n\t\t\t\t.nullable(),\n\t\t])\n\t\t.nullable()\n\t\t.optional(),\n});\n\nexport const DEFAULT_VALUES = {\n\tname: \"\",\n\tdescription: \"\",\n\tis_paused: false,\n\tconcurrency_limit: null,\n\tpriority: null,\n} as const;\n\ntype UseCreateOrEditWorkPoolQueueFormOptions = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditWorkPoolQueueForm = ({\n\tworkPoolName,\n\tqueueToEdit,\n\tonSubmit,\n}: UseCreateOrEditWorkPoolQueueFormOptions) => {\n\tconst { mutate: createWorkPoolQueue, isPending: isCreateLoading } =\n\t\tuseCreateWorkPoolQueueMutation();\n\tconst { mutate: updateWorkPoolQueue, isPending: isUpdateLoading } =\n\t\tuseUpdateWorkPoolQueueMutation();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with queue-to-edit data\n\tuseEffect(() => {\n\t\tif (queueToEdit) {\n\t\t\tform.reset({\n\t\t\t\tname: queueToEdit.name,\n\t\t\t\tdescription: queueToEdit.description ?? \"\",\n\t\t\t\tis_paused: queueToEdit.is_paused ?? false,\n\t\t\t\tconcurrency_limit: queueToEdit.concurrency_limit ?? null,\n\t\t\t\tpriority: queueToEdit.priority ?? null,\n\t\t\t});\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, queueToEdit]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst workQueueData = {\n\t\t\t...values,\n\t\t\tdescription: values.description || null,\n\t\t};\n\n\t\tif (queueToEdit) {\n\t\t\tupdateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tqueueName: queueToEdit.name,\n\t\t\t\t\tworkQueueData: {\n\t\t\t\t\t\t...workQueueData,\n\t\t\t\t\t\tis_paused:\n\t\t\t\t\t\t\tworkQueueData.is_paused ?? queueToEdit.is_paused ?? false,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue updated\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while updating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateWorkPoolQueue(\n\t\t\t\t{\n\t\t\t\t\tworkPoolName,\n\t\t\t\t\tworkQueueData,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Work queue created\");\n\t\t\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\t\t\tonSubmit();\n\t\t\t\t\t},\n\t\t\t\t\tonError: (error) => {\n\t\t\t\t\t\tconst message =\n\t\t\t\t\t\t\terror.message || \"Unknown error while creating work queue.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: isCreateLoading || isUpdateLoading,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\nimport {\n\tForm,\n\tFormControl,\n\tFormField,\n\tFormItem,\n\tFormLabel,\n\tFormMessage,\n} from \"@/components/ui/form\";\nimport { Icon } from \"@/components/ui/icons\";\nimport { Input } from \"@/components/ui/input\";\nimport { Textarea } from \"@/components/ui/textarea\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\n\nimport { useCreateOrEditWorkPoolQueueForm } from \"./use-create-work-pool-queue-form\";\n\ntype WorkPoolQueueCreateOrEditDialogProps = {\n\tworkPoolName: string;\n\tqueueToEdit?: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const WorkPoolQueueCreateOrEditDialog = ({\n\tworkPoolName,\n\tqueueToEdit,\n\topen,\n\tonOpenChange,\n\tonSubmit,\n}: WorkPoolQueueCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } = useCreateOrEditWorkPoolQueueForm({\n\t\tworkPoolName,\n\t\tqueueToEdit,\n\t\tonSubmit,\n\t});\n\n\tconst isEditMode = !!queueToEdit;\n\tconst dialogTitle = isEditMode ? \"Edit Work Queue\" : \"Create Work Queue\";\n\tconst submitButtonText = isEditMode ? \"Save\" : \"Create Work Queue\";\n\n\treturn (\n\t\t<Dialog open={open} onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>{dialogTitle}</DialogTitle>\n\t\t\t\t</DialogHeader>\n\n\t\t\t\t<Form {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => void form.handleSubmit(saveOrUpdate)(e)}\n\t\t\t\t\t\tclassName=\"space-y-4\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<FormMessage>{form.formState.errors.root?.message}</FormMessage>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Name</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"text\" autoComplete=\"off\" {...field} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Description</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Textarea {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"concurrency_limit\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel>Flow Run Concurrency</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\tname=\"priority\"\n\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t<FormLabel className=\"flex items-center gap-2\">\n\t\t\t\t\t\t\t\t\t\tPriority\n\t\t\t\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t\t\t\t<button type=\"button\" className=\"cursor-help\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Icon id=\"Info\" className=\"size-4\" />\n\t\t\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t\t\t\t<TooltipContent>\n\t\t\t\t\t\t\t\t\t\t\t\t<p className=\"text-xs\">\n\t\t\t\t\t\t\t\t\t\t\t\t\tWork on higher priority queues is executed first.\n\t\t\t\t\t\t\t\t\t\t\t\t\tLower numbers have higher priority.\n\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t</TooltipContent>\n\t\t\t\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t\t\t\t</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} value={field.value || \"\"} />\n\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<DialogFooter>\n\t\t\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t\t\t<Button variant=\"outline\">Cancel</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isLoading}>\n\t\t\t\t\t\t\t\t{submitButtonText}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</DialogFooter>\n\t\t\t\t\t</form>\n\t\t\t\t</Form>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { useDeleteWorkPoolQueueMutation } from \"@/api/work-pool-queues\";\nimport { DeleteConfirmationDialog } from \"@/components/ui/delete-confirmation-dialog\";\n\ntype DeleteWorkPoolQueueDialogProps = {\n\tqueue: WorkPoolQueue;\n\topen: boolean;\n\tonOpenChange: (open: boolean) => void;\n\tonDeleted?: () => void;\n};\n\nexport const DeleteWorkPoolQueueDialog = ({\n\tqueue,\n\topen,\n\tonOpenChange,\n\tonDeleted,\n}: DeleteWorkPoolQueueDialogProps) => {\n\tconst deleteQueueMutation = useDeleteWorkPoolQueueMutation();\n\n\tconst handleDelete = () => {\n\t\tif (!queue.work_pool_name) {\n\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\treturn;\n\t\t}\n\n\t\tdeleteQueueMutation.mutate(\n\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Work pool queue deleted successfully\");\n\t\t\t\t\tonDeleted?.();\n\t\t\t\t\tonOpenChange(false);\n\t\t\t\t},\n\t\t\t\tonError: () => {\n\t\t\t\t\ttoast.error(\"Failed to delete work pool queue\");\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\treturn (\n\t\t<DeleteConfirmationDialog\n\t\t\tisOpen={open}\n\t\t\ttitle=\"Delete Work Pool Queue\"\n\t\t\tdescription={`Are you sure you want to delete the work pool queue \"${queue.name}\"? This action cannot be undone.`}\n\t\t\tconfirmText={queue.name}\n\t\t\tisLoading={deleteQueueMutation.isPending}\n\t\t\tloadingText=\"Deleting...\"\n\t\t\tonConfirm={handleDelete}\n\t\t\tonClose={() => onOpenChange(false)}\n\t\t/>\n\t);\n};\n","import { useNavigate } from \"@tanstack/react-router\";\nimport { Copy, Edit, MoreVertical, Trash2, Zap } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueMenu = (queue: WorkPoolQueue) => {\n\tconst navigate = useNavigate();\n\tconst [showDeleteDialog, setShowDeleteDialog] = useState(false);\n\tconst [showEditDialog, setShowEditDialog] = useState(false);\n\n\tconst handleCopyId = () => {\n\t\tvoid navigator.clipboard.writeText(queue.id);\n\t\ttoast.success(\"ID copied to clipboard\");\n\t};\n\n\tconst handleEdit = () => {\n\t\tsetShowEditDialog(true);\n\t};\n\n\tconst handleAutomate = () => {\n\t\tvoid navigate({\n\t\t\tto: \"/automations/create\",\n\t\t});\n\t};\n\n\tconst isDefaultQueue = queue.name === \"default\";\n\n\tconst menuItems = [\n\t\t{\n\t\t\tlabel: \"Copy ID\",\n\t\t\ticon: Copy,\n\t\t\taction: handleCopyId,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Edit\",\n\t\t\ticon: Edit,\n\t\t\taction: handleEdit,\n\t\t\tshow: true,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Delete\",\n\t\t\ticon: Trash2,\n\t\t\taction: () => setShowDeleteDialog(true),\n\t\t\tshow: !isDefaultQueue, // Default queue cannot be deleted\n\t\t\tvariant: \"destructive\" as const,\n\t\t},\n\t\t{\n\t\t\tlabel: \"Automate\",\n\t\t\ticon: Zap,\n\t\t\taction: handleAutomate,\n\t\t\tshow: true,\n\t\t},\n\t].filter((item) => item.show);\n\n\treturn {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: MoreVertical,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { WorkPoolQueueCreateOrEditDialog } from \"@/components/work-pools/work-pool-queue-create-dialog\";\nimport { cn } from \"@/utils\";\nimport { DeleteWorkPoolQueueDialog } from \"./components/delete-work-pool-queue-dialog\";\nimport { useWorkPoolQueueMenu } from \"./hooks/use-work-pool-queue-menu\";\n\ntype WorkPoolQueueMenuProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueMenu = ({\n\tqueue,\n\tonUpdate,\n\tclassName,\n}: WorkPoolQueueMenuProps) => {\n\tconst {\n\t\tmenuItems,\n\t\tshowDeleteDialog,\n\t\tsetShowDeleteDialog,\n\t\tshowEditDialog,\n\t\tsetShowEditDialog,\n\t\ttriggerIcon: TriggerIcon,\n\t} = useWorkPoolQueueMenu(queue);\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu>\n\t\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tsize=\"icon\"\n\t\t\t\t\t\tclassName={cn(\"size-8\", className)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t\t<TriggerIcon className=\"size-4\" />\n\t\t\t\t\t</Button>\n\t\t\t\t</DropdownMenuTrigger>\n\t\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t\t{menuItems.map((item) => {\n\t\t\t\t\t\tconst Icon = item.icon;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<DropdownMenuItem\n\t\t\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\t\t\tonClick={item.action}\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\titem.variant === \"destructive\" && \"text-destructive\",\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Icon className=\"mr-2 h-4 w-4\" />\n\t\t\t\t\t\t\t\t{item.label}\n\t\t\t\t\t\t\t</DropdownMenuItem>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</DropdownMenuContent>\n\t\t\t</DropdownMenu>\n\t\t\t<DeleteWorkPoolQueueDialog\n\t\t\t\tqueue={queue}\n\t\t\t\topen={showDeleteDialog}\n\t\t\t\tonOpenChange={setShowDeleteDialog}\n\t\t\t\tonDeleted={onUpdate}\n\t\t\t/>\n\t\t\t<WorkPoolQueueCreateOrEditDialog\n\t\t\t\tworkPoolName={queue.work_pool_name ?? \"\"}\n\t\t\t\tqueueToEdit={queue}\n\t\t\t\topen={showEditDialog}\n\t\t\t\tonOpenChange={setShowEditDialog}\n\t\t\t\tonSubmit={() => {\n\t\t\t\t\tsetShowEditDialog(false);\n\t\t\t\t\tonUpdate?.();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n};\n","import { useCallback } from \"react\";\nimport { toast } from \"sonner\";\nimport type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport {\n\tusePauseWorkPoolQueueMutation,\n\tuseResumeWorkPoolQueueMutation,\n} from \"@/api/work-pool-queues\";\n\nexport const useWorkPoolQueueToggle = (\n\tqueue: WorkPoolQueue,\n\tonUpdate?: () => void,\n) => {\n\tconst pauseMutation = usePauseWorkPoolQueueMutation();\n\tconst resumeMutation = useResumeWorkPoolQueueMutation();\n\n\tconst handleToggle = useCallback(\n\t\t(isResumed: boolean) => {\n\t\t\tif (!queue.work_pool_name) {\n\t\t\t\ttoast.error(\"Work pool name is required\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst mutation = isResumed ? resumeMutation : pauseMutation;\n\t\t\tconst action = isResumed ? \"resumed\" : \"paused\";\n\n\t\t\tmutation.mutate(\n\t\t\t\t{ workPoolName: queue.work_pool_name, queueName: queue.name },\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(`Queue ${action} successfully`);\n\t\t\t\t\t\tonUpdate?.();\n\t\t\t\t\t},\n\t\t\t\t\tonError: () => {\n\t\t\t\t\t\ttoast.error(`Failed to ${action.slice(0, -1)} queue`);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\t[queue, pauseMutation, resumeMutation, onUpdate],\n\t);\n\n\treturn {\n\t\thandleToggle,\n\t\tisLoading: pauseMutation.isPending || resumeMutation.isPending,\n\t};\n};\n","import type { WorkPoolQueue } from \"@/api/work-pool-queues\";\nimport { Switch } from \"@/components/ui/switch\";\nimport {\n\tTooltip,\n\tTooltipContent,\n\tTooltipProvider,\n\tTooltipTrigger,\n} from \"@/components/ui/tooltip\";\nimport { cn } from \"@/utils\";\nimport { useWorkPoolQueueToggle } from \"./hooks/use-work-pool-queue-toggle\";\n\ntype WorkPoolQueueToggleProps = {\n\tqueue: WorkPoolQueue;\n\tonUpdate?: () => void;\n\tdisabled?: boolean;\n\tclassName?: string;\n};\n\nexport const WorkPoolQueueToggle = ({\n\tqueue,\n\tonUpdate,\n\tdisabled = false,\n\tclassName,\n}: WorkPoolQueueToggleProps) => {\n\tconst { handleToggle, isLoading } = useWorkPoolQueueToggle(queue, onUpdate);\n\tconst isPaused = queue.status === \"PAUSED\";\n\n\tconst isDisabled = disabled || isLoading;\n\n\treturn (\n\t\t<TooltipProvider>\n\t\t\t<Tooltip>\n\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\tchecked={!isPaused}\n\t\t\t\t\t\t\tonCheckedChange={handleToggle}\n\t\t\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tisPaused ? \"Resume work pool queue\" : \"Pause work pool queue\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclassName={cn(className)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</TooltipTrigger>\n\t\t\t\t<TooltipContent>\n\t\t\t\t\t<p>Pause or resume this work pool queue</p>\n\t\t\t\t</TooltipContent>\n\t\t\t</Tooltip>\n\t\t</TooltipProvider>\n\t);\n};\n"],"names":["__iconNode","SquarePen","createLucideIcon","statusConfig","WorkPoolQueueStatusBadge","status","className","config","jsx","TooltipProvider","jsxs","Tooltip","TooltipTrigger","Badge","cn","Pause","TooltipContent","formSchema","z.object","z.string","z.boolean","z.union","val","num","z.number","DEFAULT_VALUES","useCreateOrEditWorkPoolQueueForm","workPoolName","queueToEdit","onSubmit","createWorkPoolQueue","isCreateLoading","useCreateWorkPoolQueueMutation","updateWorkPoolQueue","isUpdateLoading","useUpdateWorkPoolQueueMutation","form","useForm","zodResolver","useEffect","values","workQueueData","toast","error","message","WorkPoolQueueCreateOrEditDialog","open","onOpenChange","isLoading","saveOrUpdate","isEditMode","dialogTitle","submitButtonText","Dialog","DialogContent","DialogHeader","DialogTitle","Form","e","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","Textarea","Icon","DialogFooter","DialogTrigger","Button","DeleteWorkPoolQueueDialog","queue","onDeleted","deleteQueueMutation","useDeleteWorkPoolQueueMutation","handleDelete","DeleteConfirmationDialog","useWorkPoolQueueMenu","navigate","useNavigate","showDeleteDialog","setShowDeleteDialog","useState","showEditDialog","setShowEditDialog","handleCopyId","handleEdit","handleAutomate","isDefaultQueue","Copy","Edit","Trash2","Zap","item","MoreVertical","WorkPoolQueueMenu","onUpdate","menuItems","TriggerIcon","Fragment","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","useWorkPoolQueueToggle","pauseMutation","usePauseWorkPoolQueueMutation","resumeMutation","useResumeWorkPoolQueueMutation","useCallback","isResumed","mutation","action","WorkPoolQueueToggle","disabled","handleToggle","isPaused","isDisabled","Switch"],"mappings":"orBASA,MAAMA,GAAa,CACjB,CAAC,OAAQ,CAAE,EAAG,6DAA8D,IAAK,QAAQ,CAAE,EAC3F,CACE,OACA,CACE,EAAG,0HACH,IAAK,QACX,CACA,CACA,EACMC,GAAYC,EAAiB,aAAcF,EAAU,ECHrDG,GAAe,CACpB,MAAO,CACN,MAAO,QACP,MAAO,eACP,QACC,4EAAA,EAEF,OAAQ,CACP,MAAO,SACP,MAAO,gBACP,QAAS,iD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iBF,EACxCO,EAASF,EAAY,UAAY,SAEvCC,EAAS,OACR,CAAE,aAAcxC,EAAM,eAAgB,UAAWA,EAAM,IAAA,EACvD,CACC,UAAW,IAAM,CAChB9B,EAAM,QAAQ,SAASuE,CAAM,eAAe,EAC5ChB,IAAA,CACD,EACA,QAAS,IAAM,CACdvD,EAAM,MAAM,aAAauE,EAAO,MAAM,EAAG,EAAE,CAAC,QAAQ,CACrD,CAAA,CACD,CAEF,EACA,CAACzC,EAAOkC,EAAeE,EAAgBX,CAAQ,CAAA,EAK/C,UAAWS,EAAc,WAAaE,EAAe,SAAA,CAEvD,EC3BaM,GAAsB,CAAC,CACnC,MAAA1C,EACA,SAAAyB,EACA,SAAAkB,EAAW,GACX,UAAA7G,CACD,IAAgC,CAC/B,KAAM,CAAE,aAAA8G,EAAc,UAAApE,CAAA,EAAcyD,GAAuBjC,EAAOyB,CAAQ,EACpEoB,EAAW7C,EAAM,SAAW,SAE5B8C,EAAaH,GAAYnE,EAE/B,OACCxC,EAAAA,IAACC,EAAA,CACA,SAAAC,EAAAA,KAACC,EAAA,CACA,SAAA,CAAAH,MAACI,EAAA,CAAe,QAAO,GACtB,SAAAJ,MAAC,MAAA,CACA,SAAAA,EAAAA,IAAC+G,EAAA,CACA,QAAS,CAACF,EACV,gBAAiBD,EACjB,SAAUE,EACV,aACCD,EAAW,yBAA2B,wBAEvC,UAAWvG,EAAGR,CAAS,CAAA,CAAA,EAEzB,CAAA,CACD,EACAE,MAACQ,EAAA,CACA,SAAAR,EAAAA,IAAC,IAAA,CAAE,gDAAoC,CAAA,CACxC,CAAA,CAAA,CACD,CAAA,CACD,CAEF","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as c,j as e,t as k,d as I,L as J,C as G,H as Z,D as X,G as pe,n as ge,s as L}from"./vendor-tanstack-BcZfOOfy.js";import{bL as je,a_ as x,q as C,bM as R,y as w,bi as fe,bh as be,af as ee,H as Q,bN as we,bO as ye,M as se,bC as Ne,bP as W,bQ as ve,aI as Ce,aG as ae,V as ke,J as Se,bR as te,bS as _e,bT as De,A as Te,F as We,bU as A,bV as O,G as Fe,bW as B,B as Ee,g as Me,h as z,bw as Pe,bF as Ie,bH as Le,bX as ne,aw as Re,bY as le,bZ as P,p as re,E as q,t as V,v as K,w as Y,x as Qe,b_ as Ae,b$ as Oe,c0 as E,c1 as Be,c2 as $e,c3 as ze,c4 as qe,c5 as Ve,aA as Ke,aB as Ye,aC as Ue,aD as T,b9 as h,c6 as He}from"./index-B8vo2Lrg.js";import{D as Je}from"./index-IBvMMs6S.js";import{S as Ge,a as Ze,F as Xe}from"./flow-runs-pagination-SLbYtvaR.js";import{D as oe,a as ie,b as ce,d as de}from"./dropdown-menu-D7Gwbd15.js";import{D as ue}from"./delete-confirmation-dialog-CwDK_2QS.js";import{S as es,W as ss,a as as,b as ts,c as ns}from"./work-pool-queue-toggle-Dh7B1zMo.js";import{D as me}from"./data-table-CPkppyg6.js";import{o as ls,e as rs}from"./vendor-forms-ClCIacbh.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-BTiKGWfR.js";import"./vendor-recharts-BvvJP9Po.js";import"./vendor-date-wwuDAncJ.js";import"./use-quick-run-B4Xj-YQQ.js";import"./use-delete-confirmation-dialog-CUdii6Lo.js";import"./index-DlHOXQhu.js";import"./cronstrue-Bevg0uGw.js";import"./use-is-overflowing-CpSV4NPP.js";import"./index-CUVvZndW.js";import"./tags-input-DHrnkwjQ.js";import"./zod-Cuos7J7w.js";import"./form-mws4law8.js";import"./textarea-DUhh6-kq.js";import"./table-BBNGfPra.js";const os=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],is=je("circle-question-mark",os),he=({command:s,title:a,subtitle:t,className:n})=>{const[o,l]=c.useState(!1),r=async()=>{if(!o){l(!0);try{await navigator.clipboard.writeText(s),w.success("Command copied to clipboard")}catch{w.error("Failed to copy command")}finally{l(!1)}}};return e.jsxs("div",{className:x("space-y-4",n),children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h3",{className:"text-lg font-semibold text-foreground mb-1",children:a}),e.jsx("p",{className:"text-muted-foreground text-sm",children:t})]}),e.jsxs("div",{className:"bg-muted border border-border rounded-lg shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"bg-muted/80 border-b border-border px-3 py-2 flex items-center space-x-2",children:[e.jsxs("div",{className:"flex space-x-1",children:[e.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-yellow-500 rounded-full"}),e.jsx("div",{className:"w-3 h-3 bg-green-500 rounded-full"})]}),e.jsx(C,{variant:"ghost",size:"sm",onClick:r,disabled:o,className:"ml-auto text-muted-foreground hover:text-foreground hover:bg-muted h-6 w-6 p-0",children:e.jsx(R,{className:"h-4 w-4"})})]}),e.jsx("div",{className:"bg-gray-800 dark:bg-gray-900 px-4 py-2",children:e.jsxs("p",{className:"py-1",children:[e.jsx("code",{className:"font-mono text-sm text-gray-300 select-all",children:s}),e.jsx("span",{className:"ml-1 -mb-1 inline-block w-[7px] h-[18px] bg-gray-400 terminal-cursor"})]})})]})]})},cs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({pageIndex:0,pageSize:50}),[o,l]=c.useState("CREATED_DESC"),[r,i]=c.useState([]),d=c.useMemo(()=>({page:t.pageIndex+1,limit:t.pageSize,sort:o,work_pools:{operator:"and_",name:{any_:[s]}},deployments:{operator:"and_",flow_or_deployment_name:{like_:r.find(f=>f.id==="flowOrDeploymentName")?.value??""},tags:{operator:"and_",all_:r.find(f=>f.id==="tags")?.value??[]}}}),[s,t,o,r]),b=c.useMemo(()=>({offset:0,sort:"CREATED_DESC",work_pools:{operator:"and_",name:{any_:[s]}}}),[s]),{data:u}=k(fe(d)),{data:g}=k(be(b)),y=c.useMemo(()=>[...new Set((u?.results??[]).map(f=>f.flow_id))],[u?.results]),{data:v}=k(ee({flows:{operator:"and_",id:{any_:y}},offset:0,sort:"NAME_ASC"},{enabled:y.length>0})),j=c.useMemo(()=>{if(!u?.results)return[];const f=new Map(v?.map(S=>[S.id,S])??[]);return u.results.map(S=>({...S,flow:f.get(S.flow_id)}))},[u?.results,v]),N=c.useCallback(f=>{n(f)},[]),D=c.useCallback(f=>{l(f)},[]),F=c.useCallback(f=>{i(f)},[]);return!u||g===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading deployments..."})}):e.jsx("div",{className:a,children:e.jsx(Je,{deployments:j,currentDeploymentsCount:g,pageCount:u.pages,pagination:t,sort:o,columnFilters:r,onPaginationChange:N,onSortChange:D,onColumnFiltersChange:F})})},ds=s=>{switch(s){case"READY":return"Ready";case"PAUSED":return"Paused";case"NOT_READY":return"Not Ready"}},us=s=>{switch(s){case"READY":return"bg-green-500";case"PAUSED":return"bg-yellow-500";case"NOT_READY":return"bg-red-500"}},ms=({status:s,className:a})=>{const t=ds(s),n=us(s);return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[s==="PAUSED"?e.jsx(we,{className:"h-2 w-2 text-muted-foreground"}):e.jsx("div",{className:x("h-2 w-2 rounded-full",n)}),e.jsx("span",{children:t})]})},M=()=>e.jsx("dd",{className:"text-muted-foreground text-sm",children:"None"}),hs=({children:s})=>e.jsx("dt",{className:"text-sm text-muted-foreground",children:s}),_=({children:s,className:a})=>e.jsx("dd",{className:x("text-sm",a),children:s});function xs({workPool:s}){const{data:a=[],isLoading:t}=k(se(s.name)),n=c.useMemo(()=>t||a.length===0?null:a.map(r=>r.last_heartbeat_time).filter(r=>!!r).sort((r,i)=>new Date(i).getTime()-new Date(r).getTime())[0]||null,[a,t]),o=[{field:"Status",ComponentValue:()=>e.jsx("dd",{children:e.jsx(ms,{status:s.status||"NOT_READY"})})},{field:"Description",ComponentValue:()=>s.description?e.jsx(_,{children:s.description}):null},{field:"Type",ComponentValue:()=>s.type?e.jsx(_,{children:Ne(s.type)}):e.jsx(M,{})},{field:"Concurrency Limit",ComponentValue:()=>e.jsx(_,{children:s.concurrency_limit?String(s.concurrency_limit):"Unlimited"})},{field:"Last Polled",ComponentValue:()=>n?e.jsx(_,{children:e.jsx(W,{date:n})}):a.length===0?null:e.jsx(_,{className:"text-muted-foreground",children:"No recent activity"})},{field:"Created",ComponentValue:()=>s.created?e.jsx(_,{children:e.jsx(W,{date:s.created})}):e.jsx(M,{})},{field:"Last Updated",ComponentValue:()=>s.updated?e.jsx(_,{children:e.jsx(W,{date:s.updated})}):e.jsx(M,{})}].filter(({ComponentValue:l})=>l()!==null);return t?e.jsx("div",{className:"text-muted-foreground text-sm",children:"Loading work pool details..."}):e.jsx("div",{children:e.jsx("ul",{className:"flex flex-col gap-3",children:o.map(({field:l,ComponentValue:r})=>e.jsx("li",{children:e.jsxs("dl",{children:[e.jsx(hs,{children:l}),e.jsx(r,{})]})},l))})})}function ps({workPool:s}){const a=s.base_job_template;if(!a?.variables||typeof a.variables!="object"||!("properties"in a.variables)||!a.variables.properties)return null;const t=a.variables.properties,n=(l,r)=>r.title||l.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "),o=l=>l==null?"None":typeof l=="boolean"?l.toString():Array.isArray(l)?l.length>0?l.join(", "):"None":typeof l=="object"?JSON.stringify(l):String(l);return e.jsxs("div",{children:[e.jsx("h3",{className:"mb-4 text-md",children:"Base Job Configuration"}),e.jsx("ul",{className:"flex flex-col gap-3",children:Object.entries(t).map(([l,r])=>{const i=r.default??null;return e.jsxs("li",{className:"flex flex-col gap-1 text-sm",children:[e.jsx("span",{className:"text-muted-foreground font-medium",children:n(l,r)}),e.jsx("span",{className:"break-words",children:o(i)})]},l)})})]})}function U({workPool:s,alternate:a=!1,className:t}){const n=a?"space-y-4":"space-y-6";return e.jsxs("div",{className:x(n,t),children:[e.jsx(xs,{workPool:s}),!!(s.base_job_template?.variables&&typeof s.base_job_template.variables=="object"&&"properties"in s.base_job_template.variables&&s.base_job_template.variables.properties&&Object.keys(s.base_job_template.variables.properties).length>0)&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{}),e.jsx(ps,{workPool:s})]})]})}const gs=({workPoolName:s,className:a})=>{const[t,n]=c.useState({limit:10,page:1}),[o,l]=c.useState(""),[r,i]=c.useState(new Set),d=ve(o,500),b=c.useMemo(()=>{const m={page:t.page,limit:t.limit,sort:"START_TIME_DESC",work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,t,d,r]),u=c.useMemo(()=>{const m={work_pools:{operator:"and_",name:{any_:[s]}}};if(d.trim()&&(m.flow_runs={operator:"and_",name:{like_:d.trim()}}),r.size>0){const p={state:{operator:"and_",name:{any_:Array.from(r)}}};m.flow_runs?m.flow_runs={...m.flow_runs,...p}:m.flow_runs={operator:"and_",...p}}return m},[s,d,r]),{data:g}=k(Ce(b)),{data:y}=k(ae(u)),v=c.useMemo(()=>[...new Set((g?.results??[]).map(m=>m.flow_id))],[g?.results]),{data:j}=k(ee({flows:{operator:"and_",id:{any_:v}},offset:0,sort:"NAME_ASC"},{enabled:v.length>0})),N=c.useMemo(()=>{if(!g?.results)return[];const m=new Map(j?.map(p=>[p.id,p])??[]);return g.results.map(p=>{const $=m.get(p.flow_id);return $?{...p,flow:$}:null}).filter(p=>p!==null)},[g?.results,j]),D=c.useCallback(m=>{l(m.target.value),n(p=>({...p,page:1}))},[]),F=c.useCallback(m=>{n(m)},[]),f=c.useCallback(m=>{i(m),n(p=>({...p,page:1}))},[]),S=c.useCallback(()=>{l(""),i(new Set),n(m=>({...m,page:1}))},[]);return!g||y===void 0?e.jsx("div",{className:a,children:e.jsx("div",{className:"text-muted-foreground text-center py-8",children:"Loading flow runs..."})}):e.jsxs("div",{className:a,children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-6",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ke,{placeholder:"Search flow runs by name...",value:o,onChange:D,debounceMs:500})}),e.jsx("div",{className:"w-full sm:w-64",children:e.jsx(Ge,{selectedFilters:r,onSelectFilter:f})})]}),e.jsx(Ze,{flowRuns:N,onClearFilters:N.length===0?S:void 0}),g.pages>1&&e.jsx("div",{className:"mt-6",children:e.jsx(Xe,{count:y,pages:g.pages,pagination:t,onChangePagination:F})})]})},js=({workPool:s,open:a,onOpenChange:t,onDeleted:n})=>{const o=I(),{deleteWorkPool:l,isPending:r}=Se(),i=()=>{l(s.name,{onSuccess:()=>{w.success("Work pool deleted successfully"),n?.(),o({to:"/work-pools"})},onError:()=>{w.error("Failed to delete work pool")}})};return e.jsx(ue,{isOpen:a,title:"Delete Work Pool",description:`Are you sure you want to delete the work pool "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>t(!1)})},fs=s=>{const a=I(),[t,n]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:R,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Edit",icon:es,action:()=>{a({to:"/work-pools/work-pool/$workPoolName/edit",params:{workPoolName:s.name}})},show:!0},{label:"Delete",icon:te,action:()=>n(!0),show:!0,variant:"destructive"},{label:"Automate",icon:_e,action:()=>{a({to:"/automations/create"})},show:!0}].filter(d=>d.show),showDeleteDialog:t,setShowDeleteDialog:n,triggerIcon:De}},bs=({workPool:s,onUpdate:a,className:t})=>{const{menuItems:n,showDeleteDialog:o,setShowDeleteDialog:l,triggerIcon:r}=fs(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"outline",size:"icon",className:x("size-8",t),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(r,{className:"size-4"})]})}),e.jsx(ce,{align:"end",children:n.map(i=>{const d=i.icon;return e.jsxs(de,{onClick:i.action,className:x(i.variant==="destructive"&&"text-destructive"),children:[e.jsx(d,{className:"mr-2 h-4 w-4"}),i.label]},i.label)})})]}),e.jsx(js,{workPool:s,open:o,onOpenChange:l,onDeleted:a})]})},ws=(s,a)=>{const{pauseWorkPool:t,isPending:n}=Te(),{resumeWorkPool:o,isPending:l}=We();return{handleToggle:c.useCallback(i=>{i?o(s.name,{onSuccess:()=>{w.success("Work pool resumed"),a?.()},onError:()=>{w.error("Failed to resume work pool")}}):t(s.name,{onSuccess:()=>{w.success("Work pool paused"),a?.()},onError:()=>{w.error("Failed to pause work pool")}})},[s.name,t,o,a]),isLoading:n||l}},ys=({workPool:s,onUpdate:a,className:t})=>{const{handleToggle:n,isLoading:o}=ws(s,a),l=s.status==="PAUSED";return e.jsxs(A,{children:[e.jsx(O,{asChild:!0,children:e.jsx("div",{children:e.jsx(Fe,{checked:!l,onCheckedChange:n,disabled:o,"aria-label":l?"Resume work pool":"Pause work pool",className:x(t)})})}),e.jsx(B,{children:e.jsx("p",{children:"Pause or resume this work pool"})})]})},Ns=({workPool:s,onUpdate:a,className:t})=>e.jsxs("header",{className:x("flex mb-4 flex-row items-center justify-between",t),children:[e.jsx(Ee,{className:t,children:e.jsxs(Me,{children:[e.jsx(z,{children:e.jsx(Pe,{to:"/work-pools",className:"text-xl font-semibold",children:"Work pools"})}),e.jsx(Ie,{}),e.jsx(z,{className:"text-xl font-semibold",children:e.jsx(Le,{children:s.name})})]})}),e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(ys,{workPool:s,onUpdate:a}),e.jsx(bs,{workPool:s,onUpdate:a})]})]}),vs=({lateRunsCount:s,className:a})=>s===0?null:e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsxs(Q,{variant:"warning",className:x("flex items-center space-x-1",a),children:[e.jsx(Re,{className:"h-3 w-3"}),e.jsx("span",{children:s})]})}),e.jsx(B,{children:e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-semibold",children:"Late Flow Runs"}),e.jsxs("p",{className:"text-sm",children:[s," flow run",s===1?"":"s"," running late"]})]})})]})}),Cs=({queue:s})=>{const{data:a=0}=k(ae({work_pools:{operator:"and_",name:{any_:[s.work_pool_name||""]}},work_pool_queues:{operator:"and_",name:{any_:[s.name]}},flow_runs:{operator:"and_",state:{operator:"and_",name:{any_:["Late"]}}}},3e4));return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:s.work_pool_name||"",workQueueName:s.name},className:"font-medium text-blue-600 hover:text-blue-800",children:s.name}),e.jsx(vs,{lateRunsCount:a})]})},xe=({enableLateIndicator:s=!1}={})=>{const a=[];return a.push({accessorKey:"name",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Name"}),cell:({row:t})=>{const n=t.original;return s?e.jsx(Cs,{queue:n}):e.jsx("div",{className:"flex items-center space-x-2",children:e.jsx(J,{to:"/work-pools/work-pool/$workPoolName/queue/$workQueueName",params:{workPoolName:n.work_pool_name||"",workQueueName:n.name},className:"font-medium text-blue-600 hover:text-blue-800",children:n.name})})}}),a.push({accessorKey:"concurrency_limit",header:({column:t})=>e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Concurrency Limit"}),cell:({row:t})=>{const n=t.original.concurrency_limit;return n!=null?n.toString():"∞"}}),a.push({accessorKey:"priority",header:({column:t})=>e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(C,{variant:"ghost",onClick:()=>t.toggleSorting(t.getIsSorted()==="asc"),className:"h-auto p-0 font-semibold",children:"Priority"}),e.jsx(ne,{children:e.jsxs(A,{children:[e.jsx(O,{children:e.jsx(is,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(B,{children:e.jsx("p",{children:"Lower numbers have higher priority"})})]})})]}),cell:({row:t})=>t.original.priority}),a.push({accessorKey:"status",header:"Status",cell:({row:t})=>e.jsx(ss,{status:t.original.status||"READY"})}),a.push({id:"actions",header:"",cell:({row:t})=>e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(as,{queue:t.original}),e.jsx(ts,{queue:t.original})]}),enableSorting:!1}),a};xe();const ks=({hasSearchQuery:s,workPoolName:a})=>s?e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx(le,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues found"}),e.jsx("p",{className:"text-muted-foreground mb-4",children:"No queues match your search criteria. Try adjusting your search."})]}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[e.jsx("div",{className:"h-12 w-12 rounded-full bg-muted flex items-center justify-center mb-4",children:e.jsx(P,{className:"h-6 w-6 text-muted-foreground"})}),e.jsx("h3",{className:"text-lg font-medium text-foreground mb-2",children:"No queues yet"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md",children:"This work pool doesn't have any queues yet. Create your first queue to start organizing work."}),e.jsxs(C,{onClick:()=>{console.log("Create queue for pool:",a)},children:[e.jsx(P,{className:"h-4 w-4 mr-2"}),"Create Queue"]})]}),Ss=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,workPoolName:o,className:l})=>{const[r,i]=c.useState(!1),d=s.length>0;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} Work Queue${n!==1?"s":""}`:`${n} Work Queue${n!==1?"s":""}`}),e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>i(!0),children:e.jsx(P,{className:"h-4 w-4"})})]}),e.jsxs("div",{className:"flex items-center space-x-2",children:[d&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsxs("div",{className:"relative",children:[e.jsx(le,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(re,{placeholder:"Search",value:s,onChange:b=>a(b.target.value),className:"pl-8 w-64"})]})]})]}),e.jsx(ns,{workPoolName:o,open:r,onOpenChange:i,onSubmit:()=>i(!1)})]})},_s=({queues:s,searchQuery:a,sortState:t,totalCount:n,workPoolName:o,className:l,onSearchChange:r,onSortingChange:i})=>{const d=c.useCallback(y=>{let v=t;typeof y=="function"?v=y(t):v=y,i(v)},[t,i]),b=xe({enableLateIndicator:!0}),u=G({data:s,columns:b,getCoreRowModel:X(),getSortedRowModel:Z(),state:{sorting:t},onSortingChange:d,initialState:{sorting:[{id:"name",desc:!1}]}}),g=s.length;return e.jsxs("div",{className:x("space-y-4",l),children:[e.jsx(Ss,{searchQuery:a,onSearchChange:r,resultsCount:g,totalCount:n,workPoolName:o}),g===0?e.jsx(ks,{hasSearchQuery:!!a,workPoolName:o}):e.jsx(me,{table:u})]})},Ds={ONLINE:{label:"Online",color:"bg-green-500"},OFFLINE:{label:"Offline",color:"bg-red-500"}},Ts=({status:s,className:a})=>{const t=Ds[s];return e.jsxs(Q,{variant:"secondary",className:x("flex items-center space-x-1",a),children:[e.jsx("div",{className:x("h-2 w-2 rounded-full",t.color)}),e.jsx("span",{children:t.label})]})},Ws=()=>[{accessorKey:"name",header:"Name",cell:({row:s})=>{const a=s.original;return e.jsx("span",{className:"font-medium",children:a.name})}},{accessorKey:"last_heartbeat_time",header:"Last Seen",cell:({row:s})=>{const a=s.original.last_heartbeat_time;return e.jsx(W,{date:a,format:"relative",showTooltip:!0})}},{accessorKey:"status",header:"Status",cell:({row:s})=>e.jsx(Ts,{status:s.original.status})}],Fs=({workPoolName:s,ActionsComponent:a})=>[...Ws(),{id:"actions",header:"",cell:({row:t})=>e.jsx(a,{worker:t.original,workPoolName:s}),enableSorting:!1,size:50,maxSize:50}],Es=({hasSearchQuery:s,workPoolName:a,className:t})=>s?e.jsxs(q,{children:[e.jsx(V,{id:"Search"}),e.jsx(K,{children:"No workers found"}),e.jsx(Y,{children:"No workers match your search criteria."})]}):e.jsx("div",{className:x("space-y-4",t),children:e.jsxs(q,{children:[e.jsx(V,{id:"Bot"}),e.jsx(K,{children:"No workers running"}),e.jsxs(Y,{children:["No workers are currently running for the “",a,"” work pool."]}),e.jsx(Qe,{children:e.jsx(he,{command:`prefect worker start --pool "${a}"`,title:"Start a worker",subtitle:"Run this command to start a worker for this pool"})})]})}),Ms=({worker:s,workPoolName:a,open:t,onOpenChange:n,onDeleted:o})=>{const{deleteWorker:l,isPending:r}=Ae(),i=()=>{l({workPoolName:a,workerName:s.name},{onSuccess:()=>{w.success("Worker deleted successfully"),o?.(),n(!1)},onError:()=>{w.error("Failed to delete worker")}})};return e.jsx(ue,{isOpen:t,title:"Delete Worker",description:`Are you sure you want to delete the worker "${s.name}"? This action cannot be undone.`,confirmText:s.name,isLoading:r,loadingText:"Deleting...",onConfirm:i,onClose:()=>n(!1)})},Ps=s=>{const[a,t]=c.useState(!1);return{menuItems:[{label:"Copy ID",icon:R,action:()=>{navigator.clipboard.writeText(s.id),w.success("ID copied to clipboard")},show:!0},{label:"Delete",icon:te,action:()=>t(!0),show:!0,variant:"destructive"}].filter(l=>l.show),showDeleteDialog:a,setShowDeleteDialog:t,triggerIcon:Oe}},Is=({worker:s,workPoolName:a,onWorkerDeleted:t,className:n})=>{const{menuItems:o,showDeleteDialog:l,setShowDeleteDialog:r,triggerIcon:i}=Ps(s);return e.jsxs(e.Fragment,{children:[e.jsxs(oe,{children:[e.jsx(ie,{asChild:!0,children:e.jsxs(C,{variant:"ghost",size:"icon",className:x("h-8 w-8",n),children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(i,{className:"h-4 w-4"})]})}),e.jsx(ce,{align:"end",children:o.map(d=>{const b=d.icon;return e.jsxs(de,{onClick:d.action,className:x(d.variant==="destructive"&&"text-destructive"),children:[e.jsx(b,{className:"mr-2 h-4 w-4"}),d.label]},d.label)})})]}),e.jsx(Ms,{worker:s,workPoolName:a,open:l,onOpenChange:r,onDeleted:t})]})},Ls=({worker:s,workPoolName:a})=>e.jsx(Is,{worker:s,workPoolName:a}),H=({searchQuery:s,onSearchChange:a,resultsCount:t,totalCount:n,className:o})=>{const l=s.length>0;return e.jsxs("div",{className:x("flex items-center justify-between",o),children:[e.jsx("div",{className:"text-sm text-muted-foreground",children:s?`${t} of ${n} workers`:`${n} workers`}),e.jsxs("div",{className:"flex items-center space-x-2",children:[l&&e.jsx(C,{variant:"ghost",size:"sm",onClick:()=>a(""),children:"Clear filters"}),e.jsx(re,{placeholder:"Search workers...",value:s,onChange:r=>a(r.target.value),className:"w-64"})]})]})},Rs=({workPoolName:s,workers:a,pagination:t,columnFilters:n,onPaginationChange:o,onColumnFiltersChange:l,className:r})=>{const i=n.find(j=>j.id==="name")?.value??"",d=c.useCallback(j=>{const N=n.filter(D=>D.id!=="name");l(j?[...N,{id:"name",value:j}]:N)},[l,n]),b=c.useCallback(j=>{let N=t;typeof j=="function"?N=j(t):N=j,o(N)},[t,o]),u=c.useMemo(()=>i?a.filter(j=>j.name.toLowerCase().includes(i.toLowerCase())):a,[a,i]),g=c.useMemo(()=>Fs({workPoolName:s,ActionsComponent:Ls}),[s]),y=G({data:u,columns:g,getCoreRowModel:X(),getSortedRowModel:Z(),getPaginationRowModel:pe(),manualPagination:!1,state:{pagination:t},onPaginationChange:b,initialState:{sorting:[{id:"name",desc:!1}]}});return a.length===0||i&&u.length===0?e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(Es,{hasSearchQuery:i.length>0,workPoolName:s})]}):e.jsxs("div",{className:x("space-y-4",r),children:[e.jsx(H,{searchQuery:i,onSearchChange:d,resultsCount:u.length,totalCount:a.length}),e.jsx(me,{table:y})]})};ls({tab:rs(["Details","Runs","Work Queues","Workers","Deployments"]).default("Runs")});const Qs=({workPoolName:s})=>{const[a,t]=c.useState(""),[n,o]=c.useState([]),{data:l}=L(He(s)),r=c.useMemo(()=>a?l.filter(i=>i.name.toLowerCase().includes(a.toLowerCase())):l,[l,a]);return e.jsx(_s,{queues:r,searchQuery:a,sortState:n,totalCount:l.length,workPoolName:s,onSearchChange:t,onSortingChange:o})},As=({workPoolName:s})=>{const[a,t]=c.useState({pageIndex:0,pageSize:10}),[n,o]=c.useState([]),{data:l}=L(se(s));return e.jsx(Rs,{workPoolName:s,workers:l,pagination:a,columnFilters:n,onPaginationChange:t,onColumnFiltersChange:o})};function da(){const{workPoolName:s}=E.useParams(),{tab:a}=E.useSearch(),t=I({from:E.fullPath}),n=ge(),{data:o}=L(Be(s)),l=o.status!=="READY",r=`prefect worker start --pool "${o.name}"`,i=c.useMemo(()=>[{id:"Details",label:"Details",hidden:!1,hiddenOnDesktop:!0},{id:"Runs",label:"Runs",hidden:!1,hiddenOnDesktop:!1},{id:"Work Queues",label:"Work Queues",hidden:!1,hiddenOnDesktop:!1},{id:"Workers",label:"Workers",hiddenOnDesktop:!1},{id:"Deployments",label:"Deployments",hidden:!1,hiddenOnDesktop:!1}].filter(u=>!u.hidden),[]),d=c.useCallback(u=>{t({search:{tab:u}})},[t]),b=c.useCallback(()=>{n.invalidateQueries({queryKey:$e.detailByName(s)})},[n,s]);return e.jsx(ze,{children:e.jsxs(qe,{children:[e.jsxs(Ve,{children:[e.jsx(Ns,{workPool:o,onUpdate:b}),l&&e.jsx("div",{className:"w-full bg-muted/50 py-6 px-4 rounded-lg mb-6",children:e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsx(he,{command:r,title:"Your work pool is almost ready!",subtitle:"Run this command to start.",className:"py-0"})})})]}),e.jsxs("div",{className:"flex flex-col xl:flex-row xl:gap-8",children:[e.jsx("div",{className:"flex-1",children:e.jsxs(Ke,{value:a,onValueChange:d,children:[e.jsx(Ye,{className:"flex w-full overflow-x-auto scrollbar-none",children:i.map(u=>e.jsx(Ue,{value:u.id,className:x("whitespace-nowrap flex-shrink-0",u.hiddenOnDesktop?"xl:hidden":""),children:u.label},u.id))}),e.jsx(T,{value:"Details",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx(h,{className:"h-4 w-48"}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-16"}),e.jsx(h,{className:"h-6 w-24"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-20"}),e.jsx(h,{className:"h-6 w-32"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-24"}),e.jsx(h,{className:"h-6 w-28"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(h,{className:"h-3 w-18"}),e.jsx(h,{className:"h-6 w-36"})]})]})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(h,{className:"h-5 w-40"}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-32 w-full"})})]})]}),children:e.jsx(U,{workPool:o})})}),e.jsx(T,{value:"Runs",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"}),e.jsx(h,{className:"h-24 w-full"})]}),children:e.jsx(gs,{workPoolName:s})})}),e.jsx(T,{value:"Work Queues",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{className:"h-6 w-24"}),e.jsx(h,{className:"h-6 w-8"})]}),e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(h,{className:"h-6 w-64"})})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(Qs,{workPoolName:s})})}),e.jsx(T,{value:"Workers",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(As,{workPoolName:s})})}),e.jsx(T,{value:"Deployments",className:"space-y-0",children:e.jsx(c.Suspense,{fallback:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{className:"h-4 w-20"}),e.jsx(h,{className:"h-9 w-64"})]}),e.jsx("div",{className:"space-y-2",children:e.jsx(h,{className:"h-34 w-full"})})]}),children:e.jsx(cs,{workPoolName:s})})})]})}),e.jsx("aside",{className:"w-full xl:w-80 xl:shrink-0 hidden xl:block",children:e.jsx("div",{className:"sticky top-8",children:e.jsx(U,{workPool:o,alternate:!0})})})]})]})})}export{da as component};
|
|
2
|
+
//# sourceMappingURL=work-pool._workPoolName-B_NFWXKS.js.map
|