prefect 3.6.14.dev3__py3-none-any.whl → 3.6.14.dev5__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/_build_info.py +3 -3
- prefect/events/clients.py +36 -3
- prefect/futures.py +17 -4
- prefect/runner/runner.py +113 -29
- prefect/server/api/events.py +3 -2
- prefect/server/ui-v2/assets/{artifact-card-CNabu-6j.js → artifact-card-DprxJzPy.js} +2 -2
- prefect/server/ui-v2/assets/{artifact-card-CNabu-6j.js.map → artifact-card-DprxJzPy.js.map} +1 -1
- prefect/server/ui-v2/assets/{artifact._id-Emkhr_0h.js → artifact._id-CXcnU7_U.js} +2 -2
- prefect/server/ui-v2/assets/{artifact._id-Emkhr_0h.js.map → artifact._id-CXcnU7_U.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-schema-CRKJHa4q.js → automation-schema-crrFcHTg.js} +2 -2
- prefect/server/ui-v2/assets/{automation-schema-CRKJHa4q.js.map → automation-schema-crrFcHTg.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation-wizard-Cej8aik5.js → automation-wizard-DPKDA6ji.js} +2 -2
- prefect/server/ui-v2/assets/{automation-wizard-Cej8aik5.js.map → automation-wizard-DPKDA6ji.js.map} +1 -1
- prefect/server/ui-v2/assets/automation._id-BvFFkDrn.js +2 -0
- prefect/server/ui-v2/assets/{automation._id-Bm1T3_NO.js.map → automation._id-BvFFkDrn.js.map} +1 -1
- prefect/server/ui-v2/assets/{automation_._id.edit-C5NIVfxR.js → automation_._id.edit-vpFy8Znl.js} +2 -2
- prefect/server/ui-v2/assets/{automation_._id.edit-C5NIVfxR.js.map → automation_._id.edit-vpFy8Znl.js.map} +1 -1
- prefect/server/ui-v2/assets/{automations-header-CdJSlWw8.js → automations-header-eG-shDxp.js} +2 -2
- prefect/server/ui-v2/assets/{automations-header-CdJSlWw8.js.map → automations-header-eG-shDxp.js.map} +1 -1
- prefect/server/ui-v2/assets/{base-job-template-form-section-DX_X28oU.js → base-job-template-form-section-du3c8HMM.js} +2 -2
- prefect/server/ui-v2/assets/{base-job-template-form-section-DX_X28oU.js.map → base-job-template-form-section-du3c8HMM.js.map} +1 -1
- prefect/server/ui-v2/assets/{block-type-details-BcpcwaJS.js → block-type-details-CIGWaz9i.js} +2 -2
- prefect/server/ui-v2/assets/{block-type-details-BcpcwaJS.js.map → block-type-details-CIGWaz9i.js.map} +1 -1
- prefect/server/ui-v2/assets/block-type-logo-B3oMH8dS.js +2 -0
- prefect/server/ui-v2/assets/{block-type-logo-ox5VqJuy.js.map → block-type-logo-B3oMH8dS.js.map} +1 -1
- prefect/server/ui-v2/assets/{block._id-BD6wu3yC.js → block._id-Cay2vm3g.js} +2 -2
- prefect/server/ui-v2/assets/{block._id-BD6wu3yC.js.map → block._id-Cay2vm3g.js.map} +1 -1
- prefect/server/ui-v2/assets/{block_._id.edit-aneXPzUW.js → block_._id.edit-bNSemu_v.js} +2 -2
- prefect/server/ui-v2/assets/{block_._id.edit-aneXPzUW.js.map → block_._id.edit-bNSemu_v.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog-C7ttFKuv.js → catalog-B3SdxUVJ.js} +2 -2
- prefect/server/ui-v2/assets/{catalog-C7ttFKuv.js.map → catalog-B3SdxUVJ.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug-CrcphBbo.js → catalog_._slug-BfQw_9GK.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug-CrcphBbo.js.map → catalog_._slug-BfQw_9GK.js.map} +1 -1
- prefect/server/ui-v2/assets/{catalog_._slug_.create-Dd7ATIKq.js → catalog_._slug_.create-k_HRDFv7.js} +2 -2
- prefect/server/ui-v2/assets/{catalog_._slug_.create-Dd7ATIKq.js.map → catalog_._slug_.create-k_HRDFv7.js.map} +1 -1
- prefect/server/ui-v2/assets/{collapsible-D5U2XK4R.js → collapsible-CjJyAdbn.js} +2 -2
- prefect/server/ui-v2/assets/{collapsible-D5U2XK4R.js.map → collapsible-CjJyAdbn.js.map} +1 -1
- prefect/server/ui-v2/assets/{concurrency-limit._id-D-xV_tiF.js → concurrency-limit._id-B3Gnqcjc.js} +2 -2
- prefect/server/ui-v2/assets/{concurrency-limit._id-D-xV_tiF.js.map → concurrency-limit._id-B3Gnqcjc.js.map} +1 -1
- prefect/server/ui-v2/assets/create-AIgXW0ut.js +2 -0
- prefect/server/ui-v2/assets/{create-Da7OBOa5.js.map → create-AIgXW0ut.js.map} +1 -1
- prefect/server/ui-v2/assets/create-CWAzl36x.js +2 -0
- prefect/server/ui-v2/assets/{create-CiMo25er.js.map → create-CWAzl36x.js.map} +1 -1
- prefect/server/ui-v2/assets/cronstrue-IJcBJ9tZ.js +2 -0
- prefect/server/ui-v2/assets/cronstrue-IJcBJ9tZ.js.map +1 -0
- prefect/server/ui-v2/assets/{data-table-Bfa8_ZJd.js → data-table-B3EtpFhV.js} +2 -2
- prefect/server/ui-v2/assets/{data-table-Bfa8_ZJd.js.map → data-table-B3EtpFhV.js.map} +1 -1
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-D18TITKv.js → delete-confirmation-dialog-DyUMWSB-.js} +2 -2
- prefect/server/ui-v2/assets/{delete-confirmation-dialog-D18TITKv.js.map → delete-confirmation-dialog-DyUMWSB-.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment-action-header-BJ8WZ6O0.js +2 -0
- prefect/server/ui-v2/assets/{deployment-action-header-AamGn0qI.js.map → deployment-action-header-BJ8WZ6O0.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-form-QIRH-pew.js → deployment-form-DXZUK11h.js} +3 -3
- prefect/server/ui-v2/assets/{deployment-form-QIRH-pew.js.map → deployment-form-DXZUK11h.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment-links-yTRvIDd3.js → deployment-links-bbtRf3OX.js} +2 -2
- prefect/server/ui-v2/assets/{deployment-links-yTRvIDd3.js.map → deployment-links-bbtRf3OX.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-m4luvPWl.js → deployment._id-DFzzDIAz.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-m4luvPWl.js.map → deployment._id-DFzzDIAz.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment._id-CCBPOCfw.js → deployment._id-GmnYU2jN.js} +2 -2
- prefect/server/ui-v2/assets/{deployment._id-CCBPOCfw.js.map → deployment._id-GmnYU2jN.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.duplicate--_rm26pJ.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.duplicate-DFjSeYn4.js.map → deployment_._id.duplicate--_rm26pJ.js.map} +1 -1
- prefect/server/ui-v2/assets/deployment_._id.edit-BS799pF4.js +2 -0
- prefect/server/ui-v2/assets/{deployment_._id.edit-5-mFOphJ.js.map → deployment_._id.edit-BS799pF4.js.map} +1 -1
- prefect/server/ui-v2/assets/{deployment_._id.run-CwVe5hPJ.js → deployment_._id.run-c02Fu6v1.js} +2 -2
- prefect/server/ui-v2/assets/{deployment_._id.run-CwVe5hPJ.js.map → deployment_._id.run-c02Fu6v1.js.map} +1 -1
- prefect/server/ui-v2/assets/{dropdown-menu-g64QiYKu.js → dropdown-menu-6cSdnzsr.js} +2 -2
- prefect/server/ui-v2/assets/{dropdown-menu-g64QiYKu.js.map → dropdown-menu-6cSdnzsr.js.map} +1 -1
- prefect/server/ui-v2/assets/{event-resource-display-BqqHFc0B.js → event-resource-display-DeFGeJR9.js} +2 -2
- prefect/server/ui-v2/assets/{event-resource-display-BqqHFc0B.js.map → event-resource-display-DeFGeJR9.js.map} +1 -1
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BR0eukkm.js → event._eventDate._eventId-CKnfHNoF.js} +2 -2
- prefect/server/ui-v2/assets/{event._eventDate._eventId-BR0eukkm.js.map → event._eventDate._eventId-CKnfHNoF.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run-graph-kZfaIevn.js → flow-run-graph-aynL8fbE.js} +2 -2
- prefect/server/ui-v2/assets/{flow-run-graph-kZfaIevn.js.map → flow-run-graph-aynL8fbE.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-4lwBtUgU.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-DiA0_X5m.js.map → flow-run._id-4lwBtUgU.js.map} +1 -1
- prefect/server/ui-v2/assets/flow-run._id-CT2imMDV.js +2 -0
- prefect/server/ui-v2/assets/{flow-run._id-Caq--9Lr.js.map → flow-run._id-CT2imMDV.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-run._id-BX0UeXTj.js → flow-run._id-s3t6dDIS.js} +4 -4
- prefect/server/ui-v2/assets/{flow-run._id-BX0UeXTj.js.map → flow-run._id-s3t6dDIS.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow-runs-pagination-CoZZ-ed_.js → flow-runs-pagination-DvDLs5GM.js} +2 -2
- prefect/server/ui-v2/assets/{flow-runs-pagination-CoZZ-ed_.js.map → flow-runs-pagination-DvDLs5GM.js.map} +1 -1
- prefect/server/ui-v2/assets/{flow._id-nRzTWzLb.js → flow._id-U31aNcVQ.js} +2 -2
- prefect/server/ui-v2/assets/{flow._id-nRzTWzLb.js.map → flow._id-U31aNcVQ.js.map} +1 -1
- prefect/server/ui-v2/assets/{form-CdcF42XZ.js → form-DvAgEGjn.js} +2 -2
- prefect/server/ui-v2/assets/{form-CdcF42XZ.js.map → form-DvAgEGjn.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DkJo9Uge.js → header-Bq61DIIv.js} +2 -2
- prefect/server/ui-v2/assets/{header-DkJo9Uge.js.map → header-Bq61DIIv.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DijI5Lcu.js → header-QiKDPn2b.js} +2 -2
- prefect/server/ui-v2/assets/{header-DijI5Lcu.js.map → header-QiKDPn2b.js.map} +1 -1
- prefect/server/ui-v2/assets/{header-DV0gMQER.js → header-YbYlGgAg.js} +2 -2
- prefect/server/ui-v2/assets/{header-DV0gMQER.js.map → header-YbYlGgAg.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BZ9TDxSy.js → index--QEAQOap.js} +2 -2
- prefect/server/ui-v2/assets/{index-BZ9TDxSy.js.map → index--QEAQOap.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-VUajxmNL.js → index-BJJn5VNO.js} +2 -2
- prefect/server/ui-v2/assets/{index-VUajxmNL.js.map → index-BJJn5VNO.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DYKO0qOd.js → index-BToZEh2M.js} +2 -2
- prefect/server/ui-v2/assets/{index-DYKO0qOd.js.map → index-BToZEh2M.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BmUvoLOK.js → index-BzE5jxe7.js} +2 -2
- prefect/server/ui-v2/assets/{index-BmUvoLOK.js.map → index-BzE5jxe7.js.map} +1 -1
- prefect/server/ui-v2/assets/index-C-uTnVrI.js +2 -0
- prefect/server/ui-v2/assets/{index-BCKNs_w7.js.map → index-C-uTnVrI.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-yTjygRmH.js → index-C19BICb6.js} +2 -2
- prefect/server/ui-v2/assets/{index-yTjygRmH.js.map → index-C19BICb6.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Cuh3BwlA.js → index-C84_3iOG.js} +2 -2
- prefect/server/ui-v2/assets/{index-Cuh3BwlA.js.map → index-C84_3iOG.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-Chtop8D8.js → index-CGt_907f.js} +2 -2
- prefect/server/ui-v2/assets/{index-Chtop8D8.js.map → index-CGt_907f.js.map} +1 -1
- prefect/server/ui-v2/assets/index-COtFm673.js +2 -0
- prefect/server/ui-v2/assets/{index-CqvGvZOq.js.map → index-COtFm673.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BZqccBpn.js → index-CQlQauOE.js} +6 -6
- prefect/server/ui-v2/assets/index-CQlQauOE.js.map +1 -0
- prefect/server/ui-v2/assets/{index-BGZtCgRR.js → index-CovPzmtX.js} +2 -2
- prefect/server/ui-v2/assets/{index-BGZtCgRR.js.map → index-CovPzmtX.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BV3WqCCv.js → index-CzZJA-g2.js} +2 -2
- prefect/server/ui-v2/assets/{index-BV3WqCCv.js.map → index-CzZJA-g2.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-CUZXozY8.js → index-D9O_iUny.js} +2 -2
- prefect/server/ui-v2/assets/{index-CUZXozY8.js.map → index-D9O_iUny.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-AXV1ellj.js → index-DBhG-F3c.js} +2 -2
- prefect/server/ui-v2/assets/{index-AXV1ellj.js.map → index-DBhG-F3c.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-KlV75baW.js → index-DEijvsFf.js} +2 -2
- prefect/server/ui-v2/assets/{index-KlV75baW.js.map → index-DEijvsFf.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-DO_c3_A_.js → index-DJx6_wL3.js} +2 -2
- prefect/server/ui-v2/assets/{index-DO_c3_A_.js.map → index-DJx6_wL3.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-faXvGo5k.js → index-DzylsDQg.js} +2 -2
- prefect/server/ui-v2/assets/{index-faXvGo5k.js.map → index-DzylsDQg.js.map} +1 -1
- prefect/server/ui-v2/assets/index-MqrX6o60.js +2 -0
- prefect/server/ui-v2/assets/{index-BijfHkUE.js.map → index-MqrX6o60.js.map} +1 -1
- prefect/server/ui-v2/assets/index-Xbikq0U9.js +2 -0
- prefect/server/ui-v2/assets/{index-CUJoNEgb.js.map → index-Xbikq0U9.js.map} +1 -1
- prefect/server/ui-v2/assets/{index-BfuGBXBN.js → index-xd6ftCzl.js} +2 -2
- prefect/server/ui-v2/assets/{index-BfuGBXBN.js.map → index-xd6ftCzl.js.map} +1 -1
- prefect/server/ui-v2/assets/{json-input-DFgWdLGv.js → json-input-CUdR2ooF.js} +2 -2
- prefect/server/ui-v2/assets/{json-input-DFgWdLGv.js.map → json-input-CUdR2ooF.js.map} +1 -1
- prefect/server/ui-v2/assets/{key._key-CpeWM0mN.js → key._key-Dkjl-3EA.js} +2 -2
- prefect/server/ui-v2/assets/{key._key-CpeWM0mN.js.map → key._key-Dkjl-3EA.js.map} +1 -1
- prefect/server/ui-v2/assets/{lazy-markdown-Bzi0YUUV.js → lazy-markdown-B5J5jhCs.js} +3 -3
- prefect/server/ui-v2/assets/{lazy-markdown-Bzi0YUUV.js.map → lazy-markdown-B5J5jhCs.js.map} +1 -1
- prefect/server/ui-v2/assets/{login-CM0nuDdd.js → login-DzDO0DVR.js} +2 -2
- prefect/server/ui-v2/assets/{login-CM0nuDdd.js.map → login-DzDO0DVR.js.map} +1 -1
- prefect/server/ui-v2/assets/{markdown-input-CGOAnaWz.js → markdown-input-BYRT3e1M.js} +2 -2
- prefect/server/ui-v2/assets/{markdown-input-CGOAnaWz.js.map → markdown-input-BYRT3e1M.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-example-snippet-CyJ28Tm-.js → python-example-snippet-BMLiEUYL.js} +3 -3
- prefect/server/ui-v2/assets/{python-example-snippet-CyJ28Tm-.js.map → python-example-snippet-BMLiEUYL.js.map} +1 -1
- prefect/server/ui-v2/assets/{python-input-D8_x22t4.js → python-input-xovZoSSG.js} +2 -2
- prefect/server/ui-v2/assets/{python-input-D8_x22t4.js.map → python-input-xovZoSSG.js.map} +1 -1
- prefect/server/ui-v2/assets/{radio-group-Dgu38qwz.js → radio-group-B4HH3BMW.js} +2 -2
- prefect/server/ui-v2/assets/{radio-group-Dgu38qwz.js.map → radio-group-B4HH3BMW.js.map} +1 -1
- prefect/server/ui-v2/assets/{route-error-state-CVHTggxQ.js → route-error-state-BI1VOaRa.js} +2 -2
- prefect/server/ui-v2/assets/{route-error-state-CVHTggxQ.js.map → route-error-state-BI1VOaRa.js.map} +1 -1
- prefect/server/ui-v2/assets/schema-form-DvPKoIJV.js +2 -0
- prefect/server/ui-v2/assets/schema-form-DvPKoIJV.js.map +1 -0
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DuEmswz-.js → schema-form-input-string-format-datetime-FBLeet2k.js} +4 -4
- prefect/server/ui-v2/assets/{schema-form-input-string-format-datetime-DuEmswz-.js.map → schema-form-input-string-format-datetime-FBLeet2k.js.map} +1 -1
- prefect/server/ui-v2/assets/{settings-CtKmYnoo.js → settings-LiwgpMzF.js} +2 -2
- prefect/server/ui-v2/assets/{settings-CtKmYnoo.js.map → settings-LiwgpMzF.js.map} +1 -1
- prefect/server/ui-v2/assets/{sort-filter-BNQ6rjAG.js → sort-filter-BdZ0BjdE.js} +2 -2
- prefect/server/ui-v2/assets/{sort-filter-BNQ6rjAG.js.map → sort-filter-BdZ0BjdE.js.map} +1 -1
- prefect/server/ui-v2/assets/{table-CJS-5Aky.js → table--kjjs3jN.js} +2 -2
- prefect/server/ui-v2/assets/{table-CJS-5Aky.js.map → table--kjjs3jN.js.map} +1 -1
- prefect/server/ui-v2/assets/{tags-input-CDvuqe9B.js → tags-input-9pBchAz7.js} +2 -2
- prefect/server/ui-v2/assets/{tags-input-CDvuqe9B.js.map → tags-input-9pBchAz7.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-DMqNFEVn.js → task-run-concurrency-limits-reset-dialog-B3XhJqIQ.js} +2 -2
- prefect/server/ui-v2/assets/{task-run-concurrency-limits-reset-dialog-DMqNFEVn.js.map → task-run-concurrency-limits-reset-dialog-B3XhJqIQ.js.map} +1 -1
- prefect/server/ui-v2/assets/task-run._id-BdlPyINB.js +2 -0
- prefect/server/ui-v2/assets/{task-run._id-CiVsXKpy.js.map → task-run._id-BdlPyINB.js.map} +1 -1
- prefect/server/ui-v2/assets/{task-run._id-CV5t0LR0.js → task-run._id-BnZwcX9a.js} +3 -3
- prefect/server/ui-v2/assets/{task-run._id-CV5t0LR0.js.map → task-run._id-BnZwcX9a.js.map} +1 -1
- prefect/server/ui-v2/assets/task-runs-pagination-ClbepGWu.js +2 -0
- prefect/server/ui-v2/assets/{task-runs-pagination-DGjxL4DO.js.map → task-runs-pagination-ClbepGWu.js.map} +1 -1
- prefect/server/ui-v2/assets/{textarea-Mne2s-1n.js → textarea-CjmPCtZi.js} +2 -2
- prefect/server/ui-v2/assets/{textarea-Mne2s-1n.js.map → textarea-CjmPCtZi.js.map} +1 -1
- prefect/server/ui-v2/assets/{timezone-select-CPBtT8tA.js → timezone-select-5WxUFUXB.js} +2 -2
- prefect/server/ui-v2/assets/{timezone-select-CPBtT8tA.js.map → timezone-select-5WxUFUXB.js.map} +1 -1
- prefect/server/ui-v2/assets/{toggle-group-CvPe0UY1.js → toggle-group-DjbSsHsv.js} +2 -2
- prefect/server/ui-v2/assets/{toggle-group-CvPe0UY1.js.map → toggle-group-DjbSsHsv.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-debounce-callback-Dcf0d0U7.js → use-debounce-callback-CVfZS_LP.js} +2 -2
- prefect/server/ui-v2/assets/{use-debounce-callback-Dcf0d0U7.js.map → use-debounce-callback-CVfZS_LP.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DnRkM1Cj.js → use-delete-automation-confirmation-dialog-C7nas8eR.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-automation-confirmation-dialog-DnRkM1Cj.js.map → use-delete-automation-confirmation-dialog-C7nas8eR.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CMHtwDvb.js → use-delete-block-document-confirmation-dialog-Cz3znU4m.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-block-document-confirmation-dialog-CMHtwDvb.js.map → use-delete-block-document-confirmation-dialog-Cz3znU4m.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-delete-confirmation-dialog-Bka9YDdO.js → use-delete-confirmation-dialog-C5d6hPL-.js} +2 -2
- prefect/server/ui-v2/assets/{use-delete-confirmation-dialog-Bka9YDdO.js.map → use-delete-confirmation-dialog-C5d6hPL-.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DB4pe2_m.js → use-flow-runs-selected-rows-B_7PiPKo.js} +2 -2
- prefect/server/ui-v2/assets/{use-flow-runs-selected-rows-DB4pe2_m.js.map → use-flow-runs-selected-rows-B_7PiPKo.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DUPrB7V9.js → use-get-artifacts-flow-task-runs-BitcuQLc.js} +2 -2
- prefect/server/ui-v2/assets/{use-get-artifacts-flow-task-runs-DUPrB7V9.js.map → use-get-artifacts-flow-task-runs-BitcuQLc.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-is-overflowing-Cc-Qm0vx.js → use-is-overflowing-CyVH32I2.js} +2 -2
- prefect/server/ui-v2/assets/{use-is-overflowing-Cc-Qm0vx.js.map → use-is-overflowing-CyVH32I2.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-page-title-ELpQMkBC.js → use-page-title-CImKMV-D.js} +2 -2
- prefect/server/ui-v2/assets/{use-page-title-ELpQMkBC.js.map → use-page-title-CImKMV-D.js.map} +1 -1
- prefect/server/ui-v2/assets/use-quick-run-IfBGzpj9.js +2 -0
- prefect/server/ui-v2/assets/{use-quick-run-uAasMmAv.js.map → use-quick-run-IfBGzpj9.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-state-favicon-CzOUYzQe.js → use-state-favicon-kNCf3RcS.js} +2 -2
- prefect/server/ui-v2/assets/{use-state-favicon-CzOUYzQe.js.map → use-state-favicon-kNCf3RcS.js.map} +1 -1
- prefect/server/ui-v2/assets/{use-stepper-DvHmfROo.js → use-stepper-DRdSNO1_.js} +2 -2
- prefect/server/ui-v2/assets/{use-stepper-DvHmfROo.js.map → use-stepper-DRdSNO1_.js.map} +1 -1
- prefect/server/ui-v2/assets/{utilities-XA-1-LhA.js → utilities-B74wofJY.js} +2 -2
- prefect/server/ui-v2/assets/{utilities-XA-1-LhA.js.map → utilities-B74wofJY.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-codemirror-Dn73yRFx.js → vendor-codemirror-OTxfneaa.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-codemirror-Dn73yRFx.js.map → vendor-codemirror-OTxfneaa.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-date-Bxa7CHB1.js → vendor-date-CRz8gtWZ.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-date-Bxa7CHB1.js.map → vendor-date-CRz8gtWZ.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-forms-mroZAMaw.js → vendor-forms-D-iybWES.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-forms-mroZAMaw.js.map → vendor-forms-D-iybWES.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-markdown-BV905mMk.js → vendor-markdown-TdbL8FCd.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-markdown-BV905mMk.js.map → vendor-markdown-TdbL8FCd.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-radix-CP6hQtRc.js → vendor-radix-DRMjKWJW.js} +5 -5
- prefect/server/ui-v2/assets/{vendor-radix-CP6hQtRc.js.map → vendor-radix-DRMjKWJW.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-recharts-BOcghvr2.js → vendor-recharts-BGjDGXVf.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-recharts-BOcghvr2.js.map → vendor-recharts-BGjDGXVf.js.map} +1 -1
- prefect/server/ui-v2/assets/{vendor-tanstack-CLpbOGYv.js → vendor-tanstack-CWDKYA_B.js} +2 -2
- prefect/server/ui-v2/assets/{vendor-tanstack-CLpbOGYv.js.map → vendor-tanstack-CWDKYA_B.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-filter-D4DI4Hd5.js → work-pool-filter-BD0cywQF.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-filter-D4DI4Hd5.js.map → work-pool-filter-BD0cywQF.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool-queue-toggle--tVsqhDi.js → work-pool-queue-toggle-Dd3mOecD.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool-queue-toggle--tVsqhDi.js.map → work-pool-queue-toggle-Dd3mOecD.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool._workPoolName-Ba0XSN4m.js → work-pool._workPoolName-Dxf0Y-lV.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool._workPoolName-Ba0XSN4m.js.map → work-pool._workPoolName-Dxf0Y-lV.js.map} +1 -1
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-B0Y9VwYX.js +2 -0
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.edit-CeYLESXS.js.map → work-pool_._workPoolName.edit-B0Y9VwYX.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CHvlnO-U.js → work-pool_._workPoolName.queue._workQueueName-ZHSn4vVg.js} +2 -2
- prefect/server/ui-v2/assets/{work-pool_._workPoolName.queue._workQueueName-CHvlnO-U.js.map → work-pool_._workPoolName.queue._workQueueName-ZHSn4vVg.js.map} +1 -1
- prefect/server/ui-v2/assets/{work-queue-icon-text-DnQAtUi_.js → work-queue-icon-text-GE7b8Ro1.js} +2 -2
- prefect/server/ui-v2/assets/{work-queue-icon-text-DnQAtUi_.js.map → work-queue-icon-text-GE7b8Ro1.js.map} +1 -1
- prefect/server/ui-v2/assets/{zod-cc-7bk3x.js → zod-CjGf5GIv.js} +2 -2
- prefect/server/ui-v2/assets/{zod-cc-7bk3x.js.map → zod-CjGf5GIv.js.map} +1 -1
- prefect/server/ui-v2/index.html +6 -6
- prefect/server/utilities/subscriptions.py +25 -8
- prefect/testing/fixtures.py +31 -1
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev5.dist-info}/METADATA +2 -2
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev5.dist-info}/RECORD +235 -235
- prefect/server/ui-v2/assets/automation._id-Bm1T3_NO.js +0 -2
- prefect/server/ui-v2/assets/block-type-logo-ox5VqJuy.js +0 -2
- prefect/server/ui-v2/assets/create-CiMo25er.js +0 -2
- prefect/server/ui-v2/assets/create-Da7OBOa5.js +0 -2
- prefect/server/ui-v2/assets/cronstrue-CeanGOEE.js +0 -2
- prefect/server/ui-v2/assets/cronstrue-CeanGOEE.js.map +0 -1
- prefect/server/ui-v2/assets/deployment-action-header-AamGn0qI.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.duplicate-DFjSeYn4.js +0 -2
- prefect/server/ui-v2/assets/deployment_._id.edit-5-mFOphJ.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-Caq--9Lr.js +0 -2
- prefect/server/ui-v2/assets/flow-run._id-DiA0_X5m.js +0 -2
- prefect/server/ui-v2/assets/index-BCKNs_w7.js +0 -2
- prefect/server/ui-v2/assets/index-BZqccBpn.js.map +0 -1
- prefect/server/ui-v2/assets/index-BijfHkUE.js +0 -2
- prefect/server/ui-v2/assets/index-CUJoNEgb.js +0 -2
- prefect/server/ui-v2/assets/index-CqvGvZOq.js +0 -2
- prefect/server/ui-v2/assets/schema-form-DqRLX--T.js +0 -2
- prefect/server/ui-v2/assets/schema-form-DqRLX--T.js.map +0 -1
- prefect/server/ui-v2/assets/task-run._id-CiVsXKpy.js +0 -2
- prefect/server/ui-v2/assets/task-runs-pagination-DGjxL4DO.js +0 -2
- prefect/server/ui-v2/assets/use-quick-run-uAasMmAv.js +0 -2
- prefect/server/ui-v2/assets/work-pool_._workPoolName.edit-CeYLESXS.js +0 -2
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev5.dist-info}/WHEEL +0 -0
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev5.dist-info}/entry_points.txt +0 -0
- {prefect-3.6.14.dev3.dist-info → prefect-3.6.14.dev5.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{j as e,F as N,r as p,C as Q,G as W,D as X,B as Y,L as he}from"./vendor-tanstack-CLpbOGYv.js";import{q as d,I as k,y as v,bf as Z,G as ee,O as se,E as ne,t as ae,v as re,w as te,x as ce,D as oe,B as _,g as V,h as E,bg as xe,_ as G,$ as M,a0 as F,a1 as I,p as C,a3 as O,bh as P,bi as je,a2 as ge,bj as ye,bk as pe,bl as be,aw as Ce,ax as ve,ay as $,az as U}from"./index-BZqccBpn.js";import{D as ie}from"./data-table-Bfa8_ZJd.js";import{D as fe,a as we,b as Le,c as Se,d as T}from"./dropdown-menu-g64QiYKu.js";import{F as le,a as u,b as x,c as j,d as g,e as y}from"./form-CdcF42XZ.js";import{a as de}from"./zod-cc-7bk3x.js";import{c as ue,o as z,n as L,s as h,b as ke,f as S,e as De}from"./vendor-forms-mroZAMaw.js";import{T as Re,a as Te,b as Ae}from"./task-run-concurrency-limits-reset-dialog-DMqNFEVn.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CP6hQtRc.js";import"./vendor-recharts-BOcghvr2.js";import"./vendor-date-Bxa7CHB1.js";import"./table-CJS-5Aky.js";const Ne=({onEditRow:s,onDeleteRow:n,...a})=>{const r=i=>{navigator.clipboard.writeText(i),v.success("ID copied")},t=a.row.original;return e.jsxs(fe,{children:[e.jsx(we,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(k,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(Le,{align:"end",children:[e.jsx(Se,{children:"Actions"}),e.jsx(T,{onClick:()=>r(t.id),children:"Copy ID"}),e.jsx(T,{onClick:()=>n(t),children:"Delete"}),e.jsx(T,{onClick:()=>s(t),children:"Edit"})]})]})},_e=s=>{const{updateGlobalConcurrencyLimit:n}=Z(),a=(i,c)=>{n({id_or_name:c,active:i},{onSuccess:()=>{v.success("Concurrency limit updated")},onError:o=>{const l=o.message||"Unknown error while updating active field.";console.error(l)}})},r=s.getValue(),t=s.row.original.id;return e.jsx(ee,{"aria-label":"toggle active",checked:r,onCheckedChange:i=>a(i,t)})},B=N("/concurrency-limits/"),b=Y(),Ve=({onEditRow:s,onDeleteRow:n})=>[b.accessor("name",{header:"Name"}),b.accessor("limit",{header:"Limit"}),b.accessor("active_slots",{header:"Active Slots"}),b.accessor("slot_decay_per_second",{header:"Slots Decay Per Second"}),b.accessor("active",{header:"Active",cell:_e}),b.display({id:"actions",cell:a=>e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Ne,{...a,onEditRow:s,onDeleteRow:n})})})],Ee=({data:s,onEditRow:n,onDeleteRow:a})=>{const r=B.useNavigate(),{search:t}=B.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.name.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Ge,{data:c,onDeleteRow:a,onEditRow:n,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Ge({data:s,onDeleteRow:n,onEditRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:Ve({onDeleteRow:n,onEditRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search global concurrency limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Me=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"AlignVerticalJustifyStart"}),e.jsx(re,{children:"Add a concurrency limit"}),e.jsx(te,{children:"Global concurrency limits can be applied to flow runs, task runs and any operation where you want to control concurrency."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"global-concurrency-guide"})]})]}),Fe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Global Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add global concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),Ie=z({active:ke().default(!0),denied_slots:L().default(0).or(h()).pipe(S.number()),limit:L().default(0).or(h()).pipe(S.number()),name:h().min(2,{message:"Name must be at least 2 characters"}).default(""),slot_decay_per_second:L().default(0).or(h()).pipe(S.number()),active_slots:L().default(0).or(h()).pipe(S.number())}),A={active:!0,name:"",limit:0,slot_decay_per_second:0,denied_slots:0,active_slots:0},Oe=({limitToUpdate:s,onSubmit:n})=>{const{createGlobalConcurrencyLimit:a,status:r}=xe(),{updateGlobalConcurrencyLimit:t,status:i}=Z(),c=ue({resolver:de(Ie),defaultValues:A});return p.useEffect(()=>{if(s){const{active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me}=s;c.reset({active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me})}else c.reset(A)},[c,s]),{form:c,saveOrUpdate:l=>{const D=()=>{c.reset(A),n()};s?.id?t({id_or_name:s.id,...l},{onSuccess:()=>{v.success("Limit updated")},onError:f=>{const w=f.message||"Unknown error while updating limit.";c.setError("root",{message:w})},onSettled:D}):a(l,{onSuccess:()=>{v.success("Limit created")},onError:f=>{const w=f.message||"Unknown error while creating variable.";c.setError("root",{message:w})},onSettled:D})},isLoading:r==="pending"||i==="pending"}},H=({limitToUpdate:s,onOpenChange:n,onSubmit:a})=>{const{form:r,isLoading:t,saveOrUpdate:i}=Oe({limitToUpdate:s,onSubmit:a}),c=s?`Update ${s.name}`:"Add Concurrency Limit";return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:c})}),e.jsx(le,{...r,children:e.jsxs("form",{onSubmit:o=>{r.handleSubmit(i)(o)},className:"space-y-4",children:[e.jsx(u,{children:r.formState.errors.root?.message}),e.jsx(x,{control:r.control,name:"name",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Name"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"limit",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"slot_decay_per_second",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Slot Decay Per Second"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),s&&e.jsx(x,{control:r.control,name:"active_slots",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active Slots"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"active",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active"}),e.jsx(y,{children:e.jsx(ee,{className:"block",checked:o.value,onCheckedChange:o.onChange})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:t,children:s?"Update":"Save"})]})]})})]})})},Pe=({limit:s,onOpenChange:n,onDelete:a})=>{const{deleteGlobalConcurrencyLimit:r,isPending:t}=je(),i=c=>{r(c,{onSuccess:()=>{v.success("Concurrency limit deleted")},onError:o=>{const l=o.message||"Unknown error while deleting concurrency limit.";console.error(l)},onSettled:a})};return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{children:[e.jsx(F,{children:e.jsx(I,{children:"Delete Concurrency Limit"})}),e.jsxs(ge,{children:["Are you sure you want to delete ",s.name]}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{variant:"destructive",onClick:()=>i(s.id),loading:t,children:"Delete"})]})]})})},ze=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(H,{onOpenChange:a,onSubmit:n});case"delete":return e.jsx(Pe,{limit:t,onOpenChange:a,onDelete:n});case"edit":return e.jsx(H,{onOpenChange:a,limitToUpdate:t,onSubmit:n});default:return null}},$e=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=ye(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"edit",data:l}),i=l=>n({dialog:"delete",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fe,{onAdd:r}),a.length===0?e.jsx(Me,{onAdd:r}):e.jsx(Ee,{data:a,onEditRow:t,onDeleteRow:i}),e.jsx(ze,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},Ue=s=>{const a=s.getValue().length;return a===0?"None":a},Be=s=>{const n=s.getValue(),a=s.row.original.id;return e.jsx(he,{params:{id:a},to:"/concurrency-limits/concurrency-limit/$id",children:n})},q=N("/concurrency-limits/"),R=Y(),He=({onDeleteRow:s,onResetRow:n})=>[R.accessor("tag",{header:"Tag",cell:Be}),R.accessor("concurrency_limit",{header:"Slots"}),R.accessor("active_slots",{header:"Active Task Runs",cell:Ue}),R.display({id:"actions",cell:a=>{const r=a.row.original;return e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Re,{id:r.id,onDelete:()=>s(r),onReset:()=>n(r)})})}})],qe=({data:s,onDeleteRow:n,onResetRow:a})=>{const r=q.useNavigate(),{search:t}=q.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.tag.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Je,{data:c,onDeleteRow:n,onResetRow:a,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Je({data:s,onDeleteRow:n,onResetRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:He({onDeleteRow:n,onResetRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search active task limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Ke=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"CircleArrowOutUpRight"}),e.jsx(re,{children:"Add a concurrency limit for your task runs"}),e.jsx(te,{children:"Creating a limit allows you to limit the number of tasks running simultaneously with a given tag."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"task-concurrency-guide"})]})]}),Qe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Task Run Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add task run concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),We=z({tag:h().min(1),concurrency_limit:L().default(0).or(h()).pipe(S.number())}),J={tag:"",concurrency_limit:0},Xe=({onOpenChange:s,onSubmit:n})=>{const{createTaskRunConcurrencyLimit:a,isPending:r}=pe(),t=ue({resolver:de(We),defaultValues:J}),i=c=>{a(c,{onSuccess:()=>{v.success("Concurrency limit added")},onError:o=>{const l=o.message||"Unknown error while updating limit.";t.setError("root",{message:l})},onSettled:()=>{t.reset(J),n()}})};return e.jsx(G,{open:!0,onOpenChange:s,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:"Add Task Run Concurrency Limit"})}),e.jsx(le,{...t,children:e.jsxs("form",{onSubmit:c=>{t.handleSubmit(i)(c)},className:"space-y-4",children:[e.jsx(u,{children:t.formState.errors.root?.message}),e.jsx(x,{control:t.control,name:"tag",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Tag"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...c})}),e.jsx(u,{})]})}),e.jsx(x,{control:t.control,name:"concurrency_limit",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...c})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:r,children:"Add"})]})]})})]})})},Ye=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(Xe,{onOpenChange:a,onSubmit:n});case"reset":return e.jsx(Ae,{data:t,onOpenChange:a,onReset:n});case"delete":return e.jsx(Te,{data:t,onOpenChange:a,onDelete:n});default:return null}},Ze=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=be(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"delete",data:l}),i=l=>n({dialog:"reset",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Qe,{onAdd:r}),a.length===0?e.jsx(Ke,{onAdd:r}):e.jsx(qe,{data:a,onDeleteRow:t,onResetRow:i}),e.jsx(Ye,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},K=N("/concurrency-limits/"),m={global:{tabSearchValue:"global",displayValue:"Global"},"task-run":{tabSearchValue:"task-run",displayValue:"Task Run"}},es=({globalView:s,taskRunView:n})=>{const{tab:a}=K.useSearch(),r=K.useNavigate();return e.jsxs(Ce,{defaultValue:"Global",value:a,children:[e.jsxs(ve,{children:[e.jsx($,{value:m.global.tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m.global.tabSearchValue}})},children:m.global.displayValue}),e.jsx($,{value:m["task-run"].tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m["task-run"].tabSearchValue}})},children:m["task-run"].displayValue})]}),e.jsx(U,{value:m.global.tabSearchValue,children:s}),e.jsx(U,{value:m["task-run"].tabSearchValue,children:n})]})},ss=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ns,{}),e.jsx(es,{globalView:e.jsx($e,{}),taskRunView:e.jsx(Ze,{})})]}),ns=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Concurrency"})})})});z({search:h().optional(),tab:De(["global","task-run"]).default("global")});const gs=ss;export{gs as component};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{j as e,F as N,r as p,C as Q,G as W,D as X,B as Y,L as he}from"./vendor-tanstack-CWDKYA_B.js";import{q as d,I as k,y as v,bf as Z,G as ee,O as se,E as ne,t as ae,v as re,w as te,x as ce,D as oe,B as _,g as V,h as E,bg as xe,_ as G,$ as M,a0 as F,a1 as I,p as C,a3 as O,bh as P,bi as je,a2 as ge,bj as ye,bk as pe,bl as be,aw as Ce,ax as ve,ay as $,az as U}from"./index-CQlQauOE.js";import{D as ie}from"./data-table-B3EtpFhV.js";import{D as fe,a as we,b as Le,c as Se,d as T}from"./dropdown-menu-6cSdnzsr.js";import{F as le,a as u,b as x,c as j,d as g,e as y}from"./form-DvAgEGjn.js";import{a as de}from"./zod-CjGf5GIv.js";import{c as ue,o as z,n as L,s as h,b as ke,f as S,e as De}from"./vendor-forms-D-iybWES.js";import{T as Re,a as Te,b as Ae}from"./task-run-concurrency-limits-reset-dialog-B3XhJqIQ.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";import"./vendor-recharts-BGjDGXVf.js";import"./vendor-date-CRz8gtWZ.js";import"./table--kjjs3jN.js";const Ne=({onEditRow:s,onDeleteRow:n,...a})=>{const r=i=>{navigator.clipboard.writeText(i),v.success("ID copied")},t=a.row.original;return e.jsxs(fe,{children:[e.jsx(we,{asChild:!0,children:e.jsxs(d,{variant:"outline",className:"size-8 p-0",children:[e.jsx("span",{className:"sr-only",children:"Open menu"}),e.jsx(k,{id:"MoreVertical",className:"size-4"})]})}),e.jsxs(Le,{align:"end",children:[e.jsx(Se,{children:"Actions"}),e.jsx(T,{onClick:()=>r(t.id),children:"Copy ID"}),e.jsx(T,{onClick:()=>n(t),children:"Delete"}),e.jsx(T,{onClick:()=>s(t),children:"Edit"})]})]})},_e=s=>{const{updateGlobalConcurrencyLimit:n}=Z(),a=(i,c)=>{n({id_or_name:c,active:i},{onSuccess:()=>{v.success("Concurrency limit updated")},onError:o=>{const l=o.message||"Unknown error while updating active field.";console.error(l)}})},r=s.getValue(),t=s.row.original.id;return e.jsx(ee,{"aria-label":"toggle active",checked:r,onCheckedChange:i=>a(i,t)})},B=N("/concurrency-limits/"),b=Y(),Ve=({onEditRow:s,onDeleteRow:n})=>[b.accessor("name",{header:"Name"}),b.accessor("limit",{header:"Limit"}),b.accessor("active_slots",{header:"Active Slots"}),b.accessor("slot_decay_per_second",{header:"Slots Decay Per Second"}),b.accessor("active",{header:"Active",cell:_e}),b.display({id:"actions",cell:a=>e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Ne,{...a,onEditRow:s,onDeleteRow:n})})})],Ee=({data:s,onEditRow:n,onDeleteRow:a})=>{const r=B.useNavigate(),{search:t}=B.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.name.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Ge,{data:c,onDeleteRow:a,onEditRow:n,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Ge({data:s,onDeleteRow:n,onEditRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:Ve({onDeleteRow:n,onEditRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search global concurrency limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Me=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"AlignVerticalJustifyStart"}),e.jsx(re,{children:"Add a concurrency limit"}),e.jsx(te,{children:"Global concurrency limits can be applied to flow runs, task runs and any operation where you want to control concurrency."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"global-concurrency-guide"})]})]}),Fe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Global Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add global concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),Ie=z({active:ke().default(!0),denied_slots:L().default(0).or(h()).pipe(S.number()),limit:L().default(0).or(h()).pipe(S.number()),name:h().min(2,{message:"Name must be at least 2 characters"}).default(""),slot_decay_per_second:L().default(0).or(h()).pipe(S.number()),active_slots:L().default(0).or(h()).pipe(S.number())}),A={active:!0,name:"",limit:0,slot_decay_per_second:0,denied_slots:0,active_slots:0},Oe=({limitToUpdate:s,onSubmit:n})=>{const{createGlobalConcurrencyLimit:a,status:r}=xe(),{updateGlobalConcurrencyLimit:t,status:i}=Z(),c=ue({resolver:de(Ie),defaultValues:A});return p.useEffect(()=>{if(s){const{active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me}=s;c.reset({active:l,name:D,limit:f,slot_decay_per_second:w,active_slots:me})}else c.reset(A)},[c,s]),{form:c,saveOrUpdate:l=>{const D=()=>{c.reset(A),n()};s?.id?t({id_or_name:s.id,...l},{onSuccess:()=>{v.success("Limit updated")},onError:f=>{const w=f.message||"Unknown error while updating limit.";c.setError("root",{message:w})},onSettled:D}):a(l,{onSuccess:()=>{v.success("Limit created")},onError:f=>{const w=f.message||"Unknown error while creating variable.";c.setError("root",{message:w})},onSettled:D})},isLoading:r==="pending"||i==="pending"}},H=({limitToUpdate:s,onOpenChange:n,onSubmit:a})=>{const{form:r,isLoading:t,saveOrUpdate:i}=Oe({limitToUpdate:s,onSubmit:a}),c=s?`Update ${s.name}`:"Add Concurrency Limit";return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:c})}),e.jsx(le,{...r,children:e.jsxs("form",{onSubmit:o=>{r.handleSubmit(i)(o)},className:"space-y-4",children:[e.jsx(u,{children:r.formState.errors.root?.message}),e.jsx(x,{control:r.control,name:"name",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Name"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"limit",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"slot_decay_per_second",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Slot Decay Per Second"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),s&&e.jsx(x,{control:r.control,name:"active_slots",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active Slots"}),e.jsx(y,{children:e.jsx(C,{type:"number",...o})}),e.jsx(u,{})]})}),e.jsx(x,{control:r.control,name:"active",render:({field:o})=>e.jsxs(j,{children:[e.jsx(g,{children:"Active"}),e.jsx(y,{children:e.jsx(ee,{className:"block",checked:o.value,onCheckedChange:o.onChange})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:t,children:s?"Update":"Save"})]})]})})]})})},Pe=({limit:s,onOpenChange:n,onDelete:a})=>{const{deleteGlobalConcurrencyLimit:r,isPending:t}=je(),i=c=>{r(c,{onSuccess:()=>{v.success("Concurrency limit deleted")},onError:o=>{const l=o.message||"Unknown error while deleting concurrency limit.";console.error(l)},onSettled:a})};return e.jsx(G,{open:!0,onOpenChange:n,children:e.jsxs(M,{children:[e.jsx(F,{children:e.jsx(I,{children:"Delete Concurrency Limit"})}),e.jsxs(ge,{children:["Are you sure you want to delete ",s.name]}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{variant:"destructive",onClick:()=>i(s.id),loading:t,children:"Delete"})]})]})})},ze=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(H,{onOpenChange:a,onSubmit:n});case"delete":return e.jsx(Pe,{limit:t,onOpenChange:a,onDelete:n});case"edit":return e.jsx(H,{onOpenChange:a,limitToUpdate:t,onSubmit:n});default:return null}},$e=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=ye(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"edit",data:l}),i=l=>n({dialog:"delete",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Fe,{onAdd:r}),a.length===0?e.jsx(Me,{onAdd:r}):e.jsx(Ee,{data:a,onEditRow:t,onDeleteRow:i}),e.jsx(ze,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},Ue=s=>{const a=s.getValue().length;return a===0?"None":a},Be=s=>{const n=s.getValue(),a=s.row.original.id;return e.jsx(he,{params:{id:a},to:"/concurrency-limits/concurrency-limit/$id",children:n})},q=N("/concurrency-limits/"),R=Y(),He=({onDeleteRow:s,onResetRow:n})=>[R.accessor("tag",{header:"Tag",cell:Be}),R.accessor("concurrency_limit",{header:"Slots"}),R.accessor("active_slots",{header:"Active Task Runs",cell:Ue}),R.display({id:"actions",cell:a=>{const r=a.row.original;return e.jsx("div",{className:"flex flex-row justify-end",children:e.jsx(Re,{id:r.id,onDelete:()=>s(r),onReset:()=>n(r)})})}})],qe=({data:s,onDeleteRow:n,onResetRow:a})=>{const r=q.useNavigate(),{search:t}=q.useSearch(),i=p.useDeferredValue(t??""),c=p.useMemo(()=>s.filter(o=>o.tag.toLowerCase().includes(i.toLowerCase())),[s,i]);return e.jsx(Je,{data:c,onDeleteRow:n,onResetRow:a,searchValue:t,onSearchChange:o=>{r({to:".",search:l=>({...l,search:o})})}})};function Je({data:s,onDeleteRow:n,onResetRow:a,onSearchChange:r,searchValue:t}){const i=Q({data:s,columns:He({onDeleteRow:n,onResetRow:a}),getCoreRowModel:X(),getPaginationRowModel:W()});return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(se,{className:"max-w-72",placeholder:"Search active task limit",value:t,onChange:c=>r(c.target.value)}),e.jsx(ie,{table:i})]})}const Ke=({onAdd:s})=>e.jsxs(ne,{children:[e.jsx(ae,{id:"CircleArrowOutUpRight"}),e.jsx(re,{children:"Add a concurrency limit for your task runs"}),e.jsx(te,{children:"Creating a limit allows you to limit the number of tasks running simultaneously with a given tag."}),e.jsxs(ce,{children:[e.jsxs(d,{onClick:s,children:["Add Concurrency Limit ",e.jsx(k,{id:"Plus",className:"size-4 ml-2"})]}),e.jsx(oe,{id:"task-concurrency-guide"})]})]}),Qe=({onAdd:s})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Task Run Concurrency Limits"})})}),e.jsx(d,{onClick:s,size:"icon",className:"size-7",variant:"outline","aria-label":"add task run concurrency limit",children:e.jsx(k,{id:"Plus",className:"size-4"})})]}),We=z({tag:h().min(1),concurrency_limit:L().default(0).or(h()).pipe(S.number())}),J={tag:"",concurrency_limit:0},Xe=({onOpenChange:s,onSubmit:n})=>{const{createTaskRunConcurrencyLimit:a,isPending:r}=pe(),t=ue({resolver:de(We),defaultValues:J}),i=c=>{a(c,{onSuccess:()=>{v.success("Concurrency limit added")},onError:o=>{const l=o.message||"Unknown error while updating limit.";t.setError("root",{message:l})},onSettled:()=>{t.reset(J),n()}})};return e.jsx(G,{open:!0,onOpenChange:s,children:e.jsxs(M,{"aria-describedby":void 0,children:[e.jsx(F,{children:e.jsx(I,{children:"Add Task Run Concurrency Limit"})}),e.jsx(le,{...t,children:e.jsxs("form",{onSubmit:c=>{t.handleSubmit(i)(c)},className:"space-y-4",children:[e.jsx(u,{children:t.formState.errors.root?.message}),e.jsx(x,{control:t.control,name:"tag",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Tag"}),e.jsx(y,{children:e.jsx(C,{type:"text",autoComplete:"off",...c})}),e.jsx(u,{})]})}),e.jsx(x,{control:t.control,name:"concurrency_limit",render:({field:c})=>e.jsxs(j,{children:[e.jsx(g,{children:"Concurrency Limit"}),e.jsx(y,{children:e.jsx(C,{type:"number",...c})}),e.jsx(u,{})]})}),e.jsxs(O,{children:[e.jsx(P,{asChild:!0,children:e.jsx(d,{variant:"outline",children:"Close"})}),e.jsx(d,{type:"submit",loading:r,children:"Add"})]})]})})]})})},Ye=({openDialog:s,onCloseDialog:n,onOpenChange:a})=>{const{dialog:r,data:t}=s;switch(r){case"create":return e.jsx(Xe,{onOpenChange:a,onSubmit:n});case"reset":return e.jsx(Ae,{data:t,onOpenChange:a,onReset:n});case"delete":return e.jsx(Te,{data:t,onOpenChange:a,onDelete:n});default:return null}},Ze=()=>{const[s,n]=p.useState({dialog:null,data:void 0}),{data:a}=be(),r=()=>n({dialog:"create",data:void 0}),t=l=>n({dialog:"delete",data:l}),i=l=>n({dialog:"reset",data:l}),c=()=>n({dialog:null,data:void 0}),o=l=>{l||c()};return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(Qe,{onAdd:r}),a.length===0?e.jsx(Ke,{onAdd:r}):e.jsx(qe,{data:a,onDeleteRow:t,onResetRow:i}),e.jsx(Ye,{openDialog:s,onCloseDialog:c,onOpenChange:o})]})},K=N("/concurrency-limits/"),m={global:{tabSearchValue:"global",displayValue:"Global"},"task-run":{tabSearchValue:"task-run",displayValue:"Task Run"}},es=({globalView:s,taskRunView:n})=>{const{tab:a}=K.useSearch(),r=K.useNavigate();return e.jsxs(Ce,{defaultValue:"Global",value:a,children:[e.jsxs(ve,{children:[e.jsx($,{value:m.global.tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m.global.tabSearchValue}})},children:m.global.displayValue}),e.jsx($,{value:m["task-run"].tabSearchValue,onClick:()=>{r({to:"/concurrency-limits",search:{tab:m["task-run"].tabSearchValue}})},children:m["task-run"].displayValue})]}),e.jsx(U,{value:m.global.tabSearchValue,children:s}),e.jsx(U,{value:m["task-run"].tabSearchValue,children:n})]})},ss=()=>e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(ns,{}),e.jsx(es,{globalView:e.jsx($e,{}),taskRunView:e.jsx(Ze,{})})]}),ns=()=>e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(_,{children:e.jsx(V,{children:e.jsx(E,{className:"text-xl font-semibold",children:"Concurrency"})})})});z({search:h().optional(),tab:De(["global","task-run"]).default("global")});const gs=ss;export{gs as component};
|
|
2
|
+
//# sourceMappingURL=index-CovPzmtX.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-BGZtCgRR.js","sources":["../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state/global-concurrency-limits-empty-state.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/global-conccurency-limits-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state/task-run-concurrency-limits-empty-state.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-concurrency-limits-header.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/task-run-concurrency-limit-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx","../../src/components/concurrency/concurrency-limits-tabs.tsx","../../src/components/concurrency/concurrency-limits-page.tsx","../../src/routes/concurrency-limits/index.tsx?tsr-split=component"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype ActionsCellProps = CellContext<GlobalConcurrencyLimit, unknown> & {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const ActionsCell = ({\n\tonEditRow,\n\tonDeleteRow,\n\t...props\n}: ActionsCellProps) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\tconst row = props.row.original;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(row.id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onDeleteRow(row)}>\n\t\t\t\t\tDelete\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onEditRow(row)}>Edit</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const ActiveCell = (\n\tprops: CellContext<GlobalConcurrencyLimit, boolean>,\n) => {\n\tconst { updateGlobalConcurrencyLimit } = useUpdateGlobalConcurrencyLimit();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateGlobalConcurrencyLimit(\n\t\t\t{\n\t\t\t\tid_or_name: id,\n\t\t\t\tactive: checked,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Concurrency limit updated\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating active field.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\tconst rowActive = props.getValue();\n\tconst rowId = props.row.original.id;\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle active\"\n\t\t\tchecked={rowActive}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, rowId)}\n\t\t/>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport { ActionsCell } from \"./actions-cell\";\nimport { ActiveCell } from \"./active-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\nconst columnHelper = createColumnHelper<GlobalConcurrencyLimit>();\n\nconst createColumns = ({\n\tonEditRow,\n\tonDeleteRow,\n}: {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"name\", {\n\t\theader: \"Name\",\n\t}),\n\tcolumnHelper.accessor(\"limit\", {\n\t\theader: \"Limit\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Slots\",\n\t}),\n\tcolumnHelper.accessor(\"slot_decay_per_second\", {\n\t\theader: \"Slots Decay Per Second\",\n\t}),\n\tcolumnHelper.accessor(\"active\", {\n\t\theader: \"Active\",\n\t\tcell: ActiveCell,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => (\n\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t<ActionsCell\n\t\t\t\t\t{...props}\n\t\t\t\t\tonEditRow={onEditRow}\n\t\t\t\t\tonDeleteRow={onDeleteRow}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t),\n\t}),\n];\n\ntype GlobalConcurrencyLimitsDataTableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const GlobalConcurrencyLimitsDataTable = ({\n\tdata,\n\tonEditRow,\n\tonDeleteRow,\n}: GlobalConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonEditRow={onEditRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonEditRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onEditRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search global concurrency limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const GlobalConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"AlignVerticalJustifyStart\" />\n\t\t<EmptyStateTitle>Add a concurrency limit</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tGlobal concurrency limits can be applied to flow runs, task runs and any\n\t\t\toperation where you want to control concurrency.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"global-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const GlobalConcurrencyLimitsHeader = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tGlobal Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add global concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\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\ttype GlobalConcurrencyLimit,\n\tuseCreateGlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\n\nconst formSchema = z.object({\n\tactive: z.boolean().default(true),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tdenied_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tlimit: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\tname: z\n\t\t.string()\n\t\t.min(2, { message: \"Name must be at least 2 characters\" })\n\t\t.default(\"\"),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tslot_decay_per_second: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n\t/** Additional fields post creation. Coerce to solve common issue of transforming a string number to a number type */\n\tactive_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\tactive: true,\n\tname: \"\",\n\tlimit: 0,\n\tslot_decay_per_second: 0,\n\tdenied_slots: 0,\n\tactive_slots: 0,\n} as const;\n\ntype UseCreateOrEditGlobalConcurrencyLimitFormOptions = {\n\t/** Limit to edit. Pass undefined if creating a new limit */\n\tlimitToUpdate: GlobalConcurrencyLimit | undefined;\n\t/** Callback after hitting Save or Update */\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditGlobalConcurrencyLimitForm = ({\n\tlimitToUpdate,\n\tonSubmit,\n}: UseCreateOrEditGlobalConcurrencyLimitFormOptions) => {\n\tconst { createGlobalConcurrencyLimit, status: createStatus } =\n\t\tuseCreateGlobalConcurrencyLimit();\n\tconst { updateGlobalConcurrencyLimit, status: updateStatus } =\n\t\tuseUpdateGlobalConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with limit-to-edit data\n\tuseEffect(() => {\n\t\tif (limitToUpdate) {\n\t\t\tconst { active, name, limit, slot_decay_per_second, active_slots } =\n\t\t\t\tlimitToUpdate;\n\t\t\tform.reset({ active, name, limit, slot_decay_per_second, active_slots });\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, limitToUpdate]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst onSettled = () => {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\tonSubmit();\n\t\t};\n\n\t\tif (limitToUpdate?.id) {\n\t\t\tupdateGlobalConcurrencyLimit(\n\t\t\t\t{\n\t\t\t\t\tid_or_name: limitToUpdate.id,\n\t\t\t\t\t...values,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Limit updated\");\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 limit.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t\tonSettled,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateGlobalConcurrencyLimit(values, {\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Limit created\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating variable.\";\n\t\t\t\t\tform.setError(\"root\", {\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonSettled,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: createStatus === \"pending\" || updateStatus === \"pending\",\n\t};\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\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 { Input } from \"@/components/ui/input\";\nimport { Switch } from \"@/components/ui/switch\";\n\nimport { useCreateOrEditGlobalConcurrencyLimitForm } from \"./use-create-or-edit-global-concurrency-limit-form\";\n\ntype GlobalConcurrencyLimitsCreateOrEditDialogProps = {\n\tlimitToUpdate?: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const GlobalConcurrencyLimitsCreateOrEditDialog = ({\n\tlimitToUpdate,\n\tonOpenChange,\n\tonSubmit,\n}: GlobalConcurrencyLimitsCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } =\n\t\tuseCreateOrEditGlobalConcurrencyLimitForm({\n\t\t\tlimitToUpdate,\n\t\t\tonSubmit,\n\t\t});\n\n\tconst dialogTitle = limitToUpdate\n\t\t? `Update ${limitToUpdate.name}`\n\t\t: \"Add Concurrency Limit\";\n\n\treturn (\n\t\t<Dialog 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=\"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>Concurrency Limit</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} />\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=\"slot_decay_per_second\"\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>Slot Decay Per Second</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} />\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{limitToUpdate && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\t\tname=\"active_slots\"\n\t\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t\t<FormLabel>Active Slots</FormLabel>\n\t\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t\t)}\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=\"active\"\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>Active</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\t\t\t\t\t\tonCheckedChange={field.onChange}\n\t\t\t\t\t\t\t\t\t\t/>\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\">Close</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{limitToUpdate ? \"Update\" : \"Save\"}\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 {\n\ttype GlobalConcurrencyLimit,\n\tuseDeleteGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\n\ntype GlobalConcurrencyLimitsDeleteDialogProps = {\n\tlimit: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonDelete: () => void;\n};\n\nexport const GlobalConcurrencyLimitsDeleteDialog = ({\n\tlimit,\n\tonOpenChange,\n\tonDelete,\n}: GlobalConcurrencyLimitsDeleteDialogProps) => {\n\tconst { deleteGlobalConcurrencyLimit, isPending } =\n\t\tuseDeleteGlobalConcurrencyLimit();\n\n\tconst handleOnClick = (id: string) => {\n\t\tdeleteGlobalConcurrencyLimit(id, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit deleted\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message =\n\t\t\t\t\terror.message || \"Unknown error while deleting concurrency limit.\";\n\t\t\t\tconsole.error(message);\n\t\t\t},\n\t\t\tonSettled: onDelete,\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Delete Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<DialogDescription>\n\t\t\t\t\tAre you sure you want to delete {limit.name}\n\t\t\t\t</DialogDescription>\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"destructive\"\n\t\t\t\t\t\tonClick={() => handleOnClick(limit.id)}\n\t\t\t\t\t\tloading={isPending}\n\t\t\t\t\t>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsCreateOrEditDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog\";\nimport { GlobalConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"delete\" | \"edit\";\n\t\t\tdata: GlobalConcurrencyLimit;\n\t };\n\nexport const GlobalConcurrencyLimitsDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsDeleteDialog\n\t\t\t\t\tlimit={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"edit\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tlimitToUpdate={data}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseListGlobalConcurrencyLimits,\n} from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsDataTable } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table\";\nimport { GlobalConcurrencyLimitsEmptyState } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state\";\nimport { GlobalConcurrencyLimitsHeader } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-header\";\n\nimport {\n\ttype DialogState,\n\tGlobalConcurrencyLimitsDialog,\n} from \"./global-conccurency-limits-dialog\";\n\nexport const GlobalConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListGlobalConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleEditRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"edit\", data });\n\n\tconst handleDeleteRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<GlobalConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<GlobalConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<GlobalConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonEditRow={handleEditRow}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<GlobalConcurrencyLimitsDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype ActiveTaskRunCellsProps = CellContext<\n\tTaskRunConcurrencyLimit,\n\tArray<string>\n>;\n\nexport const ActiveTaskRunCells = (props: ActiveTaskRunCellsProps) => {\n\tconst activeTaskRuns = props.getValue();\n\tconst numActiveTaskRuns = activeTaskRuns.length;\n\tif (numActiveTaskRuns === 0) {\n\t\treturn \"None\";\n\t}\n\treturn numActiveTaskRuns;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype TagCellProps = CellContext<TaskRunConcurrencyLimit, string>;\n\nexport const TagCell = (props: TagCellProps) => {\n\tconst tag = props.getValue();\n\tconst id = props.row.original.id;\n\treturn (\n\t\t<Link params={{ id }} to={\"/concurrency-limits/concurrency-limit/$id\"}>\n\t\t\t{tag}\n\t\t</Link>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsActionsMenu } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\n\nimport { ActiveTaskRunCells } from \"./active-task-runs-cell\";\nimport { TagCell } from \"./tag-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\nconst columnHelper = createColumnHelper<TaskRunConcurrencyLimit>();\n\nconst createColumns = ({\n\tonDeleteRow,\n\tonResetRow,\n}: {\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"tag\", {\n\t\theader: \"Tag\",\n\t\tcell: TagCell,\n\t}),\n\tcolumnHelper.accessor(\"concurrency_limit\", {\n\t\theader: \"Slots\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Task Runs\",\n\t\tcell: ActiveTaskRunCells,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => {\n\t\t\tconst row = props.row.original;\n\t\t\treturn (\n\t\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t\t<TaskRunConcurrencyLimitsActionsMenu\n\t\t\t\t\t\tid={row.id}\n\t\t\t\t\t\tonDelete={() => onDeleteRow(row)}\n\t\t\t\t\t\tonReset={() => onResetRow(row)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t}),\n];\n\ntype TaskRunConcurrencyLimitsDataTableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n};\n\nexport const TaskRunConcurrencyLimitsDataTable = ({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n}: TaskRunConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.tag.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonResetRow={onResetRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onResetRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search active task limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const TaskRunConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"CircleArrowOutUpRight\" />\n\t\t<EmptyStateTitle>\n\t\t\tAdd a concurrency limit for your task runs\n\t\t</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tCreating a limit allows you to limit the number of tasks running\n\t\t\tsimultaneously with a given tag.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"task-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsHeader = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tTask Run Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add task run concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateTaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\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 { Input } from \"@/components/ui/input\";\n\nconst formSchema = z.object({\n\ttag: z.string().min(1),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tconcurrency_limit: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\ttag: \"\",\n\tconcurrency_limit: 0,\n} as const;\n\ntype TaskRunConcurrencyLimitsCreateDialogProps = {\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsCreateDialog = ({\n\tonOpenChange,\n\tonSubmit,\n}: TaskRunConcurrencyLimitsCreateDialogProps) => {\n\tconst { createTaskRunConcurrencyLimit, isPending } =\n\t\tuseCreateTaskRunConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst handleAddLimit = (values: z.infer<typeof formSchema>) => {\n\t\tcreateTaskRunConcurrencyLimit(values, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit added\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message = error.message || \"Unknown error while updating limit.\";\n\t\t\t\tform.setError(\"root\", { message });\n\t\t\t},\n\t\t\tonSettled: () => {\n\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\tonSubmit();\n\t\t\t},\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Add Task Run Concurrency Limit</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(handleAddLimit)(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=\"tag\"\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>Tag</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=\"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>Concurrency Limit</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} />\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\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isPending}>\n\t\t\t\t\t\t\t\tAdd\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 type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsCreateDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog\";\nimport { TaskRunConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog\";\nimport { TaskRunConcurrencyLimitsResetDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"reset\" | \"delete\";\n\t\t\tdata: TaskRunConcurrencyLimit;\n\t };\n\nexport const TaskRunConcurrencyLimitDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsCreateDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"reset\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsResetDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonReset={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsDeleteDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype TaskRunConcurrencyLimit,\n\tuseListTaskRunConcurrencyLimits,\n} from \"@/api/task-run-concurrency-limits\";\n\nimport { TaskRunConcurrencyLimitsDataTable } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table\";\nimport { TaskRunConcurrencyLimitsEmptyState } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state\";\nimport { TaskRunConcurrencyLimitsHeader } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header\";\nimport {\n\ttype DialogState,\n\tTaskRunConcurrencyLimitDialog,\n} from \"./task-run-concurrency-limit-dialog\";\n\nexport const TaskRunConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListTaskRunConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleDeleteRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleResetRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"reset\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<TaskRunConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<TaskRunConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<TaskRunConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t\tonResetRow={handleResetRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<TaskRunConcurrencyLimitDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport type { JSX } from \"react\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport type { TabOptions } from \"@/routes/concurrency-limits\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\ntype TabOptionValues = {\n\t/** Value of search value in url */\n\ttabSearchValue: TabOptions;\n\t/** Display value for the UI */\n\tdisplayValue: string;\n};\n\n/** Maps url tab option to visual name */\nconst TAB_OPTIONS: Record<TabOptions, TabOptionValues> = {\n\tglobal: {\n\t\ttabSearchValue: \"global\",\n\t\tdisplayValue: \"Global\",\n\t},\n\t\"task-run\": {\n\t\ttabSearchValue: \"task-run\",\n\t\tdisplayValue: \"Task Run\",\n\t},\n} as const;\n\ntype ConcurrencyLimitsTabsProps = {\n\tglobalView: React.ReactNode;\n\ttaskRunView: React.ReactNode;\n};\n\n// TODO: Move Tabs for navigation to a generic styled component\n\nexport const ConcurrencyLimitsTabs = ({\n\tglobalView,\n\ttaskRunView,\n}: ConcurrencyLimitsTabsProps): JSX.Element => {\n\tconst { tab } = routeApi.useSearch();\n\tconst navigate = routeApi.useNavigate();\n\n\treturn (\n\t\t<Tabs defaultValue=\"Global\" value={tab}>\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS.global.tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS.global.tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS.global.displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS[\"task-run\"].tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS[\"task-run\"].tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS[\"task-run\"].displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsContent value={TAB_OPTIONS.global.tabSearchValue}>\n\t\t\t\t{globalView}\n\t\t\t</TabsContent>\n\t\t\t<TabsContent value={TAB_OPTIONS[\"task-run\"].tabSearchValue}>\n\t\t\t\t{taskRunView}\n\t\t\t</TabsContent>\n\t\t</Tabs>\n\t);\n};\n","import { GlobalConcurrencyLimitsView } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-view\";\nimport { TaskRunConcurrencyLimitsView } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nimport { ConcurrencyLimitsTabs } from \"./concurrency-limits-tabs\";\n\nexport const ConcurrencyLimitsPage = () => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ConcurrencyLimitTitle />\n\t\t\t<ConcurrencyLimitsTabs\n\t\t\t\tglobalView={<GlobalConcurrencyLimitsView />}\n\t\t\t\ttaskRunView={<TaskRunConcurrencyLimitsView />}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nconst ConcurrencyLimitTitle = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tConcurrency\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListGlobalConcurrencyLimitsQuery } from \"@/api/global-concurrency-limits\";\nimport { buildListTaskRunConcurrencyLimitsQuery } from \"@/api/task-run-concurrency-limits\";\nimport { ConcurrencyLimitsPage } from \"@/components/concurrency/concurrency-limits-page\";\n\n/**\n * Schema for validating URL search parameters for the Concurrency Limits page.\n * @property {string} search used to filter data table\n * @property {'global' | 'task-run'} tab used designate which tab view to display\n */\nconst searchParams = z.object({\n\tsearch: z.string().optional(),\n\ttab: z.enum([\"global\", \"task-run\"]).default(\"global\"),\n});\n\nexport type TabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nexport const Route = createFileRoute(\"/concurrency-limits/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: ConcurrencyLimitsPage,\n\twrapInSuspense: true,\n\tloader: ({ context }) =>\n\t\tPromise.all([\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListGlobalConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListTaskRunConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t]),\n});\n"],"names":["ActionsCell","onEditRow","onDeleteRow","props","handleCopyId","id","toast","row","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","ActiveCell","updateGlobalConcurrencyLimit","useUpdateGlobalConcurrencyLimit","handleCheckedChange","checked","error","message","rowActive","rowId","Switch","routeApi","getRouteApi","columnHelper","createColumnHelper","createColumns","GlobalConcurrencyLimitsDataTable","data","navigate","search","deferredSearch","useDeferredValue","filteredData","useMemo","Table","value","prev","onSearchChange","searchValue","table","useReactTable","getCoreRowModel","getPaginationRowModel","SearchInput","e","DataTable","GlobalConcurrencyLimitsEmptyState","onAdd","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","GlobalConcurrencyLimitsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","formSchema","z.object","z.boolean","z.number","z.string","z.coerce","DEFAULT_VALUES","useCreateOrEditGlobalConcurrencyLimitForm","limitToUpdate","onSubmit","createGlobalConcurrencyLimit","createStatus","useCreateGlobalConcurrencyLimit","updateStatus","form","useForm","zodResolver","useEffect","active","name","limit","slot_decay_per_second","active_slots","values","onSettled","GlobalConcurrencyLimitsCreateOrEditDialog","onOpenChange","isLoading","saveOrUpdate","dialogTitle","Dialog","DialogContent","DialogHeader","DialogTitle","Form","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","DialogFooter","DialogTrigger","GlobalConcurrencyLimitsDeleteDialog","onDelete","deleteGlobalConcurrencyLimit","isPending","useDeleteGlobalConcurrencyLimit","handleOnClick","DialogDescription","GlobalConcurrencyLimitsDialog","openDialog","onCloseDialog","dialog","GlobalConcurrencyLimitsView","setOpenDialog","useState","useListGlobalConcurrencyLimits","handleAddRow","handleEditRow","handleDeleteRow","handleCloseDialog","handleOpenChange","open","ActiveTaskRunCells","numActiveTaskRuns","TagCell","tag","Link","onResetRow","TaskRunConcurrencyLimitsActionsMenu","TaskRunConcurrencyLimitsDataTable","TaskRunConcurrencyLimitsEmptyState","TaskRunConcurrencyLimitsHeader","TaskRunConcurrencyLimitsCreateDialog","createTaskRunConcurrencyLimit","useCreateTaskRunConcurrencyLimit","handleAddLimit","TaskRunConcurrencyLimitDialog","TaskRunConcurrencyLimitsResetDialog","TaskRunConcurrencyLimitsDeleteDialog","TaskRunConcurrencyLimitsView","useListTaskRunConcurrencyLimits","handleResetRow","TAB_OPTIONS","ConcurrencyLimitsTabs","globalView","taskRunView","tab","Tabs","TabsList","TabsTrigger","TabsContent","ConcurrencyLimitsPage","ConcurrencyLimitTitle","z","string","optional","default","SplitComponent"],"mappings":"s9BAkBO,MAAMA,GAAc,CAAC,CAC3B,UAAAC,EACA,YAAAC,EACA,GAAGC,CACJ,IAAwB,CACvB,MAAMC,EAAgBC,GAAe,CAC/B,UAAU,UAAU,UAAUA,CAAE,EACrCC,EAAM,QAAQ,WAAW,CAC1B,EAEMC,EAAMJ,EAAM,IAAI,SAEtB,cACEK,GAAA,CACA,SAAA,CAAAC,EAAAA,IAACC,GAAA,CAAoB,QAAO,GAC3B,SAAAC,EAAAA,KAACC,GAAO,QAAQ,UAAU,UAAU,aACnC,SAAA,CAAAH,EAAAA,IAAC,OAAA,CAAK,UAAU,UAAU,SAAA,YAAS,EACnCA,EAAAA,IAACI,EAAA,CAAK,GAAG,eAAe,UAAU,QAAA,CAAS,CAAA,CAAA,CAC5C,CAAA,CACD,EACAF,EAAAA,KAACG,GAAA,CAAoB,MAAM,MAC1B,SAAA,CAAAL,EAAAA,IAACM,IAAkB,SAAA,SAAA,CAAO,EAC1BN,MAACO,GAAiB,QAAS,IAAMZ,EAAaG,EAAI,EAAE,EAAG,SAAA,UAEvD,QACCS,EAAA,CAAiB,QAAS,IAAMd,EAAYK,CAAG,EAAG,SAAA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J,EAAAA,IAACmJ,EAAA,CACA,MAAOP,EAAY,OAAO,eAC1B,QAAS,IAAM,CACTnH,EAAS,CACb,GAAI,sBACJ,OAAQ,CACP,IAAKmH,EAAY,OAAO,cAAA,CACzB,CACA,CACF,EAEC,WAAY,OAAO,YAAA,CAAA,EAErB5I,EAAAA,IAACmJ,EAAA,CACA,MAAOP,EAAY,UAAU,EAAE,eAC/B,QAAS,IAAM,CACTnH,EAAS,CACb,GAAI,sBACJ,OAAQ,CACP,IAAKmH,EAAY,UAAU,EAAE,cAAA,CAC9B,CACA,CACF,EAEC,SAAAA,EAAY,UAAU,EAAE,YAAA,CAAA,CAC1B,EACD,QACCQ,EAAA,CAAY,MAAOR,EAAY,OAAO,eACrC,SAAAE,EACF,QACCM,EAAA,CAAY,MAAOR,EAAY,UAAU,EAAE,eAC1C,SAAAG,CAAA,CACF,CAAA,EACD,CAEF,ECpEaM,GAAwB,IAEnCnJ,EAAAA,KAAC,MAAA,CAAI,UAAU,sBACd,SAAA,CAAAF,EAAAA,IAACsJ,GAAA,EAAsB,EACvBtJ,EAAAA,IAAC6I,GAAA,CACA,iBAAa/B,GAAA,EAA4B,EACzC,kBAAc2B,GAAA,CAAA,CAA6B,CAAA,CAAA,CAC5C,EACD,EAIIa,GAAwB,IAC7BtJ,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACd,SAAAA,EAAAA,IAACoD,EAAA,CACA,SAAApD,EAAAA,IAACqD,EAAA,CACA,eAACC,EAAA,CAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,EACD,EACD,CAAA,CACD,ECnBoBiG,EAAS,CAC7B7H,OAAQ6H,EAAEC,EAASC,SAAAA,EACnBT,IAAKO,GAAO,CAAC,SAAU,UAAU,CAAC,EAAEG,QAAQ,QAAQ,CACrD,CAAC,EAE4D,MAAAC,GAZpDN"}
|
|
1
|
+
{"version":3,"file":"index-CovPzmtX.js","sources":["../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/actions-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/active-cell.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table/global-concurrency-limits-data-table.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state/global-concurrency-limits-empty-state.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-header/global-concurrency-limits-header.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/use-create-or-edit-global-concurrency-limit-form.ts","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog/global-concurrency-limits-create-or-edit-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog/global-concurrency-limits-delete-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/global-conccurency-limits-dialog.tsx","../../src/components/concurrency/global-concurrency-limits/global-concurrency-limits-view/index.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/active-task-runs-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/tag-cell.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table/task-run-concurrency-limits-data-table.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state/task-run-concurrency-limits-empty-state.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header/task-run-concurrency-limits-header.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog/task-run-concurrency-limits-create-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/task-run-concurrency-limit-dialog.tsx","../../src/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view/index.tsx","../../src/components/concurrency/concurrency-limits-tabs.tsx","../../src/components/concurrency/concurrency-limits-page.tsx","../../src/routes/concurrency-limits/index.tsx?tsr-split=component"],"sourcesContent":["import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDropdownMenu,\n\tDropdownMenuContent,\n\tDropdownMenuItem,\n\tDropdownMenuLabel,\n\tDropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype ActionsCellProps = CellContext<GlobalConcurrencyLimit, unknown> & {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const ActionsCell = ({\n\tonEditRow,\n\tonDeleteRow,\n\t...props\n}: ActionsCellProps) => {\n\tconst handleCopyId = (id: string) => {\n\t\tvoid navigator.clipboard.writeText(id);\n\t\ttoast.success(\"ID copied\");\n\t};\n\n\tconst row = props.row.original;\n\n\treturn (\n\t\t<DropdownMenu>\n\t\t\t<DropdownMenuTrigger asChild>\n\t\t\t\t<Button variant=\"outline\" className=\"size-8 p-0\">\n\t\t\t\t\t<span className=\"sr-only\">Open menu</span>\n\t\t\t\t\t<Icon id=\"MoreVertical\" className=\"size-4\" />\n\t\t\t\t</Button>\n\t\t\t</DropdownMenuTrigger>\n\t\t\t<DropdownMenuContent align=\"end\">\n\t\t\t\t<DropdownMenuLabel>Actions</DropdownMenuLabel>\n\t\t\t\t<DropdownMenuItem onClick={() => handleCopyId(row.id)}>\n\t\t\t\t\tCopy ID\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onDeleteRow(row)}>\n\t\t\t\t\tDelete\n\t\t\t\t</DropdownMenuItem>\n\t\t\t\t<DropdownMenuItem onClick={() => onEditRow(row)}>Edit</DropdownMenuItem>\n\t\t\t</DropdownMenuContent>\n\t\t</DropdownMenu>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport { toast } from \"sonner\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const ActiveCell = (\n\tprops: CellContext<GlobalConcurrencyLimit, boolean>,\n) => {\n\tconst { updateGlobalConcurrencyLimit } = useUpdateGlobalConcurrencyLimit();\n\n\tconst handleCheckedChange = (checked: boolean, id: string) => {\n\t\tupdateGlobalConcurrencyLimit(\n\t\t\t{\n\t\t\t\tid_or_name: id,\n\t\t\t\tactive: checked,\n\t\t\t},\n\t\t\t{\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Concurrency limit updated\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while updating active field.\";\n\t\t\t\t\tconsole.error(message);\n\t\t\t\t},\n\t\t\t},\n\t\t);\n\t};\n\n\tconst rowActive = props.getValue();\n\tconst rowId = props.row.original.id;\n\n\treturn (\n\t\t<Switch\n\t\t\taria-label=\"toggle active\"\n\t\t\tchecked={rowActive}\n\t\t\tonCheckedChange={(checked) => handleCheckedChange(checked, rowId)}\n\t\t/>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\nimport { ActionsCell } from \"./actions-cell\";\nimport { ActiveCell } from \"./active-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\nconst columnHelper = createColumnHelper<GlobalConcurrencyLimit>();\n\nconst createColumns = ({\n\tonEditRow,\n\tonDeleteRow,\n}: {\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"name\", {\n\t\theader: \"Name\",\n\t}),\n\tcolumnHelper.accessor(\"limit\", {\n\t\theader: \"Limit\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Slots\",\n\t}),\n\tcolumnHelper.accessor(\"slot_decay_per_second\", {\n\t\theader: \"Slots Decay Per Second\",\n\t}),\n\tcolumnHelper.accessor(\"active\", {\n\t\theader: \"Active\",\n\t\tcell: ActiveCell,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => (\n\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t<ActionsCell\n\t\t\t\t\t{...props}\n\t\t\t\t\tonEditRow={onEditRow}\n\t\t\t\t\tonDeleteRow={onDeleteRow}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t),\n\t}),\n];\n\ntype GlobalConcurrencyLimitsDataTableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n};\n\nexport const GlobalConcurrencyLimitsDataTable = ({\n\tdata,\n\tonEditRow,\n\tonDeleteRow,\n}: GlobalConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.name.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonEditRow={onEditRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<GlobalConcurrencyLimit>;\n\tonDeleteRow: (row: GlobalConcurrencyLimit) => void;\n\tonEditRow: (row: GlobalConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonEditRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onEditRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search global concurrency limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const GlobalConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"AlignVerticalJustifyStart\" />\n\t\t<EmptyStateTitle>Add a concurrency limit</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tGlobal concurrency limits can be applied to flow runs, task runs and any\n\t\t\toperation where you want to control concurrency.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"global-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype GlobalConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const GlobalConcurrencyLimitsHeader = ({\n\tonAdd,\n}: GlobalConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tGlobal Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add global concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\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\ttype GlobalConcurrencyLimit,\n\tuseCreateGlobalConcurrencyLimit,\n\tuseUpdateGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\n\nconst formSchema = z.object({\n\tactive: z.boolean().default(true),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tdenied_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tlimit: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n\tname: z\n\t\t.string()\n\t\t.min(2, { message: \"Name must be at least 2 characters\" })\n\t\t.default(\"\"),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tslot_decay_per_second: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n\t/** Additional fields post creation. Coerce to solve common issue of transforming a string number to a number type */\n\tactive_slots: z.number().default(0).or(z.string()).pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\tactive: true,\n\tname: \"\",\n\tlimit: 0,\n\tslot_decay_per_second: 0,\n\tdenied_slots: 0,\n\tactive_slots: 0,\n} as const;\n\ntype UseCreateOrEditGlobalConcurrencyLimitFormOptions = {\n\t/** Limit to edit. Pass undefined if creating a new limit */\n\tlimitToUpdate: GlobalConcurrencyLimit | undefined;\n\t/** Callback after hitting Save or Update */\n\tonSubmit: () => void;\n};\n\nexport const useCreateOrEditGlobalConcurrencyLimitForm = ({\n\tlimitToUpdate,\n\tonSubmit,\n}: UseCreateOrEditGlobalConcurrencyLimitFormOptions) => {\n\tconst { createGlobalConcurrencyLimit, status: createStatus } =\n\t\tuseCreateGlobalConcurrencyLimit();\n\tconst { updateGlobalConcurrencyLimit, status: updateStatus } =\n\t\tuseUpdateGlobalConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\t// Sync form data with limit-to-edit data\n\tuseEffect(() => {\n\t\tif (limitToUpdate) {\n\t\t\tconst { active, name, limit, slot_decay_per_second, active_slots } =\n\t\t\t\tlimitToUpdate;\n\t\t\tform.reset({ active, name, limit, slot_decay_per_second, active_slots });\n\t\t} else {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t}\n\t}, [form, limitToUpdate]);\n\n\tconst saveOrUpdate = (values: z.infer<typeof formSchema>) => {\n\t\tconst onSettled = () => {\n\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\tonSubmit();\n\t\t};\n\n\t\tif (limitToUpdate?.id) {\n\t\t\tupdateGlobalConcurrencyLimit(\n\t\t\t\t{\n\t\t\t\t\tid_or_name: limitToUpdate.id,\n\t\t\t\t\t...values,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tonSuccess: () => {\n\t\t\t\t\t\ttoast.success(\"Limit updated\");\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 limit.\";\n\t\t\t\t\t\tform.setError(\"root\", { message });\n\t\t\t\t\t},\n\t\t\t\t\tonSettled,\n\t\t\t\t},\n\t\t\t);\n\t\t} else {\n\t\t\tcreateGlobalConcurrencyLimit(values, {\n\t\t\t\tonSuccess: () => {\n\t\t\t\t\ttoast.success(\"Limit created\");\n\t\t\t\t},\n\t\t\t\tonError: (error) => {\n\t\t\t\t\tconst message =\n\t\t\t\t\t\terror.message || \"Unknown error while creating variable.\";\n\t\t\t\t\tform.setError(\"root\", {\n\t\t\t\t\t\tmessage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonSettled,\n\t\t\t});\n\t\t}\n\t};\n\n\treturn {\n\t\tform,\n\t\tsaveOrUpdate,\n\t\tisLoading: createStatus === \"pending\" || updateStatus === \"pending\",\n\t};\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\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 { Input } from \"@/components/ui/input\";\nimport { Switch } from \"@/components/ui/switch\";\n\nimport { useCreateOrEditGlobalConcurrencyLimitForm } from \"./use-create-or-edit-global-concurrency-limit-form\";\n\ntype GlobalConcurrencyLimitsCreateOrEditDialogProps = {\n\tlimitToUpdate?: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const GlobalConcurrencyLimitsCreateOrEditDialog = ({\n\tlimitToUpdate,\n\tonOpenChange,\n\tonSubmit,\n}: GlobalConcurrencyLimitsCreateOrEditDialogProps) => {\n\tconst { form, isLoading, saveOrUpdate } =\n\t\tuseCreateOrEditGlobalConcurrencyLimitForm({\n\t\t\tlimitToUpdate,\n\t\t\tonSubmit,\n\t\t});\n\n\tconst dialogTitle = limitToUpdate\n\t\t? `Update ${limitToUpdate.name}`\n\t\t: \"Add Concurrency Limit\";\n\n\treturn (\n\t\t<Dialog 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=\"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>Concurrency Limit</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} />\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=\"slot_decay_per_second\"\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>Slot Decay Per Second</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} />\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{limitToUpdate && (\n\t\t\t\t\t\t\t<FormField\n\t\t\t\t\t\t\t\tcontrol={form.control}\n\t\t\t\t\t\t\t\tname=\"active_slots\"\n\t\t\t\t\t\t\t\trender={({ field }) => (\n\t\t\t\t\t\t\t\t\t<FormItem>\n\t\t\t\t\t\t\t\t\t\t<FormLabel>Active Slots</FormLabel>\n\t\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t\t<Input type=\"number\" {...field} />\n\t\t\t\t\t\t\t\t\t\t</FormControl>\n\t\t\t\t\t\t\t\t\t\t<FormMessage />\n\t\t\t\t\t\t\t\t\t</FormItem>\n\t\t\t\t\t\t\t\t)}\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=\"active\"\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>Active</FormLabel>\n\t\t\t\t\t\t\t\t\t<FormControl>\n\t\t\t\t\t\t\t\t\t\t<Switch\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"block\"\n\t\t\t\t\t\t\t\t\t\t\tchecked={field.value}\n\t\t\t\t\t\t\t\t\t\t\tonCheckedChange={field.onChange}\n\t\t\t\t\t\t\t\t\t\t/>\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\">Close</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{limitToUpdate ? \"Update\" : \"Save\"}\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 {\n\ttype GlobalConcurrencyLimit,\n\tuseDeleteGlobalConcurrencyLimit,\n} from \"@/api/global-concurrency-limits\";\nimport { Button } from \"@/components/ui/button\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogFooter,\n\tDialogHeader,\n\tDialogTitle,\n\tDialogTrigger,\n} from \"@/components/ui/dialog\";\n\ntype GlobalConcurrencyLimitsDeleteDialogProps = {\n\tlimit: GlobalConcurrencyLimit;\n\tonOpenChange: (open: boolean) => void;\n\tonDelete: () => void;\n};\n\nexport const GlobalConcurrencyLimitsDeleteDialog = ({\n\tlimit,\n\tonOpenChange,\n\tonDelete,\n}: GlobalConcurrencyLimitsDeleteDialogProps) => {\n\tconst { deleteGlobalConcurrencyLimit, isPending } =\n\t\tuseDeleteGlobalConcurrencyLimit();\n\n\tconst handleOnClick = (id: string) => {\n\t\tdeleteGlobalConcurrencyLimit(id, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit deleted\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message =\n\t\t\t\t\terror.message || \"Unknown error while deleting concurrency limit.\";\n\t\t\t\tconsole.error(message);\n\t\t\t},\n\t\t\tonSettled: onDelete,\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Delete Concurrency Limit</DialogTitle>\n\t\t\t\t</DialogHeader>\n\t\t\t\t<DialogDescription>\n\t\t\t\t\tAre you sure you want to delete {limit.name}\n\t\t\t\t</DialogDescription>\n\t\t\t\t<DialogFooter>\n\t\t\t\t\t<DialogTrigger asChild>\n\t\t\t\t\t\t<Button variant=\"outline\">Close</Button>\n\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"destructive\"\n\t\t\t\t\t\tonClick={() => handleOnClick(limit.id)}\n\t\t\t\t\t\tloading={isPending}\n\t\t\t\t\t>\n\t\t\t\t\t\tDelete\n\t\t\t\t\t</Button>\n\t\t\t\t</DialogFooter>\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n};\n","import type { GlobalConcurrencyLimit } from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsCreateOrEditDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-create-or-edit-dialog\";\nimport { GlobalConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-delete-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"delete\" | \"edit\";\n\t\t\tdata: GlobalConcurrencyLimit;\n\t };\n\nexport const GlobalConcurrencyLimitsDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsDeleteDialog\n\t\t\t\t\tlimit={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"edit\":\n\t\t\treturn (\n\t\t\t\t<GlobalConcurrencyLimitsCreateOrEditDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tlimitToUpdate={data}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype GlobalConcurrencyLimit,\n\tuseListGlobalConcurrencyLimits,\n} from \"@/api/global-concurrency-limits\";\n\nimport { GlobalConcurrencyLimitsDataTable } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-data-table\";\nimport { GlobalConcurrencyLimitsEmptyState } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-empty-state\";\nimport { GlobalConcurrencyLimitsHeader } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-header\";\n\nimport {\n\ttype DialogState,\n\tGlobalConcurrencyLimitsDialog,\n} from \"./global-conccurency-limits-dialog\";\n\nexport const GlobalConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListGlobalConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleEditRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"edit\", data });\n\n\tconst handleDeleteRow = (data: GlobalConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<GlobalConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<GlobalConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<GlobalConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonEditRow={handleEditRow}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<GlobalConcurrencyLimitsDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype ActiveTaskRunCellsProps = CellContext<\n\tTaskRunConcurrencyLimit,\n\tArray<string>\n>;\n\nexport const ActiveTaskRunCells = (props: ActiveTaskRunCellsProps) => {\n\tconst activeTaskRuns = props.getValue();\n\tconst numActiveTaskRuns = activeTaskRuns.length;\n\tif (numActiveTaskRuns === 0) {\n\t\treturn \"None\";\n\t}\n\treturn numActiveTaskRuns;\n};\n","import { Link } from \"@tanstack/react-router\";\nimport type { CellContext } from \"@tanstack/react-table\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\n\ntype TagCellProps = CellContext<TaskRunConcurrencyLimit, string>;\n\nexport const TagCell = (props: TagCellProps) => {\n\tconst tag = props.getValue();\n\tconst id = props.row.original.id;\n\treturn (\n\t\t<Link params={{ id }} to={\"/concurrency-limits/concurrency-limit/$id\"}>\n\t\t\t{tag}\n\t\t</Link>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport {\n\tcreateColumnHelper,\n\tgetCoreRowModel,\n\tgetPaginationRowModel,\n\tuseReactTable,\n} from \"@tanstack/react-table\";\nimport { useDeferredValue, useMemo } from \"react\";\nimport type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsActionsMenu } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-actions-menu\";\nimport { DataTable } from \"@/components/ui/data-table\";\nimport { SearchInput } from \"@/components/ui/input\";\n\nimport { ActiveTaskRunCells } from \"./active-task-runs-cell\";\nimport { TagCell } from \"./tag-cell\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\nconst columnHelper = createColumnHelper<TaskRunConcurrencyLimit>();\n\nconst createColumns = ({\n\tonDeleteRow,\n\tonResetRow,\n}: {\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n}) => [\n\tcolumnHelper.accessor(\"tag\", {\n\t\theader: \"Tag\",\n\t\tcell: TagCell,\n\t}),\n\tcolumnHelper.accessor(\"concurrency_limit\", {\n\t\theader: \"Slots\",\n\t}),\n\tcolumnHelper.accessor(\"active_slots\", {\n\t\theader: \"Active Task Runs\",\n\t\tcell: ActiveTaskRunCells,\n\t}),\n\tcolumnHelper.display({\n\t\tid: \"actions\",\n\t\tcell: (props) => {\n\t\t\tconst row = props.row.original;\n\t\t\treturn (\n\t\t\t\t<div className=\"flex flex-row justify-end\">\n\t\t\t\t\t<TaskRunConcurrencyLimitsActionsMenu\n\t\t\t\t\t\tid={row.id}\n\t\t\t\t\t\tonDelete={() => onDeleteRow(row)}\n\t\t\t\t\t\tonReset={() => onResetRow(row)}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t);\n\t\t},\n\t}),\n];\n\ntype TaskRunConcurrencyLimitsDataTableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n};\n\nexport const TaskRunConcurrencyLimitsDataTable = ({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n}: TaskRunConcurrencyLimitsDataTableProps) => {\n\tconst navigate = routeApi.useNavigate();\n\tconst { search } = routeApi.useSearch();\n\tconst deferredSearch = useDeferredValue(search ?? \"\");\n\n\tconst filteredData = useMemo(() => {\n\t\treturn data.filter((row) =>\n\t\t\trow.tag.toLowerCase().includes(deferredSearch.toLowerCase()),\n\t\t);\n\t}, [data, deferredSearch]);\n\n\treturn (\n\t\t<Table\n\t\t\tdata={filteredData}\n\t\t\tonDeleteRow={onDeleteRow}\n\t\t\tonResetRow={onResetRow}\n\t\t\tsearchValue={search}\n\t\t\tonSearchChange={(value) =>\n\t\t\t\tvoid navigate({\n\t\t\t\t\tto: \".\",\n\t\t\t\t\tsearch: (prev) => ({ ...prev, search: value }),\n\t\t\t\t})\n\t\t\t}\n\t\t/>\n\t);\n};\n\ntype TableProps = {\n\tdata: Array<TaskRunConcurrencyLimit>;\n\tonDeleteRow: (row: TaskRunConcurrencyLimit) => void;\n\tonResetRow: (row: TaskRunConcurrencyLimit) => void;\n\tonSearchChange: (value: string) => void;\n\tsearchValue: string | undefined;\n};\n\nexport function Table({\n\tdata,\n\tonDeleteRow,\n\tonResetRow,\n\tonSearchChange,\n\tsearchValue,\n}: TableProps) {\n\tconst table = useReactTable({\n\t\tdata,\n\t\tcolumns: createColumns({ onDeleteRow, onResetRow }),\n\t\tgetCoreRowModel: getCoreRowModel(),\n\t\tgetPaginationRowModel: getPaginationRowModel(), //load client-side pagination code\n\t});\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<SearchInput\n\t\t\t\tclassName=\"max-w-72\"\n\t\t\t\tplaceholder=\"Search active task limit\"\n\t\t\t\tvalue={searchValue}\n\t\t\t\tonChange={(e) => onSearchChange(e.target.value)}\n\t\t\t/>\n\t\t\t<DataTable table={table} />\n\t\t</div>\n\t);\n}\n","import { Button } from \"@/components/ui/button\";\nimport { DocsLink } from \"@/components/ui/docs-link\";\nimport {\n\tEmptyState,\n\tEmptyStateActions,\n\tEmptyStateDescription,\n\tEmptyStateIcon,\n\tEmptyStateTitle,\n} from \"@/components/ui/empty-state\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsEmptyStateProps = {\n\tonAdd: () => void;\n};\nexport const TaskRunConcurrencyLimitsEmptyState = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsEmptyStateProps) => (\n\t<EmptyState>\n\t\t<EmptyStateIcon id=\"CircleArrowOutUpRight\" />\n\t\t<EmptyStateTitle>\n\t\t\tAdd a concurrency limit for your task runs\n\t\t</EmptyStateTitle>\n\t\t<EmptyStateDescription>\n\t\t\tCreating a limit allows you to limit the number of tasks running\n\t\t\tsimultaneously with a given tag.\n\t\t</EmptyStateDescription>\n\t\t<EmptyStateActions>\n\t\t\t<Button onClick={onAdd}>\n\t\t\t\tAdd Concurrency Limit <Icon id=\"Plus\" className=\"size-4 ml-2\" />\n\t\t\t</Button>\n\t\t\t<DocsLink id=\"task-concurrency-guide\" />\n\t\t</EmptyStateActions>\n\t</EmptyState>\n);\n","import {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\nimport { Button } from \"@/components/ui/button\";\nimport { Icon } from \"@/components/ui/icons\";\n\ntype TaskRunConcurrencyLimitsHeaderProps = {\n\tonAdd: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsHeader = ({\n\tonAdd,\n}: TaskRunConcurrencyLimitsHeaderProps) => {\n\treturn (\n\t\t<div className=\"flex items-center gap-2\">\n\t\t\t<Breadcrumb>\n\t\t\t\t<BreadcrumbList>\n\t\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\t\tTask Run Concurrency Limits\n\t\t\t\t\t</BreadcrumbItem>\n\t\t\t\t</BreadcrumbList>\n\t\t\t</Breadcrumb>\n\t\t\t<Button\n\t\t\t\tonClick={onAdd}\n\t\t\t\tsize=\"icon\"\n\t\t\t\tclassName=\"size-7\"\n\t\t\t\tvariant=\"outline\"\n\t\t\t\taria-label=\"add task run concurrency limit\"\n\t\t\t>\n\t\t\t\t<Icon id=\"Plus\" className=\"size-4\" />\n\t\t\t</Button>\n\t\t</div>\n\t);\n};\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { useForm } from \"react-hook-form\";\nimport { toast } from \"sonner\";\nimport { z } from \"zod\";\nimport { useCreateTaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\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 { Input } from \"@/components/ui/input\";\n\nconst formSchema = z.object({\n\ttag: z.string().min(1),\n\t/** Coerce to solve common issue of transforming a string number to a number type */\n\tconcurrency_limit: z\n\t\t.number()\n\t\t.default(0)\n\t\t.or(z.string())\n\t\t.pipe(z.coerce.number()),\n});\n\nconst DEFAULT_VALUES = {\n\ttag: \"\",\n\tconcurrency_limit: 0,\n} as const;\n\ntype TaskRunConcurrencyLimitsCreateDialogProps = {\n\tonOpenChange: (open: boolean) => void;\n\tonSubmit: () => void;\n};\n\nexport const TaskRunConcurrencyLimitsCreateDialog = ({\n\tonOpenChange,\n\tonSubmit,\n}: TaskRunConcurrencyLimitsCreateDialogProps) => {\n\tconst { createTaskRunConcurrencyLimit, isPending } =\n\t\tuseCreateTaskRunConcurrencyLimit();\n\n\tconst form = useForm({\n\t\tresolver: zodResolver(formSchema),\n\t\tdefaultValues: DEFAULT_VALUES,\n\t});\n\n\tconst handleAddLimit = (values: z.infer<typeof formSchema>) => {\n\t\tcreateTaskRunConcurrencyLimit(values, {\n\t\t\tonSuccess: () => {\n\t\t\t\ttoast.success(\"Concurrency limit added\");\n\t\t\t},\n\t\t\tonError: (error) => {\n\t\t\t\tconst message = error.message || \"Unknown error while updating limit.\";\n\t\t\t\tform.setError(\"root\", { message });\n\t\t\t},\n\t\t\tonSettled: () => {\n\t\t\t\tform.reset(DEFAULT_VALUES);\n\t\t\t\tonSubmit();\n\t\t\t},\n\t\t});\n\t};\n\n\treturn (\n\t\t<Dialog open onOpenChange={onOpenChange}>\n\t\t\t<DialogContent aria-describedby={undefined}>\n\t\t\t\t<DialogHeader>\n\t\t\t\t\t<DialogTitle>Add Task Run Concurrency Limit</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(handleAddLimit)(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=\"tag\"\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>Tag</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=\"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>Concurrency Limit</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} />\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\">Close</Button>\n\t\t\t\t\t\t\t</DialogTrigger>\n\t\t\t\t\t\t\t<Button type=\"submit\" loading={isPending}>\n\t\t\t\t\t\t\t\tAdd\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 type { TaskRunConcurrencyLimit } from \"@/api/task-run-concurrency-limits\";\nimport { TaskRunConcurrencyLimitsCreateDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-create-dialog\";\nimport { TaskRunConcurrencyLimitsDeleteDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-delete-dialog\";\nimport { TaskRunConcurrencyLimitsResetDialog } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-reset-dialog\";\n\nexport type DialogState =\n\t| { dialog: null | \"create\"; data: undefined }\n\t| {\n\t\t\tdialog: \"reset\" | \"delete\";\n\t\t\tdata: TaskRunConcurrencyLimit;\n\t };\n\nexport const TaskRunConcurrencyLimitDialog = ({\n\topenDialog,\n\tonCloseDialog,\n\tonOpenChange,\n}: {\n\topenDialog: DialogState;\n\tonOpenChange: (open: boolean) => void;\n\tonCloseDialog: () => void;\n}) => {\n\tconst { dialog, data } = openDialog;\n\tswitch (dialog) {\n\t\tcase \"create\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsCreateDialog\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonSubmit={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"reset\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsResetDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonReset={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"delete\":\n\t\t\treturn (\n\t\t\t\t<TaskRunConcurrencyLimitsDeleteDialog\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonOpenChange={onOpenChange}\n\t\t\t\t\tonDelete={onCloseDialog}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn null;\n\t}\n};\n","import { useState } from \"react\";\nimport {\n\ttype TaskRunConcurrencyLimit,\n\tuseListTaskRunConcurrencyLimits,\n} from \"@/api/task-run-concurrency-limits\";\n\nimport { TaskRunConcurrencyLimitsDataTable } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-data-table\";\nimport { TaskRunConcurrencyLimitsEmptyState } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-empty-state\";\nimport { TaskRunConcurrencyLimitsHeader } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-header\";\nimport {\n\ttype DialogState,\n\tTaskRunConcurrencyLimitDialog,\n} from \"./task-run-concurrency-limit-dialog\";\n\nexport const TaskRunConcurrencyLimitsView = () => {\n\tconst [openDialog, setOpenDialog] = useState<DialogState>({\n\t\tdialog: null,\n\t\tdata: undefined,\n\t});\n\n\tconst { data } = useListTaskRunConcurrencyLimits();\n\n\tconst handleAddRow = () =>\n\t\tsetOpenDialog({ dialog: \"create\", data: undefined });\n\n\tconst handleDeleteRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"delete\", data });\n\n\tconst handleResetRow = (data: TaskRunConcurrencyLimit) =>\n\t\tsetOpenDialog({ dialog: \"reset\", data });\n\n\tconst handleCloseDialog = () =>\n\t\tsetOpenDialog({ dialog: null, data: undefined });\n\n\t// Because all modals will be rendered, only control the closing logic\n\tconst handleOpenChange = (open: boolean) => {\n\t\tif (!open) {\n\t\t\thandleCloseDialog();\n\t\t}\n\t};\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<TaskRunConcurrencyLimitsHeader onAdd={handleAddRow} />\n\t\t\t{data.length === 0 ? (\n\t\t\t\t<TaskRunConcurrencyLimitsEmptyState onAdd={handleAddRow} />\n\t\t\t) : (\n\t\t\t\t<TaskRunConcurrencyLimitsDataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tonDeleteRow={handleDeleteRow}\n\t\t\t\t\tonResetRow={handleResetRow}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<TaskRunConcurrencyLimitDialog\n\t\t\t\topenDialog={openDialog}\n\t\t\t\tonCloseDialog={handleCloseDialog}\n\t\t\t\tonOpenChange={handleOpenChange}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n","import { getRouteApi } from \"@tanstack/react-router\";\nimport type { JSX } from \"react\";\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from \"@/components/ui/tabs\";\nimport type { TabOptions } from \"@/routes/concurrency-limits\";\n\nconst routeApi = getRouteApi(\"/concurrency-limits/\");\n\ntype TabOptionValues = {\n\t/** Value of search value in url */\n\ttabSearchValue: TabOptions;\n\t/** Display value for the UI */\n\tdisplayValue: string;\n};\n\n/** Maps url tab option to visual name */\nconst TAB_OPTIONS: Record<TabOptions, TabOptionValues> = {\n\tglobal: {\n\t\ttabSearchValue: \"global\",\n\t\tdisplayValue: \"Global\",\n\t},\n\t\"task-run\": {\n\t\ttabSearchValue: \"task-run\",\n\t\tdisplayValue: \"Task Run\",\n\t},\n} as const;\n\ntype ConcurrencyLimitsTabsProps = {\n\tglobalView: React.ReactNode;\n\ttaskRunView: React.ReactNode;\n};\n\n// TODO: Move Tabs for navigation to a generic styled component\n\nexport const ConcurrencyLimitsTabs = ({\n\tglobalView,\n\ttaskRunView,\n}: ConcurrencyLimitsTabsProps): JSX.Element => {\n\tconst { tab } = routeApi.useSearch();\n\tconst navigate = routeApi.useNavigate();\n\n\treturn (\n\t\t<Tabs defaultValue=\"Global\" value={tab}>\n\t\t\t<TabsList>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS.global.tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS.global.tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS.global.displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t\t<TabsTrigger\n\t\t\t\t\tvalue={TAB_OPTIONS[\"task-run\"].tabSearchValue}\n\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\tvoid navigate({\n\t\t\t\t\t\t\tto: \"/concurrency-limits\",\n\t\t\t\t\t\t\tsearch: {\n\t\t\t\t\t\t\t\ttab: TAB_OPTIONS[\"task-run\"].tabSearchValue,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{TAB_OPTIONS[\"task-run\"].displayValue}\n\t\t\t\t</TabsTrigger>\n\t\t\t</TabsList>\n\t\t\t<TabsContent value={TAB_OPTIONS.global.tabSearchValue}>\n\t\t\t\t{globalView}\n\t\t\t</TabsContent>\n\t\t\t<TabsContent value={TAB_OPTIONS[\"task-run\"].tabSearchValue}>\n\t\t\t\t{taskRunView}\n\t\t\t</TabsContent>\n\t\t</Tabs>\n\t);\n};\n","import { GlobalConcurrencyLimitsView } from \"@/components/concurrency/global-concurrency-limits/global-concurrency-limits-view\";\nimport { TaskRunConcurrencyLimitsView } from \"@/components/concurrency/task-run-concurrency-limits/task-run-concurrency-limits-view\";\nimport {\n\tBreadcrumb,\n\tBreadcrumbItem,\n\tBreadcrumbList,\n} from \"@/components/ui/breadcrumb\";\n\nimport { ConcurrencyLimitsTabs } from \"./concurrency-limits-tabs\";\n\nexport const ConcurrencyLimitsPage = () => {\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<ConcurrencyLimitTitle />\n\t\t\t<ConcurrencyLimitsTabs\n\t\t\t\tglobalView={<GlobalConcurrencyLimitsView />}\n\t\t\t\ttaskRunView={<TaskRunConcurrencyLimitsView />}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\nconst ConcurrencyLimitTitle = () => (\n\t<div className=\"flex items-center gap-2\">\n\t\t<Breadcrumb>\n\t\t\t<BreadcrumbList>\n\t\t\t\t<BreadcrumbItem className=\"text-xl font-semibold\">\n\t\t\t\t\tConcurrency\n\t\t\t\t</BreadcrumbItem>\n\t\t\t</BreadcrumbList>\n\t\t</Breadcrumb>\n\t</div>\n);\n","import { createFileRoute } from \"@tanstack/react-router\";\nimport { zodValidator } from \"@tanstack/zod-adapter\";\nimport { z } from \"zod\";\nimport { buildListGlobalConcurrencyLimitsQuery } from \"@/api/global-concurrency-limits\";\nimport { buildListTaskRunConcurrencyLimitsQuery } from \"@/api/task-run-concurrency-limits\";\nimport { ConcurrencyLimitsPage } from \"@/components/concurrency/concurrency-limits-page\";\n\n/**\n * Schema for validating URL search parameters for the Concurrency Limits page.\n * @property {string} search used to filter data table\n * @property {'global' | 'task-run'} tab used designate which tab view to display\n */\nconst searchParams = z.object({\n\tsearch: z.string().optional(),\n\ttab: z.enum([\"global\", \"task-run\"]).default(\"global\"),\n});\n\nexport type TabOptions = z.infer<typeof searchParams>[\"tab\"];\n\nexport const Route = createFileRoute(\"/concurrency-limits/\")({\n\tvalidateSearch: zodValidator(searchParams),\n\tcomponent: ConcurrencyLimitsPage,\n\twrapInSuspense: true,\n\tloader: ({ context }) =>\n\t\tPromise.all([\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListGlobalConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t\tcontext.queryClient.ensureQueryData(\n\t\t\t\tbuildListTaskRunConcurrencyLimitsQuery(),\n\t\t\t),\n\t\t]),\n});\n"],"names":["ActionsCell","onEditRow","onDeleteRow","props","handleCopyId","id","toast","row","DropdownMenu","jsx","DropdownMenuTrigger","jsxs","Button","Icon","DropdownMenuContent","DropdownMenuLabel","DropdownMenuItem","ActiveCell","updateGlobalConcurrencyLimit","useUpdateGlobalConcurrencyLimit","handleCheckedChange","checked","error","message","rowActive","rowId","Switch","routeApi","getRouteApi","columnHelper","createColumnHelper","createColumns","GlobalConcurrencyLimitsDataTable","data","navigate","search","deferredSearch","useDeferredValue","filteredData","useMemo","Table","value","prev","onSearchChange","searchValue","table","useReactTable","getCoreRowModel","getPaginationRowModel","SearchInput","e","DataTable","GlobalConcurrencyLimitsEmptyState","onAdd","EmptyState","EmptyStateIcon","EmptyStateTitle","EmptyStateDescription","EmptyStateActions","DocsLink","GlobalConcurrencyLimitsHeader","Breadcrumb","BreadcrumbList","BreadcrumbItem","formSchema","z.object","z.boolean","z.number","z.string","z.coerce","DEFAULT_VALUES","useCreateOrEditGlobalConcurrencyLimitForm","limitToUpdate","onSubmit","createGlobalConcurrencyLimit","createStatus","useCreateGlobalConcurrencyLimit","updateStatus","form","useForm","zodResolver","useEffect","active","name","limit","slot_decay_per_second","active_slots","values","onSettled","GlobalConcurrencyLimitsCreateOrEditDialog","onOpenChange","isLoading","saveOrUpdate","dialogTitle","Dialog","DialogContent","DialogHeader","DialogTitle","Form","FormMessage","FormField","field","FormItem","FormLabel","FormControl","Input","DialogFooter","DialogTrigger","GlobalConcurrencyLimitsDeleteDialog","onDelete","deleteGlobalConcurrencyLimit","isPending","useDeleteGlobalConcurrencyLimit","handleOnClick","DialogDescription","GlobalConcurrencyLimitsDialog","openDialog","onCloseDialog","dialog","GlobalConcurrencyLimitsView","setOpenDialog","useState","useListGlobalConcurrencyLimits","handleAddRow","handleEditRow","handleDeleteRow","handleCloseDialog","handleOpenChange","open","ActiveTaskRunCells","numActiveTaskRuns","TagCell","tag","Link","onResetRow","TaskRunConcurrencyLimitsActionsMenu","TaskRunConcurrencyLimitsDataTable","TaskRunConcurrencyLimitsEmptyState","TaskRunConcurrencyLimitsHeader","TaskRunConcurrencyLimitsCreateDialog","createTaskRunConcurrencyLimit","useCreateTaskRunConcurrencyLimit","handleAddLimit","TaskRunConcurrencyLimitDialog","TaskRunConcurrencyLimitsResetDialog","TaskRunConcurrencyLimitsDeleteDialog","TaskRunConcurrencyLimitsView","useListTaskRunConcurrencyLimits","handleResetRow","TAB_OPTIONS","ConcurrencyLimitsTabs","globalView","taskRunView","tab","Tabs","TabsList","TabsTrigger","TabsContent","ConcurrencyLimitsPage","ConcurrencyLimitTitle","z","string","optional","default","SplitComponent"],"mappings":"s9BAkBO,MAAMA,GAAc,CAAC,CAC3B,UAAAC,EACA,YAAAC,EACA,GAAGC,CACJ,IAAwB,CACvB,MAAMC,EAAgBC,GAAe,CAC/B,UAAU,UAAU,UAAUA,CAAE,EACrCC,EAAM,QAAQ,WAAW,CAC1B,EAEMC,EAAMJ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GAAA,EAA4B,EACzC,kBAAc2B,GAAA,CAAA,CAA6B,CAAA,CAAA,CAC5C,EACD,EAIIa,GAAwB,IAC7BtJ,EAAAA,IAAC,MAAA,CAAI,UAAU,0BACd,SAAAA,EAAAA,IAACoD,EAAA,CACA,SAAApD,EAAAA,IAACqD,EAAA,CACA,eAACC,EAAA,CAAe,UAAU,wBAAwB,SAAA,aAAA,CAElD,EACD,EACD,CAAA,CACD,ECnBoBiG,EAAS,CAC7B7H,OAAQ6H,EAAEC,EAASC,SAAAA,EACnBT,IAAKO,GAAO,CAAC,SAAU,UAAU,CAAC,EAAEG,QAAQ,QAAQ,CACrD,CAAC,EAE4D,MAAAC,GAZpDN"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as l,j as s,s as E,L as Me,F as $e,m as ot,E as rt}from"./vendor-tanstack-CLpbOGYv.js";import{a8 as Ye,a9 as lt,aa as it,ab as be,ac as ct,ad as ut,ae as dt,af as mt,ag as ft,ah as gt,ai as ht,aj as Ee,ak as oe,al as re,am as pt,y as ee,N as qe,q as le,I as V,an as xt,ao as wt,ap as St,aq as vt,ar as kt,as as yt,at as Ft,_ as jt,$ as Ct,a0 as Rt,a1 as bt,a2 as Tt,p as Dt,a3 as _t,au as ie,av as Nt,i as O,aw as Mt,ax as Et,ay as Ae,az as Pe,C as At,o as Pt,G as It,O as Ie,B as Lt,g as zt,h as Ot,E as Vt,t as Ht,v as Wt,w as Bt,x as Ut,D as Qt,aA as Ge,aB as j,aC as $t,aD as Yt,aE as Le,aF as ze,aG as qt,aH as Oe,aI as Gt,aJ as Xt,aK as Kt,aL as Jt}from"./index-BZqccBpn.js";import{D as Zt,W as es}from"./work-pool-filter-D4DI4Hd5.js";import{S as ts}from"./sort-filter-BNQ6rjAG.js";import{S as ss,F as as,a as ns}from"./flow-runs-pagination-CoZZ-ed_.js";import{u as os,F as rs}from"./use-flow-runs-selected-rows-DB4pe2_m.js";import{D as Xe}from"./delete-confirmation-dialog-D18TITKv.js";import{D as ls,a as is,b as cs,d as te,e as us}from"./dropdown-menu-g64QiYKu.js";import{g as ds,S as ms}from"./state-colors-CAAf0Eg3.js";import{R as fs,S as gs,X as hs,Y as ps,T as xs,d as ws}from"./vendor-recharts-BOcghvr2.js";import{c as Ss}from"./vendor-date-Bxa7CHB1.js";import{T as vs,a as ks,b as ys}from"./task-runs-pagination-DGjxL4DO.js";import{u as Fs}from"./use-delete-confirmation-dialog-Bka9YDdO.js";import{T as js}from"./tags-input-CDvuqe9B.js";import{a as Cs}from"./zod-cc-7bk3x.js";import{c as Rs,o as Ke,s as _,e as se,n as ae,b as bs}from"./vendor-forms-mroZAMaw.js";import{F as Ts,b as Ds,c as _s,d as Ns,e as Ms,a as Es}from"./form-CdcF42XZ.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-CP6hQtRc.js";const As=({value:e,onValueChange:t,className:n})=>{const a=l.useMemo(()=>Ye(e),[e]),o=i=>{t(it(i))};return s.jsx(lt,{value:a,onValueChange:o,placeholder:"All time",clearable:!0,className:n})},Ve=2,Ps=({selectedFlows:e,onSelectFlows:t})=>{const[n,a]=l.useState(""),o=l.useDeferredValue(n),{data:i=[]}=E(be({flows:o?{operator:"and_",name:{like_:o}}:void 0,limit:100,offset:0,sort:"NAME_ASC"})),{data:r=[]}=E(be({flows:e.size>0?{operator:"and_",id:{any_:Array.from(e)}}:void 0,limit:e.size||1,offset:0,sort:"NAME_ASC"},{enabled:e.size>0})),u=m=>{const h=new Set(e);e.has(m)?h.delete(m):h.add(m),t(h)},c=()=>{t(new Set)},d=()=>{if(e.size===0)return"All flows";const m=r.filter(S=>e.has(S.id)).map(S=>S.name),h=m.slice(0,Ve),x=m.length-Ve;return s.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[s.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:s.jsx("span",{className:"truncate",children:h.join(", ")})}),x>0&&s.jsxs(re,{variant:"bodySmall",className:"shrink-0",children:["+ ",x]})]})},f=l.useMemo(()=>i.filter(m=>!o||m.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return s.jsxs(ct,{children:[s.jsx(ut,{"aria-label":"Filter by flow",selected:e.size===0,children:d()}),s.jsxs(dt,{children:[s.jsx(mt,{value:n,onValueChange:a,placeholder:"Search flows..."}),s.jsxs(ft,{children:[s.jsx(gt,{children:"No flows found"}),s.jsxs(ht,{children:[s.jsxs(Ee,{"aria-label":"All flows",onSelect:c,closeOnSelect:!1,value:"__all__",children:[s.jsx(oe,{checked:e.size===0}),"All flows"]}),f.map(m=>s.jsxs(Ee,{"aria-label":m.name,onSelect:()=>u(m.id),closeOnSelect:!1,value:m.id,children:[s.jsx(oe,{checked:e.has(m.id)}),m.name]},m.id))]})]})]})]})},Is=()=>{const[e,t]=Fs(),{mutateAsync:n}=pt(),a=async(i,r=()=>{})=>{try{const u=await Promise.allSettled(i.map(f=>n({id:f}))),{numFails:c,numSuccess:d}=u.reduce((f,m)=>(m.status==="rejected"?f.numFails+=1:f.numSuccess+=1,f),{numFails:0,numSuccess:0});c>1?ee.error(`${c} task runs failed to delete`):c===1?ee.error("Task run failed to delete"):d>1?ee.success(`${d} task runs deleted`):ee.success("Task run deleted")}catch(u){console.error("Unknown error while deleting task run.",u)}finally{r()}};return[e,(i,r=()=>{})=>t({title:"Delete Task Runs",description:"Are you sure you want to delete selected task runs?",onConfirm:()=>{a(i,r)}})]},Ls=({count:e=0,...t})=>"results"in t&&"setSelectedRows"in t&&"selectedRows"in t?s.jsx(zs,{count:e,...t}):s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[e," ",qe(e,"Task run")]});function zs({count:e=0,results:t=[],setSelectedRows:n,selectedRows:a}){const[o,i]=Is(),r=l.useMemo(()=>t.map(({id:d})=>d),[t]),u=Array.from(a),c=()=>{const d=r.every(h=>a.has(h)),f=r.some(h=>a.has(h));let m=!1;return d?m=!0:f&&(m="indeterminate"),s.jsx(oe,{className:"block",checked:m,onCheckedChange:h=>{n(h?new Set(r):new Set)},"aria-label":"Toggle all"})};return a.size>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(c,{}),s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[u.length," selected"]}),s.jsx(le,{"aria-label":"Delete rows",size:"icon",variant:"secondary",onClick:()=>{i(u,()=>n(new Set))},children:s.jsx(V,{id:"Trash2",className:"size-4"})})]}),s.jsx(Xe,{...o})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[t&&n&&a&&s.jsx(oe,{className:"block",checked:!1,onCheckedChange:d=>{n(new Set(d?r:void 0))},"aria-label":"Toggle all"}),s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[e," ",qe(e,"Task run")]})]})}const Os=e=>{const[t,n]=l.useState(new Set(e)),a=c=>n(d=>new Set(d).add(c)),o=c=>n(d=>{const f=new Set(d);return f.delete(c),f});return[t,n,{addRow:a,removeRow:o,onSelectRow:(c,d)=>{d?a(c):o(c)},clearSet:()=>n(new Set)}]},Je="Custom",Vs="Unsaved";function Hs(e){return e?e.name===Je||e.name===Vs:!0}const Ws=({currentFilter:e,savedFilters:t,onSelect:n,onSave:a,onDelete:o,onSetDefault:i,onRemoveDefault:r,permissions:u={canSave:!0,canDelete:!0}})=>{const[c,d]=l.useState(!1),f=e?.name??Je,m=Hs(e),h=m&&u.canSave,x=e?.id&&u.canDelete,S=!m,y=()=>{e?.id&&(o(e.id),d(!1))},g=()=>{e?.id&&(e.isDefault?r(e.id):i(e.id))};return s.jsxs(s.Fragment,{children:[s.jsxs(ls,{children:[s.jsx(is,{asChild:!0,children:s.jsxs(le,{variant:"outline",className:"gap-2",children:[s.jsx(V,{id:"SlidersVertical",className:"size-4"}),s.jsx("span",{children:f}),s.jsx(V,{id:"ChevronDown",className:"size-4"})]})}),s.jsxs(cs,{align:"start",className:"min-w-[200px]",children:[t.map(p=>s.jsxs(te,{onClick:()=>n(p),className:"flex items-center justify-between",children:[s.jsx("span",{children:p.name}),p.isDefault&&s.jsx(V,{id:"CircleCheck",className:"size-4 text-green-500"})]},p.id??p.name)),(h||x||S)&&s.jsx(us,{}),h&&s.jsxs(te,{onClick:a,children:[s.jsx(V,{id:"Plus",className:"mr-2 size-4"}),"Save current filters"]}),x&&s.jsxs(te,{variant:"destructive",onClick:()=>d(!0),children:[s.jsx(V,{id:"Trash2",className:"mr-2 size-4"}),"Delete"]}),S&&s.jsxs(te,{onClick:g,children:[s.jsx(V,{id:"CircleCheck",className:"mr-2 size-4"}),e?.isDefault?"Remove as default":"Set as default"]})]})]}),s.jsx(Xe,{isOpen:c,title:"Delete saved filter",description:`Are you sure you want to delete "${e?.name}"? This action cannot be undone.`,onConfirm:y,onClose:()=>d(!1)})]})},Bs=({cx:e,cy:t,payload:n})=>{if(e===void 0||t===void 0||!n)return null;const a=ds(n.stateType)||ms[n.stateType]||"#6b7280";return s.jsx("circle",{cx:e,cy:t,r:6,fill:a,stroke:a,strokeWidth:1,opacity:.7,className:"hover:opacity-100 transition-opacity cursor-pointer"})},Us=({active:e,payload:t})=>{const a=t?.[0]?.payload,o=a?.id,{data:i}=E({...xt(o??""),enabled:e&&!!o,staleTime:300*1e3}),{data:r}=E({...wt(i?.flow_id??""),enabled:!!i?.flow_id,staleTime:300*1e3});if(!e||!t||t.length===0||!a)return null;const u=new Date(a.timestamp);return s.jsxs("div",{className:"bg-background border rounded-lg p-3 shadow-lg flex flex-col gap-2 min-w-48",children:[s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[i?.flow_id&&s.jsxs(s.Fragment,{children:[s.jsx(Me,{to:"/flows/flow/$id",params:{id:i.flow_id},className:"font-semibold hover:underline truncate max-w-32",children:r?.name??"..."}),s.jsx(St,{className:"size-3 flex-shrink-0"})]}),s.jsx(Me,{to:"/runs/flow-run/$id",params:{id:a.id},className:"hover:underline truncate max-w-32",children:i?.name??a.id.slice(0,8)})]}),s.jsx("div",{children:s.jsx(vt,{type:a.stateType})}),s.jsx("hr",{className:"border-border"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(yt,{className:"size-4"}),kt(Math.ceil(a.duration*1e3),{largest:2,round:!0})]}),s.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ft,{className:"size-4"}),u.toLocaleString()]})]})]})},Qs=e=>t=>t===0?"0s":e<1?`${Math.round(t*1e3)}ms`:e<10?`${t.toFixed(1)}s`:e<60?`${Math.round(t)}s`:Ss(0,t*1e3,{addSuffix:!1}),$s=(e,t)=>i=>{const r=new Date(i);if(t<1e3||e<1e4){const u=r.getSeconds(),c=r.getMilliseconds();return`${r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}:${u.toString().padStart(2,"0")}.${Math.floor(c/100)}`}return t<6e4||e<10*6e4?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):e>=864e5?r.getHours()===0&&r.getMinutes()===0&&r.getSeconds()===0&&r.getMilliseconds()===0?r.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},Ys=({history:e,startDate:t,endDate:n})=>{const a=l.useRef(null),[o,i]=l.useState(0);l.useEffect(()=>{const g=a.current;if(!g)return;const p=new ResizeObserver(w=>{for(const k of w)i(k.contentRect.width)});return p.observe(g),i(g.getBoundingClientRect().width),()=>p.disconnect()},[]);const r=l.useMemo(()=>e.map(g=>({x:new Date(g.timestamp).getTime(),y:g.duration,stateType:g.state_type,id:g.id,duration:g.duration,lateness:g.lateness,timestamp:g.timestamp})),[e]),{xDomain:u,xDomainMin:c,xDomainMax:d}=l.useMemo(()=>{if(t&&n)return{xDomain:[t.getTime(),n.getTime()],xDomainMin:t.getTime(),xDomainMax:n.getTime()};if(r.length===0){const k=Date.now(),b=k-1440*60*1e3;return{xDomain:[b,k],xDomainMin:b,xDomainMax:k}}const g=r.map(k=>k.x),p=Math.min(...g),w=Math.max(...g);return{xDomain:[p,w],xDomainMin:p,xDomainMax:w}},[t,n,r]),f=l.useMemo(()=>r.length===0?60:Math.max(...r.map(g=>g.y)),[r]),m=l.useMemo(()=>{if(r.length<2)return Number.POSITIVE_INFINITY;const g=r.map(w=>w.x).sort((w,k)=>w-k);let p=Number.POSITIVE_INFINITY;for(let w=1;w<g.length;w++){const k=g[w]-g[w-1];k>0&&k<p&&(p=k)}return p},[r]),h=d-c,x=l.useMemo(()=>$s(h,m),[h,m]),S=l.useMemo(()=>Qs(f),[f]),y=l.useMemo(()=>{const w=o-60,k=Math.max(2,Math.ceil(w/100)),b=1440*60*1e3,F=d-c;if(F>=b){const v=[],W=new Date(c),H=new Date(W);H.setHours(24,0,0,0),v.push(c);let P=H.getTime();for(;P<d;)v.push(P),P+=b;const B=v[v.length-1];if(d-B>F/k/2&&v.push(d),v.length<k){const M=[];for(let T=0;T<v.length-1;T++){M.push(v[T]);const I=v[T+1]-v[T],L=Math.max(1,Math.floor(I/(F/k)));if(L>1){const U=I/L;for(let z=1;z<L;z++)M.push(v[T]+U*z)}}return M.push(v[v.length-1]),M}return v}const N=[],A=(d-c)/(k-1);for(let v=0;v<k;v++)N.push(c+A*v);return N},[o,c,d]);return e.length===0?null:s.jsx("div",{ref:a,className:"hidden md:block w-full h-64","data-testid":"scatter-plot",children:s.jsx(fs,{width:"100%",height:"100%",children:s.jsxs(gs,{children:[s.jsx(hs,{type:"number",dataKey:"x",scale:"time",domain:u,ticks:y,tickFormatter:x,tick:{fontSize:12},tickLine:!1,axisLine:{stroke:"#e5e7eb"}}),s.jsx(ps,{type:"number",dataKey:"y",tickFormatter:S,tick:{fontSize:12},tickLine:!1,axisLine:{stroke:"#e5e7eb"},width:60}),s.jsx(xs,{content:s.jsx(Us,{}),cursor:{strokeDasharray:"3 3"},animationDuration:0}),s.jsx(ws,{data:r,shape:s.jsx(Bs,{}),isAnimationActive:!1})]})})})},qs=Ke({name:_().min(1,{message:"Name is required"}).max(100,{message:"Name must be 100 characters or less"})}),Gs=({open:e,onOpenChange:t,onSave:n})=>{const a=Rs({resolver:Cs(qs),defaultValues:{name:""}});l.useEffect(()=>{e&&a.reset({name:""})},[e,a]);const o=i=>{n(i.name),t(!1)};return s.jsx(jt,{open:e,onOpenChange:t,children:s.jsxs(Ct,{children:[s.jsx(Rt,{children:s.jsx(bt,{children:"Save Filter"})}),s.jsx(Tt,{children:"Save your current filter configuration for quick access later."}),s.jsx(Ts,{...a,children:s.jsxs("form",{onSubmit:i=>{a.handleSubmit(o)(i)},className:"space-y-4",children:[s.jsx(Ds,{control:a.control,name:"name",render:({field:i})=>s.jsxs(_s,{children:[s.jsx(Ns,{children:"Filter Name"}),s.jsx(Ms,{children:s.jsx(Dt,{autoComplete:"off",placeholder:"e.g., Failed runs this week",...i})}),s.jsx(Es,{})]})}),s.jsxs(_t,{children:[s.jsx(le,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(le,{type:"submit",children:"Save"})]})]})})]})})},Xs="prefect-ui-v2-saved-filters",Ks="prefect-ui-v2-default-filter-id",Ze="system-past-week",et="system-hide-scheduled";function Js(e){return e===Ze||e===et}const tt=[{id:Ze,name:"Past week",filters:{range:"past-7-days"}},{id:et,name:"Hide scheduled runs",filters:{range:"past-7-days",state:[...Nt]}}],Zs=tt[0];function ea(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ta(e,t){const n=(a,o)=>{if(a===void 0&&o===void 0)return!0;if(a===void 0||o===void 0||a.length!==o.length)return!1;const i=[...a].sort(),r=[...o].sort();return i.every((u,c)=>u===r[c])};return n(e.state,t.state)&&n(e.flows,t.flows)&&n(e.deployments,t.deployments)&&n(e.workPools,t.workPools)&&n(e.tags,t.tags)&&e.range===t.range&&e.start===t.start&&e.end===t.end}function st(){const[e,t]=ie(Xs,[]),[n,a]=ie(Ks,null),o=l.useMemo(()=>[...tt,...e],[e]),i=l.useCallback(h=>{const x={id:ea(),name:h.name,filters:h.filters};return t(S=>[...S,x]),x},[t]),r=l.useCallback(h=>{t(x=>x.filter(S=>S.id!==h)),a(x=>x===h?null:x)},[t,a]),u=l.useCallback((h,x)=>{t(S=>S.map(y=>y.id===h?{...y,...x.name!==void 0&&{name:x.name},...x.filters!==void 0&&{filters:x.filters}}:y))},[t]),c=l.useCallback(h=>{a(h)},[a]),d=l.useCallback(h=>o.find(x=>x.id===h),[o]),f=l.useCallback(h=>o.find(x=>ta(x.filters,h)),[o]),m=l.useMemo(()=>h=>n===h,[n]);return{savedFilters:o,defaultFilterId:n,saveFilter:i,deleteFilter:r,updateFilter:u,setDefaultFilter:c,getFilterById:d,findMatchingFilter:f,isDefaultFilter:m}}const sa=({tab:e,onTabChange:t,flowRunsCount:n,taskRunsCount:a,hasAnyFlowRuns:o,hasAnyTaskRuns:i,flowRuns:r,flowRunsPages:u,pagination:c,onPaginationChange:d,onPrefetchPage:f,sort:m,onSortChange:h,hideSubflows:x,onHideSubflowsChange:S,flowRunSearch:y,onFlowRunSearchChange:g,selectedStates:p,onStateFilterChange:w,selectedFlows:k,onFlowFilterChange:b,selectedDeployments:F,onDeploymentFilterChange:N,selectedTags:A,onTagsFilterChange:v,selectedWorkPools:W,onWorkPoolFilterChange:H,dateRange:P,onDateRangeChange:B,flowRunHistory:M,scatterPlotDateRange:T,taskRuns:I,taskRunsPages:L,taskRunsPagination:U,onTaskRunsPaginationChange:z,onTaskRunsPrefetchPage:Q,taskRunsSort:de,onTaskRunsSortChange:me,taskRunSearch:fe,onTaskRunSearchChange:ge,onClearTaskRunFilters:he,currentFilter:X,savedFilters:pe,onSelectFilter:xe,onSaveFilter:we,onDeleteFilter:Se,onSetDefault:ve,onRemoveDefault:ke,isSaveDialogOpen:$,onCloseSaveDialog:Y,onConfirmSave:ye})=>{const q=!o&&!i,[K,Fe,{onSelectRow:je}]=os(),[J,Ce,{onSelectRow:C}]=Os(),D=[...new Set(r.map(R=>R.flow_id))],{data:Z}=E(be({flows:{operator:"and_",id:{any_:D}},offset:0,sort:"NAME_ASC"},{enabled:D.length>0})),G=r.map(R=>({...R,flow:Z?.find(Re=>Re.id===R.flow_id)}));return q?s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(He,{}),s.jsx(aa,{})]}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(He,{}),s.jsx(Ws,{currentFilter:X,savedFilters:pe,onSelect:xe,onSave:we,onDelete:Se,onSetDefault:ve,onRemoveDefault:ke,permissions:{canSave:!0,canDelete:!Js(X?.id??null)}})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap gap-2 lg:grid lg:grid-flow-col lg:auto-cols-fr",children:[s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Date Range"}),s.jsx(As,{value:P,onValueChange:B})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"States"}),s.jsx(ss,{selectedFilters:p,onSelectFilter:w})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 lg:grid lg:grid-flow-col lg:auto-cols-fr",children:[s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Flows"}),s.jsx(Ps,{selectedFlows:k,onSelectFlows:b})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Deployments"}),s.jsx(Zt,{selectedDeployments:F,onSelectDeployments:N})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Work Pools"}),s.jsx(es,{selectedWorkPools:W,onSelectWorkPools:H})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Tags"}),s.jsx(js,{value:Array.from(A),onChange:R=>{const Re=Array.isArray(R)?R:[];v(new Set(Re))},placeholder:"All tags"})]})]})]}),s.jsx(Gs,{open:$,onOpenChange:Y,onSave:ye}),s.jsxs(Mt,{value:e,onValueChange:t,children:[s.jsxs(Et,{children:[s.jsx(Ae,{value:"flow-runs",children:"Flow Runs"}),s.jsx(Ae,{value:"task-runs",children:"Task Runs"})]}),s.jsx(Pe,{value:"flow-runs",children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(At,{children:s.jsx(Pt,{children:s.jsx(Ys,{history:M,startDate:T.startDate,endDate:T.endDate})})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(rs,{count:n,results:G,selectedRows:K,setSelectedRows:Fe}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[s.jsx(It,{id:"hide-subflows",checked:x,onCheckedChange:S}),s.jsx(O,{htmlFor:"hide-subflows",children:"Hide subflows"})]}),s.jsx(Ie,{value:y,onChange:R=>g(R.target.value),placeholder:"Search by flow run name","aria-label":"Search by flow run name",className:"w-64",debounceMs:1200}),s.jsx(ts,{value:m,onSelect:h})]})]}),s.jsx(as,{count:n,pages:u,pagination:c,onChangePagination:d,onPrefetchPage:f}),s.jsx(ns,{flowRuns:G,selectedRows:K,onSelect:je})]})}),s.jsx(Pe,{value:"task-runs",children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ls,{count:a,results:I,selectedRows:J,setSelectedRows:Ce}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Ie,{value:fe,onChange:R=>ge(R.target.value),placeholder:"Search by task run name","aria-label":"Search by task run name",className:"w-64",debounceMs:1200}),s.jsx(vs,{value:de,onSelect:me})]})]}),s.jsx(ks,{count:a,pages:L,pagination:U,onChangePagination:z,onPrefetchPage:Q}),s.jsx(ys,{taskRuns:I,selectedRows:J,onSelect:C,onClearFilters:he})]})})]})]})},He=()=>s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Lt,{children:s.jsx(zt,{children:s.jsx(Ot,{className:"text-xl font-semibold",children:"Runs"})})})}),aa=()=>s.jsxs(Vt,{children:[s.jsx(Ht,{id:"Workflow"}),s.jsx(Wt,{children:"Run a task or flow to get started"}),s.jsx(Bt,{children:"Runs store the state history for each execution of a task or flow."}),s.jsx(Ut,{children:s.jsx(Qt,{id:"getting-started"})})]}),ce=$e("/runs/");function na(e){const t=u=>u?u.split(",").filter(c=>c.trim().length>0):[],n=t(e.state),a=t(e.flows),o=t(e.deployments),i=t(e["work-pools"]),r=t(e.tags);return{...n.length>0&&{state:n},...a.length>0&&{flows:a},...o.length>0&&{deployments:o},...i.length>0&&{workPools:i},...r.length>0&&{tags:r},...e.range&&{range:e.range},...e.start&&{start:e.start},...e.end&&{end:e.end}}}function at(e){return{state:e.state?.join(",")??"",flows:e.flows?.join(",")??"",deployments:e.deployments?.join(",")??"","work-pools":e.workPools?.join(",")??"",tags:e.tags?.join(",")??"",range:e.range,start:e.start,end:e.end}}function We(e,t){return{id:e.id,name:e.name,isDefault:e.id===t}}function oa(){const e=ce.useSearch(),t=ce.useNavigate(),{savedFilters:n,defaultFilterId:a,saveFilter:o,deleteFilter:i,setDefaultFilter:r,findMatchingFilter:u}=st(),[c,d]=l.useState(!1),f=l.useMemo(()=>na(e),[e]),m=l.useMemo(()=>u(f),[u,f]),h=l.useMemo(()=>n.map(F=>We(F,a)),[n,a]),x=l.useMemo(()=>m?We(m,a):f.state?.length||f.flows?.length||f.deployments?.length||f.workPools?.length||f.tags?.length||f.range||f.start||f.end?{id:null,name:"Unsaved",isDefault:!1}:{id:null,name:"Custom",isDefault:!1},[m,a,f]),S=l.useCallback(F=>{const N=n.find(v=>v.id===F.id);if(!N)return;const A=at(N.filters);t({to:".",search:v=>({...v,...A,page:1}),replace:!0})},[t,n]),y=l.useCallback(()=>{d(!0)},[]),g=l.useCallback(F=>{o({name:F,filters:f}),d(!1)},[o,f]),p=l.useCallback(()=>{d(!1)},[]),w=l.useCallback(F=>{i(F)},[i]),k=l.useCallback(F=>{r(F)},[r]),b=l.useCallback(()=>{r(null)},[r]);return{currentFilter:x,savedFiltersForMenu:h,onSelectFilter:S,onSaveFilter:y,onDeleteFilter:w,onSetDefault:k,onRemoveDefault:b,isSaveDialogOpen:c,closeSaveDialog:p,confirmSave:g}}function ra(){const e=ce.useNavigate(),t=ce.useSearch(),{defaultFilterId:n,getFilterById:a}=st(),o=l.useRef(!1),i=l.useMemo(()=>!!(t.state||t.flows||t.deployments||t["work-pools"]||t.tags||t.range||t.start||t.end),[t]);l.useEffect(()=>{if(o.current||i)return;let r;n&&(r=a(n)),r||(r=Zs),o.current=!0;const u=at(r.filters);e({to:".",search:c=>({...c,...u,page:1}),replace:!0})},[n,i,a,e])}const Be=$e("/runs/"),la=e=>e?e.split(",").filter(t=>Ge.includes(t)):[],ne=e=>e?e.split(",").filter(t=>t.trim().length>0):[];function ia(){const e=Be.useSearch(),t=Be.useNavigate(),n=l.useMemo(()=>new Set(la(e.state??"")),[e.state]),a=l.useMemo(()=>new Set(ne(e.flows??"")),[e.flows]),o=l.useMemo(()=>new Set(ne(e.deployments??"")),[e.deployments]),i=l.useMemo(()=>new Set(ne(e["work-pools"]??"")),[e["work-pools"]]),r=l.useMemo(()=>new Set(ne(e.tags??"")),[e.tags]),u=l.useMemo(()=>({range:e.range,start:e.start,end:e.end}),[e.range,e.start,e.end]),c=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,state:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),d=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,flows:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),f=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,deployments:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),m=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,"work-pools":p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),h=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,tags:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),x=l.useCallback(g=>{t({to:".",search:p=>({...p,range:g.range,start:g.start,end:g.end,page:1}),replace:!0})},[t]),S=l.useMemo(()=>n.size>0||a.size>0||o.size>0||i.size>0||r.size>0||u.range!==void 0||u.start!==void 0||u.end!==void 0,[n,a,o,i,r,u]),y=l.useCallback(()=>{t({to:".",search:g=>({...g,state:"",flows:"",deployments:"","work-pools":"",tags:"",range:void 0,start:void 0,end:void 0,page:1}),replace:!0})},[t]);return{states:n,flows:a,deployments:o,workPools:i,tags:r,dateRange:u,onStatesChange:c,onFlowsChange:d,onDeploymentsChange:f,onWorkPoolsChange:m,onTagsChange:h,onDateRangeChange:x,clearAllFilters:y,hasActiveFilters:S}}Ke({tab:se(["flow-runs","task-runs"]).optional().default("flow-runs"),page:ae().int().positive().optional().default(1).catch(1),limit:ae().int().positive().optional().catch(void 0),sort:se(Jt).optional().default("START_TIME_DESC"),"hide-subflows":bs().optional().default(!1),"flow-run-search":_().optional().default(""),state:_().optional().default(""),flows:_().optional().default(""),deployments:_().optional().default(""),"work-pools":_().optional().default(""),tags:_().optional().default(""),range:se(Kt).optional(),start:_().optional(),end:_().optional(),"task-runs-page":ae().int().positive().optional().default(1).catch(1),"task-runs-limit":ae().int().positive().optional().catch(void 0),"task-runs-sort":se(Xt).optional().default("EXPECTED_START_TIME_DESC"),"task-run-search":_().optional().default("")});const Te=e=>e?e.split(",").filter(t=>Ge.includes(t)):[],ue=e=>{if(!e)return;const t={range:e.range,start:e.start,end:e.end},n=Ye(t);if(!n)return;const a=Gt(n);if(a)return{after_:a.startDate.toISOString(),before_:a.endDate.toISOString()}},De=e=>e?e.split(",").filter(t=>t.trim().length>0):[],_e=e=>e?e.split(",").filter(t=>t.trim().length>0):[],nt=e=>e?e.split(",").filter(t=>t.trim().length>0):[],Ne=e=>e?e.split(",").filter(t=>t.trim().length>0):[],Ue=e=>{const t=e?.["hide-subflows"],n=e?.["flow-run-search"],a=Te(e?.state??""),o=De(e?.flows??""),i=_e(e?.deployments??""),r=nt(e?.["work-pools"]??""),u=Ne(e?.tags??""),c=ue(e),d=a.length>0?a:void 0,f=o.length>0?o:void 0,m=i.length>0?i:void 0,h=r.length>0?r:void 0,S=t||n||d||f||m||u.length>0||c?{operator:"and_",...t&&{parent_task_run_id:{operator:"and_",is_null_:!0}},...n&&{name:{like_:n}},...d&&{state:{operator:"and_",name:{any_:d}}},...u.length>0&&{tags:{operator:"and_",any_:u}},...c&&{expected_start_time:c}}:void 0,y=f?{operator:"and_",id:{any_:f}}:void 0,g=m?{operator:"and_",id:{any_:m}}:void 0,p=h?{operator:"and_",name:{any_:h}}:void 0;return{page:e?.page??1,limit:e?.limit??100,sort:e?.sort??"START_TIME_DESC",flow_runs:S,flows:y,deployments:g,work_pools:p}},Qe=e=>{const t=e?.["task-run-search"],n=Te(e?.state??""),a=De(e?.flows??""),o=_e(e?.deployments??""),i=Ne(e?.tags??""),r=ue(e),u=t?{operator:"and_",name:{like_:t}}:void 0,c=n.length>0?n:void 0,f=c||i.length>0||r?{operator:"and_",...c&&{state:{operator:"and_",name:{any_:c}}},...i.length>0&&{tags:{operator:"and_",any_:i}},...r&&{expected_start_time:r}}:void 0,m=a.length>0?a:void 0,h=m?{operator:"and_",id:{any_:m}}:void 0,x=o.length>0?o:void 0,S=x?{operator:"and_",id:{any_:x}}:void 0;return{page:e?.["task-runs-page"]??1,limit:e?.["task-runs-limit"]??100,sort:e?.["task-runs-sort"]??"EXPECTED_START_TIME_DESC",task_runs:u,flow_runs:f,flows:h,deployments:S}},ca=e=>{const t=e?.["hide-subflows"],n=Te(e?.state??""),a=De(e?.flows??""),o=_e(e?.deployments??""),i=nt(e?.["work-pools"]??""),r=Ne(e?.tags??""),u=ue(e),c=n.length>0?n:void 0,d=a.length>0?a:void 0,f=o.length>0?o:void 0,m=i.length>0?i:void 0;return{sort:"EXPECTED_START_TIME_DESC",limit:1e3,offset:0,flow_runs:t||c||r.length>0||u?{operator:"and_",...t&&{parent_task_run_id:{operator:"and_",is_null_:!0}},...c&&{state:{operator:"and_",name:{any_:c}}},...r.length>0&&{tags:{operator:"and_",any_:r}},...u&&{expected_start_time:u}}:void 0,flows:d?{operator:"and_",id:{any_:d}}:void 0,deployments:f?{operator:"and_",id:{any_:f}}:void 0,work_pools:m?{operator:"and_",name:{any_:m}}:void 0}},ua=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useMemo(()=>({page:e.page??1,limit:e.limit??100}),[e.page,e.limit]),a=l.useCallback(o=>{t({to:".",search:i=>({...i,page:o.page,limit:o.limit}),replace:!0})},[t]);return[n,a]},da=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,sort:a,page:1}),replace:!0})},[t]);return[e.sort,n]},ma=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"hide-subflows":a,page:1}),replace:!0})},[t]);return[e["hide-subflows"],n]},fa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,tab:a,page:1}),replace:!0})},[t]);return[e.tab,n]},ga=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"flow-run-search":a,page:1}),replace:!0})},[t]);return[e["flow-run-search"],n]},ha=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useMemo(()=>({page:e["task-runs-page"]??1,limit:e["task-runs-limit"]??100}),[e["task-runs-page"],e["task-runs-limit"]]),a=l.useCallback(o=>{t({to:".",search:i=>({...i,"task-runs-page":o.page,"task-runs-limit":o.limit}),replace:!0})},[t]);return[n,a]},pa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"task-runs-sort":a,"task-runs-page":1}),replace:!0})},[t]);return[e["task-runs-sort"],n]},xa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"task-run-search":a,"task-runs-page":1}),replace:!0})},[t]);return[e["task-run-search"],n]};function La(){const e=ot(),t=j.useSearch(),n=j.useNavigate(),[a,o]=ie("workspace-flow-runs-list-limit",100),[i,r]=ie("workspace-task-runs-list-limit",100),u=l.useRef(!1);l.useEffect(()=>{if(u.current)return;u.current=!0;const C=t.limit===void 0,D=t["task-runs-limit"]===void 0;(C||D)&&n({to:".",search:Z=>({...Z,...C&&{limit:a},...D&&{"task-runs-limit":i}}),replace:!0})},[n,t.limit,t["task-runs-limit"],a,i]),l.useEffect(()=>{t.limit!==void 0&&t.limit!==a&&o(t.limit)},[t.limit,a,o]),l.useEffect(()=>{t["task-runs-limit"]!==void 0&&t["task-runs-limit"]!==i&&r(t["task-runs-limit"])},[t["task-runs-limit"],i,r]);const[c,d]=ua(),[f,m]=da(),[h,x]=ma(),[S,y]=fa(),[g,p]=ga(),{states:w,flows:k,deployments:b,workPools:F,tags:N,dateRange:A,onStatesChange:v,onFlowsChange:W,onDeploymentsChange:H,onWorkPoolsChange:P,onTagsChange:B,onDateRangeChange:M}=ia(),[T,I]=ha(),[L,U]=pa(),[z,Q]=xa(),{currentFilter:de,savedFiltersForMenu:me,onSelectFilter:fe,onSaveFilter:ge,onDeleteFilter:he,onSetDefault:X,onRemoveDefault:pe,isSaveDialogOpen:xe,closeSaveDialog:we,confirmSave:Se}=oa();ra();const[{data:ve},{data:ke}]=rt({queries:[$t(),Yt()]}),{data:$}=E(Le(Ue(t),3e4)),{data:Y}=E(ze(Qe(t),3e4)),{data:ye}=E(qt(ca(t),3e4)),q=$?.results??[],K=Y?.results??[],Fe=l.useMemo(()=>{const C=ue(t);return{startDate:C?.after_?new Date(C.after_):void 0,endDate:C?.before_?new Date(C.before_):void 0}},[t]);l.useEffect(()=>{const C=q.map(D=>D.id);C.length>0&&e.prefetchQuery(Oe(C))},[e,q]);const je=l.useCallback(C=>{const D=Ue({...t,page:C});(async()=>{const G=(await e.ensureQueryData(Le(D,3e4)))?.results?.map(R=>R.id)??[];G.length>0&&e.prefetchQuery(Oe(G))})()},[e,t]),J=l.useCallback(C=>{const D=Qe({...t,"task-runs-page":C});e.prefetchQuery(ze(D,3e4))},[e,t]),Ce=l.useCallback(()=>{Q("")},[Q]);return s.jsx(sa,{tab:S,onTabChange:y,flowRunsCount:$?.count??0,taskRunsCount:Y?.count??0,hasAnyFlowRuns:(ve??0)>0,hasAnyTaskRuns:(ke??0)>0,flowRuns:q,flowRunsPages:$?.pages??0,pagination:c,onPaginationChange:d,onPrefetchPage:je,sort:f,onSortChange:m,hideSubflows:h,onHideSubflowsChange:x,flowRunSearch:g,onFlowRunSearchChange:p,selectedStates:w,onStateFilterChange:v,selectedFlows:k,onFlowFilterChange:W,selectedDeployments:b,onDeploymentFilterChange:H,selectedTags:N,onTagsFilterChange:B,selectedWorkPools:F,onWorkPoolFilterChange:P,dateRange:A,onDateRangeChange:M,flowRunHistory:ye??[],scatterPlotDateRange:Fe,taskRuns:K,taskRunsPages:Y?.pages??0,taskRunsPagination:T,onTaskRunsPaginationChange:I,onTaskRunsPrefetchPage:J,taskRunsSort:L,onTaskRunsSortChange:U,taskRunSearch:z,onTaskRunSearchChange:Q,onClearTaskRunFilters:Ce,currentFilter:de,savedFilters:me,onSelectFilter:fe,onSaveFilter:ge,onDeleteFilter:he,onSetDefault:X,onRemoveDefault:pe,isSaveDialogOpen:xe,onCloseSaveDialog:we,onConfirmSave:Se})}export{La as component};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{r as l,j as s,u as E,L as Me,F as $e,n as ot,E as rt}from"./vendor-tanstack-CWDKYA_B.js";import{a8 as Ye,a9 as lt,aa as it,ab as be,ac as ct,ad as ut,ae as dt,af as mt,ag as ft,ah as gt,ai as ht,aj as Ee,ak as oe,al as re,am as pt,y as ee,N as qe,q as le,I as V,an as xt,ao as wt,ap as St,aq as vt,ar as kt,as as yt,at as Ft,_ as jt,$ as Ct,a0 as Rt,a1 as bt,a2 as Tt,p as Dt,a3 as _t,au as ie,av as Nt,i as O,aw as Mt,ax as Et,ay as Ae,az as Pe,C as At,o as Pt,G as It,O as Ie,B as Lt,g as zt,h as Ot,E as Vt,t as Ht,v as Wt,w as Bt,x as Ut,D as Qt,aA as Ge,aB as j,aC as $t,aD as Yt,aE as Le,aF as ze,aG as qt,aH as Oe,aI as Gt,aJ as Xt,aK as Kt,aL as Jt}from"./index-CQlQauOE.js";import{D as Zt,W as es}from"./work-pool-filter-BD0cywQF.js";import{S as ts}from"./sort-filter-BdZ0BjdE.js";import{S as ss,F as as,a as ns}from"./flow-runs-pagination-DvDLs5GM.js";import{u as os,F as rs}from"./use-flow-runs-selected-rows-B_7PiPKo.js";import{D as Xe}from"./delete-confirmation-dialog-DyUMWSB-.js";import{D as ls,a as is,b as cs,d as te,e as us}from"./dropdown-menu-6cSdnzsr.js";import{g as ds,S as ms}from"./state-colors-CAAf0Eg3.js";import{R as fs,S as gs,X as hs,Y as ps,T as xs,d as ws}from"./vendor-recharts-BGjDGXVf.js";import{c as Ss}from"./vendor-date-CRz8gtWZ.js";import{T as vs,a as ks,b as ys}from"./task-runs-pagination-ClbepGWu.js";import{u as Fs}from"./use-delete-confirmation-dialog-C5d6hPL-.js";import{T as js}from"./tags-input-9pBchAz7.js";import{a as Cs}from"./zod-CjGf5GIv.js";import{c as Rs,o as Ke,s as _,e as se,n as ae,b as bs}from"./vendor-forms-D-iybWES.js";import{F as Ts,b as Ds,c as _s,d as Ns,e as Ms,a as Es}from"./form-DvAgEGjn.js";import"./vendor-react-Bce9NwRC.js";import"./vendor-radix-DRMjKWJW.js";const As=({value:e,onValueChange:t,className:n})=>{const a=l.useMemo(()=>Ye(e),[e]),o=i=>{t(it(i))};return s.jsx(lt,{value:a,onValueChange:o,placeholder:"All time",clearable:!0,className:n})},Ve=2,Ps=({selectedFlows:e,onSelectFlows:t})=>{const[n,a]=l.useState(""),o=l.useDeferredValue(n),{data:i=[]}=E(be({flows:o?{operator:"and_",name:{like_:o}}:void 0,limit:100,offset:0,sort:"NAME_ASC"})),{data:r=[]}=E(be({flows:e.size>0?{operator:"and_",id:{any_:Array.from(e)}}:void 0,limit:e.size||1,offset:0,sort:"NAME_ASC"},{enabled:e.size>0})),u=m=>{const h=new Set(e);e.has(m)?h.delete(m):h.add(m),t(h)},c=()=>{t(new Set)},d=()=>{if(e.size===0)return"All flows";const m=r.filter(S=>e.has(S.id)).map(S=>S.name),h=m.slice(0,Ve),x=m.length-Ve;return s.jsxs("div",{className:"flex flex-1 min-w-0 items-center gap-2",children:[s.jsx("div",{className:"flex flex-1 min-w-0 items-center gap-2 overflow-hidden",children:s.jsx("span",{className:"truncate",children:h.join(", ")})}),x>0&&s.jsxs(re,{variant:"bodySmall",className:"shrink-0",children:["+ ",x]})]})},f=l.useMemo(()=>i.filter(m=>!o||m.name.toLowerCase().includes(o.toLowerCase())),[i,o]);return s.jsxs(ct,{children:[s.jsx(ut,{"aria-label":"Filter by flow",selected:e.size===0,children:d()}),s.jsxs(dt,{children:[s.jsx(mt,{value:n,onValueChange:a,placeholder:"Search flows..."}),s.jsxs(ft,{children:[s.jsx(gt,{children:"No flows found"}),s.jsxs(ht,{children:[s.jsxs(Ee,{"aria-label":"All flows",onSelect:c,closeOnSelect:!1,value:"__all__",children:[s.jsx(oe,{checked:e.size===0}),"All flows"]}),f.map(m=>s.jsxs(Ee,{"aria-label":m.name,onSelect:()=>u(m.id),closeOnSelect:!1,value:m.id,children:[s.jsx(oe,{checked:e.has(m.id)}),m.name]},m.id))]})]})]})]})},Is=()=>{const[e,t]=Fs(),{mutateAsync:n}=pt(),a=async(i,r=()=>{})=>{try{const u=await Promise.allSettled(i.map(f=>n({id:f}))),{numFails:c,numSuccess:d}=u.reduce((f,m)=>(m.status==="rejected"?f.numFails+=1:f.numSuccess+=1,f),{numFails:0,numSuccess:0});c>1?ee.error(`${c} task runs failed to delete`):c===1?ee.error("Task run failed to delete"):d>1?ee.success(`${d} task runs deleted`):ee.success("Task run deleted")}catch(u){console.error("Unknown error while deleting task run.",u)}finally{r()}};return[e,(i,r=()=>{})=>t({title:"Delete Task Runs",description:"Are you sure you want to delete selected task runs?",onConfirm:()=>{a(i,r)}})]},Ls=({count:e=0,...t})=>"results"in t&&"setSelectedRows"in t&&"selectedRows"in t?s.jsx(zs,{count:e,...t}):s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[e," ",qe(e,"Task run")]});function zs({count:e=0,results:t=[],setSelectedRows:n,selectedRows:a}){const[o,i]=Is(),r=l.useMemo(()=>t.map(({id:d})=>d),[t]),u=Array.from(a),c=()=>{const d=r.every(h=>a.has(h)),f=r.some(h=>a.has(h));let m=!1;return d?m=!0:f&&(m="indeterminate"),s.jsx(oe,{className:"block",checked:m,onCheckedChange:h=>{n(h?new Set(r):new Set)},"aria-label":"Toggle all"})};return a.size>0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(c,{}),s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[u.length," selected"]}),s.jsx(le,{"aria-label":"Delete rows",size:"icon",variant:"secondary",onClick:()=>{i(u,()=>n(new Set))},children:s.jsx(V,{id:"Trash2",className:"size-4"})})]}),s.jsx(Xe,{...o})]}):s.jsxs("div",{className:"flex items-center gap-2",children:[t&&n&&a&&s.jsx(oe,{className:"block",checked:!1,onCheckedChange:d=>{n(new Set(d?r:void 0))},"aria-label":"Toggle all"}),s.jsxs(re,{variant:"bodySmall",className:"text-muted-foreground",children:[e," ",qe(e,"Task run")]})]})}const Os=e=>{const[t,n]=l.useState(new Set(e)),a=c=>n(d=>new Set(d).add(c)),o=c=>n(d=>{const f=new Set(d);return f.delete(c),f});return[t,n,{addRow:a,removeRow:o,onSelectRow:(c,d)=>{d?a(c):o(c)},clearSet:()=>n(new Set)}]},Je="Custom",Vs="Unsaved";function Hs(e){return e?e.name===Je||e.name===Vs:!0}const Ws=({currentFilter:e,savedFilters:t,onSelect:n,onSave:a,onDelete:o,onSetDefault:i,onRemoveDefault:r,permissions:u={canSave:!0,canDelete:!0}})=>{const[c,d]=l.useState(!1),f=e?.name??Je,m=Hs(e),h=m&&u.canSave,x=e?.id&&u.canDelete,S=!m,y=()=>{e?.id&&(o(e.id),d(!1))},g=()=>{e?.id&&(e.isDefault?r(e.id):i(e.id))};return s.jsxs(s.Fragment,{children:[s.jsxs(ls,{children:[s.jsx(is,{asChild:!0,children:s.jsxs(le,{variant:"outline",className:"gap-2",children:[s.jsx(V,{id:"SlidersVertical",className:"size-4"}),s.jsx("span",{children:f}),s.jsx(V,{id:"ChevronDown",className:"size-4"})]})}),s.jsxs(cs,{align:"start",className:"min-w-[200px]",children:[t.map(p=>s.jsxs(te,{onClick:()=>n(p),className:"flex items-center justify-between",children:[s.jsx("span",{children:p.name}),p.isDefault&&s.jsx(V,{id:"CircleCheck",className:"size-4 text-green-500"})]},p.id??p.name)),(h||x||S)&&s.jsx(us,{}),h&&s.jsxs(te,{onClick:a,children:[s.jsx(V,{id:"Plus",className:"mr-2 size-4"}),"Save current filters"]}),x&&s.jsxs(te,{variant:"destructive",onClick:()=>d(!0),children:[s.jsx(V,{id:"Trash2",className:"mr-2 size-4"}),"Delete"]}),S&&s.jsxs(te,{onClick:g,children:[s.jsx(V,{id:"CircleCheck",className:"mr-2 size-4"}),e?.isDefault?"Remove as default":"Set as default"]})]})]}),s.jsx(Xe,{isOpen:c,title:"Delete saved filter",description:`Are you sure you want to delete "${e?.name}"? This action cannot be undone.`,onConfirm:y,onClose:()=>d(!1)})]})},Bs=({cx:e,cy:t,payload:n})=>{if(e===void 0||t===void 0||!n)return null;const a=ds(n.stateType)||ms[n.stateType]||"#6b7280";return s.jsx("circle",{cx:e,cy:t,r:6,fill:a,stroke:a,strokeWidth:1,opacity:.7,className:"hover:opacity-100 transition-opacity cursor-pointer"})},Us=({active:e,payload:t})=>{const a=t?.[0]?.payload,o=a?.id,{data:i}=E({...xt(o??""),enabled:e&&!!o,staleTime:300*1e3}),{data:r}=E({...wt(i?.flow_id??""),enabled:!!i?.flow_id,staleTime:300*1e3});if(!e||!t||t.length===0||!a)return null;const u=new Date(a.timestamp);return s.jsxs("div",{className:"bg-background border rounded-lg p-3 shadow-lg flex flex-col gap-2 min-w-48",children:[s.jsxs("div",{className:"flex items-center gap-1 text-sm text-muted-foreground",children:[i?.flow_id&&s.jsxs(s.Fragment,{children:[s.jsx(Me,{to:"/flows/flow/$id",params:{id:i.flow_id},className:"font-semibold hover:underline truncate max-w-32",children:r?.name??"..."}),s.jsx(St,{className:"size-3 flex-shrink-0"})]}),s.jsx(Me,{to:"/runs/flow-run/$id",params:{id:a.id},className:"hover:underline truncate max-w-32",children:i?.name??a.id.slice(0,8)})]}),s.jsx("div",{children:s.jsx(vt,{type:a.stateType})}),s.jsx("hr",{className:"border-border"}),s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(yt,{className:"size-4"}),kt(Math.ceil(a.duration*1e3),{largest:2,round:!0})]}),s.jsxs("span",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(Ft,{className:"size-4"}),u.toLocaleString()]})]})]})},Qs=e=>t=>t===0?"0s":e<1?`${Math.round(t*1e3)}ms`:e<10?`${t.toFixed(1)}s`:e<60?`${Math.round(t)}s`:Ss(0,t*1e3,{addSuffix:!1}),$s=(e,t)=>i=>{const r=new Date(i);if(t<1e3||e<1e4){const u=r.getSeconds(),c=r.getMilliseconds();return`${r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}:${u.toString().padStart(2,"0")}.${Math.floor(c/100)}`}return t<6e4||e<10*6e4?r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}):e>=864e5?r.getHours()===0&&r.getMinutes()===0&&r.getSeconds()===0&&r.getMilliseconds()===0?r.toLocaleDateString(void 0,{weekday:"short",day:"numeric"}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"}):r.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})},Ys=({history:e,startDate:t,endDate:n})=>{const a=l.useRef(null),[o,i]=l.useState(0);l.useEffect(()=>{const g=a.current;if(!g)return;const p=new ResizeObserver(w=>{for(const k of w)i(k.contentRect.width)});return p.observe(g),i(g.getBoundingClientRect().width),()=>p.disconnect()},[]);const r=l.useMemo(()=>e.map(g=>({x:new Date(g.timestamp).getTime(),y:g.duration,stateType:g.state_type,id:g.id,duration:g.duration,lateness:g.lateness,timestamp:g.timestamp})),[e]),{xDomain:u,xDomainMin:c,xDomainMax:d}=l.useMemo(()=>{if(t&&n)return{xDomain:[t.getTime(),n.getTime()],xDomainMin:t.getTime(),xDomainMax:n.getTime()};if(r.length===0){const k=Date.now(),b=k-1440*60*1e3;return{xDomain:[b,k],xDomainMin:b,xDomainMax:k}}const g=r.map(k=>k.x),p=Math.min(...g),w=Math.max(...g);return{xDomain:[p,w],xDomainMin:p,xDomainMax:w}},[t,n,r]),f=l.useMemo(()=>r.length===0?60:Math.max(...r.map(g=>g.y)),[r]),m=l.useMemo(()=>{if(r.length<2)return Number.POSITIVE_INFINITY;const g=r.map(w=>w.x).sort((w,k)=>w-k);let p=Number.POSITIVE_INFINITY;for(let w=1;w<g.length;w++){const k=g[w]-g[w-1];k>0&&k<p&&(p=k)}return p},[r]),h=d-c,x=l.useMemo(()=>$s(h,m),[h,m]),S=l.useMemo(()=>Qs(f),[f]),y=l.useMemo(()=>{const w=o-60,k=Math.max(2,Math.ceil(w/100)),b=1440*60*1e3,F=d-c;if(F>=b){const v=[],W=new Date(c),H=new Date(W);H.setHours(24,0,0,0),v.push(c);let P=H.getTime();for(;P<d;)v.push(P),P+=b;const B=v[v.length-1];if(d-B>F/k/2&&v.push(d),v.length<k){const M=[];for(let T=0;T<v.length-1;T++){M.push(v[T]);const I=v[T+1]-v[T],L=Math.max(1,Math.floor(I/(F/k)));if(L>1){const U=I/L;for(let z=1;z<L;z++)M.push(v[T]+U*z)}}return M.push(v[v.length-1]),M}return v}const N=[],A=(d-c)/(k-1);for(let v=0;v<k;v++)N.push(c+A*v);return N},[o,c,d]);return e.length===0?null:s.jsx("div",{ref:a,className:"hidden md:block w-full h-64","data-testid":"scatter-plot",children:s.jsx(fs,{width:"100%",height:"100%",children:s.jsxs(gs,{children:[s.jsx(hs,{type:"number",dataKey:"x",scale:"time",domain:u,ticks:y,tickFormatter:x,tick:{fontSize:12},tickLine:!1,axisLine:{stroke:"#e5e7eb"}}),s.jsx(ps,{type:"number",dataKey:"y",tickFormatter:S,tick:{fontSize:12},tickLine:!1,axisLine:{stroke:"#e5e7eb"},width:60}),s.jsx(xs,{content:s.jsx(Us,{}),cursor:{strokeDasharray:"3 3"},animationDuration:0}),s.jsx(ws,{data:r,shape:s.jsx(Bs,{}),isAnimationActive:!1})]})})})},qs=Ke({name:_().min(1,{message:"Name is required"}).max(100,{message:"Name must be 100 characters or less"})}),Gs=({open:e,onOpenChange:t,onSave:n})=>{const a=Rs({resolver:Cs(qs),defaultValues:{name:""}});l.useEffect(()=>{e&&a.reset({name:""})},[e,a]);const o=i=>{n(i.name),t(!1)};return s.jsx(jt,{open:e,onOpenChange:t,children:s.jsxs(Ct,{children:[s.jsx(Rt,{children:s.jsx(bt,{children:"Save Filter"})}),s.jsx(Tt,{children:"Save your current filter configuration for quick access later."}),s.jsx(Ts,{...a,children:s.jsxs("form",{onSubmit:i=>{a.handleSubmit(o)(i)},className:"space-y-4",children:[s.jsx(Ds,{control:a.control,name:"name",render:({field:i})=>s.jsxs(_s,{children:[s.jsx(Ns,{children:"Filter Name"}),s.jsx(Ms,{children:s.jsx(Dt,{autoComplete:"off",placeholder:"e.g., Failed runs this week",...i})}),s.jsx(Es,{})]})}),s.jsxs(_t,{children:[s.jsx(le,{type:"button",variant:"outline",onClick:()=>t(!1),children:"Cancel"}),s.jsx(le,{type:"submit",children:"Save"})]})]})})]})})},Xs="prefect-ui-v2-saved-filters",Ks="prefect-ui-v2-default-filter-id",Ze="system-past-week",et="system-hide-scheduled";function Js(e){return e===Ze||e===et}const tt=[{id:Ze,name:"Past week",filters:{range:"past-7-days"}},{id:et,name:"Hide scheduled runs",filters:{range:"past-7-days",state:[...Nt]}}],Zs=tt[0];function ea(){return`${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ta(e,t){const n=(a,o)=>{if(a===void 0&&o===void 0)return!0;if(a===void 0||o===void 0||a.length!==o.length)return!1;const i=[...a].sort(),r=[...o].sort();return i.every((u,c)=>u===r[c])};return n(e.state,t.state)&&n(e.flows,t.flows)&&n(e.deployments,t.deployments)&&n(e.workPools,t.workPools)&&n(e.tags,t.tags)&&e.range===t.range&&e.start===t.start&&e.end===t.end}function st(){const[e,t]=ie(Xs,[]),[n,a]=ie(Ks,null),o=l.useMemo(()=>[...tt,...e],[e]),i=l.useCallback(h=>{const x={id:ea(),name:h.name,filters:h.filters};return t(S=>[...S,x]),x},[t]),r=l.useCallback(h=>{t(x=>x.filter(S=>S.id!==h)),a(x=>x===h?null:x)},[t,a]),u=l.useCallback((h,x)=>{t(S=>S.map(y=>y.id===h?{...y,...x.name!==void 0&&{name:x.name},...x.filters!==void 0&&{filters:x.filters}}:y))},[t]),c=l.useCallback(h=>{a(h)},[a]),d=l.useCallback(h=>o.find(x=>x.id===h),[o]),f=l.useCallback(h=>o.find(x=>ta(x.filters,h)),[o]),m=l.useMemo(()=>h=>n===h,[n]);return{savedFilters:o,defaultFilterId:n,saveFilter:i,deleteFilter:r,updateFilter:u,setDefaultFilter:c,getFilterById:d,findMatchingFilter:f,isDefaultFilter:m}}const sa=({tab:e,onTabChange:t,flowRunsCount:n,taskRunsCount:a,hasAnyFlowRuns:o,hasAnyTaskRuns:i,flowRuns:r,flowRunsPages:u,pagination:c,onPaginationChange:d,onPrefetchPage:f,sort:m,onSortChange:h,hideSubflows:x,onHideSubflowsChange:S,flowRunSearch:y,onFlowRunSearchChange:g,selectedStates:p,onStateFilterChange:w,selectedFlows:k,onFlowFilterChange:b,selectedDeployments:F,onDeploymentFilterChange:N,selectedTags:A,onTagsFilterChange:v,selectedWorkPools:W,onWorkPoolFilterChange:H,dateRange:P,onDateRangeChange:B,flowRunHistory:M,scatterPlotDateRange:T,taskRuns:I,taskRunsPages:L,taskRunsPagination:U,onTaskRunsPaginationChange:z,onTaskRunsPrefetchPage:Q,taskRunsSort:de,onTaskRunsSortChange:me,taskRunSearch:fe,onTaskRunSearchChange:ge,onClearTaskRunFilters:he,currentFilter:X,savedFilters:pe,onSelectFilter:xe,onSaveFilter:we,onDeleteFilter:Se,onSetDefault:ve,onRemoveDefault:ke,isSaveDialogOpen:$,onCloseSaveDialog:Y,onConfirmSave:ye})=>{const q=!o&&!i,[K,Fe,{onSelectRow:je}]=os(),[J,Ce,{onSelectRow:C}]=Os(),D=[...new Set(r.map(R=>R.flow_id))],{data:Z}=E(be({flows:{operator:"and_",id:{any_:D}},offset:0,sort:"NAME_ASC"},{enabled:D.length>0})),G=r.map(R=>({...R,flow:Z?.find(Re=>Re.id===R.flow_id)}));return q?s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(He,{}),s.jsx(aa,{})]}):s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(He,{}),s.jsx(Ws,{currentFilter:X,savedFilters:pe,onSelect:xe,onSave:we,onDelete:Se,onSetDefault:ve,onRemoveDefault:ke,permissions:{canSave:!0,canDelete:!Js(X?.id??null)}})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex flex-wrap gap-2 lg:grid lg:grid-flow-col lg:auto-cols-fr",children:[s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Date Range"}),s.jsx(As,{value:P,onValueChange:B})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"States"}),s.jsx(ss,{selectedFilters:p,onSelectFilter:w})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 lg:grid lg:grid-flow-col lg:auto-cols-fr",children:[s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Flows"}),s.jsx(Ps,{selectedFlows:k,onSelectFlows:b})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Deployments"}),s.jsx(Zt,{selectedDeployments:F,onSelectDeployments:N})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Work Pools"}),s.jsx(es,{selectedWorkPools:W,onSelectWorkPools:H})]}),s.jsxs("div",{className:"flex flex-col gap-1 w-full lg:w-auto",children:[s.jsx(O,{className:"text-xs text-muted-foreground",children:"Tags"}),s.jsx(js,{value:Array.from(A),onChange:R=>{const Re=Array.isArray(R)?R:[];v(new Set(Re))},placeholder:"All tags"})]})]})]}),s.jsx(Gs,{open:$,onOpenChange:Y,onSave:ye}),s.jsxs(Mt,{value:e,onValueChange:t,children:[s.jsxs(Et,{children:[s.jsx(Ae,{value:"flow-runs",children:"Flow Runs"}),s.jsx(Ae,{value:"task-runs",children:"Task Runs"})]}),s.jsx(Pe,{value:"flow-runs",children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsx(At,{children:s.jsx(Pt,{children:s.jsx(Ys,{history:M,startDate:T.startDate,endDate:T.endDate})})}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(rs,{count:n,results:G,selectedRows:K,setSelectedRows:Fe}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2 whitespace-nowrap",children:[s.jsx(It,{id:"hide-subflows",checked:x,onCheckedChange:S}),s.jsx(O,{htmlFor:"hide-subflows",children:"Hide subflows"})]}),s.jsx(Ie,{value:y,onChange:R=>g(R.target.value),placeholder:"Search by flow run name","aria-label":"Search by flow run name",className:"w-64",debounceMs:1200}),s.jsx(ts,{value:m,onSelect:h})]})]}),s.jsx(as,{count:n,pages:u,pagination:c,onChangePagination:d,onPrefetchPage:f}),s.jsx(ns,{flowRuns:G,selectedRows:K,onSelect:je})]})}),s.jsx(Pe,{value:"task-runs",children:s.jsxs("div",{className:"flex flex-col gap-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ls,{count:a,results:I,selectedRows:J,setSelectedRows:Ce}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(Ie,{value:fe,onChange:R=>ge(R.target.value),placeholder:"Search by task run name","aria-label":"Search by task run name",className:"w-64",debounceMs:1200}),s.jsx(vs,{value:de,onSelect:me})]})]}),s.jsx(ks,{count:a,pages:L,pagination:U,onChangePagination:z,onPrefetchPage:Q}),s.jsx(ys,{taskRuns:I,selectedRows:J,onSelect:C,onClearFilters:he})]})})]})]})},He=()=>s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Lt,{children:s.jsx(zt,{children:s.jsx(Ot,{className:"text-xl font-semibold",children:"Runs"})})})}),aa=()=>s.jsxs(Vt,{children:[s.jsx(Ht,{id:"Workflow"}),s.jsx(Wt,{children:"Run a task or flow to get started"}),s.jsx(Bt,{children:"Runs store the state history for each execution of a task or flow."}),s.jsx(Ut,{children:s.jsx(Qt,{id:"getting-started"})})]}),ce=$e("/runs/");function na(e){const t=u=>u?u.split(",").filter(c=>c.trim().length>0):[],n=t(e.state),a=t(e.flows),o=t(e.deployments),i=t(e["work-pools"]),r=t(e.tags);return{...n.length>0&&{state:n},...a.length>0&&{flows:a},...o.length>0&&{deployments:o},...i.length>0&&{workPools:i},...r.length>0&&{tags:r},...e.range&&{range:e.range},...e.start&&{start:e.start},...e.end&&{end:e.end}}}function at(e){return{state:e.state?.join(",")??"",flows:e.flows?.join(",")??"",deployments:e.deployments?.join(",")??"","work-pools":e.workPools?.join(",")??"",tags:e.tags?.join(",")??"",range:e.range,start:e.start,end:e.end}}function We(e,t){return{id:e.id,name:e.name,isDefault:e.id===t}}function oa(){const e=ce.useSearch(),t=ce.useNavigate(),{savedFilters:n,defaultFilterId:a,saveFilter:o,deleteFilter:i,setDefaultFilter:r,findMatchingFilter:u}=st(),[c,d]=l.useState(!1),f=l.useMemo(()=>na(e),[e]),m=l.useMemo(()=>u(f),[u,f]),h=l.useMemo(()=>n.map(F=>We(F,a)),[n,a]),x=l.useMemo(()=>m?We(m,a):f.state?.length||f.flows?.length||f.deployments?.length||f.workPools?.length||f.tags?.length||f.range||f.start||f.end?{id:null,name:"Unsaved",isDefault:!1}:{id:null,name:"Custom",isDefault:!1},[m,a,f]),S=l.useCallback(F=>{const N=n.find(v=>v.id===F.id);if(!N)return;const A=at(N.filters);t({to:".",search:v=>({...v,...A,page:1}),replace:!0})},[t,n]),y=l.useCallback(()=>{d(!0)},[]),g=l.useCallback(F=>{o({name:F,filters:f}),d(!1)},[o,f]),p=l.useCallback(()=>{d(!1)},[]),w=l.useCallback(F=>{i(F)},[i]),k=l.useCallback(F=>{r(F)},[r]),b=l.useCallback(()=>{r(null)},[r]);return{currentFilter:x,savedFiltersForMenu:h,onSelectFilter:S,onSaveFilter:y,onDeleteFilter:w,onSetDefault:k,onRemoveDefault:b,isSaveDialogOpen:c,closeSaveDialog:p,confirmSave:g}}function ra(){const e=ce.useNavigate(),t=ce.useSearch(),{defaultFilterId:n,getFilterById:a}=st(),o=l.useRef(!1),i=l.useMemo(()=>!!(t.state||t.flows||t.deployments||t["work-pools"]||t.tags||t.range||t.start||t.end),[t]);l.useEffect(()=>{if(o.current||i)return;let r;n&&(r=a(n)),r||(r=Zs),o.current=!0;const u=at(r.filters);e({to:".",search:c=>({...c,...u,page:1}),replace:!0})},[n,i,a,e])}const Be=$e("/runs/"),la=e=>e?e.split(",").filter(t=>Ge.includes(t)):[],ne=e=>e?e.split(",").filter(t=>t.trim().length>0):[];function ia(){const e=Be.useSearch(),t=Be.useNavigate(),n=l.useMemo(()=>new Set(la(e.state??"")),[e.state]),a=l.useMemo(()=>new Set(ne(e.flows??"")),[e.flows]),o=l.useMemo(()=>new Set(ne(e.deployments??"")),[e.deployments]),i=l.useMemo(()=>new Set(ne(e["work-pools"]??"")),[e["work-pools"]]),r=l.useMemo(()=>new Set(ne(e.tags??"")),[e.tags]),u=l.useMemo(()=>({range:e.range,start:e.start,end:e.end}),[e.range,e.start,e.end]),c=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,state:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),d=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,flows:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),f=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,deployments:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),m=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,"work-pools":p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),h=l.useCallback(g=>{const p=Array.from(g);t({to:".",search:w=>({...w,tags:p.length>0?p.join(","):"",page:1}),replace:!0})},[t]),x=l.useCallback(g=>{t({to:".",search:p=>({...p,range:g.range,start:g.start,end:g.end,page:1}),replace:!0})},[t]),S=l.useMemo(()=>n.size>0||a.size>0||o.size>0||i.size>0||r.size>0||u.range!==void 0||u.start!==void 0||u.end!==void 0,[n,a,o,i,r,u]),y=l.useCallback(()=>{t({to:".",search:g=>({...g,state:"",flows:"",deployments:"","work-pools":"",tags:"",range:void 0,start:void 0,end:void 0,page:1}),replace:!0})},[t]);return{states:n,flows:a,deployments:o,workPools:i,tags:r,dateRange:u,onStatesChange:c,onFlowsChange:d,onDeploymentsChange:f,onWorkPoolsChange:m,onTagsChange:h,onDateRangeChange:x,clearAllFilters:y,hasActiveFilters:S}}Ke({tab:se(["flow-runs","task-runs"]).optional().default("flow-runs"),page:ae().int().positive().optional().default(1).catch(1),limit:ae().int().positive().optional().catch(void 0),sort:se(Jt).optional().default("START_TIME_DESC"),"hide-subflows":bs().optional().default(!1),"flow-run-search":_().optional().default(""),state:_().optional().default(""),flows:_().optional().default(""),deployments:_().optional().default(""),"work-pools":_().optional().default(""),tags:_().optional().default(""),range:se(Kt).optional(),start:_().optional(),end:_().optional(),"task-runs-page":ae().int().positive().optional().default(1).catch(1),"task-runs-limit":ae().int().positive().optional().catch(void 0),"task-runs-sort":se(Xt).optional().default("EXPECTED_START_TIME_DESC"),"task-run-search":_().optional().default("")});const Te=e=>e?e.split(",").filter(t=>Ge.includes(t)):[],ue=e=>{if(!e)return;const t={range:e.range,start:e.start,end:e.end},n=Ye(t);if(!n)return;const a=Gt(n);if(a)return{after_:a.startDate.toISOString(),before_:a.endDate.toISOString()}},De=e=>e?e.split(",").filter(t=>t.trim().length>0):[],_e=e=>e?e.split(",").filter(t=>t.trim().length>0):[],nt=e=>e?e.split(",").filter(t=>t.trim().length>0):[],Ne=e=>e?e.split(",").filter(t=>t.trim().length>0):[],Ue=e=>{const t=e?.["hide-subflows"],n=e?.["flow-run-search"],a=Te(e?.state??""),o=De(e?.flows??""),i=_e(e?.deployments??""),r=nt(e?.["work-pools"]??""),u=Ne(e?.tags??""),c=ue(e),d=a.length>0?a:void 0,f=o.length>0?o:void 0,m=i.length>0?i:void 0,h=r.length>0?r:void 0,S=t||n||d||f||m||u.length>0||c?{operator:"and_",...t&&{parent_task_run_id:{operator:"and_",is_null_:!0}},...n&&{name:{like_:n}},...d&&{state:{operator:"and_",name:{any_:d}}},...u.length>0&&{tags:{operator:"and_",any_:u}},...c&&{expected_start_time:c}}:void 0,y=f?{operator:"and_",id:{any_:f}}:void 0,g=m?{operator:"and_",id:{any_:m}}:void 0,p=h?{operator:"and_",name:{any_:h}}:void 0;return{page:e?.page??1,limit:e?.limit??100,sort:e?.sort??"START_TIME_DESC",flow_runs:S,flows:y,deployments:g,work_pools:p}},Qe=e=>{const t=e?.["task-run-search"],n=Te(e?.state??""),a=De(e?.flows??""),o=_e(e?.deployments??""),i=Ne(e?.tags??""),r=ue(e),u=t?{operator:"and_",name:{like_:t}}:void 0,c=n.length>0?n:void 0,f=c||i.length>0||r?{operator:"and_",...c&&{state:{operator:"and_",name:{any_:c}}},...i.length>0&&{tags:{operator:"and_",any_:i}},...r&&{expected_start_time:r}}:void 0,m=a.length>0?a:void 0,h=m?{operator:"and_",id:{any_:m}}:void 0,x=o.length>0?o:void 0,S=x?{operator:"and_",id:{any_:x}}:void 0;return{page:e?.["task-runs-page"]??1,limit:e?.["task-runs-limit"]??100,sort:e?.["task-runs-sort"]??"EXPECTED_START_TIME_DESC",task_runs:u,flow_runs:f,flows:h,deployments:S}},ca=e=>{const t=e?.["hide-subflows"],n=Te(e?.state??""),a=De(e?.flows??""),o=_e(e?.deployments??""),i=nt(e?.["work-pools"]??""),r=Ne(e?.tags??""),u=ue(e),c=n.length>0?n:void 0,d=a.length>0?a:void 0,f=o.length>0?o:void 0,m=i.length>0?i:void 0;return{sort:"EXPECTED_START_TIME_DESC",limit:1e3,offset:0,flow_runs:t||c||r.length>0||u?{operator:"and_",...t&&{parent_task_run_id:{operator:"and_",is_null_:!0}},...c&&{state:{operator:"and_",name:{any_:c}}},...r.length>0&&{tags:{operator:"and_",any_:r}},...u&&{expected_start_time:u}}:void 0,flows:d?{operator:"and_",id:{any_:d}}:void 0,deployments:f?{operator:"and_",id:{any_:f}}:void 0,work_pools:m?{operator:"and_",name:{any_:m}}:void 0}},ua=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useMemo(()=>({page:e.page??1,limit:e.limit??100}),[e.page,e.limit]),a=l.useCallback(o=>{t({to:".",search:i=>({...i,page:o.page,limit:o.limit}),replace:!0})},[t]);return[n,a]},da=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,sort:a,page:1}),replace:!0})},[t]);return[e.sort,n]},ma=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"hide-subflows":a,page:1}),replace:!0})},[t]);return[e["hide-subflows"],n]},fa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,tab:a,page:1}),replace:!0})},[t]);return[e.tab,n]},ga=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"flow-run-search":a,page:1}),replace:!0})},[t]);return[e["flow-run-search"],n]},ha=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useMemo(()=>({page:e["task-runs-page"]??1,limit:e["task-runs-limit"]??100}),[e["task-runs-page"],e["task-runs-limit"]]),a=l.useCallback(o=>{t({to:".",search:i=>({...i,"task-runs-page":o.page,"task-runs-limit":o.limit}),replace:!0})},[t]);return[n,a]},pa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"task-runs-sort":a,"task-runs-page":1}),replace:!0})},[t]);return[e["task-runs-sort"],n]},xa=()=>{const e=j.useSearch(),t=j.useNavigate(),n=l.useCallback(a=>{t({to:".",search:o=>({...o,"task-run-search":a,"task-runs-page":1}),replace:!0})},[t]);return[e["task-run-search"],n]};function La(){const e=ot(),t=j.useSearch(),n=j.useNavigate(),[a,o]=ie("workspace-flow-runs-list-limit",100),[i,r]=ie("workspace-task-runs-list-limit",100),u=l.useRef(!1);l.useEffect(()=>{if(u.current)return;u.current=!0;const C=t.limit===void 0,D=t["task-runs-limit"]===void 0;(C||D)&&n({to:".",search:Z=>({...Z,...C&&{limit:a},...D&&{"task-runs-limit":i}}),replace:!0})},[n,t.limit,t["task-runs-limit"],a,i]),l.useEffect(()=>{t.limit!==void 0&&t.limit!==a&&o(t.limit)},[t.limit,a,o]),l.useEffect(()=>{t["task-runs-limit"]!==void 0&&t["task-runs-limit"]!==i&&r(t["task-runs-limit"])},[t["task-runs-limit"],i,r]);const[c,d]=ua(),[f,m]=da(),[h,x]=ma(),[S,y]=fa(),[g,p]=ga(),{states:w,flows:k,deployments:b,workPools:F,tags:N,dateRange:A,onStatesChange:v,onFlowsChange:W,onDeploymentsChange:H,onWorkPoolsChange:P,onTagsChange:B,onDateRangeChange:M}=ia(),[T,I]=ha(),[L,U]=pa(),[z,Q]=xa(),{currentFilter:de,savedFiltersForMenu:me,onSelectFilter:fe,onSaveFilter:ge,onDeleteFilter:he,onSetDefault:X,onRemoveDefault:pe,isSaveDialogOpen:xe,closeSaveDialog:we,confirmSave:Se}=oa();ra();const[{data:ve},{data:ke}]=rt({queries:[$t(),Yt()]}),{data:$}=E(Le(Ue(t),3e4)),{data:Y}=E(ze(Qe(t),3e4)),{data:ye}=E(qt(ca(t),3e4)),q=$?.results??[],K=Y?.results??[],Fe=l.useMemo(()=>{const C=ue(t);return{startDate:C?.after_?new Date(C.after_):void 0,endDate:C?.before_?new Date(C.before_):void 0}},[t]);l.useEffect(()=>{const C=q.map(D=>D.id);C.length>0&&e.prefetchQuery(Oe(C))},[e,q]);const je=l.useCallback(C=>{const D=Ue({...t,page:C});(async()=>{const G=(await e.ensureQueryData(Le(D,3e4)))?.results?.map(R=>R.id)??[];G.length>0&&e.prefetchQuery(Oe(G))})()},[e,t]),J=l.useCallback(C=>{const D=Qe({...t,"task-runs-page":C});e.prefetchQuery(ze(D,3e4))},[e,t]),Ce=l.useCallback(()=>{Q("")},[Q]);return s.jsx(sa,{tab:S,onTabChange:y,flowRunsCount:$?.count??0,taskRunsCount:Y?.count??0,hasAnyFlowRuns:(ve??0)>0,hasAnyTaskRuns:(ke??0)>0,flowRuns:q,flowRunsPages:$?.pages??0,pagination:c,onPaginationChange:d,onPrefetchPage:je,sort:f,onSortChange:m,hideSubflows:h,onHideSubflowsChange:x,flowRunSearch:g,onFlowRunSearchChange:p,selectedStates:w,onStateFilterChange:v,selectedFlows:k,onFlowFilterChange:W,selectedDeployments:b,onDeploymentFilterChange:H,selectedTags:N,onTagsFilterChange:B,selectedWorkPools:F,onWorkPoolFilterChange:P,dateRange:A,onDateRangeChange:M,flowRunHistory:ye??[],scatterPlotDateRange:Fe,taskRuns:K,taskRunsPages:Y?.pages??0,taskRunsPagination:T,onTaskRunsPaginationChange:I,onTaskRunsPrefetchPage:J,taskRunsSort:L,onTaskRunsSortChange:U,taskRunSearch:z,onTaskRunSearchChange:Q,onClearTaskRunFilters:Ce,currentFilter:de,savedFilters:me,onSelectFilter:fe,onSaveFilter:ge,onDeleteFilter:he,onSetDefault:X,onRemoveDefault:pe,isSaveDialogOpen:xe,onCloseSaveDialog:we,onConfirmSave:Se})}export{La as component};
|
|
2
|
+
//# sourceMappingURL=index-CzZJA-g2.js.map
|