dirigent-server 0.23.0__tar.gz → 0.23.1__tar.gz
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.
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/PKG-INFO +5 -5
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/pyproject.toml +5 -5
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/pyproject.toml.orig +5 -5
- dirigent_server-0.23.0/src/dirigent_server/static/assets/AdminOnly-CdJ1ded0.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/AdminOnly-CtBdW1t6.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Alerting-B5sI7bkS.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Alerting-U5C7hMo0.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Blocks-Bv1m2JIH.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Blocks-4B1Q93XA.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Breadcrumb-w3EMx9zM.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Breadcrumb-CVC1xwHQ.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/ConnectionFields-HTVyzXLM.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/ConnectionFields-DzzkA2pf.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Connections-Cy5CmtxJ.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Connections-DWRa690e.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Dashboard-DQpEKL7c.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Dashboard-BWyP6o7B.js +1 -1
- dirigent_server-0.23.1/src/dirigent_server/static/assets/Disclosure-C-OLxsgl.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/ExamplePanel-Bk9Am0Hf.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/ExamplePanel-DieWamsW.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Examples-D_j1Eck8.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Examples-CpPCbV7p.js +2 -2
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Instant-CihfxyJ1.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Instant-Ogv9qDZy.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/JsonBlock-BRHbezyM.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/JsonBlock-BKULShrN.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/ListTable-A_dkU0ci.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/ListTable-BOX3h68A.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Overview-BD118wP-.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Overview-DmM4YF5-.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PageState-CuZbHz6s.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/PageState-859W4wWp.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Panel-COl_eBj1.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Panel-Hp0TZRIS.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Picker-BUMFpPCz.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Picker-DLXu0hr0.js +1 -1
- dirigent_server-0.23.1/src/dirigent_server/static/assets/PipelineEditor-Dz47LDQ5.js +2 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineGraph-BZhB7E7N.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/PipelineGraph-DOtuXlH5.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelinePreview-C4b75dOj.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/PipelinePreview-BJPDPmw8.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineTab-CICtEZUo.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/PipelineTab-BhkGRhQI.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/ProgramReference-BEfxZwxT.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/ProgramReference-XGlt7u1Z.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Refusal-3GHMZOnu.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Refusal-Bjzfpcdg.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/RunDetail-nkC4jwxI.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/RunDetail-mGvEAbYi.js +3 -3
- dirigent_server-0.23.0/src/dirigent_server/static/assets/RunGraph-B-FMnqWE.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/RunGraph-Cu99JbeG.js +1 -1
- dirigent_server-0.23.1/src/dirigent_server/static/assets/SchemaForm-BOKQeNtm.js +1 -0
- dirigent_server-0.23.1/src/dirigent_server/static/assets/Schemas-uBRBZ6dO.js +10 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/SettingsDialog-CdQvlI8u.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/SettingsDialog-F3fWtNnY.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/StarterPicker-Bsc3wsmp.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/StarterPicker-DMA1HEjN.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/StepPorts-CBb-ntoM.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/StepPorts-DJ0RHzZF.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/TileCard-g50S83Uu.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/TileCard-a84qFXIR.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Triggers-C23ermTW.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Triggers-DXeO5KFL.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Users-BKibVm5A.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Users-D7_Kq_mR.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/WindowedPane-B5QHXRJT.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/WindowedPane-CptewOG5.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Workers-CDXpyuHv.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/Workers-AgeAsFA2.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/WorkersTable-LugQKhcG.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/WorkersTable-Cy2hzFSC.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/api-B9HrzKUX.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/api-jh39Ky4Q.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/auth-QgZsjd0d.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/auth-Bdybp9f_.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/badge-CzFHv2r3.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/badge-Eu1xPQ-u.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/blocks-DCUqC697.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/blocks-B8eZqUob.js +1 -1
- dirigent_server-0.23.1/src/dirigent_server/static/assets/chevron-down-P-YdU4_3.js +1 -0
- dirigent_server-0.23.0/src/dirigent_server/static/assets/connections-ENTr1Nsd.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/connections-DobzdyIe.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/copy-BXKuMpY5.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/copy-CwsIH1zY.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/dropdown-menu-BHh5eZwx.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/dropdown-menu-fVWTjkXO.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/examples-NA2YGKLT.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/examples-BP1UpQbc.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/file-braces-CTPaWRnZ.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/file-braces-D0GrrmLo.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/format-D2kQLRJs.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/format-DK4FnJoS.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/glyphs-CaFpiNjJ.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/glyphs-DLSRr36C.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/index-DcrUT8O1.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/index-Bk7mn1Ys.js +3 -3
- dirigent_server-0.23.0/src/dirigent_server/static/assets/input-sbz1EN8t.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/input-DjAM-vmX.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/labels-Dp8H1wzG.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/labels-DPg21HPJ.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/nav-kCAjFkWN.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/nav-Dr9UOjZp.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/paging-C4feZMNQ.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/paging-B8nfgCnQ.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/pipelines-Da2DZJX0.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/pipelines-CFguQTLF.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/play-BEK7f0g4.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/play-lh-2vSaT.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/resolveAriaLabelledBy-oo0FwAnY.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/resolveAriaLabelledBy-gVlixxhm.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/schemas-BJXljAsa.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/schemas-DcjLLg6l.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/status-PejJT5B-.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/status-Didq7MpX.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/tooltip-Bas36yZU.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/tooltip-CrzRgh7Y.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/triggers-DD6LKQNg.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/triggers-DM2qTKEm.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/users-CgBtM5Vf.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/users-Cu33sW4_.js +1 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/workers-D21cApnc.js → dirigent_server-0.23.1/src/dirigent_server/static/assets/workers-DzwKP3Ua.js +1 -1
- dirigent_server-0.23.1/src/dirigent_server/static/assets/x-CfN8vp59.js +1 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/index.html +19 -19
- dirigent_server-0.23.0/src/dirigent_server/static/assets/PipelineEditor-B3ym720q.js +0 -2
- dirigent_server-0.23.0/src/dirigent_server/static/assets/SchemaForm-ByfDLufz.js +0 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/Schemas-PtKVK80Z.js +0 -10
- dirigent_server-0.23.0/src/dirigent_server/static/assets/chevron-down-CxU_G9N3.js +0 -1
- dirigent_server-0.23.0/src/dirigent_server/static/assets/x-C07Lrlf8.js +0 -1
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/LICENSE +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/README.md +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/THIRD_PARTY_NOTICES.md +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/__init__.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/app.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/dependencies.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/errors.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/health.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/logging.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/messages.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/pagination.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/py.typed +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/__init__.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/alerts.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/auth.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/blocks.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/connections.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/examples.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/hooks.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/labels.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/pipelines.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/playground.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/runs.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/schema.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/schemas.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/system.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/trigger_documents.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/triggers.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/users.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/routes/workers.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/security.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/.gitkeep +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/CodeEditor-C4OnjBMt.css +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/CodeEditor-DsxK1EAQ.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/Description-C-byz7P3.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/KindChip-CwU_Xxdy.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/Mark-DQR2php6.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/Markdown-D4x5xD_I.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/Segmented-KaDiGiyr.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/chunk-OB3PAWPO-m4Sckj1b.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/codicon-DCmgc-ay.ttf +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/dist-CvOdB3Md.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/docs-CCoB3shg.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/editor.worker-CIvRzd4O.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/elk-engine-Bm7I_NRI.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/elk-worker.min-DfmSo98M.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-ext-wght-normal-d45eAU9y.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-cyrillic-wght-normal-BAAhND-U.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-greek-wght-normal-CmyJS8uq.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/ibm-plex-sans-vietnamese-wght-normal-Dg1JeJN0.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/identity-BNZxCf_y.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/idle-DnO3aHK7.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/index-DZ7D7u3R.css +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-400-normal-BEIGL1Tu.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-400-normal-ugxPyKxw.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-500-normal-DJqRU3vO.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-500-normal-DmUKJPL_.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-600-normal-8K4wrrwR.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-cyrillic-600-normal-EVf6-Yzo.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-400-normal-B9oWc5Lo.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-400-normal-C190GLew.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-500-normal-D7SFKleX.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-500-normal-JpySY46c.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-600-normal-H7WoG9Et.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-greek-600-normal-mc2nkWzM.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-400-normal-6-qcROiO.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-400-normal-V6pRDFza.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-500-normal-BWZEU5yA.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-500-normal-CJOVTJB7.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-600-normal-BfsvjouI.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-600-normal-C8RAYTDA.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-400-normal-Bc8Ftmh3.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-400-normal-fXTG6kC5.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-500-normal-Cut-4mMH.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-500-normal-ckzbgY84.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-600-normal-BfB_LPfz.woff2 +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-latin-ext-600-normal-DObL3zCW.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-400-normal-CqNFfHCs.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-500-normal-DNRqzVM1.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jetbrains-mono-vietnamese-600-normal-OWROknRo.woff +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/json.worker-fczZDBja.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/jsonMode-DzxZa00C.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/panels-D1Fnei43.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/preferences-SNZNX5Se.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/preload-helper-BZ1Pz5am.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/rolldown-runtime-Dd_uD5pT.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/shell-CC2rA5mh.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/sql-NEE52Syq.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/starters-DexsdOaG.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/store-D-5yFBN1.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/textarea-D86x5ut1.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/twig-De2hgUGE.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/use-heartbeat-C3WWagro.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/use-store-CZcp6jmY.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/utils-CT7ZGLfR.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/yaml-D-Hjyunz.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/assets/yaml.worker-B2SaT_wA.js +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/favicon-32.png +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/static/logo.png +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/transactions.py +0 -0
- {dirigent_server-0.23.0 → dirigent_server-0.23.1}/src/dirigent_server/ui.py +0 -0
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dirigent-server
|
|
3
|
-
Version: 0.23.
|
|
3
|
+
Version: 0.23.1
|
|
4
4
|
Summary: Dirigent FastAPI server: the REST API, its authentication, and the health probes.
|
|
5
5
|
License-Expression: LicenseRef-Proprietary
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
License-File: THIRD_PARTY_NOTICES.md
|
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
-
Requires-Dist: dirigent-client==0.23.
|
|
11
|
-
Requires-Dist: dirigent-common==0.23.
|
|
12
|
-
Requires-Dist: dirigent-core==0.23.
|
|
13
|
-
Requires-Dist: dirigent-examples==0.23.
|
|
10
|
+
Requires-Dist: dirigent-client==0.23.1
|
|
11
|
+
Requires-Dist: dirigent-common==0.23.1
|
|
12
|
+
Requires-Dist: dirigent-core==0.23.1
|
|
13
|
+
Requires-Dist: dirigent-examples==0.23.1
|
|
14
14
|
Requires-Dist: fastapi>=0.141.1
|
|
15
15
|
Requires-Python: >=3.13
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.23.
|
|
3
|
+
version = "0.23.1"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -14,10 +14,10 @@ classifiers = [
|
|
|
14
14
|
"Programming Language :: Python :: 3.13",
|
|
15
15
|
]
|
|
16
16
|
dependencies = [
|
|
17
|
-
"dirigent-client==0.23.
|
|
18
|
-
"dirigent-common==0.23.
|
|
19
|
-
"dirigent-core==0.23.
|
|
20
|
-
"dirigent-examples==0.23.
|
|
17
|
+
"dirigent-client==0.23.1",
|
|
18
|
+
"dirigent-common==0.23.1",
|
|
19
|
+
"dirigent-core==0.23.1",
|
|
20
|
+
"dirigent-examples==0.23.1",
|
|
21
21
|
"fastapi>=0.141.1",
|
|
22
22
|
]
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dirigent-server"
|
|
3
|
-
version = "0.23.
|
|
3
|
+
version = "0.23.1"
|
|
4
4
|
description = "Dirigent FastAPI server: the REST API, its authentication, and the health probes."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.13"
|
|
@@ -11,10 +11,10 @@ classifiers = [
|
|
|
11
11
|
"Programming Language :: Python :: 3.13",
|
|
12
12
|
]
|
|
13
13
|
dependencies = [
|
|
14
|
-
"dirigent-client==0.23.
|
|
15
|
-
"dirigent-common==0.23.
|
|
16
|
-
"dirigent-core==0.23.
|
|
17
|
-
"dirigent-examples==0.23.
|
|
14
|
+
"dirigent-client==0.23.1",
|
|
15
|
+
"dirigent-common==0.23.1",
|
|
16
|
+
"dirigent-core==0.23.1",
|
|
17
|
+
"dirigent-examples==0.23.1",
|
|
18
18
|
"fastapi>=0.141.1",
|
|
19
19
|
]
|
|
20
20
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./labels-
|
|
1
|
+
import{t as e}from"./labels-DPg21HPJ.js";import{n as t}from"./PageState-859W4wWp.js";import{r as n}from"./utils-CT7ZGLfR.js";import{t as r}from"./use-store-CZcp6jmY.js";import{n as i,t as a}from"./auth-Bdybp9f_.js";var o=n(),s={status:403,title:e.refusal.admin_only,code:`server.forbidden`,params:{},detail:e.refusal.shut,problems:[],instance:null};function c({children:e}){let n=r(a);return i(n)?(0,o.jsx)(o.Fragment,{children:e}):(0,o.jsx)(t,{loading:!1,problem:s,empty:!1,children:null})}export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,n as r,t as i}from"./labels-Dp8H1wzG.js";import{n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{i as o,r as s}from"./api-B9HrzKUX.js";import{N as c}from"./dropdown-menu-BHh5eZwx.js";import{r as l}from"./glyphs-CaFpiNjJ.js";import{l as u,n as d,t as f,u as p}from"./PageState-CuZbHz6s.js";import{i as m,t as h}from"./ListTable-A_dkU0ci.js";import{t as g}from"./WindowedPane-B5QHXRJT.js";import{r as _,t as v}from"./utils-CT7ZGLfR.js";import{i as y,n as b,t as x}from"./tooltip-Bas36yZU.js";import{d as S,h as C}from"./paging-C4feZMNQ.js";import{t as w}from"./input-sbz1EN8t.js";import{a as ee,o as T,r as te}from"./panels-D1Fnei43.js";import{l as E}from"./format-D2kQLRJs.js";import{t as D}from"./identity-BNZxCf_y.js";import{r as O,t as k,u as A}from"./pipelines-Da2DZJX0.js";import{A as j,At as ne,E as M,Ft as re,It as N,Lt as P,Mt as ie,Nt as F,Pt as ae,S as oe,b as I,ct as L,ft as R,gt as z,it as se,jt as ce,rt as le,v as ue,x as B}from"./index-DcrUT8O1.js";import{t as de}from"./Description-C-byz7P3.js";import{c as fe,f as pe,n as me,o as he}from"./connections-ENTr1Nsd.js";import{n as V,t as H}from"./Refusal-3GHMZOnu.js";import{t as U}from"./Instant-CihfxyJ1.js";import{t as W}from"./Segmented-KaDiGiyr.js";import{t as G}from"./Mark-DQR2php6.js";import{t as ge}from"./ProgramReference-BEfxZwxT.js";import{t as _e}from"./Picker-BUMFpPCz.js";import{t as ve}from"./AdminOnly-CdJ1ded0.js";var ye={name:`bell-plus`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M15 8h6`,key:`8ybuxh`}],[`path`,{d:`M18 5v6`,key:`g5ayrv`}],[`path`,{d:`M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332`,key:`1abcvy`}]]};ye.node;var be=n(ye),xe={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};xe.node;var Se=n(xe),K=e(t(),1),Ce=[`run_failed`,`run_completed_with_errors`,`run_succeeded`,`run_stuck`],we=[`pending`,`sending`,`sent`,`failed`],Te=`0s`;function Ee(e){return e===Te?i.word.none:e}function De(e){return e.scope===`pipeline`&&e.pipeline!==null?e.pipeline:i.alerting.every_pipeline}function Oe(e){return e===null?null:i.alerting.importance_floor(e)}function ke(e){return e.active&&!e.paused}function Ae(e){return e===`sent`||e===`failed`}function je(e,t=50){let n=new URLSearchParams({limit:String(t)});return e!==null&&n.set(`after`,e),`/alert-rules?${n.toString()}`}function Me(e){return s(je(e))}function Ne(e){return o(`/alert-rules`,`POST`,e)}function Pe(e,t){return o(`/alert-rules/${encodeURIComponent(e)}`,`PATCH`,t)}function Fe(e,t){return Pe(e,{paused:t})}function Ie(e){return s(`/alert-rules/${encodeURIComponent(e)}`,{method:`DELETE`})}var Le={status:``,notifier:``};function Re(e){return e.status!==``||e.notifier!==``}function ze(e,t,n=50){let r=new URLSearchParams({limit:String(n)});return e.status!==``&&r.set(`status`,e.status),e.notifier!==``&&r.set(`notifier`,e.notifier),t!==null&&r.set(`after`,t),`/notifications?${r.toString()}`}function Be(e,t){return s(ze(e,t))}function Ve(e){return s(`/notifications/${encodeURIComponent(e)}`)}function He(e){return o(`/notifications/${encodeURIComponent(e)}/$retry`,`POST`,{})}function Ue(e){return o(`/alert-rules/$test`,`POST`,e)}async function We(){return(await s(`/blocks`)).notifiers.map(e=>e.id)}function Ge(e,t){let n=[];for(let r of e){if(r===`log`){n.push({id:r,notifier:r,connection:null,reachable:!0,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}let e=t.filter(e=>e.kind===r);if(e.length===0){n.push({id:r,notifier:r,connection:null,reachable:!1,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}for(let t of e)n.push({id:`${r}:${t.code}`,notifier:r,connection:t.code,reachable:!0,last_check_at:t.last_check_at,last_check_healthy:t.last_check_healthy,last_check_detail:t.last_check_detail})}return Ye(n)}function Ke(e){return e.connection??e.notifier}function qe(e){return e.connection===null?e.notifier===`log`?null:fe(e.notifier):me(e.connection)}function q(e){if(e.notifier===`log`)return{tone:`good`,label:i.alerting.channel.ready,detail:null};if(!e.reachable)return{tone:`quiet`,label:i.alerting.channel.not_set_up,detail:null};let t=he(e);return{tone:t.tone??`quiet`,label:t.label,detail:t.detail}}var Je={good:0,critical:1,quiet:2};function Ye(e){return e.toSorted((e,t)=>{let n=Je[q(e).tone]-Je[q(t).tone];if(n!==0)return n;let r=e.notifier.localeCompare(t.notifier);return r===0?(e.connection??``).localeCompare(t.connection??``):r})}var Xe=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u,Ze=/^(?:\d+(?:ms|s|m|h|d|w))+$/u,Qe=i.alerting.subject_references,$e=i.alerting.subject_hint(Qe),et=i.alerting.body_hint,J=`text/x-jinja`;function Y(e){let t=e.trim();return t===``?null:t}var tt=[{value:`global`,label:i.alerting.scope.global},{value:`pipeline`,label:i.alerting.scope.pipeline}],nt=[{value:``,label:i.alerting.importance_any},...k.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))];function rt(e){return e===``?null:e}function it(e){return e===``?null:e}var at=i.alerting.log_target;function ot(e,t){let n=t.filter(t=>t.kind!==`log`&&e.includes(t.kind)).map(e=>({row:e,heading:D(e)})).toSorted((e,t)=>e.row.kind.localeCompare(t.row.kind)||e.heading.title.localeCompare(t.heading.title));return[{value:``,label:at,aside:``,mark:l(`log`)},...n.map(({row:e,heading:t})=>({value:e.code,label:`${t.title} · ${e.kind}`,aside:t.code??``,mark:l(e.kind)}))]}function st(e){if(e.code.trim()===``)return i.alerting.unready.code_missing;if(!Xe.test(e.code.trim()))return i.alerting.unready.code_shape;if(e.scope===`pipeline`&&e.pipeline===``)return i.alerting.unready.pipeline_missing;if(!Ze.test(e.throttle.trim()))return i.alerting.unready.throttle_shape}var X=_();function ct({rule:e,onChanged:t,onDeleted:n,onTest:r}){let[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=s===e.code,d=B(),f=Oe(e.importance),p=(0,K.useCallback)(e=>Be(Le,e),[]),{state:m}=I(p,dt),h=m.rows.filter(t=>t.rule===e.code);return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(gt,{thing:e,children:[e.paused&&(0,X.jsx)(ht,{children:i.state.armed.paused}),!e.active&&(0,X.jsx)(ht,{children:i.state.armed.off})]}),(0,X.jsx)(de,{text:e.description}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.scope,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[De(e),f!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f})]})}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.throttle,children:Ee(e.throttle)}),l?(0,X.jsx)(lt,{rule:e,onDone:()=>{c(null)},onSaved:e=>{t(e),c(null)}},e.code):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.subject,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[e.template===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.none}):(0,X.jsx)(`span`,{className:`font-mono text-xs break-all`,children:e.template}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`ghost`,size:`xs`,disabled:!d.may,title:d.why,onClick:()=>{c(e.code)},children:i.action.edit})})]})}),e.body!==null&&(0,X.jsx)(Z,{label:i.word.body,children:(0,X.jsx)(`span`,{className:`line-clamp-3 font-mono text-xs break-words whitespace-pre-wrap`,children:e.body})})]}),(0,X.jsx)(Z,{label:i.alerting.last_sent,children:e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{at:e.last_sent_at})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Fe(e.code,!e.paused).then(t,V).finally(()=>{o(!1)})},children:e.paused?i.action.resume:i.action.pause})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:!d.may,title:d.why,onClick:r,children:i.action.send_test})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,className:`destructive-action ml-auto`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Ie(e.code).then(n,V).finally(()=>{o(!1)})},children:i.action.delete.verb})})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.recent_deliveries}),!m.read&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.shell.reading}),m.read&&h.length===0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.deliveries_empty}),(0,X.jsx)(`ul`,{className:`divide-y divide-border`,children:h.map(e=>(0,X.jsxs)(`li`,{className:`row-hover -mx-4 flex items-center gap-2 px-4 py-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:e.subject}),(0,X.jsx)(U,{className:`shrink-0 text-xs text-faint`,at:e.created_at})]},e.id))})]})]})}function lt({rule:e,onDone:t,onSaved:n}){let[r,a]=(0,K.useState)(e.template??``),[o,s]=(0,K.useState)(e.body??``),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),f=`alert-rule/${e.code}/body`,p=`rule-${e.code}-subject`;return(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-secondary/30 p-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:p,children:i.word.subject}),(0,X.jsx)(w,{id:p,className:`font-mono`,spellCheck:!1,autoComplete:`off`,value:r,placeholder:i.alerting.subject_placeholder,onChange:e=>{a(e.target.value)}}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:$e})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:i.alerting.body_pane,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane_windowed(i.alerting.body_pane),className:`min-h-0 flex-1`,onChange:s}),children:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:s})})]}),c!==null&&(0,X.jsx)(H,{problem:c}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(C,{variant:`ghost`,size:`sm`,onClick:t,children:i.action.cancel}),(0,X.jsx)(C,{size:`sm`,disabled:u,onClick:()=>{let i={};if(Y(r)!==e.template&&(i.template=Y(r)),Y(o)!==e.body&&(i.body=Y(o)),Object.keys(i).length===0){t();return}d(!0),l(null),Pe(e.code,i).then(n,e=>{l(S(e))}).finally(()=>{d(!1)})},children:u?i.action.save.busy:i.action.save.verb})]})]})}function ut({notification:e,onChanged:t}){let[n,r]=(0,K.useState)(!1),o=B();return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsx)(`div`,{className:`space-y-1`,children:(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:e.subject})]})}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[e.rule===null?(0,X.jsx)(Z,{label:i.alerting.raised_by,children:(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.raised_by_test})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.rule.label,children:(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.rule})})]}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.run.label,children:(0,X.jsx)(mt,{notification:e})}),(0,X.jsx)(Z,{label:i.alerting.queued_at,children:(0,X.jsx)(U,{at:e.created_at})}),e.status===`sent`?(0,X.jsx)(Z,{label:i.alerting.sent_at,children:(0,X.jsx)(U,{at:e.sent_at})}):(0,X.jsx)(Z,{label:i.alerting.next_try,children:(0,X.jsx)(U,{at:e.available_at})}),(0,X.jsx)(Z,{label:i.word.attempt.heading,children:i.alerting.attempts_of.bare(e.attempt,e.max_attempts)})]}),e.error!==null&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.channel_said}),(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.latest_refusal_only})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:o.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:n||!o.may,title:o.why,onClick:()=>{r(!0),He(e.id).then(t,V).finally(()=>{r(!1)})},children:i.action.retry_now})}),e.run_id!==null&&(0,X.jsx)(C,{variant:`outline`,size:`sm`,render:(0,X.jsx)(a,{to:`/runs/${e.run_id}`}),children:i.alerting.open_run})]})]})}var dt=e=>e.id;function ft({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(G,{glyph:l(e)}),(0,X.jsx)(`span`,{className:t===null?`text-sm`:`font-mono text-xs`,children:t??e})]})}function pt({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e}),t!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t})]})}function mt({notification:e}){if(e.run_id===null)return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.no_run});let t=e.run_pipeline??i.alerting.a_run;return(0,X.jsxs)(a,{className:`text-primary-ink hover:underline`,to:`/runs/${e.run_id}`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:t}),e.run_started_at!==null&&(0,X.jsx)(U,{className:`ml-1.5 text-xs text-muted-foreground`,at:e.run_started_at})]})}function ht({children:e}){return(0,X.jsx)(`span`,{className:`rounded-sm border border-border px-1.5 text-xs text-muted-foreground`,children:e})}function gt({thing:e,children:t}){let n=D(e);return(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:n.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:n.title}),t,n.code!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.code})]})}function Z({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`dt`,{className:`w-32 shrink-0 text-xs text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}var _t={good:`var(--good)`,critical:`var(--critical)`,quiet:`var(--faint)`},vt=`flex min-h-9 items-center gap-2 rounded-full border border-border bg-card py-1 pr-3 pl-2.5 transition-colors`,Q=`hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`;function yt({channels:e,read:t}){let n=p(),r=bt(e.length,t);return n?(0,X.jsx)(Ct,{channels:e,note:r}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),r===null?(0,X.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,X.jsx)(`li`,{className:`flex`,children:(0,X.jsx)(xt,{channel:e})},e.id))}):(0,X.jsx)(`p`,{className:r.tone,children:r.text})]})}function bt(e,t){return t?e===0?{text:i.alerting.channels_none,tone:`text-sm text-muted-foreground`}:null:{text:i.shell.reading,tone:`text-sm text-faint`}}function xt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)}),(0,X.jsx)(Tt,{tone:t.tone})]}),i=n===null?(0,X.jsx)(`button`,{type:`button`,className:v(vt,Q),children:r}):(0,X.jsx)(a,{to:n,className:v(vt,Q),children:r});return(0,X.jsxs)(x,{children:[(0,X.jsx)(y,{render:i}),(0,X.jsx)(b,{className:`flex-col items-start gap-1`,side:`bottom`,children:(0,X.jsx)(St,{channel:e,view:t})})]})}function St({channel:e,view:t}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[e.notifier,` · `,t.label,e.last_check_at!==null&&(0,X.jsxs)(`span`,{className:`font-normal opacity-70`,children:[` `,E(e.last_check_at)]})]}),e.connection!==null&&(0,X.jsx)(`span`,{className:`font-mono`,children:e.connection}),t.detail!==null&&(0,X.jsx)(`span`,{className:`opacity-70`,children:t.detail})]})}function Ct({channels:e,note:t}){let[n,r]=(0,K.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{r(!n)},className:v(`flex min-h-finger w-full items-center gap-2.5 border-b border-border px-1 text-left`,Q),children:[(0,X.jsx)(c,{className:v(`size-4 shrink-0 text-muted-foreground`,n&&`rotate-90`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,"aria-hidden":!0,children:e.map(e=>(0,X.jsx)(Tt,{tone:q(e).tone},e.id))})]}),n&&(t===null?(0,X.jsx)(`table`,{className:`w-full text-sm`,children:(0,X.jsx)(`tbody`,{children:e.map(e=>(0,X.jsx)(wt,{channel:e},e.id))})}):(0,X.jsx)(`p`,{className:t.tone,children:t.text}))]})}function wt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)})]});return(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-b-0`,children:[(0,X.jsx)(`td`,{className:`w-0 py-2 pr-2 align-middle`,children:(0,X.jsx)(Tt,{tone:t.tone})}),(0,X.jsx)(`td`,{className:`min-w-0 py-2 align-middle`,children:e.connection===null||n===null?r:(0,X.jsx)(a,{to:n,className:v(`control-link flex items-center rounded-md px-1`,Q),children:r})}),(0,X.jsx)(`td`,{className:`w-0 py-2 pl-2 text-right align-middle whitespace-nowrap`,children:t.label===i.alerting.channel.not_set_up&&n!==null?(0,X.jsx)(a,{to:n,className:v(`control-link inline-flex items-center rounded-md text-xs text-primary-ink`,Q),children:i.alerting.set_up_channel(e.notifier)}):e.last_check_at!==null&&(0,X.jsx)(`span`,{className:`text-xs text-faint`,children:E(e.last_check_at)})})]})}function Tt({tone:e}){return(0,X.jsx)(`span`,{className:`status-dot`,style:{"--chip":_t[e]}})}function $({id:e,label:t,value:n,onChange:r,placeholder:i,mono:a,hint:o}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:t}),(0,X.jsx)(w,{id:e,className:a===!0?`font-mono`:void 0,spellCheck:!1,autoComplete:`off`,value:n,placeholder:i,onChange:e=>{r(e.target.value)}}),o!==void 0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:o})]})}function Et({id:e,options:t,value:n,onChange:r}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:i.word.delivers_through}),(0,X.jsx)(_e,{id:e,label:i.word.delivers_through,value:n,options:t,placeholder:i.alerting.target_search,onChange:r})]})}var Dt=`0s`,Ot=`alert-rule/new/body`,kt=i.alerting.body_pane;function At({open:e,onOpenChange:t,notifiers:n,connections:r,onCreated:a}){let[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(``),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(`run_failed`),[h,_]=(0,K.useState)(`global`),[v,y]=(0,K.useState)(``),[b,x]=(0,K.useState)(``),[w,ee]=(0,K.useState)(``),[T,te]=(0,K.useState)(``),[E,D]=(0,K.useState)(``),[O,k]=(0,K.useState)(Dt),[A,M]=(0,K.useState)(null),[P,F]=(0,K.useState)(!1),I=jt(e),R=B(),z=oe(R.why,st({code:o,scope:h,pipeline:v,throttle:O}));return(0,X.jsx)(ne,{open:e,onOpenChange:t,children:(0,X.jsxs)(ie,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-3xl`,showCloseButton:!1,children:[(0,X.jsx)(re,{children:(0,X.jsx)(N,{children:i.alerting.new_rule.button})}),(0,X.jsxs)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)($,{id:`rule-code`,label:i.word.code,value:o,onChange:s,placeholder:i.alerting.code_placeholder,mono:!0}),(0,X.jsx)($,{id:`rule-name`,label:i.word.name.label,value:c,onChange:l,placeholder:i.alerting.name_placeholder})]}),(0,X.jsx)($,{id:`rule-description`,label:i.word.description,value:d,onChange:f,placeholder:i.alerting.description_placeholder}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.event}),(0,X.jsx)(W,{label:i.word.event,size:`md`,value:p,options:Ce.map(e=>({value:e,label:i.alerting.event[e]})),onChoose:m})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.scope}),(0,X.jsx)(W,{label:i.word.scope,size:`md`,value:h,options:tt,onChoose:_})]}),h===`pipeline`&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:`rule-pipeline`,children:i.word.pipeline.label}),(0,X.jsx)(_e,{id:`rule-pipeline`,label:i.word.pipeline.label,value:v,options:I,placeholder:i.alerting.pipeline_search,onChange:y})]})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.importance}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.importance_hint}),(0,X.jsx)(W,{label:i.word.importance,size:`md`,value:b,options:nt,onChoose:x})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)(Et,{id:`rule-connection`,options:ot(n,r),value:w,onChange:ee})}),(0,X.jsx)($,{id:`rule-subject`,label:i.word.subject,value:T,onChange:te,placeholder:i.alerting.subject_placeholder,mono:!0,hint:$e}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:kt,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:i.alerting.body_pane_windowed(kt),className:`min-h-0 flex-1`,onChange:D}),children:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:kt,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:D})})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)($,{id:`rule-throttle`,label:i.word.throttle,value:O,onChange:k,placeholder:i.alerting.throttle_placeholder,mono:!0})})]}),A!==null&&(0,X.jsx)(H,{problem:A}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(`p`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:i.alerting.declare_only}),(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),(0,X.jsx)(u,{why:z,children:(0,X.jsx)(C,{disabled:P||z!==void 0,title:z,onClick:()=>{F(!0),M(null),Ne({code:o.trim(),name:Y(c),description:Y(d),event:p,scope:h,pipeline:h===`pipeline`?v:null,importance:rt(b),connection:it(w),template:Y(T),body:Y(E),throttle:O.trim()}).then(()=>{a(),s(``),l(``),f(``),te(``),D(``),t(!1)},e=>{M(S(e))}).finally(()=>{F(!1)})},children:P?i.action.create.busy:i.action.create.verb})})]})]})})}function jt(e){let[t,n]=(0,K.useState)([]);return(0,K.useEffect)(()=>{if(!e)return;let t=!0;return A().then(e=>{t&&n(e.toSorted(O).map(e=>{let t=D(e);return{value:e.code,label:t.title,aside:t.code??``}}))},()=>{t&&n([])}),()=>{t=!1}},[e]),t}var Mt=1e3,Nt=6e4,Pt={connection:``,subject:``};function Ft({open:e,draft:t,onOpenChange:n,notifiers:r,connections:a,onQueued:o,onOpenQueue:s}){let[c,l]=(0,K.useState)(t.connection),[d,f]=(0,K.useState)(t.subject),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1),y=Lt(p),b=B(),x=y!==null&&Ae(y.status)?y.id:null;(0,K.useEffect)(()=>{x!==null&&o()},[x]);let w=b.why;return(0,X.jsx)(ne,{open:e,onOpenChange:n,children:(0,X.jsxs)(ie,{className:`sm:max-w-lg`,showCloseButton:!1,children:[(0,X.jsxs)(re,{children:[(0,X.jsx)(N,{children:i.action.send_test}),(0,X.jsx)(F,{children:i.alerting.test_explained})]}),(0,X.jsx)(Et,{id:`test-connection`,options:ot(r,a),value:c,onChange:l}),(0,X.jsx)($,{id:`test-subject`,label:i.word.subject,value:d,onChange:f,placeholder:i.alerting.test_subject}),h!==null&&(0,X.jsx)(H,{problem:h}),y!==null&&(0,X.jsx)(It,{row:y}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),p!==null&&(0,X.jsx)(C,{variant:`outline`,onClick:()=>{s(p)},children:i.alerting.open_in_queue}),(0,X.jsx)(u,{why:w,children:(0,X.jsx)(C,{disabled:_||w!==void 0,title:w,onClick:()=>{v(!0),g(null),m(null),Ue({connection:it(c),subject:d.trim()===``?i.alerting.test_subject:d.trim()}).then(e=>{m(e.notification_id),o()},e=>{g(S(e))}).finally(()=>{v(!1)})},children:p===null?i.alerting.send:i.alerting.send_again})})]})]})})}function It({row:e}){return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-secondary/40 p-3`,"data-testid":`test-delivery`,"aria-live":`polite`,children:[(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm`,children:e.subject})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.status===`sent`?(0,X.jsxs)(X.Fragment,{children:[i.alerting.delivered,` `,(0,X.jsx)(U,{at:e.sent_at}),`.`]}):e.status===`failed`?r(e.max_attempts,i.alerting.delivery_stopped)(e.attempt,e.max_attempts):e.attempt===0?i.alerting.queued_for_worker:(0,X.jsxs)(X.Fragment,{children:[i.alerting.attempt_of(e.attempt,e.max_attempts),` `,(0,X.jsx)(U,{at:e.available_at}),`.`]})}),e.error!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error})]})}function Lt(e){let[t,n]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(e===null)return;let t=!0,r,i=Date.now()+Nt,a=()=>{Ve(e).then(o=>{t&&(n({id:e,row:o}),!(Ae(o.status)||Date.now()>i)&&(r=setTimeout(a,Mt)))},()=>{})};return a(),()=>{t=!1,r!==void 0&&clearTimeout(r)}},[e]),t!==null&&t.id===e?t.row:null}var Rt=e=>e.id,zt=e=>e.id;function Bt(){return(0,X.jsx)(ve,{children:(0,X.jsx)(Vt,{})})}function Vt(){let[e,t]=(0,K.useState)(!1),[n,r]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)({status:``,notifier:``}),[p,g]=(0,K.useState)({}),[_,v]=(0,K.useState)({}),y=I((0,K.useCallback)(e=>Me(e),[]),Rt),b=I((0,K.useCallback)(e=>Be(l,e),[l]),zt),x=Wt(),{reload:S}=y,{reload:C}=b,w=(0,K.useMemo)(()=>y.state.rows.map(e=>p[e.id]??e),[p,y.state.rows]),E=(0,K.useMemo)(()=>b.state.rows.map(e=>_[e.id]??e),[_,b.state.rows]),D=w.find(e=>e.id===a)??null,O=E.find(e=>e.id===s)??null,k=(0,K.useCallback)(e=>{r(t=>({draft:e,opened:(t?.opened??0)+1}))},[]);(0,K.useEffect)(()=>(se({note:null,tone:`quiet`,identifier:null}),le),[]),(0,K.useEffect)(()=>{if(D!==null){let e=D;return ee([{id:`rule`,label:i.word.rule.label,render:()=>(0,X.jsx)(ct,{rule:e,onChanged:e=>{g(t=>({...t,[e.id]:e}))},onDeleted:()=>{o(null),S()},onTest:()=>{k({connection:e.connection??``,subject:``})}})}],{screen:`alerting`})}if(O!==null){let e=O;return ee([{id:`notification`,label:i.word.notification.label,render:()=>(0,X.jsx)(ut,{notification:e,onChanged:e=>{v(t=>({...t,[e.id]:e}))}})}],{screen:`alerting`})}},[O,D,k,S]);let A=B(`admin`),j=A.may;(0,K.useEffect)(()=>z([...j?[{id:`alerting:rule`,title:i.alerting.new_rule.palette,group:R,screen:!0,icon:be,keywords:[`alert`,`event`,`create`],run:()=>{t(!0)}},{id:`alerting:test`,title:i.alerting.palette.send_test,group:R,screen:!0,icon:Se,keywords:[`alert`,`notification`,`try`],run:()=>{k(Pt)}}]:[],{id:`alerting:reload`,title:i.alerting.palette.reload,group:R,screen:!0,icon:P,keywords:[`refresh`,`reload`],run:()=>{S(),C()}}]),[j,k,C,S]);let ne=e=>{c(null),o(e.id),T()},re=e=>{o(null),c(e.id),T()},N=()=>{o(null),c(null),te()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(f,{title:i.screen.alerting.name,aside:(0,X.jsx)(m,{tag:`alerts`}),actions:[{id:`test`,label:i.action.send_test,icon:Se,variant:`outline`,disabled:!A.may,why:A.why,onClick:()=>{k(Pt)}},{id:`rule`,label:i.alerting.new_rule.button,icon:be,disabled:!A.may,why:A.why,onClick:()=>{t(!0)}}]}),(0,X.jsx)(`section`,{className:`mb-6 space-y-2`,children:(0,X.jsx)(yt,{channels:x.rows,read:x.read})}),(0,X.jsxs)(`section`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.rule.heading}),(0,X.jsx)(d,{loading:!y.state.read,problem:y.state.problem,empty:w.length===0,emptyMessage:i.alerting.rules_empty,children:(0,X.jsx)(h,{columns:Kt,rows:w,rowKey:Rt,rowClassName:e=>ke(e)?void 0:`opacity-60`,reading:y.state.reading,next:y.state.next,onMore:y.more,noun:i.word.rule.count,onSelect:ne,selected:e=>e.id===a,onClose:N})})]}),(0,X.jsxs)(`section`,{className:`mt-8 space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.notification.heading}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(ue,{label:i.word.status,value:l.status,anything:i.alerting.any_status,options:we.map(e=>({value:e,label:e,mark:(0,X.jsx)(M,{status:e})})),onChange:e=>{u(t=>({...t,status:e}))}}),(0,X.jsx)(ue,{label:i.alerting.notifier,value:l.notifier,anything:i.alerting.any_notifier,options:Ut(x.rows),onChange:e=>{u(t=>({...t,notifier:e}))}})]})]}),(0,X.jsx)(d,{loading:!b.state.read,problem:b.state.problem,empty:E.length===0,emptyMessage:Re(l)?i.alerting.notifications_empty_filtered:i.alerting.notifications_empty,children:(0,X.jsx)(h,{columns:qt,rows:E,rowKey:zt,reading:b.state.reading,next:b.state.next,onMore:b.more,noun:i.word.notification.count,onSelect:re,selected:e=>e.id===s,onClose:N})})]}),(0,X.jsx)(At,{open:e,onOpenChange:t,notifiers:Ht(x.rows),connections:x.connections,onCreated:S}),(0,X.jsx)(Ft,{open:n!==null,draft:n?.draft??Pt,onOpenChange:e=>{e||r(null)},notifiers:Ht(x.rows),connections:x.connections,onQueued:C,onOpenQueue:e=>{r(null),o(null),c(e),C(),T()}},n?.opened??0)]})}function Ht(e){return[...new Set(e.map(e=>e.notifier))]}function Ut(e){return Ht(e).map(e=>({value:e,label:e}))}function Wt(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(null);return(0,K.useEffect)(()=>{let e=!0;return We().then(n=>{e&&t(n)},()=>{e&&t([])}),pe().then(t=>{e&&r(t.items)},()=>{e&&r([])}),()=>{e=!1}},[]),{rows:(0,K.useMemo)(()=>Ge(e??[],n??[]),[n,e]),connections:n??[],read:e!==null&&n!==null}}function Gt({rule:e}){let t=Oe(e.importance);return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,X.jsx)(`span`,{className:e.scope===`pipeline`?`font-mono text-xs`:`text-sm`,children:De(e)}),t!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}var Kt=[{id:`rule`,header:i.word.rule.label,kind:`title`,cell:e=>{let t=D(e);return(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:v(`truncate`,t.named?`text-sm font-medium`:`font-mono text-sm font-medium`),title:t.title,children:t.title}),t.code!==null&&(0,X.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code})]})}},{id:`event`,header:i.word.event,cell:e=>(0,X.jsx)(`span`,{className:`text-sm`,children:i.alerting.event[e.event]})},{id:`scope`,header:i.word.scope,cell:e=>(0,X.jsx)(Gt,{rule:e})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})},{id:`throttle`,header:i.word.throttle,className:`font-mono text-xs`,cell:e=>(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:Ee(e.throttle)})},{id:`sent`,header:i.alerting.last_sent,className:`text-xs`,cell:e=>e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.last_sent_at})},{id:`live`,header:i.word.state,cell:e=>e.paused?(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.paused}):e.active?(0,X.jsx)(`span`,{className:`text-xs text-good`,children:i.state.armed.active}):(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.off})}],qt=[{id:`status`,header:i.word.status,cell:e=>(0,X.jsx)(M,{status:e.status})},{id:`subject`,header:i.word.subject,kind:`prose`,cell:e=>(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm`,title:e.subject,children:e.subject}),e.error!==null&&(0,X.jsx)(`span`,{className:`truncate text-xs text-critical`,title:e.error,children:e.error})]})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})},{id:`run`,header:i.word.run.label,cell:e=>(0,X.jsx)(mt,{notification:e})},{id:`queued`,header:i.alerting.queued_at,className:`text-xs`,cell:e=>(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.created_at})},{id:`sent`,header:i.alerting.sent_at,className:`text-xs`,cell:e=>e.status===`sent`?(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.sent_at}):e.attempt>0?(0,X.jsx)(`span`,{className:`text-faint`,children:r(e.max_attempts,i.alerting.attempts_of.counted)(e.attempt,e.max_attempts)}):null}];export{Bt as AdminAlerting};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,n as r,t as i}from"./labels-DPg21HPJ.js";import{n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{i as o,r as s}from"./api-jh39Ky4Q.js";import{N as c}from"./dropdown-menu-fVWTjkXO.js";import{r as l}from"./glyphs-DLSRr36C.js";import{l as u,n as d,t as f,u as p}from"./PageState-859W4wWp.js";import{i as m,t as h}from"./ListTable-BOX3h68A.js";import{t as g}from"./WindowedPane-CptewOG5.js";import{r as _,t as v}from"./utils-CT7ZGLfR.js";import{i as y,n as b,t as x}from"./tooltip-CrzRgh7Y.js";import{d as S,h as C}from"./paging-B8nfgCnQ.js";import{t as w}from"./input-DjAM-vmX.js";import{a as ee,o as T,r as te}from"./panels-D1Fnei43.js";import{l as E}from"./format-DK4FnJoS.js";import{t as D}from"./identity-BNZxCf_y.js";import{r as O,t as k,u as A}from"./pipelines-CFguQTLF.js";import{A as j,At as ne,E as M,Ft as re,It as N,Lt as P,Mt as ie,Nt as F,Pt as ae,S as oe,b as I,ct as L,ft as R,gt as z,it as se,jt as ce,rt as le,v as ue,x as B}from"./index-Bk7mn1Ys.js";import{t as de}from"./Description-C-byz7P3.js";import{c as fe,f as pe,n as me,o as he}from"./connections-DobzdyIe.js";import{n as V,t as H}from"./Refusal-Bjzfpcdg.js";import{t as U}from"./Instant-Ogv9qDZy.js";import{t as W}from"./Segmented-KaDiGiyr.js";import{t as G}from"./Mark-DQR2php6.js";import{t as ge}from"./ProgramReference-XGlt7u1Z.js";import{t as _e}from"./Picker-DLXu0hr0.js";import{t as ve}from"./AdminOnly-CtBdW1t6.js";var ye={name:`bell-plus`,size:24,node:[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M15 8h6`,key:`8ybuxh`}],[`path`,{d:`M18 5v6`,key:`g5ayrv`}],[`path`,{d:`M20.002 14.464a9 9 0 0 0 .738.863A1 1 0 0 1 20 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 8.75-5.332`,key:`1abcvy`}]]};ye.node;var be=n(ye),xe={name:`send`,size:24,node:[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]};xe.node;var Se=n(xe),K=e(t(),1),Ce=[`run_failed`,`run_completed_with_errors`,`run_succeeded`,`run_stuck`],we=[`pending`,`sending`,`sent`,`failed`],Te=`0s`;function Ee(e){return e===Te?i.word.none:e}function De(e){return e.scope===`pipeline`&&e.pipeline!==null?e.pipeline:i.alerting.every_pipeline}function Oe(e){return e===null?null:i.alerting.importance_floor(e)}function ke(e){return e.active&&!e.paused}function Ae(e){return e===`sent`||e===`failed`}function je(e,t=50){let n=new URLSearchParams({limit:String(t)});return e!==null&&n.set(`after`,e),`/alert-rules?${n.toString()}`}function Me(e){return s(je(e))}function Ne(e){return o(`/alert-rules`,`POST`,e)}function Pe(e,t){return o(`/alert-rules/${encodeURIComponent(e)}`,`PATCH`,t)}function Fe(e,t){return Pe(e,{paused:t})}function Ie(e){return s(`/alert-rules/${encodeURIComponent(e)}`,{method:`DELETE`})}var Le={status:``,notifier:``};function Re(e){return e.status!==``||e.notifier!==``}function ze(e,t,n=50){let r=new URLSearchParams({limit:String(n)});return e.status!==``&&r.set(`status`,e.status),e.notifier!==``&&r.set(`notifier`,e.notifier),t!==null&&r.set(`after`,t),`/notifications?${r.toString()}`}function Be(e,t){return s(ze(e,t))}function Ve(e){return s(`/notifications/${encodeURIComponent(e)}`)}function He(e){return o(`/notifications/${encodeURIComponent(e)}/$retry`,`POST`,{})}function Ue(e){return o(`/alert-rules/$test`,`POST`,e)}async function We(){return(await s(`/blocks`)).notifiers.map(e=>e.id)}function Ge(e,t){let n=[];for(let r of e){if(r===`log`){n.push({id:r,notifier:r,connection:null,reachable:!0,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}let e=t.filter(e=>e.kind===r);if(e.length===0){n.push({id:r,notifier:r,connection:null,reachable:!1,last_check_at:null,last_check_healthy:null,last_check_detail:null});continue}for(let t of e)n.push({id:`${r}:${t.code}`,notifier:r,connection:t.code,reachable:!0,last_check_at:t.last_check_at,last_check_healthy:t.last_check_healthy,last_check_detail:t.last_check_detail})}return Ye(n)}function Ke(e){return e.connection??e.notifier}function qe(e){return e.connection===null?e.notifier===`log`?null:fe(e.notifier):me(e.connection)}function q(e){if(e.notifier===`log`)return{tone:`good`,label:i.alerting.channel.ready,detail:null};if(!e.reachable)return{tone:`quiet`,label:i.alerting.channel.not_set_up,detail:null};let t=he(e);return{tone:t.tone??`quiet`,label:t.label,detail:t.detail}}var Je={good:0,critical:1,quiet:2};function Ye(e){return e.toSorted((e,t)=>{let n=Je[q(e).tone]-Je[q(t).tone];if(n!==0)return n;let r=e.notifier.localeCompare(t.notifier);return r===0?(e.connection??``).localeCompare(t.connection??``):r})}var Xe=/^[a-z0-9]+(?:[-_][a-z0-9]+)*$/u,Ze=/^(?:\d+(?:ms|s|m|h|d|w))+$/u,Qe=i.alerting.subject_references,$e=i.alerting.subject_hint(Qe),et=i.alerting.body_hint,J=`text/x-jinja`;function Y(e){let t=e.trim();return t===``?null:t}var tt=[{value:`global`,label:i.alerting.scope.global},{value:`pipeline`,label:i.alerting.scope.pipeline}],nt=[{value:``,label:i.alerting.importance_any},...k.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))];function rt(e){return e===``?null:e}function it(e){return e===``?null:e}var at=i.alerting.log_target;function ot(e,t){let n=t.filter(t=>t.kind!==`log`&&e.includes(t.kind)).map(e=>({row:e,heading:D(e)})).toSorted((e,t)=>e.row.kind.localeCompare(t.row.kind)||e.heading.title.localeCompare(t.heading.title));return[{value:``,label:at,aside:``,mark:l(`log`)},...n.map(({row:e,heading:t})=>({value:e.code,label:`${t.title} · ${e.kind}`,aside:t.code??``,mark:l(e.kind)}))]}function st(e){if(e.code.trim()===``)return i.alerting.unready.code_missing;if(!Xe.test(e.code.trim()))return i.alerting.unready.code_shape;if(e.scope===`pipeline`&&e.pipeline===``)return i.alerting.unready.pipeline_missing;if(!Ze.test(e.throttle.trim()))return i.alerting.unready.throttle_shape}var X=_();function ct({rule:e,onChanged:t,onDeleted:n,onTest:r}){let[a,o]=(0,K.useState)(!1),[s,c]=(0,K.useState)(null),l=s===e.code,d=B(),f=Oe(e.importance),p=(0,K.useCallback)(e=>Be(Le,e),[]),{state:m}=I(p,dt),h=m.rows.filter(t=>t.rule===e.code);return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsxs)(gt,{thing:e,children:[e.paused&&(0,X.jsx)(ht,{children:i.state.armed.paused}),!e.active&&(0,X.jsx)(ht,{children:i.state.armed.off})]}),(0,X.jsx)(de,{text:e.description}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.scope,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[De(e),f!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:f})]})}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.throttle,children:Ee(e.throttle)}),l?(0,X.jsx)(lt,{rule:e,onDone:()=>{c(null)},onSaved:e=>{t(e),c(null)}},e.code):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.subject,children:(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-2`,children:[e.template===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.none}):(0,X.jsx)(`span`,{className:`font-mono text-xs break-all`,children:e.template}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`ghost`,size:`xs`,disabled:!d.may,title:d.why,onClick:()=>{c(e.code)},children:i.action.edit})})]})}),e.body!==null&&(0,X.jsx)(Z,{label:i.word.body,children:(0,X.jsx)(`span`,{className:`line-clamp-3 font-mono text-xs break-words whitespace-pre-wrap`,children:e.body})})]}),(0,X.jsx)(Z,{label:i.alerting.last_sent,children:e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{at:e.last_sent_at})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Fe(e.code,!e.paused).then(t,V).finally(()=>{o(!1)})},children:e.paused?i.action.resume:i.action.pause})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:!d.may,title:d.why,onClick:r,children:i.action.send_test})}),(0,X.jsx)(u,{why:d.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,className:`destructive-action ml-auto`,disabled:a||!d.may,title:d.why,onClick:()=>{o(!0),Ie(e.code).then(n,V).finally(()=>{o(!1)})},children:i.action.delete.verb})})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.recent_deliveries}),!m.read&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.shell.reading}),m.read&&h.length===0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.deliveries_empty}),(0,X.jsx)(`ul`,{className:`divide-y divide-border`,children:h.map(e=>(0,X.jsxs)(`li`,{className:`row-hover -mx-4 flex items-center gap-2 px-4 py-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs`,children:e.subject}),(0,X.jsx)(U,{className:`shrink-0 text-xs text-faint`,at:e.created_at})]},e.id))})]})]})}function lt({rule:e,onDone:t,onSaved:n}){let[r,a]=(0,K.useState)(e.template??``),[o,s]=(0,K.useState)(e.body??``),[c,l]=(0,K.useState)(null),[u,d]=(0,K.useState)(!1),f=`alert-rule/${e.code}/body`,p=`rule-${e.code}-subject`;return(0,X.jsxs)(`div`,{className:`space-y-3 rounded-lg border border-border bg-secondary/30 p-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:p,children:i.word.subject}),(0,X.jsx)(w,{id:p,className:`font-mono`,spellCheck:!1,autoComplete:`off`,value:r,placeholder:i.alerting.subject_placeholder,onChange:e=>{a(e.target.value)}}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:$e})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:i.alerting.body_pane,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane_windowed(i.alerting.body_pane),className:`min-h-0 flex-1`,onChange:s}),children:(0,X.jsx)(L,{value:o,mediaType:J,path:f,label:i.alerting.body_pane,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:s})})]}),c!==null&&(0,X.jsx)(H,{problem:c}),(0,X.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,X.jsx)(C,{variant:`ghost`,size:`sm`,onClick:t,children:i.action.cancel}),(0,X.jsx)(C,{size:`sm`,disabled:u,onClick:()=>{let i={};if(Y(r)!==e.template&&(i.template=Y(r)),Y(o)!==e.body&&(i.body=Y(o)),Object.keys(i).length===0){t();return}d(!0),l(null),Pe(e.code,i).then(n,e=>{l(S(e))}).finally(()=>{d(!1)})},children:u?i.action.save.busy:i.action.save.verb})]})]})}function ut({notification:e,onChanged:t}){let[n,r]=(0,K.useState)(!1),o=B();return(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,X.jsx)(`div`,{className:`space-y-1`,children:(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:e.subject})]})}),(0,X.jsxs)(`dl`,{className:`space-y-1.5`,children:[e.rule===null?(0,X.jsx)(Z,{label:i.alerting.raised_by,children:(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.raised_by_test})}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Z,{label:i.word.event,children:i.alerting.event[e.event]}),(0,X.jsx)(Z,{label:i.word.rule.label,children:(0,X.jsx)(`span`,{className:`font-mono text-xs`,children:e.rule})})]}),(0,X.jsx)(Z,{label:i.word.delivers_through,children:(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})}),(0,X.jsx)(Z,{label:i.word.run.label,children:(0,X.jsx)(mt,{notification:e})}),(0,X.jsx)(Z,{label:i.alerting.queued_at,children:(0,X.jsx)(U,{at:e.created_at})}),e.status===`sent`?(0,X.jsx)(Z,{label:i.alerting.sent_at,children:(0,X.jsx)(U,{at:e.sent_at})}):(0,X.jsx)(Z,{label:i.alerting.next_try,children:(0,X.jsx)(U,{at:e.available_at})}),(0,X.jsx)(Z,{label:i.word.attempt.heading,children:i.alerting.attempts_of.bare(e.attempt,e.max_attempts)})]}),e.error!==null&&(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:i.alerting.channel_said}),(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.latest_refusal_only})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(u,{why:o.why,children:(0,X.jsx)(C,{variant:`outline`,size:`sm`,disabled:n||!o.may,title:o.why,onClick:()=>{r(!0),He(e.id).then(t,V).finally(()=>{r(!1)})},children:i.action.retry_now})}),e.run_id!==null&&(0,X.jsx)(C,{variant:`outline`,size:`sm`,render:(0,X.jsx)(a,{to:`/runs/${e.run_id}`}),children:i.alerting.open_run})]})]})}var dt=e=>e.id;function ft({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(G,{glyph:l(e)}),(0,X.jsx)(`span`,{className:t===null?`text-sm`:`font-mono text-xs`,children:t??e})]})}function pt({notifier:e,connection:t}){return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-1.5`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:e}),t!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:t})]})}function mt({notification:e}){if(e.run_id===null)return(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.alerting.no_run});let t=e.run_pipeline??i.alerting.a_run;return(0,X.jsxs)(a,{className:`text-primary-ink hover:underline`,to:`/runs/${e.run_id}`,children:[(0,X.jsx)(`span`,{className:`text-sm`,children:t}),e.run_started_at!==null&&(0,X.jsx)(U,{className:`ml-1.5 text-xs text-muted-foreground`,at:e.run_started_at})]})}function ht({children:e}){return(0,X.jsx)(`span`,{className:`rounded-sm border border-border px-1.5 text-xs text-muted-foreground`,children:e})}function gt({thing:e,children:t}){let n=D(e);return(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(`span`,{className:n.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:n.title}),t,n.code!==null&&(0,X.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:n.code})]})}function Z({label:e,children:t}){return(0,X.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,X.jsx)(`dt`,{className:`w-32 shrink-0 text-xs text-muted-foreground`,children:e}),(0,X.jsx)(`dd`,{className:`min-w-0 text-sm`,children:t})]})}var _t={good:`var(--good)`,critical:`var(--critical)`,quiet:`var(--faint)`},vt=`flex min-h-9 items-center gap-2 rounded-full border border-border bg-card py-1 pr-3 pl-2.5 transition-colors`,Q=`hover:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-none`;function yt({channels:e,read:t}){let n=p(),r=bt(e.length,t);return n?(0,X.jsx)(Ct,{channels:e,note:r}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),r===null?(0,X.jsx)(`ul`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,X.jsx)(`li`,{className:`flex`,children:(0,X.jsx)(xt,{channel:e})},e.id))}):(0,X.jsx)(`p`,{className:r.tone,children:r.text})]})}function bt(e,t){return t?e===0?{text:i.alerting.channels_none,tone:`text-sm text-muted-foreground`}:null:{text:i.shell.reading,tone:`text-sm text-faint`}}function xt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)}),(0,X.jsx)(Tt,{tone:t.tone})]}),i=n===null?(0,X.jsx)(`button`,{type:`button`,className:v(vt,Q),children:r}):(0,X.jsx)(a,{to:n,className:v(vt,Q),children:r});return(0,X.jsxs)(x,{children:[(0,X.jsx)(y,{render:i}),(0,X.jsx)(b,{className:`flex-col items-start gap-1`,side:`bottom`,children:(0,X.jsx)(St,{channel:e,view:t})})]})}function St({channel:e,view:t}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`span`,{className:`font-medium`,children:[e.notifier,` · `,t.label,e.last_check_at!==null&&(0,X.jsxs)(`span`,{className:`font-normal opacity-70`,children:[` `,E(e.last_check_at)]})]}),e.connection!==null&&(0,X.jsx)(`span`,{className:`font-mono`,children:e.connection}),t.detail!==null&&(0,X.jsx)(`span`,{className:`opacity-70`,children:t.detail})]})}function Ct({channels:e,note:t}){let[n,r]=(0,K.useState)(!1);return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(`button`,{type:`button`,"aria-expanded":n,onClick:()=>{r(!n)},className:v(`flex min-h-finger w-full items-center gap-2.5 border-b border-border px-1 text-left`,Q),children:[(0,X.jsx)(c,{className:v(`size-4 shrink-0 text-muted-foreground`,n&&`rotate-90`),"aria-hidden":!0}),(0,X.jsx)(`span`,{className:`text-sm font-semibold`,children:i.alerting.channels_heading}),(0,X.jsx)(`span`,{className:`ml-auto flex items-center gap-1.5`,"aria-hidden":!0,children:e.map(e=>(0,X.jsx)(Tt,{tone:q(e).tone},e.id))})]}),n&&(t===null?(0,X.jsx)(`table`,{className:`w-full text-sm`,children:(0,X.jsx)(`tbody`,{children:e.map(e=>(0,X.jsx)(wt,{channel:e},e.id))})}):(0,X.jsx)(`p`,{className:t.tone,children:t.text}))]})}function wt({channel:e}){let t=q(e),n=qe(e),r=(0,X.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[(0,X.jsx)(G,{glyph:l(e.notifier)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-xs font-semibold`,children:Ke(e)})]});return(0,X.jsxs)(`tr`,{className:`border-b border-border last:border-b-0`,children:[(0,X.jsx)(`td`,{className:`w-0 py-2 pr-2 align-middle`,children:(0,X.jsx)(Tt,{tone:t.tone})}),(0,X.jsx)(`td`,{className:`min-w-0 py-2 align-middle`,children:e.connection===null||n===null?r:(0,X.jsx)(a,{to:n,className:v(`control-link flex items-center rounded-md px-1`,Q),children:r})}),(0,X.jsx)(`td`,{className:`w-0 py-2 pl-2 text-right align-middle whitespace-nowrap`,children:t.label===i.alerting.channel.not_set_up&&n!==null?(0,X.jsx)(a,{to:n,className:v(`control-link inline-flex items-center rounded-md text-xs text-primary-ink`,Q),children:i.alerting.set_up_channel(e.notifier)}):e.last_check_at!==null&&(0,X.jsx)(`span`,{className:`text-xs text-faint`,children:E(e.last_check_at)})})]})}function Tt({tone:e}){return(0,X.jsx)(`span`,{className:`status-dot`,style:{"--chip":_t[e]}})}function $({id:e,label:t,value:n,onChange:r,placeholder:i,mono:a,hint:o}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:t}),(0,X.jsx)(w,{id:e,className:a===!0?`font-mono`:void 0,spellCheck:!1,autoComplete:`off`,value:n,placeholder:i,onChange:e=>{r(e.target.value)}}),o!==void 0&&(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:o})]})}function Et({id:e,options:t,value:n,onChange:r}){return(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:e,children:i.word.delivers_through}),(0,X.jsx)(_e,{id:e,label:i.word.delivers_through,value:n,options:t,placeholder:i.alerting.target_search,onChange:r})]})}var Dt=`0s`,Ot=`alert-rule/new/body`,kt=i.alerting.body_pane;function At({open:e,onOpenChange:t,notifiers:n,connections:r,onCreated:a}){let[o,s]=(0,K.useState)(``),[c,l]=(0,K.useState)(``),[d,f]=(0,K.useState)(``),[p,m]=(0,K.useState)(`run_failed`),[h,_]=(0,K.useState)(`global`),[v,y]=(0,K.useState)(``),[b,x]=(0,K.useState)(``),[w,ee]=(0,K.useState)(``),[T,te]=(0,K.useState)(``),[E,D]=(0,K.useState)(``),[O,k]=(0,K.useState)(Dt),[A,M]=(0,K.useState)(null),[P,F]=(0,K.useState)(!1),I=jt(e),R=B(),z=oe(R.why,st({code:o,scope:h,pipeline:v,throttle:O}));return(0,X.jsx)(ne,{open:e,onOpenChange:t,children:(0,X.jsxs)(ie,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-3xl`,showCloseButton:!1,children:[(0,X.jsx)(re,{children:(0,X.jsx)(N,{children:i.alerting.new_rule.button})}),(0,X.jsxs)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:[(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsx)($,{id:`rule-code`,label:i.word.code,value:o,onChange:s,placeholder:i.alerting.code_placeholder,mono:!0}),(0,X.jsx)($,{id:`rule-name`,label:i.word.name.label,value:c,onChange:l,placeholder:i.alerting.name_placeholder})]}),(0,X.jsx)($,{id:`rule-description`,label:i.word.description,value:d,onChange:f,placeholder:i.alerting.description_placeholder}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.event}),(0,X.jsx)(W,{label:i.word.event,size:`md`,value:p,options:Ce.map(e=>({value:e,label:i.alerting.event[e]})),onChoose:m})]}),(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.scope}),(0,X.jsx)(W,{label:i.word.scope,size:`md`,value:h,options:tt,onChoose:_})]}),h===`pipeline`&&(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{htmlFor:`rule-pipeline`,children:i.word.pipeline.label}),(0,X.jsx)(_e,{id:`rule-pipeline`,label:i.word.pipeline.label,value:v,options:I,placeholder:i.alerting.pipeline_search,onChange:y})]})]}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.importance}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:i.alerting.importance_hint}),(0,X.jsx)(W,{label:i.word.importance,size:`md`,value:b,options:nt,onChoose:x})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)(Et,{id:`rule-connection`,options:ot(n,r),value:w,onChange:ee})}),(0,X.jsx)($,{id:`rule-subject`,label:i.word.subject,value:T,onChange:te,placeholder:i.alerting.subject_placeholder,mono:!0,hint:$e}),(0,X.jsxs)(`div`,{className:`space-y-2`,children:[(0,X.jsx)(j,{children:i.word.body}),(0,X.jsx)(`p`,{className:`text-xs text-faint`,children:et}),(0,X.jsx)(g,{name:kt,className:`overflow-hidden rounded-md border border-border bg-background`,aside:(0,X.jsx)(ge,{mediaType:J}),windowed:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:i.alerting.body_pane_windowed(kt),className:`min-h-0 flex-1`,onChange:D}),children:(0,X.jsx)(L,{value:E,mediaType:J,path:Ot,label:kt,placeholder:i.alerting.body_placeholder,className:`h-40 min-h-32`,onChange:D})})]}),(0,X.jsx)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:(0,X.jsx)($,{id:`rule-throttle`,label:i.word.throttle,value:O,onChange:k,placeholder:i.alerting.throttle_placeholder,mono:!0})})]}),A!==null&&(0,X.jsx)(H,{problem:A}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(`p`,{className:`mr-auto self-center text-xs text-muted-foreground`,children:i.alerting.declare_only}),(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),(0,X.jsx)(u,{why:z,children:(0,X.jsx)(C,{disabled:P||z!==void 0,title:z,onClick:()=>{F(!0),M(null),Ne({code:o.trim(),name:Y(c),description:Y(d),event:p,scope:h,pipeline:h===`pipeline`?v:null,importance:rt(b),connection:it(w),template:Y(T),body:Y(E),throttle:O.trim()}).then(()=>{a(),s(``),l(``),f(``),te(``),D(``),t(!1)},e=>{M(S(e))}).finally(()=>{F(!1)})},children:P?i.action.create.busy:i.action.create.verb})})]})]})})}function jt(e){let[t,n]=(0,K.useState)([]);return(0,K.useEffect)(()=>{if(!e)return;let t=!0;return A().then(e=>{t&&n(e.toSorted(O).map(e=>{let t=D(e);return{value:e.code,label:t.title,aside:t.code??``}}))},()=>{t&&n([])}),()=>{t=!1}},[e]),t}var Mt=1e3,Nt=6e4,Pt={connection:``,subject:``};function Ft({open:e,draft:t,onOpenChange:n,notifiers:r,connections:a,onQueued:o,onOpenQueue:s}){let[c,l]=(0,K.useState)(t.connection),[d,f]=(0,K.useState)(t.subject),[p,m]=(0,K.useState)(null),[h,g]=(0,K.useState)(null),[_,v]=(0,K.useState)(!1),y=Lt(p),b=B(),x=y!==null&&Ae(y.status)?y.id:null;(0,K.useEffect)(()=>{x!==null&&o()},[x]);let w=b.why;return(0,X.jsx)(ne,{open:e,onOpenChange:n,children:(0,X.jsxs)(ie,{className:`sm:max-w-lg`,showCloseButton:!1,children:[(0,X.jsxs)(re,{children:[(0,X.jsx)(N,{children:i.action.send_test}),(0,X.jsx)(F,{children:i.alerting.test_explained})]}),(0,X.jsx)(Et,{id:`test-connection`,options:ot(r,a),value:c,onChange:l}),(0,X.jsx)($,{id:`test-subject`,label:i.word.subject,value:d,onChange:f,placeholder:i.alerting.test_subject}),h!==null&&(0,X.jsx)(H,{problem:h}),y!==null&&(0,X.jsx)(It,{row:y}),(0,X.jsxs)(ae,{children:[(0,X.jsx)(ce,{render:(0,X.jsx)(C,{variant:`ghost`}),children:i.action.close}),p!==null&&(0,X.jsx)(C,{variant:`outline`,onClick:()=>{s(p)},children:i.alerting.open_in_queue}),(0,X.jsx)(u,{why:w,children:(0,X.jsx)(C,{disabled:_||w!==void 0,title:w,onClick:()=>{v(!0),g(null),m(null),Ue({connection:it(c),subject:d.trim()===``?i.alerting.test_subject:d.trim()}).then(e=>{m(e.notification_id),o()},e=>{g(S(e))}).finally(()=>{v(!1)})},children:p===null?i.alerting.send:i.alerting.send_again})})]})]})})}function It({row:e}){return(0,X.jsxs)(`div`,{className:`space-y-2 rounded-lg border border-border bg-secondary/40 p-3`,"data-testid":`test-delivery`,"aria-live":`polite`,children:[(0,X.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2`,children:[(0,X.jsx)(M,{status:e.status}),(0,X.jsx)(`span`,{className:`text-sm`,children:e.subject})]}),(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.status===`sent`?(0,X.jsxs)(X.Fragment,{children:[i.alerting.delivered,` `,(0,X.jsx)(U,{at:e.sent_at}),`.`]}):e.status===`failed`?r(e.max_attempts,i.alerting.delivery_stopped)(e.attempt,e.max_attempts):e.attempt===0?i.alerting.queued_for_worker:(0,X.jsxs)(X.Fragment,{children:[i.alerting.attempt_of(e.attempt,e.max_attempts),` `,(0,X.jsx)(U,{at:e.available_at}),`.`]})}),e.error!==null&&(0,X.jsx)(`p`,{className:`text-xs break-words text-critical`,children:e.error})]})}function Lt(e){let[t,n]=(0,K.useState)(null);return(0,K.useEffect)(()=>{if(e===null)return;let t=!0,r,i=Date.now()+Nt,a=()=>{Ve(e).then(o=>{t&&(n({id:e,row:o}),!(Ae(o.status)||Date.now()>i)&&(r=setTimeout(a,Mt)))},()=>{})};return a(),()=>{t=!1,r!==void 0&&clearTimeout(r)}},[e]),t!==null&&t.id===e?t.row:null}var Rt=e=>e.id,zt=e=>e.id;function Bt(){return(0,X.jsx)(ve,{children:(0,X.jsx)(Vt,{})})}function Vt(){let[e,t]=(0,K.useState)(!1),[n,r]=(0,K.useState)(null),[a,o]=(0,K.useState)(null),[s,c]=(0,K.useState)(null),[l,u]=(0,K.useState)({status:``,notifier:``}),[p,g]=(0,K.useState)({}),[_,v]=(0,K.useState)({}),y=I((0,K.useCallback)(e=>Me(e),[]),Rt),b=I((0,K.useCallback)(e=>Be(l,e),[l]),zt),x=Wt(),{reload:S}=y,{reload:C}=b,w=(0,K.useMemo)(()=>y.state.rows.map(e=>p[e.id]??e),[p,y.state.rows]),E=(0,K.useMemo)(()=>b.state.rows.map(e=>_[e.id]??e),[_,b.state.rows]),D=w.find(e=>e.id===a)??null,O=E.find(e=>e.id===s)??null,k=(0,K.useCallback)(e=>{r(t=>({draft:e,opened:(t?.opened??0)+1}))},[]);(0,K.useEffect)(()=>(se({note:null,tone:`quiet`,identifier:null}),le),[]),(0,K.useEffect)(()=>{if(D!==null){let e=D;return ee([{id:`rule`,label:i.word.rule.label,render:()=>(0,X.jsx)(ct,{rule:e,onChanged:e=>{g(t=>({...t,[e.id]:e}))},onDeleted:()=>{o(null),S()},onTest:()=>{k({connection:e.connection??``,subject:``})}})}],{screen:`alerting`})}if(O!==null){let e=O;return ee([{id:`notification`,label:i.word.notification.label,render:()=>(0,X.jsx)(ut,{notification:e,onChanged:e=>{v(t=>({...t,[e.id]:e}))}})}],{screen:`alerting`})}},[O,D,k,S]);let A=B(`admin`),j=A.may;(0,K.useEffect)(()=>z([...j?[{id:`alerting:rule`,title:i.alerting.new_rule.palette,group:R,screen:!0,icon:be,keywords:[`alert`,`event`,`create`],run:()=>{t(!0)}},{id:`alerting:test`,title:i.alerting.palette.send_test,group:R,screen:!0,icon:Se,keywords:[`alert`,`notification`,`try`],run:()=>{k(Pt)}}]:[],{id:`alerting:reload`,title:i.alerting.palette.reload,group:R,screen:!0,icon:P,keywords:[`refresh`,`reload`],run:()=>{S(),C()}}]),[j,k,C,S]);let ne=e=>{c(null),o(e.id),T()},re=e=>{o(null),c(e.id),T()},N=()=>{o(null),c(null),te()};return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(f,{title:i.screen.alerting.name,aside:(0,X.jsx)(m,{tag:`alerts`}),actions:[{id:`test`,label:i.action.send_test,icon:Se,variant:`outline`,disabled:!A.may,why:A.why,onClick:()=>{k(Pt)}},{id:`rule`,label:i.alerting.new_rule.button,icon:be,disabled:!A.may,why:A.why,onClick:()=>{t(!0)}}]}),(0,X.jsx)(`section`,{className:`mb-6 space-y-2`,children:(0,X.jsx)(yt,{channels:x.rows,read:x.read})}),(0,X.jsxs)(`section`,{className:`space-y-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.rule.heading}),(0,X.jsx)(d,{loading:!y.state.read,problem:y.state.problem,empty:w.length===0,emptyMessage:i.alerting.rules_empty,children:(0,X.jsx)(h,{columns:Kt,rows:w,rowKey:Rt,rowClassName:e=>ke(e)?void 0:`opacity-60`,reading:y.state.reading,next:y.state.next,onMore:y.more,noun:i.word.rule.count,onSelect:ne,selected:e=>e.id===a,onClose:N})})]}),(0,X.jsxs)(`section`,{className:`mt-8 space-y-2`,children:[(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,X.jsx)(`h2`,{className:`text-sm font-semibold`,children:i.word.notification.heading}),(0,X.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,X.jsx)(ue,{label:i.word.status,value:l.status,anything:i.alerting.any_status,options:we.map(e=>({value:e,label:e,mark:(0,X.jsx)(M,{status:e})})),onChange:e=>{u(t=>({...t,status:e}))}}),(0,X.jsx)(ue,{label:i.alerting.notifier,value:l.notifier,anything:i.alerting.any_notifier,options:Ut(x.rows),onChange:e=>{u(t=>({...t,notifier:e}))}})]})]}),(0,X.jsx)(d,{loading:!b.state.read,problem:b.state.problem,empty:E.length===0,emptyMessage:Re(l)?i.alerting.notifications_empty_filtered:i.alerting.notifications_empty,children:(0,X.jsx)(h,{columns:qt,rows:E,rowKey:zt,reading:b.state.reading,next:b.state.next,onMore:b.more,noun:i.word.notification.count,onSelect:re,selected:e=>e.id===s,onClose:N})})]}),(0,X.jsx)(At,{open:e,onOpenChange:t,notifiers:Ht(x.rows),connections:x.connections,onCreated:S}),(0,X.jsx)(Ft,{open:n!==null,draft:n?.draft??Pt,onOpenChange:e=>{e||r(null)},notifiers:Ht(x.rows),connections:x.connections,onQueued:C,onOpenQueue:e=>{r(null),o(null),c(e),C(),T()}},n?.opened??0)]})}function Ht(e){return[...new Set(e.map(e=>e.notifier))]}function Ut(e){return Ht(e).map(e=>({value:e,label:e}))}function Wt(){let[e,t]=(0,K.useState)(null),[n,r]=(0,K.useState)(null);return(0,K.useEffect)(()=>{let e=!0;return We().then(n=>{e&&t(n)},()=>{e&&t([])}),pe().then(t=>{e&&r(t.items)},()=>{e&&r([])}),()=>{e=!1}},[]),{rows:(0,K.useMemo)(()=>Ge(e??[],n??[]),[n,e]),connections:n??[],read:e!==null&&n!==null}}function Gt({rule:e}){let t=Oe(e.importance);return(0,X.jsxs)(`span`,{className:`flex flex-wrap items-baseline gap-x-1.5`,children:[(0,X.jsx)(`span`,{className:e.scope===`pipeline`?`font-mono text-xs`:`text-sm`,children:De(e)}),t!==null&&(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:t})]})}var Kt=[{id:`rule`,header:i.word.rule.label,kind:`title`,cell:e=>{let t=D(e);return(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:v(`truncate`,t.named?`text-sm font-medium`:`font-mono text-sm font-medium`),title:t.title,children:t.title}),t.code!==null&&(0,X.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code})]})}},{id:`event`,header:i.word.event,cell:e=>(0,X.jsx)(`span`,{className:`text-sm`,children:i.alerting.event[e.event]})},{id:`scope`,header:i.word.scope,cell:e=>(0,X.jsx)(Gt,{rule:e})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(ft,{notifier:e.notifier,connection:e.connection})},{id:`throttle`,header:i.word.throttle,className:`font-mono text-xs`,cell:e=>(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:Ee(e.throttle)})},{id:`sent`,header:i.alerting.last_sent,className:`text-xs`,cell:e=>e.last_sent_at===null?(0,X.jsx)(`span`,{className:`text-muted-foreground`,children:i.word.never}):(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.last_sent_at})},{id:`live`,header:i.word.state,cell:e=>e.paused?(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.paused}):e.active?(0,X.jsx)(`span`,{className:`text-xs text-good`,children:i.state.armed.active}):(0,X.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:i.state.armed.off})}],qt=[{id:`status`,header:i.word.status,cell:e=>(0,X.jsx)(M,{status:e.status})},{id:`subject`,header:i.word.subject,kind:`prose`,cell:e=>(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`truncate text-sm`,title:e.subject,children:e.subject}),e.error!==null&&(0,X.jsx)(`span`,{className:`truncate text-xs text-critical`,title:e.error,children:e.error})]})},{id:`delivers`,header:i.word.delivers_through,cell:e=>(0,X.jsx)(pt,{notifier:e.notifier,connection:e.connection})},{id:`run`,header:i.word.run.label,cell:e=>(0,X.jsx)(mt,{notification:e})},{id:`queued`,header:i.alerting.queued_at,className:`text-xs`,cell:e=>(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.created_at})},{id:`sent`,header:i.alerting.sent_at,className:`text-xs`,cell:e=>e.status===`sent`?(0,X.jsx)(U,{className:`text-muted-foreground`,at:e.sent_at}):e.attempt>0?(0,X.jsx)(`span`,{className:`text-faint`,children:r(e.max_attempts,i.alerting.attempts_of.counted)(e.attempt,e.max_attempts)}):null}];export{Bt as AdminAlerting};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-DPg21HPJ.js";import{n as i}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as a,t as o}from"./PageState-859W4wWp.js";import{i as s,t as c}from"./ListTable-BOX3h68A.js";import{r as l}from"./utils-CT7ZGLfR.js";import{a as u,o as d,r as f}from"./panels-D1Fnei43.js";import{T as p,it as m,rt as h,y as g}from"./index-Bk7mn1Ys.js";import{t as _}from"./Markdown-D4x5xD_I.js";import{n as v,r as y}from"./Panel-Hp0TZRIS.js";import{i as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./blocks-B8eZqUob.js";import{b as D}from"./connections-DobzdyIe.js";import{l as O,r as k}from"./examples-BP1UpQbc.js";import{t as A}from"./KindChip-CwU_Xxdy.js";var j=e(t(),1),M=l(),N=e=>e.id,P=[{key:`scheme`,title:r.blocks.registry.scheme.title,noun:r.blocks.registry.scheme.noun},{key:`notifier`,title:r.blocks.registry.notifier.title,noun:r.blocks.registry.notifier.noun},{key:`connection`,title:r.blocks.registry.connection.title,noun:r.blocks.registry.connection.noun}],F=e=>t=>`${e}:${t.id}`,I=()=>{};function L(){let[e,t]=(0,j.useState)(``),[n,i]=(0,j.useState)(null),{value:l,problem:_,read:v}=g(x),y=g(O),b=(0,j.useMemo)(()=>k(y.value??[]),[y.value]),C=(0,j.useMemo)(()=>l?.blocks??[],[l]),E=(0,j.useMemo)(()=>S(C,e),[C,e]),D=(0,j.useMemo)(()=>T(E),[E]),A=(0,j.useMemo)(()=>w(l?.storage_schemes??[],e),[l,e]),L=(0,j.useMemo)(()=>w(l?.notifiers??[],e),[l,e]),z=(0,j.useMemo)(()=>w(l?.connection_kinds??[],e),[l,e]),U=(0,j.useMemo)(()=>R(b),[b]),W=C.find(e=>`block:${e.id}`===n)??null,G={scheme:A,notifier:L,connection:z},K=P.flatMap(e=>G[e.key].map(t=>({registry:e,entry:t}))).find(({registry:e,entry:t})=>F(e.key)(t)===n)??null;(0,j.useEffect)(()=>{if(v)return m({note:null,tone:`quiet`,identifier:null}),h},[C,v,l]),(0,j.useEffect)(()=>{if(W!==null)return u([{id:`block`,label:r.word.block.label,render:()=>(0,M.jsx)(H,{entry:W})}],{screen:`blocks`});if(K!==null){let{registry:e,entry:t}=K;return u([{id:`entry`,label:e.title,render:()=>(0,M.jsx)(V,{entry:t})}],{screen:`blocks`})}},[W,K]);let q=(0,j.useCallback)(e=>{i(`block:${e.id}`),d()},[]),J=(0,j.useCallback)(()=>{i(null),f()},[]);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(o,{title:r.screen.blocks.name,aside:(0,M.jsx)(s,{tag:`blocks`})}),(0,M.jsx)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:(0,M.jsx)(p,{value:e,label:r.blocks.search,onChange:t})}),(0,M.jsx)(a,{loading:!v,problem:_,empty:E.length===0&&A.length===0&&L.length===0&&z.length===0,emptyMessage:C.length===0?r.blocks.empty:r.blocks.empty_filtered,children:(0,M.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[D.map(([e,t])=>(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e}),(0,M.jsx)(c,{chrome:{footer:!1},columns:U,rows:t,rowKey:N,reading:!1,next:null,onMore:I,noun:r.word.block.count,onSelect:q,selected:e=>`block:${e.id}`===n,onClose:J})]},e)),P.map(e=>{let t=G[e.key];return t.length===0?null:(0,M.jsxs)(`section`,{children:[(0,M.jsx)(`h2`,{className:`mb-1.5 font-mono text-xs font-semibold tracking-wide text-faint uppercase`,children:e.title}),(0,M.jsx)(c,{chrome:{footer:!1},columns:B(e.key),rows:t,rowKey:F(e.key),reading:!1,next:null,onMore:I,noun:e.noun,onSelect:t=>{i(F(e.key)(t)),d()},selected:t=>F(e.key)(t)===n,onClose:J})]},e.key)})]})})]})}function R(e){return[{id:`block`,header:r.word.block.label,kind:`title`,cell:e=>(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:e.summary,children:e.summary})]})},{id:`kind`,header:r.word.kind.label,className:`min-w-32 whitespace-nowrap`,cell:e=>(0,M.jsx)(A,{kind:e.kind})},{id:`examples`,header:r.word.example.heading,className:`min-w-28 whitespace-nowrap`,cell:t=>(0,M.jsx)(z,{id:t.id,many:e.get(t.id)??0})},{id:`plugin`,header:r.word.plugin.label,className:`min-w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function z({id:e,many:t}){if(t===0)return(0,M.jsx)(`span`,{className:`text-xs text-faint`,children:r.word.none});let a=n(t,r.blocks.example_count)(String(t));return(0,M.jsx)(i,{className:`text-xs text-primary-ink hover:underline`,to:`/examples?block=${encodeURIComponent(e)}`,title:r.blocks.example_link(e),onClick:e=>{e.stopPropagation()},children:a})}function B(e){let t=e===`scheme`?`storage`:e;return[{id:`entry`,header:r.blocks.entry_header,kind:`title`,cell:e=>{let t=typeof e.config_schema.description==`string`?e.config_schema.description:``;return(0,M.jsxs)(`div`,{className:`min-w-0`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:t,children:t})]})}},{id:`kind`,header:r.word.kind.label,className:`min-w-32 whitespace-nowrap`,cell:()=>(0,M.jsx)(A,{kind:t})},{id:`plugin`,header:r.word.plugin.label,className:`min-w-36 font-mono text-xs whitespace-nowrap`,cell:e=>(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]}function V({entry:e}){let t=(0,j.useMemo)(()=>D(e.config_schema),[e]),n=typeof e.config_schema.description==`string`?e.config_schema.description:null;return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),n!==null&&(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n}),(0,M.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:(0,M.jsx)(v,{term:r.blocks.fact.term.plugin,detail:e.plugin})})]}),(0,M.jsx)(y,{title:r.word.config,children:t.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r.form.no_configuration}):(0,M.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,M.jsx)(U,{field:e},e.name))})})]})}function H({entry:e}){let t=(0,j.useMemo)(()=>D(e.config_schema),[e]),n=b(e);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,M.jsxs)(`div`,{className:`space-y-1`,children:[(0,M.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:e.id}),(0,M.jsx)(`p`,{children:(0,M.jsx)(A,{kind:e.kind})}),(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.summary})]}),(0,M.jsx)(y,{title:r.blocks.facts_section,children:(0,M.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:n.map(e=>(0,M.jsx)(v,{term:e.term,detail:e.detail},e.term))})}),(0,M.jsx)(y,{title:r.word.config,children:t.length===0?(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r.form.no_configuration}):(0,M.jsx)(`div`,{className:`flex flex-col gap-4`,children:t.map(e=>(0,M.jsx)(U,{field:e},e.name))})})]})}function U({field:e}){let t=C(e);return(0,M.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,M.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2`,children:[(0,M.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),(0,M.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:E(e)}),e.required&&(0,M.jsx)(`span`,{className:`text-xs text-primary-ink`,children:r.blocks.field_required}),e.hint!==null&&(0,M.jsx)(`span`,{className:`text-xs text-faint`,children:e.hint}),t!==null&&(0,M.jsxs)(`span`,{className:`text-xs text-faint`,children:[r.blocks.field_default,` `,t]})]}),e.options.length>0&&(0,M.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:e.options.map(e=>e.label).join(` · `)}),e.help!==null&&(0,M.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,M.jsx)(_,{text:e.help})})]})}export{L as Blocks};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-DPg21HPJ.js";import{n as r}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{r as i,t as a}from"./utils-CT7ZGLfR.js";var o=e(t(),1),s=i();function c({trail:e,code:t}){return(0,s.jsxs)(`nav`,{className:`flex min-w-0 items-center gap-1.5 text-sm`,"aria-label":n.shell.breadcrumb,title:e.map(e=>e.label).join(` / `),children:[e.map((t,n)=>{let i=n===e.length-1,c=i||t.keep===!0,l=e.slice(0,n).some(e=>e.keep===!0);return(0,s.jsxs)(o.Fragment,{children:[n>0&&(0,s.jsx)(`span`,{className:a(`text-faint`,!(c&&l)&&`hidden md:inline`),"aria-hidden":!0,children:`/`}),t.to===void 0?(0,s.jsx)(`span`,{title:t.title,className:a(`min-w-0 truncate`,i&&`font-medium`,t.mono===!0&&`font-mono`,!c&&`hidden md:inline`),children:t.label}):(0,s.jsx)(r,{to:t.to,title:t.title,className:a(`min-w-0 truncate text-muted-foreground hover:text-foreground`,t.mono===!0&&`font-mono`,!c&&`hidden md:inline`),children:t.label})]},`${t.label}-${String(n)}`)}),t!=null&&(0,s.jsx)(`span`,{className:`min-w-0 truncate font-mono text-xs text-muted-foreground`,children:t})]})}export{c as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-DPg21HPJ.js";import{a as r,i,n as a,o,r as s}from"./JsonBlock-BKULShrN.js";import{r as c}from"./glyphs-DLSRr36C.js";import{r as l}from"./utils-CT7ZGLfR.js";import{d as u}from"./paging-B8nfgCnQ.js";import{t as d}from"./input-DjAM-vmX.js";import{t as f}from"./SchemaForm-BOKQeNtm.js";import{t as p}from"./textarea-D86x5ut1.js";import{t as m}from"./use-store-CZcp6jmY.js";import{A as h,S as g,j as _,x as v}from"./index-Bk7mn1Ys.js";import{C as y,I as b,L as x,a as S,p as C,s as w}from"./connections-DobzdyIe.js";import{t as T}from"./Refusal-Bjzfpcdg.js";import{t as E}from"./Mark-DQR2php6.js";var D=l();function O({id:e,name:t,stored:r,value:i,onChange:a}){return(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(h,{htmlFor:e,className:`font-mono text-sm font-medium`,children:t}),(0,D.jsx)(d,{id:e,type:`password`,autoComplete:`new-password`,value:i,onChange:e=>{a(e.target.value)},placeholder:r?n.connections.secret_stored:n.connections.secret_unset})]})}var k=e(t(),1),A={code:``,kind:``,name:``,description:``,values:{},secrets:{}};function j(e,t){return{...A,code:e,kind:t??``}}function M(e,t){return{...e,kind:t,values:{},secrets:{}}}function N(e,t,n){let r={...e.values};return n===void 0?delete r[t]:r[t]=n,{...e,values:r}}function P(e,t,n){return{...e,secrets:{...e.secrets,[t]:n}}}function F(e){return{code:e.code.trim(),name:L(e.name),kind:e.kind,description:L(e.description),config:w(e.values,e.secrets)}}function I(e,t,r){if(e.code.trim()===``)return n.connections.needs_code;if(e.kind===``)return n.connections.needs_kind;if(r.size>0)return n.connections.unreadable_setting;if(!y(t,r))return n.connections.settings_refused}function L(e){let t=e.trim();return t===``?null:t}function R(e,t=``,r=null){let[i,a]=(0,k.useState)(()=>j(t,r)),[o,s]=(0,k.useState)(()=>new Set),[c,l]=(0,k.useState)(()=>new Set),[d,f]=(0,k.useState)(!1),[p,m]=(0,k.useState)(null),[h,_]=(0,k.useState)(!1),y=v(`admin`),w=e.find(e=>e.id===i.kind)??null,T=(0,k.useMemo)(()=>C(w?.config_schema??null,w?.secret_fields??[]),[w]),E=(0,k.useMemo)(()=>b(T,i.values),[T,i.values]);return{draft:i,chosen:w,fields:T,problems:E,stated:d?void 0:o,shut:g(y.why,I(i,E,c),i.kind!==``&&w===null?n.connections.kind_unknown(i.kind):void 0),busy:h,problem:p,setCode:e=>{a(t=>({...t,code:e}))},chooseKind:e=>{a(t=>M(t,e)),s(new Set),l(new Set),f(!1)},setName:e=>{a(t=>({...t,name:e}))},setDescription:e=>{a(t=>({...t,description:e}))},setSetting:(e,t)=>{a(n=>N(n,e,t))},setSecret:(e,t)=>{a(n=>P(n,e,t))},touch:e=>{s(t=>t.has(e)?t:new Set(t).add(e))},markUnreadable:(e,t)=>{l(n=>x(n,e,t))},create:e=>{f(!0),_(!0),m(null),S(F(i)).then(n=>{a(j(t,r)),s(new Set),l(new Set),f(!1),e(n)},e=>{m(u(e))}).finally(()=>{_(!1)})}}}function z({form:e,kinds:t,decided:r,ids:i}){let{draft:a,chosen:o}=e,s=r===void 0||r.kind===null;return(0,D.jsxs)(D.Fragment,{children:[r===void 0?(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-code`,children:n.word.code}),(0,D.jsx)(d,{id:`${i}-code`,className:`font-mono`,value:a.code,onChange:t=>{e.setCode(t.target.value)},placeholder:n.connections.code_placeholder})]}),(0,D.jsx)(B,{form:e,kinds:t,ids:i})]}):s&&(0,D.jsx)(B,{form:e,kinds:t,ids:i}),r===void 0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-name`,children:n.word.name.label}),(0,D.jsx)(d,{id:`${i}-name`,value:a.name,onChange:t=>{e.setName(t.target.value)}})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${i}-description`,children:n.word.description}),(0,D.jsx)(p,{id:`${i}-description`,className:`h-24`,value:a.description,onChange:t=>{e.setDescription(t.target.value)},placeholder:n.connections.description_placeholder})]})]}),o!==null&&(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:n.connections.settings_heading}),(0,D.jsxs)(`div`,{className:`space-y-3`,children:[(0,D.jsx)(f,{fields:e.fields,values:a.values,problems:e.problems,stated:e.stated,fold:r!==void 0,onChange:e.setSetting,onTouch:e.touch,onUnreadable:e.markUnreadable}),o.secret_fields.map(t=>(0,D.jsx)(O,{id:`${i}-secret-${t}`,name:t,stored:!1,value:a.secrets[t]??``,onChange:n=>{e.setSecret(t,n)}},t))]})]}),e.problem!==null&&(0,D.jsx)(T,{problem:e.problem})]})}function B({form:e,kinds:t,ids:c}){let l=e.chosen;return(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(h,{htmlFor:`${c}-kind`,children:n.word.kind.label}),(0,D.jsxs)(a,{value:e.draft.kind,onValueChange:t=>{e.chooseKind(String(t))},children:[(0,D.jsx)(r,{id:`${c}-kind`,className:`w-full font-mono`,children:(0,D.jsx)(o,{placeholder:n.connections.choose_kind,children:l===null?void 0:()=>(0,D.jsx)(V,{kind:l.id})})}),(0,D.jsx)(s,{children:t.map(e=>(0,D.jsx)(i,{value:e.id,className:`font-mono`,children:(0,D.jsx)(V,{kind:e.id})},e.id))})]})]})}function V({kind:e}){let t=m(_);return(0,D.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(E,{glyph:c(e,t)}),e]})}export{R as n,O as r,z as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,t as r}from"./labels-Dp8H1wzG.js";import{c as i,l as a,u as o}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{r as s}from"./glyphs-CaFpiNjJ.js";import{l as c,n as l,t as u}from"./PageState-CuZbHz6s.js";import{i as d,n as f,t as p}from"./ListTable-A_dkU0ci.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{i as g,n as _,t as v}from"./tooltip-Bas36yZU.js";import{d as y,h as b}from"./paging-C4feZMNQ.js";import{t as x}from"./input-sbz1EN8t.js";import{t as S}from"./SchemaForm-ByfDLufz.js";import{t as C}from"./textarea-D86x5ut1.js";import{t as w}from"./use-store-CZcp6jmY.js";import{a as T,o as E,r as D}from"./panels-D1Fnei43.js";import{d as O,l as k,s as A}from"./format-D2kQLRJs.js";import{t as j}from"./identity-BNZxCf_y.js";import{A as M,At as N,Ft as P,It as F,Lt as I,Mt as L,Nt as R,Pt as z,S as B,b as ee,gt as te,it as ne,j as V,jt as re,mt as H,rt as U,x as W,y as ie}from"./index-DcrUT8O1.js";import{t as ae}from"./Description-C-byz7P3.js";import{C as oe,I as se,L as ce,d as le,f as ue,g as de,h as fe,i as pe,l as me,n as he,o as G,p as ge,t as _e,u as ve}from"./connections-ENTr1Nsd.js";import{n as ye,t as be}from"./Refusal-3GHMZOnu.js";import{t as xe}from"./KindChip-CwU_Xxdy.js";import{t as K}from"./Instant-CihfxyJ1.js";import{t as q}from"./Mark-DQR2php6.js";import{n as Se,r as Ce,t as we}from"./ConnectionFields-HTVyzXLM.js";var J={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};J.node;var Y=n(J),X=e(t(),1),Z=m(),Te={good:`var(--good)`,critical:`var(--critical)`};function Ee(e){return e===null?`var(--faint)`:Te[e]}function Q({view:e,className:t}){return(0,Z.jsxs)(`span`,{className:h(`flex items-center gap-2 text-xs`,t),children:[(0,Z.jsx)(`span`,{className:`status-dot`,style:{"--chip":Ee(e.tone)},"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:h(`whitespace-nowrap`,e.tone===null&&`text-faint`),children:e.label})]})}function De({connection:e,schema:t,onSaved:n}){let i=w(V),[a,o]=(0,X.useState)(e.name??``),[l,u]=(0,X.useState)(e.description??``),[d,f]=(0,X.useState)(()=>Ae(e)),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(()=>new Set),[_,v]=(0,X.useState)(null),[T,E]=(0,X.useState)(!1),[D,k]=(0,X.useState)(!1),A=j(e),N=(0,X.useMemo)(()=>ke(e,t),[e,t]),P=(0,X.useMemo)(()=>se(N,d),[N,d]),F=W(`admin`),I=B(F.why,oe(P,h)?void 0:r.connections.settings_refused);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,i)}),(0,Z.jsx)(`span`,{className:A.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:A.title}),A.code!==null&&(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:A.code}),(0,Z.jsx)(xe,{kind:e.kind})]}),(0,Z.jsxs)(`p`,{className:`text-xs text-faint`,children:[r.word.created.label,` `,(0,Z.jsx)(K,{at:e.created_at}),O(e.created_at,e.updated_at)&&(0,Z.jsxs)(Z.Fragment,{children:[r.connections.also_updated,(0,Z.jsx)(K,{at:e.updated_at})]})]}),(0,Z.jsx)(Oe,{connection:e}),(0,Z.jsx)(ae,{text:e.description})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-name`,children:r.word.name.label}),(0,Z.jsx)(x,{id:`connection-name`,value:a,onChange:e=>{o(e.target.value),k(!1)}}),(0,Z.jsx)(`p`,{className:`text-xs text-faint`,children:r.connections.name_hint(e.code)})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-description`,children:r.word.description}),(0,Z.jsx)(C,{id:`connection-description`,className:`h-24`,value:l,onChange:e=>{u(e.target.value),k(!1)},placeholder:r.connections.description_placeholder})]}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:r.connections.settings_heading}),(0,Z.jsx)(S,{fields:N,values:d,problems:P,onChange:(e,t)=>{f(n=>({...n,[e]:t})),k(!1)},onUnreadable:(e,t)=>{g(n=>ce(n,e,t))}}),e.secret_fields.map(t=>(0,Z.jsx)(Ce,{id:`secret-${t}`,name:t,stored:je(e.config[t]),value:p[t]??``,onChange:e=>{m(n=>({...n,[t]:e})),k(!1)}},t))]}),_!==null&&(0,Z.jsx)(be,{problem:_}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(c,{why:I,children:(0,Z.jsx)(b,{size:`sm`,onClick:()=>{let t=me(e,Me(e,d,p),$(a),$(l));if(t===null){k(!0);return}E(!0),v(null),fe(e.code,t).then(e=>{m({}),k(!0),n(e)},e=>{v(y(e))}).finally(()=>{E(!1)})},disabled:T||I!==void 0,title:I,children:T?r.action.save.busy:r.action.save.verb})}),D&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r.action.save.done})]})]})}function Oe({connection:e}){let t=G(e);return(0,Z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{view:t}),t.checkedAt!==null&&(0,Z.jsxs)(`span`,{className:`text-xs text-faint`,children:[r.word.checked.term,` `,(0,Z.jsx)(K,{at:t.checkedAt})]})]}),t.detail!==null&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.detail})]})}function ke(e,t){let n=new Set(e.secret_fields);return t===null?Object.keys(e.config).filter(e=>!n.has(e)).map(t=>({name:t,kind:typeof e.config[t]==`string`?`text`:`json`,help:null,required:!1,nullable:!0,fallback:void 0,options:[],mediaType:null,refers:null,hint:null,placeholder:``,bounds:{},accepts:[],holds:[]})):ge(t,e.secret_fields)}function Ae(e){let t=new Set(e.secret_fields),n={};for(let[r,i]of Object.entries(e.config))t.has(r)||(n[r]=i);return n}function je(e){return e!=null}function $(e){let t=e.trim();return t===``?null:t}function Me(e,t,n){let r={};for(let[n,i]of Object.entries(t))Object.is(i,e.config[n])||(r[n]=i);for(let[e,t]of Object.entries(n))t!==``&&(r[e]=t);return r}function Ne({open:e,kinds:t,startKind:n=``,onOpenChange:i,onCreated:a}){let o=Se(t,``,n);return(0,Z.jsx)(N,{open:e,onOpenChange:i,children:(0,Z.jsxs)(L,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-xl`,showCloseButton:!1,children:[(0,Z.jsxs)(P,{children:[(0,Z.jsx)(F,{children:r.connections.new}),(0,Z.jsx)(R,{children:r.connections.sealed})]}),(0,Z.jsx)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:(0,Z.jsx)(we,{form:o,kinds:t,ids:`connection-new`})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(re,{render:(0,Z.jsx)(b,{variant:`ghost`}),children:r.action.close}),(0,Z.jsx)(c,{why:o.shut,children:(0,Z.jsx)(b,{disabled:o.busy||o.shut!==void 0,title:o.shut,onClick:()=>{o.create(e=>{a(e),i(!1)})},children:o.busy?r.action.create.busy:r.action.create.verb})})]})]})})}var Pe=e=>e.code;function Fe(){let{code:e=null}=a(),t=i(),[n,s]=o(),f=n.get(`new`),[m,h]=(0,X.useState)(!1),g=m||f!==null,[_,v]=(0,X.useState)({}),[y,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),{state:w,more:O,reload:k}=ee(ue,Pe),A=(0,X.useMemo)(()=>w.rows.map(e=>_[e.code]??e),[_,w.rows]),j=A.find(t=>t.code===e)??null,M=(0,X.useCallback)(()=>e===null||j!==null?Promise.resolve(null):ve(e),[e,j]),N=ie(M).value,P=j??(N===null?null:_[N.code]??N);(0,X.useEffect)(()=>{e!==null&&E()},[e]);let F=(0,X.useCallback)(e=>{v(t=>({...t,[e.code]:e}))},[]),L=(0,X.useCallback)(e=>{x(e.code),_e(e.code).then(t=>{F(de(e,t,new Date().toISOString()))},ye).finally(()=>{x(null)})},[F]),R=e!==null||g;(0,X.useEffect)(()=>{if(!R||S!==null)return;let e=!0;return le().then(t=>{e&&C(t)},()=>{}),()=>{e=!1}},[S,R]),(0,X.useEffect)(()=>{let e=pe(A);if(e===null){U();return}return ne({note:e,tone:`quiet`,identifier:null}),U},[A]),(0,X.useEffect)(()=>{if(P===null)return;let e=S?.find(e=>e.id===P.kind)?.config_schema??null;return T([{id:`connection`,label:r.word.connection.label,render:()=>(0,Z.jsx)(De,{connection:P,schema:e,onSaved:F},P.code)}],{screen:`connections`})},[F,S,P]);let z=W(`admin`),B=z.may;(0,X.useEffect)(()=>te([...B?[{id:`connections:new`,title:r.connections.new,group:H,screen:!0,icon:Y,keywords:[`credential`,`create`,`add`],run:()=>{h(!0)}}]:[],{id:`connections:reload`,title:r.connections.reload,group:H,screen:!0,icon:I,keywords:[`refresh`,`reload`],run:k}]),[B,k]);let V=(0,X.useMemo)(()=>Ie(L,y,z.why),[L,y,z.why]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{title:r.screen.connections.name,aside:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{tag:`connections`}),(0,Z.jsx)(c,{why:z.why,children:(0,Z.jsxs)(b,{size:`sm`,"aria-label":r.connections.new,disabled:!z.may,title:z.why,onClick:()=>{h(!0)},children:[(0,Z.jsx)(Y,{"aria-hidden":!0}),r.action.new]})})]})}),(0,Z.jsx)(l,{loading:!w.read,problem:w.problem,empty:A.length===0,emptyMessage:r.connections.empty,children:(0,Z.jsx)(p,{columns:V,rows:A,rowKey:Pe,reading:w.reading,next:w.next,onMore:O,noun:r.word.connection.count,onSelect:e=>{t(he(e.code),{replace:!0})},selected:t=>t.code===e,onClose:()=>{t(`/connections`,{replace:!0}),D()}})}),(0,Z.jsx)(Ne,{open:g,kinds:S??[],startKind:f??``,onOpenChange:e=>{h(e),!e&&f!==null&&(n.delete(`new`),s(n,{replace:!0}))},onCreated:()=>{k()}},f??``)]})}function Ie(e,t,n){return[{id:`connection`,header:r.word.connection.label,kind:`title`,cell:e=>(0,Z.jsx)(Le,{row:e})},{id:`health`,header:r.word.health,cell:e=>(0,Z.jsx)(Re,{row:e})},{id:`checked`,header:r.word.checked.label,className:`text-xs`,cell:e=>e.last_check_at===null?null:(0,Z.jsx)(ze,{at:e.last_check_at})},{id:`check`,header:``,className:`py-1 text-right`,cell:i=>(0,Z.jsx)(c,{why:n,children:(0,Z.jsx)(b,{variant:`outline`,size:`icon-lg`,"aria-label":r.connections.check_row(i.code),disabled:t===i.code||n!==void 0,title:n??r.action.check,onClick:t=>{t.stopPropagation(),e(i)},children:(0,Z.jsx)(I,{className:h(t===i.code&&`animate-spin`),"aria-hidden":!0})})})}]}function Le({row:e}){let t=j(e),n=w(V);return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,n)}),(0,Z.jsx)(`span`,{className:h(`truncate font-semibold`,!t.named&&`font-mono`),title:t.title,children:t.title}),t.code!==null&&(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code}),(0,Z.jsx)(xe,{kind:e.kind})]})}function Re({row:e}){let t=G(e),n=f();return t.detail===null||n?(0,Z.jsx)(Q,{view:t}):(0,Z.jsxs)(v,{children:[(0,Z.jsx)(g,{render:(0,Z.jsx)(`button`,{type:`button`,className:`rounded-sm focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Q,{view:t})})}),(0,Z.jsx)(_,{side:`bottom`,children:t.detail})]})}function ze({at:e}){return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,title:A(e),children:k(e)})}export{Fe as Connections};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{a as n,t as r}from"./labels-DPg21HPJ.js";import{c as i,l as a,u as o}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{r as s}from"./glyphs-DLSRr36C.js";import{l as c,n as l,t as u}from"./PageState-859W4wWp.js";import{i as d,n as f,t as p}from"./ListTable-BOX3h68A.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{i as g,n as _,t as v}from"./tooltip-CrzRgh7Y.js";import{d as y,h as b}from"./paging-B8nfgCnQ.js";import{t as x}from"./input-DjAM-vmX.js";import{t as S}from"./SchemaForm-BOKQeNtm.js";import{t as C}from"./textarea-D86x5ut1.js";import{t as w}from"./use-store-CZcp6jmY.js";import{a as T,o as E,r as D}from"./panels-D1Fnei43.js";import{d as O,l as k,s as A}from"./format-DK4FnJoS.js";import{t as j}from"./identity-BNZxCf_y.js";import{A as M,At as N,Ft as P,It as F,Lt as I,Mt as L,Nt as R,Pt as z,S as B,b as ee,gt as te,it as ne,j as V,jt as re,mt as H,rt as U,x as W,y as ie}from"./index-Bk7mn1Ys.js";import{t as ae}from"./Description-C-byz7P3.js";import{C as oe,I as se,L as ce,d as le,f as ue,g as de,h as fe,i as pe,l as me,n as he,o as G,p as ge,t as _e,u as ve}from"./connections-DobzdyIe.js";import{n as ye,t as be}from"./Refusal-Bjzfpcdg.js";import{t as xe}from"./KindChip-CwU_Xxdy.js";import{t as K}from"./Instant-Ogv9qDZy.js";import{t as q}from"./Mark-DQR2php6.js";import{n as Se,r as Ce,t as we}from"./ConnectionFields-DzzkA2pf.js";var J={name:`plug-zap`,size:24,node:[[`path`,{d:`M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z`,key:`goz73y`}],[`path`,{d:`m2 22 3-3`,key:`19mgm9`}],[`path`,{d:`M7.5 13.5 10 11`,key:`7xgeeb`}],[`path`,{d:`M10.5 16.5 13 14`,key:`10btkg`}],[`path`,{d:`m18 3-4 4h6l-4 4`,key:`16psg9`}]],aliases:[`plug-zap-2`]};J.node;var Y=n(J),X=e(t(),1),Z=m(),Te={good:`var(--good)`,critical:`var(--critical)`};function Ee(e){return e===null?`var(--faint)`:Te[e]}function Q({view:e,className:t}){return(0,Z.jsxs)(`span`,{className:h(`flex items-center gap-2 text-xs`,t),children:[(0,Z.jsx)(`span`,{className:`status-dot`,style:{"--chip":Ee(e.tone)},"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:h(`whitespace-nowrap`,e.tone===null&&`text-faint`),children:e.label})]})}function De({connection:e,schema:t,onSaved:n}){let i=w(V),[a,o]=(0,X.useState)(e.name??``),[l,u]=(0,X.useState)(e.description??``),[d,f]=(0,X.useState)(()=>Ae(e)),[p,m]=(0,X.useState)({}),[h,g]=(0,X.useState)(()=>new Set),[_,v]=(0,X.useState)(null),[T,E]=(0,X.useState)(!1),[D,k]=(0,X.useState)(!1),A=j(e),N=(0,X.useMemo)(()=>ke(e,t),[e,t]),P=(0,X.useMemo)(()=>se(N,d),[N,d]),F=W(`admin`),I=B(F.why,oe(P,h)?void 0:r.connections.settings_refused);return(0,Z.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,i)}),(0,Z.jsx)(`span`,{className:A.named?`text-sm font-semibold`:`font-mono text-sm font-semibold`,children:A.title}),A.code!==null&&(0,Z.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground`,children:A.code}),(0,Z.jsx)(xe,{kind:e.kind})]}),(0,Z.jsxs)(`p`,{className:`text-xs text-faint`,children:[r.word.created.label,` `,(0,Z.jsx)(K,{at:e.created_at}),O(e.created_at,e.updated_at)&&(0,Z.jsxs)(Z.Fragment,{children:[r.connections.also_updated,(0,Z.jsx)(K,{at:e.updated_at})]})]}),(0,Z.jsx)(Oe,{connection:e}),(0,Z.jsx)(ae,{text:e.description})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-name`,children:r.word.name.label}),(0,Z.jsx)(x,{id:`connection-name`,value:a,onChange:e=>{o(e.target.value),k(!1)}}),(0,Z.jsx)(`p`,{className:`text-xs text-faint`,children:r.connections.name_hint(e.code)})]}),(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsx)(M,{htmlFor:`connection-description`,children:r.word.description}),(0,Z.jsx)(C,{id:`connection-description`,className:`h-24`,value:l,onChange:e=>{u(e.target.value),k(!1)},placeholder:r.connections.description_placeholder})]}),(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(`p`,{className:`text-xs font-semibold tracking-wide text-faint uppercase`,children:r.connections.settings_heading}),(0,Z.jsx)(S,{fields:N,values:d,problems:P,onChange:(e,t)=>{f(n=>({...n,[e]:t})),k(!1)},onUnreadable:(e,t)=>{g(n=>ce(n,e,t))}}),e.secret_fields.map(t=>(0,Z.jsx)(Ce,{id:`secret-${t}`,name:t,stored:je(e.config[t]),value:p[t]??``,onChange:e=>{m(n=>({...n,[t]:e})),k(!1)}},t))]}),_!==null&&(0,Z.jsx)(be,{problem:_}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(c,{why:I,children:(0,Z.jsx)(b,{size:`sm`,onClick:()=>{let t=me(e,Me(e,d,p),$(a),$(l));if(t===null){k(!0);return}E(!0),v(null),fe(e.code,t).then(e=>{m({}),k(!0),n(e)},e=>{v(y(e))}).finally(()=>{E(!1)})},disabled:T||I!==void 0,title:I,children:T?r.action.save.busy:r.action.save.verb})}),D&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r.action.save.done})]})]})}function Oe({connection:e}){let t=G(e);return(0,Z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,Z.jsxs)(`p`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Q,{view:t}),t.checkedAt!==null&&(0,Z.jsxs)(`span`,{className:`text-xs text-faint`,children:[r.word.checked.term,` `,(0,Z.jsx)(K,{at:t.checkedAt})]})]}),t.detail!==null&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t.detail})]})}function ke(e,t){let n=new Set(e.secret_fields);return t===null?Object.keys(e.config).filter(e=>!n.has(e)).map(t=>({name:t,kind:typeof e.config[t]==`string`?`text`:`json`,help:null,required:!1,nullable:!0,fallback:void 0,options:[],mediaType:null,refers:null,hint:null,placeholder:``,bounds:{},accepts:[],holds:[]})):ge(t,e.secret_fields)}function Ae(e){let t=new Set(e.secret_fields),n={};for(let[r,i]of Object.entries(e.config))t.has(r)||(n[r]=i);return n}function je(e){return e!=null}function $(e){let t=e.trim();return t===``?null:t}function Me(e,t,n){let r={};for(let[n,i]of Object.entries(t))Object.is(i,e.config[n])||(r[n]=i);for(let[e,t]of Object.entries(n))t!==``&&(r[e]=t);return r}function Ne({open:e,kinds:t,startKind:n=``,onOpenChange:i,onCreated:a}){let o=Se(t,``,n);return(0,Z.jsx)(N,{open:e,onOpenChange:i,children:(0,Z.jsxs)(L,{className:`flex max-h-[calc(100vh-4rem)] flex-col sm:max-w-xl`,showCloseButton:!1,children:[(0,Z.jsxs)(P,{children:[(0,Z.jsx)(F,{children:r.connections.new}),(0,Z.jsx)(R,{children:r.connections.sealed})]}),(0,Z.jsx)(`div`,{className:`-mx-1 min-h-0 flex-1 space-y-4 overflow-y-auto px-1`,children:(0,Z.jsx)(we,{form:o,kinds:t,ids:`connection-new`})}),(0,Z.jsxs)(z,{children:[(0,Z.jsx)(re,{render:(0,Z.jsx)(b,{variant:`ghost`}),children:r.action.close}),(0,Z.jsx)(c,{why:o.shut,children:(0,Z.jsx)(b,{disabled:o.busy||o.shut!==void 0,title:o.shut,onClick:()=>{o.create(e=>{a(e),i(!1)})},children:o.busy?r.action.create.busy:r.action.create.verb})})]})]})})}var Pe=e=>e.code;function Fe(){let{code:e=null}=a(),t=i(),[n,s]=o(),f=n.get(`new`),[m,h]=(0,X.useState)(!1),g=m||f!==null,[_,v]=(0,X.useState)({}),[y,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),{state:w,more:O,reload:k}=ee(ue,Pe),A=(0,X.useMemo)(()=>w.rows.map(e=>_[e.code]??e),[_,w.rows]),j=A.find(t=>t.code===e)??null,M=(0,X.useCallback)(()=>e===null||j!==null?Promise.resolve(null):ve(e),[e,j]),N=ie(M).value,P=j??(N===null?null:_[N.code]??N);(0,X.useEffect)(()=>{e!==null&&E()},[e]);let F=(0,X.useCallback)(e=>{v(t=>({...t,[e.code]:e}))},[]),L=(0,X.useCallback)(e=>{x(e.code),_e(e.code).then(t=>{F(de(e,t,new Date().toISOString()))},ye).finally(()=>{x(null)})},[F]),R=e!==null||g;(0,X.useEffect)(()=>{if(!R||S!==null)return;let e=!0;return le().then(t=>{e&&C(t)},()=>{}),()=>{e=!1}},[S,R]),(0,X.useEffect)(()=>{let e=pe(A);if(e===null){U();return}return ne({note:e,tone:`quiet`,identifier:null}),U},[A]),(0,X.useEffect)(()=>{if(P===null)return;let e=S?.find(e=>e.id===P.kind)?.config_schema??null;return T([{id:`connection`,label:r.word.connection.label,render:()=>(0,Z.jsx)(De,{connection:P,schema:e,onSaved:F},P.code)}],{screen:`connections`})},[F,S,P]);let z=W(`admin`),B=z.may;(0,X.useEffect)(()=>te([...B?[{id:`connections:new`,title:r.connections.new,group:H,screen:!0,icon:Y,keywords:[`credential`,`create`,`add`],run:()=>{h(!0)}}]:[],{id:`connections:reload`,title:r.connections.reload,group:H,screen:!0,icon:I,keywords:[`refresh`,`reload`],run:k}]),[B,k]);let V=(0,X.useMemo)(()=>Ie(L,y,z.why),[L,y,z.why]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(u,{title:r.screen.connections.name,aside:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{tag:`connections`}),(0,Z.jsx)(c,{why:z.why,children:(0,Z.jsxs)(b,{size:`sm`,"aria-label":r.connections.new,disabled:!z.may,title:z.why,onClick:()=>{h(!0)},children:[(0,Z.jsx)(Y,{"aria-hidden":!0}),r.action.new]})})]})}),(0,Z.jsx)(l,{loading:!w.read,problem:w.problem,empty:A.length===0,emptyMessage:r.connections.empty,children:(0,Z.jsx)(p,{columns:V,rows:A,rowKey:Pe,reading:w.reading,next:w.next,onMore:O,noun:r.word.connection.count,onSelect:e=>{t(he(e.code),{replace:!0})},selected:t=>t.code===e,onClose:()=>{t(`/connections`,{replace:!0}),D()}})}),(0,Z.jsx)(Ne,{open:g,kinds:S??[],startKind:f??``,onOpenChange:e=>{h(e),!e&&f!==null&&(n.delete(`new`),s(n,{replace:!0}))},onCreated:()=>{k()}},f??``)]})}function Ie(e,t,n){return[{id:`connection`,header:r.word.connection.label,kind:`title`,cell:e=>(0,Z.jsx)(Le,{row:e})},{id:`health`,header:r.word.health,cell:e=>(0,Z.jsx)(Re,{row:e})},{id:`checked`,header:r.word.checked.label,className:`text-xs`,cell:e=>e.last_check_at===null?null:(0,Z.jsx)(ze,{at:e.last_check_at})},{id:`check`,header:``,className:`py-1 text-right`,cell:i=>(0,Z.jsx)(c,{why:n,children:(0,Z.jsx)(b,{variant:`outline`,size:`icon-lg`,"aria-label":r.connections.check_row(i.code),disabled:t===i.code||n!==void 0,title:n??r.action.check,onClick:t=>{t.stopPropagation(),e(i)},children:(0,Z.jsx)(I,{className:h(t===i.code&&`animate-spin`),"aria-hidden":!0})})})}]}function Le({row:e}){let t=j(e),n=w(V);return(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,Z.jsx)(q,{glyph:s(e.kind,n)}),(0,Z.jsx)(`span`,{className:h(`truncate font-semibold`,!t.named&&`font-mono`),title:t.title,children:t.title}),t.code!==null&&(0,Z.jsx)(`span`,{className:`truncate font-mono text-xs text-muted-foreground`,title:t.code,children:t.code}),(0,Z.jsx)(xe,{kind:e.kind})]})}function Re({row:e}){let t=G(e),n=f();return t.detail===null||n?(0,Z.jsx)(Q,{view:t}):(0,Z.jsxs)(v,{children:[(0,Z.jsx)(g,{render:(0,Z.jsx)(`button`,{type:`button`,className:`rounded-sm focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-none`,children:(0,Z.jsx)(Q,{view:t})})}),(0,Z.jsx)(_,{side:`bottom`,children:t.detail})]})}function ze({at:e}){return(0,Z.jsx)(`span`,{className:`text-muted-foreground`,title:A(e),children:k(e)})}export{Fe as Connections};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-Dp8H1wzG.js";import{c as i,n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as o,r as s}from"./glyphs-CaFpiNjJ.js";import{i as c,n as l,r as u,t as d}from"./PageState-CuZbHz6s.js";import{i as f,t as p}from"./ListTable-A_dkU0ci.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{t as g}from"./use-store-CZcp6jmY.js";import{t as _}from"./auth-QgZsjd0d.js";import{v}from"./format-D2kQLRJs.js";import{t as ee}from"./use-heartbeat-C3WWagro.js";import{t as y}from"./identity-BNZxCf_y.js";import{m as b}from"./pipelines-Da2DZJX0.js";import{E as x,Lt as S,gt as C,h as w,j as T,l as E,pt as te,t as D,u as O,y as k}from"./index-DcrUT8O1.js";import{f as A,i as j,o as M,r as N}from"./connections-ENTr1Nsd.js";import{t as P}from"./Instant-CihfxyJ1.js";import{t as F}from"./Mark-DQR2php6.js";import{f as ne,i as I,p as re,r as ie,s as ae,t as oe,u as se}from"./TileCard-g50S83Uu.js";import{a as ce,i as L,r as R}from"./workers-D21cApnc.js";import{f as z,s as B}from"./triggers-DD6LKQNg.js";var V=e(t(),1),H=m(),U={neutral:`bg-muted-foreground`,good:`bg-good`,info:`bg-info`,warning:`bg-warning`,critical:`bg-critical`};function W({rows:e,note:t,reading:n}){let i=g(_).identity?.role??null;return(0,H.jsx)(u,{className:`gap-0 p-0`,children:(0,H.jsxs)(c,{className:`flex h-full flex-col p-0`,children:[(0,H.jsxs)(`div`,{className:`space-y-1 px-3 py-3`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.word.health}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?r.shell.reading:r.dashboard.health.hint})]}),(0,H.jsx)(`ul`,{className:`max-h-64 grow overflow-y-auto`,children:e.map(e=>{let t=e.kind===`connection`?`/connections`:i===`admin`?`/admin/workers`:null,n=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-full`,U[e.tone]),"aria-hidden":!0}),e.mark===null?(0,H.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,H.jsx)(F,{glyph:e.mark})]}),(0,H.jsx)(`span`,{className:`max-w-[55%] min-w-[6ch] truncate font-mono text-xs`,title:e.label,children:e.label}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline justify-end gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.detail,children:e.detail}),e.at!==null&&(0,H.jsx)(P,{className:`shrink-0 text-xs text-faint`,at:e.at})]})]});return(0,H.jsx)(`li`,{className:`border-t border-border`,children:t===null?(0,H.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 px-3 py-1.5`,children:n}):(0,H.jsx)(a,{to:t,className:`control-link flex min-w-0 items-center gap-2 px-3 py-1.5 hover:bg-accent/60`,children:n})},`${e.kind}:${e.id}`)})}),(0,H.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:t})]})})}function G(e,t){return`${String(e)}${t.next===null?``:`+`}`}function K(e,t){return e===0?`neutral`:t}function le(e,t){return e.items.filter(e=>e.status===t).length}function ue(e,t,n){let i=(t,n,r)=>{if(e===null)return null;let i=le(e,t);return{id:t,label:n,value:G(i,e),note:``,tone:K(i,r),to:O({...D,status:t,since:`24h`})}},a=(e,t,n,r,i)=>{if(i===null)return null;let a=i.items.length;return{id:e,label:t,value:G(a,i),note:a===0?``:r,tone:K(a,n),to:O({...D,status:e})}};return[{id:`runs`,tile:e===null?null:{id:`runs`,label:r.screen.runs.name,value:G(e.items.length,e),note:r.dashboard.tile.runs_window,tone:`neutral`,to:O({...D,since:`24h`})}},{id:`succeeded`,tile:i(`succeeded`,r.state.run.succeeded.tile,`good`)},{id:`failed`,tile:i(`failed`,r.state.run.failed.tile,`critical`)},{id:`completed_with_errors`,tile:i(`completed_with_errors`,r.state.run.completed_with_errors.tile,`warning`)},{id:`running`,tile:a(`running`,r.state.run.running.tile,`info`,r.state.run.running.sentence,t)},{id:`queued`,tile:a(`queued`,r.state.run.queued.tile,`neutral`,r.state.run.queued.sentence,n)}]}var q=36e5,J=864e5;function de(e,t){let n=e+t*6e4;return Math.floor(n/q)*q-t*6e4}function fe(e,t){let n=e+t*6e4;return Math.floor((n%J+J)%J/q)}function pe(e,t,n,r=24){let i=de(t.getTime(),n)-(r-1)*q,a=Array.from({length:r},(e,t)=>{let r=i+t*q;return{start:r,hour:fe(r,n),succeeded:0,withErrors:0,failed:0,total:0}});for(let t of e){let e=Date.parse(t.created_at);if(Number.isNaN(e))continue;let n=Math.floor((e-i)/q);if(n<0||n>=r)continue;let o=a[n];o.total+=1,t.status===`succeeded`?o.succeeded+=1:t.status===`completed_with_errors`?o.withErrors+=1:t.status===`failed`&&(o.failed+=1)}return a}function Y(e){return e.succeeded+e.withErrors+e.failed}function me(e){return e.reduce((e,t)=>Math.max(e,Y(t)),0)}function he(e){let t=t=>e.reduce((e,n)=>e+t(n),0),i=t(e=>e.total);if(i===0)return r.dashboard.chart.summary_empty;let a=r.dashboard.counted,o=[a(String(t(e=>e.succeeded)),r.state.run.succeeded.chip),a(String(t(e=>e.withErrors)),r.state.run.completed_with_errors.sentence),a(String(t(e=>e.failed)),r.state.run.failed.chip)];return n(i,r.dashboard.chart.summary)(String(i),o.join(`, `))}function ge(e,t,i=o){let a=e.map(e=>{let t=R(e);return{id:e.id,kind:`worker`,mark:null,label:e.name,tone:t===null?`good`:I(t),detail:t===null?n(e.concurrency,r.dashboard.health.worker)(String(e.concurrency)):L(t),at:t===null?null:e.last_seen_at}}),c=t.map(e=>{let t=M(e);return{id:e.id,kind:`connection`,mark:s(e.kind,i),label:e.code,tone:t.tone??`neutral`,detail:_e(t),at:e.last_check_at}});return[...a,...c]}function _e(e){switch(e.state){case`unchecked`:return r.state.health.unchecked;case`unverified`:return r.state.health.unverified;case`healthy`:return e.detail??r.state.health.healthy;case`failed`:return e.detail??r.state.health.failed.sentence}}function ve(e,t){let i=e.filter(e=>R(e)===null).length,{healthy:a,total:o}=N(t),s=[];if(e.length===0?s.push(r.dashboard.health.no_worker):i<e.length&&s.push(n(e.length,r.dashboard.health.workers_healthy)(String(i),String(e.length))),a<o){let e=j(t,r.word.connection.count);e!==null&&s.push(e)}if(s.length>0){let e=s.join(` · `);return`${e.charAt(0).toUpperCase()}${e.slice(1)}.`}return t.length===0?r.dashboard.health.every_worker_well:r.dashboard.health.all_well}function ye(e,t,n=6){return[...e,...t].toSorted((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at)).slice(0,n)}function be(e,t=6){return e.flatMap(e=>{let t=B(e.schedule);return t.kind===`due`?[{...e,at:t.at}]:[]}).toSorted((e,t)=>Date.parse(e.at)-Date.parse(t.at)).slice(0,t)}async function xe(e){let t=e.filter(e=>e.schedules>0);return(await Promise.all(t.map(async e=>(await z(e.code,null)).items.map(t=>({pipeline:e.code,schedule:t}))))).flat()}async function Se(){let e=await b(null);return{pipelines:e.items,schedules:await xe(e.items)}}var Ce=6,X=[{id:`failed`,label:r.state.run.failed.tile,fill:`bg-status-failed/80`},{id:`withErrors`,label:r.state.run.completed_with_errors.tile,fill:`bg-status-completed-with-errors/80`},{id:`succeeded`,label:r.state.run.succeeded.tile,fill:`bg-status-succeeded/75`}];function we(e){let t=`${String(e.hour).padStart(2,`0`)}:00`;if(e.total===0)return r.dashboard.chart.hour_empty(t);let n=X.filter(t=>e[t.id]>0).map(t=>r.dashboard.counted(String(e[t.id]),t.label.toLowerCase())),i=n.length===0?r.dashboard.chart.none_settled:n.join(`, `);return r.dashboard.chart.hour(t,String(e.total),i)}function Te({buckets:e,reading:t,className:n}){let i=me(e);return(0,H.jsx)(u,{className:h(`gap-0 p-0`,n),children:(0,H.jsxs)(c,{className:`space-y-3 p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.dashboard.chart.title}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t?r.shell.reading:r.dashboard.chart.hint})]}),(0,H.jsx)(`ul`,{className:`flex items-center gap-3`,children:X.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-sm`,e.fill),"aria-hidden":!0}),e.label]},e.id))})]}),(0,H.jsx)(`div`,{className:`flex h-32 items-end gap-px`,role:`img`,"aria-label":he(e),children:e.map(e=>(0,H.jsxs)(`div`,{className:`flex h-full flex-1 flex-col justify-end rounded-sm hover:bg-accent/40`,title:we(e),children:[X.map(t=>e[t.id]===0?null:(0,H.jsx)(`div`,{className:h(`min-h-0.5 w-full`,t.fill),style:{height:`${String(e[t.id]/Math.max(i,1)*100)}%`}},t.id)),Y(e)===0&&(0,H.jsx)(`div`,{className:`h-px w-full bg-border`})]},e.start))}),(0,H.jsx)(`div`,{className:`flex gap-px font-mono text-xs text-faint`,"aria-hidden":!0,children:e.map((e,t)=>(0,H.jsx)(`span`,{className:`flex-1 text-center`,children:t%Ce===0?`${String(e.hour).padStart(2,`0`)}`:``},e.start))})]})})}function Z(){let e=g(T),t=k((0,V.useCallback)(()=>E({...D,since:`24h`},null,500),[])),n=k((0,V.useCallback)(()=>E({...D,status:`running`},null),[])),a=k((0,V.useCallback)(()=>E({...D,status:`queued`},null),[])),o=k((0,V.useCallback)(()=>E({...D,status:`failed`},null),[])),s=k((0,V.useCallback)(()=>E({...D,status:`completed_with_errors`},null),[])),c=k(Se),u=k((0,V.useCallback)(()=>ce(null),[])),m=k((0,V.useCallback)(()=>A(null),[])),{again:_}=t,{again:y}=n,{again:b}=a,{again:x}=o,{again:O}=s,{again:j}=c,{again:M}=u,{again:N}=m,P=(0,V.useCallback)(()=>{_(),y(),b(),x(),O(),j(),M(),N()},[j,N,_,x,O,b,y,M]);(0,V.useEffect)(()=>C([{id:`dashboard:refresh`,title:r.dashboard.refresh,group:te,screen:!0,icon:S,keywords:[`refresh`,`reload`,`home`],run:P}]),[P]);let F=i();ee(P,g(w));let I=ye(n.value?.items??[],a.value?.items??[]),L=se(ae(o.value?.items??[],s.value?.items??[]),c.value?.pipelines??[]),R=be(c.value?.schedules??[]),z=ue(t.value,n.value,a.value),B=new Date,U=pe(t.value?.items??[],B,v(B)),G=u.problem===null&&m.problem===null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(d,{title:r.screen.dashboard.name,aside:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{tag:`runs`}),(0,H.jsx)(re,{onRefresh:P})]})}),(0,H.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6`,children:z.map(e=>e.tile===null?(0,H.jsx)(ie,{},e.id):(0,H.jsx)(oe,{tile:e.tile},e.id))}),(0,H.jsxs)(`div`,{className:`mb-6 grid gap-3 xl:grid-cols-3`,children:[(0,H.jsx)(`div`,{className:h(G?`xl:col-span-2`:`xl:col-span-3`),children:t.problem===null?(0,H.jsx)(Te,{buckets:U,reading:!t.read}):(0,H.jsx)(l,{loading:!1,problem:t.problem,empty:!1,children:null})}),G&&(0,H.jsx)(W,{rows:ge(u.value?.items??[],m.value?.items??[],e),note:ve(u.value?.items??[],m.value?.items??[]),reading:!u.read||!m.read})]}),(0,H.jsx)(Q,{title:r.word.in_flight.heading,to:`/runs`,children:(0,H.jsx)(l,{loading:!n.read||!a.read,problem:n.problem??a.problem,empty:I.length===0,emptyMessage:r.dashboard.nothing_in_flight,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:Ee,rows:I,rowKey:e=>e.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.troubled_runs,to:`/runs`,children:(0,H.jsx)(l,{loading:!o.read||!s.read,problem:o.problem??s.problem,empty:L.length===0,emptyMessage:r.dashboard.nothing_troubled,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:ne,rows:L,rowKey:e=>e.run.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.run.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.next_firings,to:`/triggers`,children:(0,H.jsx)(l,{loading:!c.read,problem:c.problem,empty:R.length===0,emptyMessage:r.dashboard.no_fire_due,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:De,rows:R,rowKey:e=>`${e.pipeline}:${e.schedule.code}`,reading:!1,next:null,onMore:$,noun:r.word.firing.count,onSelect:e=>void F(`/pipelines/${encodeURIComponent(e.pipeline)}`)})})})]})}function Q({title:e,to:t,children:n}){return(0,H.jsxs)(`section`,{className:`mb-6 space-y-2 last:mb-0`,children:[(0,H.jsx)(`div`,{className:`space-y-1`,children:(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,H.jsx)(a,{to:t,className:`hover:text-primary-ink`,children:e})})}),n]})}var $=()=>{},Ee=[{id:`status`,header:r.word.status,cell:e=>(0,H.jsx)(x,{status:e.status})},{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`since`,header:r.dashboard.column.since,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.started_at??e.created_at})}],De=[{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`schedule`,header:r.word.schedule.label,cell:e=>{let t=y(e.schedule);return(0,H.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:h(`truncate text-xs`,t.named?`text-foreground`:`font-mono`),children:t.title}),t.code!==null&&(0,H.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`fires`,header:r.word.next,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.at})}];export{Z as Dashboard};
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{n,t as r}from"./labels-DPg21HPJ.js";import{c as i,n as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as o,r as s}from"./glyphs-DLSRr36C.js";import{i as c,n as l,r as u,t as d}from"./PageState-859W4wWp.js";import{i as f,t as p}from"./ListTable-BOX3h68A.js";import{r as m,t as h}from"./utils-CT7ZGLfR.js";import{t as g}from"./use-store-CZcp6jmY.js";import{t as _}from"./auth-Bdybp9f_.js";import{v}from"./format-DK4FnJoS.js";import{t as ee}from"./use-heartbeat-C3WWagro.js";import{t as y}from"./identity-BNZxCf_y.js";import{m as b}from"./pipelines-CFguQTLF.js";import{E as x,Lt as S,gt as C,h as w,j as T,l as E,pt as te,t as D,u as O,y as k}from"./index-Bk7mn1Ys.js";import{f as A,i as j,o as M,r as N}from"./connections-DobzdyIe.js";import{t as P}from"./Instant-Ogv9qDZy.js";import{t as F}from"./Mark-DQR2php6.js";import{f as ne,i as I,p as re,r as ie,s as ae,t as oe,u as se}from"./TileCard-a84qFXIR.js";import{a as ce,i as L,r as R}from"./workers-DzwKP3Ua.js";import{f as z,s as B}from"./triggers-DM2qTKEm.js";var V=e(t(),1),H=m(),U={neutral:`bg-muted-foreground`,good:`bg-good`,info:`bg-info`,warning:`bg-warning`,critical:`bg-critical`};function W({rows:e,note:t,reading:n}){let i=g(_).identity?.role??null;return(0,H.jsx)(u,{className:`gap-0 p-0`,children:(0,H.jsxs)(c,{className:`flex h-full flex-col p-0`,children:[(0,H.jsxs)(`div`,{className:`space-y-1 px-3 py-3`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.word.health}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n?r.shell.reading:r.dashboard.health.hint})]}),(0,H.jsx)(`ul`,{className:`max-h-64 grow overflow-y-auto`,children:e.map(e=>{let t=e.kind===`connection`?`/connections`:i===`admin`?`/admin/workers`:null,n=(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-full`,U[e.tone]),"aria-hidden":!0}),e.mark===null?(0,H.jsx)(`span`,{className:`size-4 shrink-0`,"aria-hidden":!0}):(0,H.jsx)(F,{glyph:e.mark})]}),(0,H.jsx)(`span`,{className:`max-w-[55%] min-w-[6ch] truncate font-mono text-xs`,title:e.label,children:e.label}),(0,H.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-baseline justify-end gap-2`,children:[(0,H.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,title:e.detail,children:e.detail}),e.at!==null&&(0,H.jsx)(P,{className:`shrink-0 text-xs text-faint`,at:e.at})]})]});return(0,H.jsx)(`li`,{className:`border-t border-border`,children:t===null?(0,H.jsx)(`span`,{className:`flex min-w-0 items-center gap-2 px-3 py-1.5`,children:n}):(0,H.jsx)(a,{to:t,className:`control-link flex min-w-0 items-center gap-2 px-3 py-1.5 hover:bg-accent/60`,children:n})},`${e.kind}:${e.id}`)})}),(0,H.jsx)(`p`,{className:`border-t border-border px-3 py-2 text-xs text-muted-foreground`,children:t})]})})}function G(e,t){return`${String(e)}${t.next===null?``:`+`}`}function K(e,t){return e===0?`neutral`:t}function le(e,t){return e.items.filter(e=>e.status===t).length}function ue(e,t,n){let i=(t,n,r)=>{if(e===null)return null;let i=le(e,t);return{id:t,label:n,value:G(i,e),note:``,tone:K(i,r),to:O({...D,status:t,since:`24h`})}},a=(e,t,n,r,i)=>{if(i===null)return null;let a=i.items.length;return{id:e,label:t,value:G(a,i),note:a===0?``:r,tone:K(a,n),to:O({...D,status:e})}};return[{id:`runs`,tile:e===null?null:{id:`runs`,label:r.screen.runs.name,value:G(e.items.length,e),note:r.dashboard.tile.runs_window,tone:`neutral`,to:O({...D,since:`24h`})}},{id:`succeeded`,tile:i(`succeeded`,r.state.run.succeeded.tile,`good`)},{id:`failed`,tile:i(`failed`,r.state.run.failed.tile,`critical`)},{id:`completed_with_errors`,tile:i(`completed_with_errors`,r.state.run.completed_with_errors.tile,`warning`)},{id:`running`,tile:a(`running`,r.state.run.running.tile,`info`,r.state.run.running.sentence,t)},{id:`queued`,tile:a(`queued`,r.state.run.queued.tile,`neutral`,r.state.run.queued.sentence,n)}]}var q=36e5,J=864e5;function de(e,t){let n=e+t*6e4;return Math.floor(n/q)*q-t*6e4}function fe(e,t){let n=e+t*6e4;return Math.floor((n%J+J)%J/q)}function pe(e,t,n,r=24){let i=de(t.getTime(),n)-(r-1)*q,a=Array.from({length:r},(e,t)=>{let r=i+t*q;return{start:r,hour:fe(r,n),succeeded:0,withErrors:0,failed:0,total:0}});for(let t of e){let e=Date.parse(t.created_at);if(Number.isNaN(e))continue;let n=Math.floor((e-i)/q);if(n<0||n>=r)continue;let o=a[n];o.total+=1,t.status===`succeeded`?o.succeeded+=1:t.status===`completed_with_errors`?o.withErrors+=1:t.status===`failed`&&(o.failed+=1)}return a}function Y(e){return e.succeeded+e.withErrors+e.failed}function me(e){return e.reduce((e,t)=>Math.max(e,Y(t)),0)}function he(e){let t=t=>e.reduce((e,n)=>e+t(n),0),i=t(e=>e.total);if(i===0)return r.dashboard.chart.summary_empty;let a=r.dashboard.counted,o=[a(String(t(e=>e.succeeded)),r.state.run.succeeded.chip),a(String(t(e=>e.withErrors)),r.state.run.completed_with_errors.sentence),a(String(t(e=>e.failed)),r.state.run.failed.chip)];return n(i,r.dashboard.chart.summary)(String(i),o.join(`, `))}function ge(e,t,i=o){let a=e.map(e=>{let t=R(e);return{id:e.id,kind:`worker`,mark:null,label:e.name,tone:t===null?`good`:I(t),detail:t===null?n(e.concurrency,r.dashboard.health.worker)(String(e.concurrency)):L(t),at:t===null?null:e.last_seen_at}}),c=t.map(e=>{let t=M(e);return{id:e.id,kind:`connection`,mark:s(e.kind,i),label:e.code,tone:t.tone??`neutral`,detail:_e(t),at:e.last_check_at}});return[...a,...c]}function _e(e){switch(e.state){case`unchecked`:return r.state.health.unchecked;case`unverified`:return r.state.health.unverified;case`healthy`:return e.detail??r.state.health.healthy;case`failed`:return e.detail??r.state.health.failed.sentence}}function ve(e,t){let i=e.filter(e=>R(e)===null).length,{healthy:a,total:o}=N(t),s=[];if(e.length===0?s.push(r.dashboard.health.no_worker):i<e.length&&s.push(n(e.length,r.dashboard.health.workers_healthy)(String(i),String(e.length))),a<o){let e=j(t,r.word.connection.count);e!==null&&s.push(e)}if(s.length>0){let e=s.join(` · `);return`${e.charAt(0).toUpperCase()}${e.slice(1)}.`}return t.length===0?r.dashboard.health.every_worker_well:r.dashboard.health.all_well}function ye(e,t,n=6){return[...e,...t].toSorted((e,t)=>Date.parse(t.created_at)-Date.parse(e.created_at)).slice(0,n)}function be(e,t=6){return e.flatMap(e=>{let t=B(e.schedule);return t.kind===`due`?[{...e,at:t.at}]:[]}).toSorted((e,t)=>Date.parse(e.at)-Date.parse(t.at)).slice(0,t)}async function xe(e){let t=e.filter(e=>e.schedules>0);return(await Promise.all(t.map(async e=>(await z(e.code,null)).items.map(t=>({pipeline:e.code,schedule:t}))))).flat()}async function Se(){let e=await b(null);return{pipelines:e.items,schedules:await xe(e.items)}}var Ce=6,X=[{id:`failed`,label:r.state.run.failed.tile,fill:`bg-status-failed/80`},{id:`withErrors`,label:r.state.run.completed_with_errors.tile,fill:`bg-status-completed-with-errors/80`},{id:`succeeded`,label:r.state.run.succeeded.tile,fill:`bg-status-succeeded/75`}];function we(e){let t=`${String(e.hour).padStart(2,`0`)}:00`;if(e.total===0)return r.dashboard.chart.hour_empty(t);let n=X.filter(t=>e[t.id]>0).map(t=>r.dashboard.counted(String(e[t.id]),t.label.toLowerCase())),i=n.length===0?r.dashboard.chart.none_settled:n.join(`, `);return r.dashboard.chart.hour(t,String(e.total),i)}function Te({buckets:e,reading:t,className:n}){let i=me(e);return(0,H.jsx)(u,{className:h(`gap-0 p-0`,n),children:(0,H.jsxs)(c,{className:`space-y-3 p-3`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1`,children:[(0,H.jsxs)(`div`,{className:`space-y-1`,children:[(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:r.dashboard.chart.title}),(0,H.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t?r.shell.reading:r.dashboard.chart.hint})]}),(0,H.jsx)(`ul`,{className:`flex items-center gap-3`,children:X.map(e=>(0,H.jsxs)(`li`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,H.jsx)(`span`,{className:h(`size-2 shrink-0 rounded-sm`,e.fill),"aria-hidden":!0}),e.label]},e.id))})]}),(0,H.jsx)(`div`,{className:`flex h-32 items-end gap-px`,role:`img`,"aria-label":he(e),children:e.map(e=>(0,H.jsxs)(`div`,{className:`flex h-full flex-1 flex-col justify-end rounded-sm hover:bg-accent/40`,title:we(e),children:[X.map(t=>e[t.id]===0?null:(0,H.jsx)(`div`,{className:h(`min-h-0.5 w-full`,t.fill),style:{height:`${String(e[t.id]/Math.max(i,1)*100)}%`}},t.id)),Y(e)===0&&(0,H.jsx)(`div`,{className:`h-px w-full bg-border`})]},e.start))}),(0,H.jsx)(`div`,{className:`flex gap-px font-mono text-xs text-faint`,"aria-hidden":!0,children:e.map((e,t)=>(0,H.jsx)(`span`,{className:`flex-1 text-center`,children:t%Ce===0?`${String(e.hour).padStart(2,`0`)}`:``},e.start))})]})})}function Z(){let e=g(T),t=k((0,V.useCallback)(()=>E({...D,since:`24h`},null,500),[])),n=k((0,V.useCallback)(()=>E({...D,status:`running`},null),[])),a=k((0,V.useCallback)(()=>E({...D,status:`queued`},null),[])),o=k((0,V.useCallback)(()=>E({...D,status:`failed`},null),[])),s=k((0,V.useCallback)(()=>E({...D,status:`completed_with_errors`},null),[])),c=k(Se),u=k((0,V.useCallback)(()=>ce(null),[])),m=k((0,V.useCallback)(()=>A(null),[])),{again:_}=t,{again:y}=n,{again:b}=a,{again:x}=o,{again:O}=s,{again:j}=c,{again:M}=u,{again:N}=m,P=(0,V.useCallback)(()=>{_(),y(),b(),x(),O(),j(),M(),N()},[j,N,_,x,O,b,y,M]);(0,V.useEffect)(()=>C([{id:`dashboard:refresh`,title:r.dashboard.refresh,group:te,screen:!0,icon:S,keywords:[`refresh`,`reload`,`home`],run:P}]),[P]);let F=i();ee(P,g(w));let I=ye(n.value?.items??[],a.value?.items??[]),L=se(ae(o.value?.items??[],s.value?.items??[]),c.value?.pipelines??[]),R=be(c.value?.schedules??[]),z=ue(t.value,n.value,a.value),B=new Date,U=pe(t.value?.items??[],B,v(B)),G=u.problem===null&&m.problem===null;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(d,{title:r.screen.dashboard.name,aside:(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(f,{tag:`runs`}),(0,H.jsx)(re,{onRefresh:P})]})}),(0,H.jsx)(`div`,{className:`mb-3 grid grid-cols-2 gap-3 sm:grid-cols-3 xl:grid-cols-6`,children:z.map(e=>e.tile===null?(0,H.jsx)(ie,{},e.id):(0,H.jsx)(oe,{tile:e.tile},e.id))}),(0,H.jsxs)(`div`,{className:`mb-6 grid gap-3 xl:grid-cols-3`,children:[(0,H.jsx)(`div`,{className:h(G?`xl:col-span-2`:`xl:col-span-3`),children:t.problem===null?(0,H.jsx)(Te,{buckets:U,reading:!t.read}):(0,H.jsx)(l,{loading:!1,problem:t.problem,empty:!1,children:null})}),G&&(0,H.jsx)(W,{rows:ge(u.value?.items??[],m.value?.items??[],e),note:ve(u.value?.items??[],m.value?.items??[]),reading:!u.read||!m.read})]}),(0,H.jsx)(Q,{title:r.word.in_flight.heading,to:`/runs`,children:(0,H.jsx)(l,{loading:!n.read||!a.read,problem:n.problem??a.problem,empty:I.length===0,emptyMessage:r.dashboard.nothing_in_flight,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:Ee,rows:I,rowKey:e=>e.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.troubled_runs,to:`/runs`,children:(0,H.jsx)(l,{loading:!o.read||!s.read,problem:o.problem??s.problem,empty:L.length===0,emptyMessage:r.dashboard.nothing_troubled,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:ne,rows:L,rowKey:e=>e.run.id,reading:!1,next:null,onMore:$,noun:r.word.run.count,onSelect:e=>void F(`/runs/${e.run.id}`)})})}),(0,H.jsx)(Q,{title:r.dashboard.next_firings,to:`/triggers`,children:(0,H.jsx)(l,{loading:!c.read,problem:c.problem,empty:R.length===0,emptyMessage:r.dashboard.no_fire_due,children:(0,H.jsx)(p,{chrome:{footer:!1},columns:De,rows:R,rowKey:e=>`${e.pipeline}:${e.schedule.code}`,reading:!1,next:null,onMore:$,noun:r.word.firing.count,onSelect:e=>void F(`/pipelines/${encodeURIComponent(e.pipeline)}`)})})})]})}function Q({title:e,to:t,children:n}){return(0,H.jsxs)(`section`,{className:`mb-6 space-y-2 last:mb-0`,children:[(0,H.jsx)(`div`,{className:`space-y-1`,children:(0,H.jsx)(`h2`,{className:`text-sm font-semibold`,children:(0,H.jsx)(a,{to:t,className:`hover:text-primary-ink`,children:e})})}),n]})}var $=()=>{},Ee=[{id:`status`,header:r.word.status,cell:e=>(0,H.jsx)(x,{status:e.status})},{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`since`,header:r.dashboard.column.since,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.started_at??e.created_at})}],De=[{id:`pipeline`,header:r.word.pipeline.label,cell:e=>(0,H.jsx)(`span`,{className:`font-mono text-sm`,children:y({code:e.pipeline}).title})},{id:`schedule`,header:r.word.schedule.label,cell:e=>{let t=y(e.schedule);return(0,H.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,H.jsx)(`span`,{className:h(`truncate text-xs`,t.named?`text-foreground`:`font-mono`),children:t.title}),t.code!==null&&(0,H.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground`,children:t.code})]})}},{id:`fires`,header:r.word.next,className:`text-right`,cell:e=>(0,H.jsx)(P,{className:`text-xs text-faint`,at:e.at})}];export{Z as Dashboard};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e}from"./dropdown-menu-fVWTjkXO.js";import{r as t,t as n}from"./utils-CT7ZGLfR.js";var r=t();function i({title:t,summary:i,open:a,onToggle:o,children:s}){let c=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(e,{className:n(`size-3 shrink-0 self-center`,a&&`rotate-90`),"aria-hidden":!0}),(0,r.jsx)(`span`,{className:`shrink-0 text-sm font-medium`,children:t}),!a&&i]});return(0,r.jsxs)(`div`,{children:[o===null?(0,r.jsx)(`div`,{className:`flex w-full items-baseline gap-2 py-1.5`,children:c}):(0,r.jsx)(`button`,{type:`button`,"aria-expanded":a,onClick:o,className:`row-hover flex w-full items-baseline gap-2 rounded-sm py-1.5 text-left`,children:c}),a&&(0,r.jsx)(`div`,{className:`my-1 ml-5 border-l border-primary py-1 pl-3`,children:s})]})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-DPg21HPJ.js";import{n as r}from"./PageState-859W4wWp.js";import{t as i}from"./WindowedPane-CptewOG5.js";import{r as a,t as o}from"./utils-CT7ZGLfR.js";import{h as s}from"./paging-B8nfgCnQ.js";import{t as c}from"./identity-BNZxCf_y.js";import{ct as l,k as u,y as d}from"./index-Bk7mn1Ys.js";import{t as f}from"./Description-C-byz7P3.js";import{n as p,r as m}from"./Panel-Hp0TZRIS.js";import{t as h}from"./badge-Eu1xPQ-u.js";import{f as g,n as _,u as v}from"./examples-BP1UpQbc.js";import{t as y}from"./starters-DexsdOaG.js";var b=e(t(),1),x=a(),S=n.examples.source_pane,C=n.examples.use_as_starter,w=n.examples.requirement.line;function T({example:e,holdings:t,onUse:a}){let T=e.code,O=d((0,b.useCallback)(()=>v(T),[T])),k=c(e),A=(0,b.useMemo)(()=>g(e.requires,t),[e.requires,t]),j=_(e),M=e.tags.filter(e=>e!==y),N=O.value?.source??``;return(0,x.jsxs)(`div`,{className:`flex flex-col gap-4 p-4`,children:[(0,x.jsxs)(`div`,{className:`space-y-1`,children:[(0,x.jsx)(`h2`,{className:o(`text-sm font-semibold`,!k.named&&`font-mono`),children:k.title}),k.code!==null&&(0,x.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground`,children:k.code}),(e.starter||j!==null)&&(0,x.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 pt-0.5`,children:[e.starter&&(0,x.jsx)(h,{variant:`outline`,children:n.examples.starter_badge}),j!==null&&(0,x.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:j})]}),(0,x.jsx)(f,{text:e.description})]}),M.length>0&&(0,x.jsx)(`p`,{className:`flex flex-wrap items-center gap-1`,children:M.map(e=>(0,x.jsx)(u,{tag:e},e))}),(0,x.jsx)(m,{title:n.examples.facts,children:(0,x.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:[(0,x.jsx)(p,{term:n.examples.fact.plugin,detail:e.plugin}),(0,x.jsx)(p,{term:n.examples.fact.shelf,detail:e.shelf===``?n.examples.root_shelf:e.shelf}),O.value!==null&&(0,x.jsx)(p,{term:n.examples.fact.path,detail:(0,x.jsx)(`span`,{className:`font-mono break-all`,children:O.value.path})})]})}),(0,x.jsx)(m,{title:n.word.requires,children:A.length===0?(0,x.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.examples.requires_nothing}):(0,x.jsx)(`ul`,{className:`space-y-1 text-xs`,children:A.map(e=>(0,x.jsxs)(`li`,{className:`flex items-baseline gap-2`,children:[(0,x.jsx)(`span`,{className:`text-faint`,children:w[e.kind]}),(0,x.jsx)(`span`,{className:`font-mono break-all`,children:e.name}),(0,x.jsx)(`span`,{className:o(`ml-auto shrink-0`,D(e)),children:E(e)})]},`${e.kind}:${e.name}`))})}),(0,x.jsx)(m,{title:n.word.source,children:!O.read||O.problem!==null?(0,x.jsx)(r,{loading:!O.read,problem:O.problem,empty:!1,children:null}):(0,x.jsx)(i,{name:S,className:`overflow-hidden rounded-md border border-border bg-background`,windowed:(0,x.jsx)(l,{value:N,path:`example-${T}-window`,label:n.examples.source_pane_windowed(S),className:`min-h-0 flex-1`,readOnly:!0}),children:(0,x.jsx)(l,{value:N,path:`example-${T}`,label:S,className:`h-72 min-h-40`,readOnly:!0})})}),e.starter&&(0,x.jsx)(s,{size:`sm`,className:`self-start`,disabled:O.value===null,onClick:()=>{a(N,T)},children:C})]})}function E(e){return e.met===null?n.examples.requirement.unchecked:e.met?n.examples.requirement.here:n.examples.requirement.missing_word}function D(e){return e.met===null?`text-faint`:e.met?`text-good`:`text-critical`}export{T as ExamplePanel};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-
|
|
2
|
-
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ExamplePanel-DieWamsW.js","assets/rolldown-runtime-Dd_uD5pT.js","assets/store-D-5yFBN1.js","assets/labels-DPg21HPJ.js","assets/PageState-859W4wWp.js","assets/dropdown-menu-fVWTjkXO.js","assets/api-jh39Ky4Q.js","assets/utils-CT7ZGLfR.js","assets/paging-B8nfgCnQ.js","assets/WindowedPane-CptewOG5.js","assets/index-Bk7mn1Ys.js","assets/dist-CvOdB3Md.js","assets/preload-helper-BZ1Pz5am.js","assets/chunk-OB3PAWPO-m4Sckj1b.js","assets/nav-Dr9UOjZp.js","assets/play-lh-2vSaT.js","assets/file-braces-D0GrrmLo.js","assets/chevron-down-P-YdU4_3.js","assets/glyphs-DLSRr36C.js","assets/ListTable-BOX3h68A.js","assets/panels-D1Fnei43.js","assets/docs-CCoB3shg.js","assets/x-CfN8vp59.js","assets/tooltip-CrzRgh7Y.js","assets/input-DjAM-vmX.js","assets/textarea-D86x5ut1.js","assets/use-store-CZcp6jmY.js","assets/auth-Bdybp9f_.js","assets/idle-DnO3aHK7.js","assets/format-DK4FnJoS.js","assets/status-Didq7MpX.js","assets/use-heartbeat-C3WWagro.js","assets/identity-BNZxCf_y.js","assets/pipelines-CFguQTLF.js","assets/index-DZ7D7u3R.css","assets/Description-C-byz7P3.js","assets/Panel-Hp0TZRIS.js","assets/copy-CwsIH1zY.js","assets/badge-Eu1xPQ-u.js","assets/examples-BP1UpQbc.js","assets/blocks-B8eZqUob.js","assets/connections-DobzdyIe.js","assets/schemas-DcjLLg6l.js","assets/starters-DexsdOaG.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{i as e}from"./rolldown-runtime-Dd_uD5pT.js";import{n as t}from"./store-D-5yFBN1.js";import{t as n}from"./labels-DPg21HPJ.js";import{t as r}from"./preload-helper-BZ1Pz5am.js";import{c as i,u as a}from"./chunk-OB3PAWPO-m4Sckj1b.js";import{n as o}from"./nav-Dr9UOjZp.js";import{n as s,t as c}from"./PageState-859W4wWp.js";import{i as l,t as u}from"./ListTable-BOX3h68A.js";import{r as d,t as f}from"./utils-CT7ZGLfR.js";import{a as p,r as m,s as h}from"./panels-D1Fnei43.js";import{n as g,t as _}from"./identity-BNZxCf_y.js";import{C as v,Lt as ee,O as y,T as b,gt as x,it as S,k as C,mt as w,rt as te,v as T,y as E,zt as D}from"./index-Bk7mn1Ys.js";import{t as O}from"./badge-Eu1xPQ-u.js";import{_ as k,a as A,c as j,d as M,f as N,h as P,i as F,l as I,n as L,o as R,p as z,s as ne,t as B}from"./examples-BP1UpQbc.js";import{n as V,t as H}from"./starters-DexsdOaG.js";import{t as U}from"./Segmented-KaDiGiyr.js";var W=e(t(),1),G=d(),K=(0,W.lazy)(()=>r(()=>import(`./ExamplePanel-DieWamsW.js`).then(e=>({default:e.ExamplePanel})),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43]))),q=`example`,J=()=>{},Y=e=>e.code,X=[{value:`all`,label:n.examples.which.all},{value:`starters`,label:n.examples.which.starters}];function Z(){let e=i(),[t,r]=a(),[d,f]=(0,W.useState)(null),g=(0,W.useMemo)(()=>F(t),[t]),_=(0,W.useCallback)(e=>{r(j(e),{replace:!0})},[r]),v=E(I),O=E(M),A=(0,W.useMemo)(()=>O.value??{blocks:null,connections:null,schemas:null},[O.value]),N=(0,W.useMemo)(()=>v.value??[],[v.value]),L=(0,W.useMemo)(()=>R(N,g),[g,N]),z=(0,W.useMemo)(()=>P(N),[N]),H=(0,W.useMemo)(()=>ne(N),[N]),Z=(0,W.useMemo)(()=>k(N),[N]),Q=(0,W.useCallback)(e=>{g.tags.includes(e)||_({...g,tags:[...g.tags,e]})},[_,g]),ae=(0,W.useMemo)(()=>ie(A,H,Q),[Q,A,H]),$=(0,W.useCallback)((t,n)=>{e(o,{state:{document:V(t,n)}})},[e]);return(0,W.useEffect)(()=>(S({note:null,tone:`quiet`,identifier:null}),te),[N.length]),(0,W.useEffect)(()=>x([{id:`examples:starters`,title:n.examples.show_starters,group:w,screen:!0,icon:D,keywords:[`starter`,`copy`,`new`],run:()=>{_({...g,starters:!0})}},{id:`examples:clear`,title:n.examples.clear_filters,group:w,screen:!0,icon:ee,keywords:[`reset`,`all`],run:()=>{_({needle:``,tags:[],shelf:``,plugin:``,starters:!1,block:``})}}]),[_,g]),(0,W.useEffect)(()=>{if(d!==null)return p([{id:q,label:n.word.example.label,render:()=>(0,G.jsx)(W.Suspense,{fallback:(0,G.jsx)(re,{}),children:(0,G.jsx)(K,{example:d,holdings:A,onUse:$},d.code)})}],{screen:`examples`})},[d,A,$]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(c,{title:n.screen.examples.name,aside:(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(l,{tag:`examples`}),L.length!==N.length&&(0,G.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n.examples.counted_of(String(L.length),String(N.length))})]})}),(0,G.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(b,{value:g.needle,label:n.examples.search,onChange:e=>{_({...g,needle:e})}}),(0,G.jsx)(U,{label:n.examples.which.label,value:g.starters?`starters`:`all`,options:X,onChoose:e=>{_({...g,starters:e===`starters`})}}),(0,G.jsx)(y,{chosen:g.tags,offered:Z,onChange:e=>{_({...g,tags:e})}}),(0,G.jsx)(T,{label:n.word.shelf,value:g.shelf,anything:n.examples.any_shelf,options:z.map(e=>({value:e,label:e})),onChange:e=>{_({...g,shelf:e===``?``:e})}}),H.length>1&&(0,G.jsx)(T,{label:n.word.plugin.label,value:g.plugin,anything:n.examples.any_plugin,options:H.map(e=>({value:e,label:e})),onChange:e=>{_({...g,plugin:e===``?``:e})}}),g.block!==``&&(0,G.jsx)(C,{tag:g.block,label:n.examples.stop_narrowing(g.block),onSelect:()=>{_({...g,block:``})}})]}),(0,G.jsx)(s,{loading:!v.read,problem:v.problem,empty:L.length===0,emptyMessage:N.length===0?n.examples.none_installed:B(g)?n.examples.none_match:n.examples.empty,children:(0,G.jsx)(u,{columns:ae,rows:L,rowKey:Y,reading:!1,next:null,onMore:J,noun:n.word.example.count,onSelect:e=>{f(e),h(q)},selected:e=>e.code===d?.code,onClose:()=>{f(null),m()}})})]})}function re(){return(0,G.jsx)(`div`,{className:`p-4`,children:(0,G.jsx)(s,{loading:!0,problem:null,empty:!1,children:null})})}function ie(e,t,r){return[{id:`example`,header:n.word.example.label,kind:`title`,cell:e=>{let t=_(e),r=L(e);return(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`span`,{className:f(`truncate font-semibold`,`max-lg:overflow-visible max-lg:whitespace-normal`,!t.named&&`font-mono`),title:t.title,children:t.title}),e.starter&&(0,G.jsx)(O,{variant:`outline`,className:`shrink-0`,children:n.examples.starter_badge}),r!==null&&(0,G.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,title:n.examples.carries_hint,children:r})]}),(0,G.jsxs)(`p`,{className:`flex items-center gap-2 text-xs`,children:[t.code!==null&&(0,G.jsx)(`span`,{className:`font-mono text-muted-foreground`,children:t.code}),e.description!==null&&(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground`,title:g(e.description),children:g(e.description)})]})]})}},{id:`tags`,header:n.word.tags,cell:e=>{let t=e.tags.filter(e=>e!==H);return t.length===0?null:(0,G.jsx)(v,{tags:t,onSelect:r})}},{id:`requires`,header:n.word.requires,className:`whitespace-nowrap`,cell:t=>{let n=N(t.requires,e),r=z(n);return r===null?null:(0,G.jsx)(`span`,{className:f(`text-xs`,A(n)===0?`text-muted-foreground`:`text-critical`),children:r})}},...t.length>1?[{id:`plugin`,header:n.word.plugin.label,className:`w-32 font-mono text-xs whitespace-nowrap`,cell:e=>(0,G.jsx)(`span`,{className:`text-muted-foreground`,children:e.plugin})}]:[]]}export{Z as Examples};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./utils-CT7ZGLfR.js";import{l as t,s as n}from"./format-
|
|
1
|
+
import{r as e}from"./utils-CT7ZGLfR.js";import{l as t,s as n}from"./format-DK4FnJoS.js";var r=e();function i({at:e,className:i}){return(0,r.jsx)(`span`,{className:i,title:e?n(e):void 0,children:t(e)})}export{i as t};
|