@fluidgrids/fe-sdk 0.0.0-stage → 2026.1203.8
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.
- package/README.md +564 -2
- package/dist/ActivityOptionsFields-C2u-hY2U.js +142 -0
- package/dist/AiStudioPage-B_hNTj-_.js +1137 -0
- package/dist/ApprovalInboxPage-ClITra3n.js +1312 -0
- package/dist/ChoiceSelect-LkK-uS9J.js +65 -0
- package/dist/ConfirmActionDialog-DHWTDRbp.js +31 -0
- package/dist/ConnectionFormDialog-C0kDgcrZ.js +153 -0
- package/dist/CreateFluidgridsTagDocument-Dtp9KPLJ.js +1055 -0
- package/dist/DataSinkDashboardPage-b4ezeqa6.js +278 -0
- package/dist/DataTablesPage-C1d9YGHz.js +5575 -0
- package/dist/DateTimeField-B1qR4ruo.js +51 -0
- package/dist/Disclosure-BNKij7-v.js +45 -0
- package/dist/ElementLibraryPage-8jNO6YmE.js +2256 -0
- package/dist/ElementLibrarySequenceDocument-B-W8SPzn.js +3979 -0
- package/dist/EnsureThemeProvider-BvlNjAd0.js +24 -0
- package/dist/EntityTagBadge-1OlP6p0c.js +25 -0
- package/dist/EntityTagPicker-BBrU5cE0.js +137 -0
- package/dist/ExecuteStepDocument-B4j1mdRT.js +189 -0
- package/dist/ExecutionDetailDocument-D6QuM-kp.js +875 -0
- package/dist/ExecutionDetailPage-D4CBtFdo.js +12217 -0
- package/dist/ExecutionDetailPage-DvQ667OE.d.ts +10 -0
- package/dist/ExecutionStatusBadge-BsDVor9t.js +221 -0
- package/dist/ExecutionsListDocument-Dan7ZiqB.js +459 -0
- package/dist/ExecutionsListPage-B3XT8ITL.js +4307 -0
- package/dist/FailureTriagePanel-DOJMaJ0n.js +1285 -0
- package/dist/FileDownloadUrlDocument-CVOYKcL5.js +92 -0
- package/dist/FluidGridsDocsLink-bX0Hnhxr.js +66 -0
- package/dist/FluidGridsMark-CE2blT7K.js +74 -0
- package/dist/HeldLoadRegion-BtTxbvOW.js +34 -0
- package/dist/HistoryPage-BLoRpJ1R.d.ts +6 -0
- package/dist/HistoryPage-BSBISXoj.js +2835 -0
- package/dist/Icon-BtQ0HXLh.js +160 -0
- package/dist/InsightsPage-D7ybj8N9.js +11245 -0
- package/dist/IsolationSetting-vy911E8b.js +1153 -0
- package/dist/LibraryParts-DOeNgR8A.js +413 -0
- package/dist/ManagedAiPolicyAuthority-BxwJ3ptd.js +40 -0
- package/dist/ManagedAiPolicyAuthority-DM3t3wNr.d.ts +18 -0
- package/dist/ManagedAiPolicyAuthorityContext-CNkxIOZ1.js +10 -0
- package/dist/McpTriggerServers-BCPCAOWB.js +459 -0
- package/dist/MissingNodesInstallModal-rO_SEDrC.js +224 -0
- package/dist/NavigationV2Provider-DCDt35eG.js +17 -0
- package/dist/NodeSchemaIntrospectionDocument-C1vAIcHd.js +95 -0
- package/dist/NodesPage-DEbnz9iU.d.ts +6 -0
- package/dist/NodesPage-O7KeeKtd.js +653 -0
- package/dist/OfflineIcon-TwMKYWjA.js +207 -0
- package/dist/OpenTemplateAsCodeButton-BhWJWIF3.js +94 -0
- package/dist/PaidTemplateConfirm-_G3ag6S4.js +28 -0
- package/dist/PublishCustomNodeAction-CIySbK4c.js +134 -0
- package/dist/RecordTaskDialog-BkpCDvhR.js +2078 -0
- package/dist/RunActionsMenu-DodOgIQm.js +59 -0
- package/dist/RunnerStatusPill-C1v967iq.js +24 -0
- package/dist/RunnersPage-dB0RSdY_.js +1929 -0
- package/dist/SandboxRuntimeExhaustedNotice-BFOIF93C.js +120 -0
- package/dist/SchedulesPage-DPWr1yvf.js +1607 -0
- package/dist/SearchBox-BGtYjvfs.js +49 -0
- package/dist/SequenceEditor-CFiHeHkR.js +497 -0
- package/dist/SettingsPage-0CQBNPZV.js +8695 -0
- package/dist/StewardPages-DAJhepen.js +47 -0
- package/dist/StewardRunImportPanel-Kva2DO0u.js +2844 -0
- package/dist/StoreTemplateCardCompact-CHn5kP7A.js +2166 -0
- package/dist/TagFilterSelect-CyA8QrS7.js +42 -0
- package/dist/TaskQueuesPage-DdnDCyat.js +3571 -0
- package/dist/TechnicalDetails-B0Oi4aZw.js +19 -0
- package/dist/TemplateConfigurationModal-CdvCYJLM.js +332 -0
- package/dist/TemplateDetailPanel-CbiKciuB.js +222 -0
- package/dist/TemplatePreview-cx7-NOeG.js +868 -0
- package/dist/TemplatesPage-BG3H-6v6.d.ts +10 -0
- package/dist/TemplatesPage-BVQpGYIV.js +3251 -0
- package/dist/TerminateExecutionDocument-B_HKNVrN.js +581 -0
- package/dist/TranslationBridge-Bd4aJKMs.d.ts +11 -0
- package/dist/TranslationBridge-Da-TPgQm.js +68 -0
- package/dist/TriggerWorkflowDocument-D9Km2Vv2.js +460 -0
- package/dist/UiSequencePickerSequenceDocument-BSYnSDV7.js +607 -0
- package/dist/UiStepScreenshot-Qh4QMyUp.js +146 -0
- package/dist/UsageTimeSeriesDocument-DcInx9-z.js +177 -0
- package/dist/VariablesPage-ChfGuW22.js +2243 -0
- package/dist/VersionDiffDialog-Bd2AeUwf.js +1702 -0
- package/dist/VersionLifecycleBar-BBeWVtz-.js +143 -0
- package/dist/WebhookDeliveriesPage-D66bua0j.js +1563 -0
- package/dist/WorkflowBuilder-B6wQD1TK.js +539 -0
- package/dist/WorkflowBuilder-DR4ku8Tr.js +1611 -0
- package/dist/WorkflowDefinitionDocument-DZLbTPUZ.js +321 -0
- package/dist/WorkflowEmbed-BXfFGy0i.js +708 -0
- package/dist/WorkflowEmbed-Cbqe1s1z.d.ts +6 -0
- package/dist/WorkflowPinnedDataDocument-BODT5omd.js +782 -0
- package/dist/WorkflowProposalCard-BruukdeF.js +96 -0
- package/dist/WorkflowProposalDocument-BdUbsrd0.js +620 -0
- package/dist/WorkflowSearchRedirect-C7zJ2MKH.js +40 -0
- package/dist/WorkflowSettingsDrawer-MVU1BKfY.d.ts +18 -0
- package/dist/WorkflowSettingsDrawer-gazs97WR.js +196 -0
- package/dist/WorkflowShareDialog-e8jJtLjU.js +469 -0
- package/dist/WorkflowVersionsDocument-DRVOp8Uj.js +3213 -0
- package/dist/WorkflowsList--hR2_8gf.js +4593 -0
- package/dist/WorkflowsList-CcNDQge5.d.ts +6 -0
- package/dist/WorkflowsListPageDocument-CnzcQm_o.js +934 -0
- package/dist/addonCatalog-CbZS4deh.js +58 -0
- package/dist/addonCatalog-sjlonAmR.d.ts +15 -0
- package/dist/addons.d.ts +3 -0
- package/dist/addons.js +4 -0
- package/dist/agent-form-Bfvm32j1.js +83 -0
- package/dist/agent-tools.d.ts +3 -0
- package/dist/agent-tools.js +5 -0
- package/dist/agentTools-CyL7DLOF.js +320 -0
- package/dist/ai-usage-BrxDgvdR.js +240 -0
- package/dist/aiCreditsBridge-BuE92tKo.js +49 -0
- package/dist/api-BKq-nIOZ.js +2286 -0
- package/dist/api-Ol7I8NxE.js +8289 -0
- package/dist/apollo-type-policies.d.ts +11 -0
- package/dist/apollo-type-policies.js +64 -0
- package/dist/askAboutBridge-ByYsQams.js +106 -0
- package/dist/askQuestions-Cmx7VnMm.js +742 -0
- package/dist/assert-rules-lfYEMc99.js +318 -0
- package/dist/assistant.d.ts +94 -0
- package/dist/assistant.js +99 -0
- package/dist/attach-node-helpers-HDKQOtrD.js +32 -0
- package/dist/badge-CXfPhoMH.js +26 -0
- package/dist/basil.generated-BK-EHbwN.js +10 -0
- package/dist/browser-steps-DMpS5TyB.js +533 -0
- package/dist/builderTimings-pvGnK1m-.js +510 -0
- package/dist/button-DG7y_FVJ.js +48 -0
- package/dist/canvasNoteTools-BxuP_AYO.js +137 -0
- package/dist/card-Bomy_1UG.js +44 -0
- package/dist/catalogGrid-BOrfMgi-.js +41 -0
- package/dist/channel-CPyQ1NR1.js +212 -0
- package/dist/chips-CvNrYJZa.js +27 -0
- package/dist/client-holder-C0M5Cfwl.js +68 -0
- package/dist/cn-QqidFIgr.js +10 -0
- package/dist/code-editor-diagnostics-Zr0cIcx1.js +46 -0
- package/dist/code-editor-field-x_JrY8KR.js +113 -0
- package/dist/codec-client-DPuD6mw7.js +515 -0
- package/dist/conditionBuilder-DwfEF0Q-.js +1144 -0
- package/dist/config-DO68jw5k.js +322 -0
- package/dist/constants-DgbVc24O.d.ts +296 -0
- package/dist/constants-DlRnHBfQ.js +217 -0
- package/dist/convert-browser-action-pfecelF7.js +347 -0
- package/dist/convert-dialog-B_o22NiJ.js +382 -0
- package/dist/create-workflow-first-Azg3JUdX.js +120 -0
- package/dist/definition-canvas-Bsda-rDT.js +31 -0
- package/dist/dialog-BVd152GS.js +94 -0
- package/dist/durable-nodes-BXyYCLxT.js +91 -0
- package/dist/duration-CDb7-mT_.js +33 -0
- package/dist/edge-mapper-wEAdGVU2.js +4477 -0
- package/dist/element-library-DkSlg_VE.js +727 -0
- package/dist/entities-I_0kio3q.js +38 -0
- package/dist/error-advice-QLr5NCm7.js +65 -0
- package/dist/errors-ClKb5sEt.js +188 -0
- package/dist/executions.d.ts +3 -0
- package/dist/executions.js +5 -0
- package/dist/feature-flags-B2qetXKd.js +385 -0
- package/dist/field-label-DPZRmE_B.js +153 -0
- package/dist/firstWorkflow-C_h0KMB2.js +133 -0
- package/dist/flags.d.ts +3 -0
- package/dist/flags.js +4 -0
- package/dist/flow-builder-DIvLOhz0.js +28038 -0
- package/dist/flow-store-holder-CUN7Terz.js +52 -0
- package/dist/fluent.generated-CA_e6-4l.js +14 -0
- package/dist/fluidgridsEvents-bbEQbwU6.js +175 -0
- package/dist/fluidgridsTheme-DUhvOgoy.js +297 -0
- package/dist/global-client-BQPuFrFa.js +433 -0
- package/dist/global-operations-BG6YgxrM.js +136 -0
- package/dist/graphql-types-UTYtujY9.js +21358 -0
- package/dist/history.d.ts +3 -0
- package/dist/history.js +4 -0
- package/dist/index-AoJAa5vU.d.ts +164958 -0
- package/dist/index-DEMT3iAM.d.ts +120 -0
- package/dist/index-ROZzNGyY.d.ts +76 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +8123 -0
- package/dist/ion.generated-mbajjcAg.js +10 -0
- package/dist/label-Lzb8ZXf_.js +29 -0
- package/dist/labels-rXd9gYQz.js +1236 -0
- package/dist/liveCanvas-D5ytXDp8.js +103 -0
- package/dist/logos.generated-X6_0kjVR.js +21 -0
- package/dist/logs-panel-Cw0DkG0l.js +468 -0
- package/dist/lucide.generated-B6NVd3GT.js +29 -0
- package/dist/marksStore-a9oIMMot.js +175 -0
- package/dist/mcp-trigger-D0nRdvq5.js +307 -0
- package/dist/mdi.generated-D1BV74d6.js +292 -0
- package/dist/menus-CU3hDGYl.js +160 -0
- package/dist/mynaui.generated-DMWr5cXz.js +66 -0
- package/dist/navigation-v2.d.ts +3 -0
- package/dist/navigation-v2.js +5 -0
- package/dist/node-detail-view-Cgm5H1P-.js +1372 -0
- package/dist/node-editor-tab-body-CZ0fVuVP.js +187 -0
- package/dist/node-operation-selection-CdV3KI_V.js +3534 -0
- package/dist/node-registry-refresh-s3okf83X.js +27 -0
- package/dist/node-role-TMbnkmeP.js +132 -0
- package/dist/node-type-icon-BZa8n4iG.js +33 -0
- package/dist/nodes.d.ts +3 -0
- package/dist/nodes.js +4 -0
- package/dist/notesKey-5EaREBGA.js +12 -0
- package/dist/observability.d.ts +3 -0
- package/dist/observability.js +5 -0
- package/dist/offset-pages-zghoClB3.js +55 -0
- package/dist/operations-BBmT9ToP.js +663 -0
- package/dist/operations-WxRJWeqO.js +3133 -0
- package/dist/output-files-Ba8bu5lv.js +196 -0
- package/dist/page-operation-DrWuhd6Y.js +129 -0
- package/dist/page-twins.d.ts +13 -0
- package/dist/page-twins.js +186 -0
- package/dist/pageControlSpecs-DZJ9K37m.js +134 -0
- package/dist/pageControlsBridge-0pX9s-3k.js +54 -0
- package/dist/pageControlsBridge-DAuT3w7L.d.ts +36 -0
- package/dist/panels-PfBBAToE.js +346 -0
- package/dist/parts-B7fBcw-B.js +346 -0
- package/dist/popover-Dms9Vz3j.js +3389 -0
- package/dist/preloadable-lazy-Pp47mqQ9.js +65 -0
- package/dist/proactive.d.ts +66 -0
- package/dist/proactive.js +237 -0
- package/dist/quick-config-panel-DFd77xho.js +451 -0
- package/dist/quota-DeA_CJ2e.js +175 -0
- package/dist/quota.d.ts +3 -0
- package/dist/quota.js +4 -0
- package/dist/read-only-context-Dt9N9SIG.js +18 -0
- package/dist/relative-time-Dxt8ZIIu.js +55 -0
- package/dist/results-CwK_yDxK.js +325 -0
- package/dist/rolldown-runtime-hDbaFkMy.js +18 -0
- package/dist/route-data.d.ts +12 -0
- package/dist/route-data.js +69 -0
- package/dist/route-match-C-0_EnAt.d.ts +5 -0
- package/dist/route-match-DMkUICYV.js +41 -0
- package/dist/route-preload-C4DlGoCd.js +120 -0
- package/dist/run-display-UjLAoYqQ.js +81 -0
- package/dist/run-history-arGiHzGU.js +285 -0
- package/dist/run-list-links-DJn4Mf1T.js +98 -0
- package/dist/run-mode-USmM0-Uo.js +82 -0
- package/dist/run-parity-CWXqEJqM.js +144 -0
- package/dist/runsQuota-B6SyTbne.js +100 -0
- package/dist/runsQuota-DsniKiSg.d.ts +20 -0
- package/dist/safe-expression-Cw7-SCsm.js +1251 -0
- package/dist/save-status-store-C7nEYpfb.js +631 -0
- package/dist/schedule-panel-B4GYXzXQ.js +13774 -0
- package/dist/schedule-rules-ggVKRkBH.js +358 -0
- package/dist/secrets-Re_wSiE3.js +153 -0
- package/dist/settings.d.ts +4 -0
- package/dist/settings.js +6 -0
- package/dist/shared-DAWGGMSM.js +177 -0
- package/dist/sidebar-node-editor-6eSSgCzc.js +178 -0
- package/dist/solar.generated-CGYuUQAC.js +10 -0
- package/dist/stableTabbedDialog-BBhrfXGe.js +20 -0
- package/dist/start-url-CT6Yz96K.js +24 -0
- package/dist/status-CessxGpm.js +55 -0
- package/dist/store-icon-OctYp5zP.js +155 -0
- package/dist/styles-WGmTnZ2n.js +26 -0
- package/dist/styles.css +139 -0
- package/dist/svg-spinners.generated-CIPT7IhM.js +10 -0
- package/dist/template-code-CzN6JWNV.js +191 -0
- package/dist/template-graph-DLF9dygU.js +20 -0
- package/dist/template-preview-DcIIKOOL.js +32 -0
- package/dist/template-price-CdUHZRMF.js +40 -0
- package/dist/templates.d.ts +3 -0
- package/dist/templates.js +5 -0
- package/dist/theme-provider-CntfC4_i.js +23 -0
- package/dist/transient-DgZfhDfN.js +57 -0
- package/dist/typed-calls-C5tO03wq.js +26 -0
- package/dist/ui-script-By74Guk3.js +1094 -0
- package/dist/ui-script-editor-CqPu2bCN.js +2447 -0
- package/dist/ui-step-fix-8uM2_Hft.js +67 -0
- package/dist/ui-step-fix-store-CcO1FdRx.js +19 -0
- package/dist/ui-step-run-context-o7bLE6KP.js +46 -0
- package/dist/ui-target-editor-D2JhB_lD.js +673 -0
- package/dist/uiMarkTools-CSznnO1i.js +1054 -0
- package/dist/upgradePrompt-BAFBKKW5.js +72 -0
- package/dist/use-bare-node-registry-O6mKJO_n.js +11498 -0
- package/dist/use-browser-available-hj8wc3Kb.js +241 -0
- package/dist/use-edge-mapper-schemas-Bonofxow.js +496 -0
- package/dist/use-extension-bridge-B9ZreOkQ.js +608 -0
- package/dist/use-mobile-BTqCUjzS.js +27 -0
- package/dist/use-sdk-query-C697xZVv.js +116 -0
- package/dist/use-workflow-code-editor-CFoRFrZ5.js +753 -0
- package/dist/useActionParam-B2tU2BlY.js +85 -0
- package/dist/useAgentTokenStream-Bko_J0d0.js +4217 -0
- package/dist/useBrowserClients-3v95-gSh.js +103 -0
- package/dist/useCodeWorkflowInsights-w0tz9Ap_.js +600 -0
- package/dist/useConnections-DsgEJs05.js +439 -0
- package/dist/useDebouncedValue-BFekcv6n.js +18 -0
- package/dist/useDurableParity-8fnMZmBc.js +1787 -0
- package/dist/useEntityTags-D0spL6Ut.js +460 -0
- package/dist/useExecutions-2u5nGJJk.js +681 -0
- package/dist/useFluidGridsAnalytics-VM8lAi2x.js +238 -0
- package/dist/useGlobalStoreClient-BTdhkA2I.js +24 -0
- package/dist/useHumanRequests-zlYDp3l1.js +221 -0
- package/dist/useNavigationV2-C2WeqN7d.js +29 -0
- package/dist/useNavigationV2-DANUmg12.d.ts +9 -0
- package/dist/useObservability-BRlQ0tOA.js +285 -0
- package/dist/useRequestedProposal-B7uPXfZB.js +51 -0
- package/dist/useRunHistory-CXCMUPyf.js +2759 -0
- package/dist/useRunLive-D0JvVZT2.js +1060 -0
- package/dist/useRunnerList-Dbi59i1K.js +446 -0
- package/dist/useRunners-URUc5quU.js +173 -0
- package/dist/useRunsPage-DG656UCK.js +2709 -0
- package/dist/useVariables-BIelxcWr.js +463 -0
- package/dist/useVersionHistoryData-CTjqVw7l.js +292 -0
- package/dist/useWorkflowCodeExport-pqxyLHD1.js +522 -0
- package/dist/useWorkflowListExport-hcZNvTaB.js +232 -0
- package/dist/useWorkflowOrganization-CpBbOrs7.js +1772 -0
- package/dist/useWorkflowProposal-BH0VdNMA.js +3280 -0
- package/dist/useWorkflows-Cvg-Z_IE.js +1606 -0
- package/dist/utils-fvBb5qOD.js +89 -0
- package/dist/webhook-deliveries-AvQujaZy.js +99 -0
- package/dist/workflow-builder-CJygVkVv.d.ts +2 -0
- package/dist/workflow-builder.d.ts +3 -0
- package/dist/workflow-builder.js +8 -0
- package/dist/workflow-code-transfer-Bsy0JKAZ.js +323 -0
- package/dist/workflow-embed.d.ts +3 -0
- package/dist/workflow-embed.js +4 -0
- package/dist/workflow-git-sync--K9ZsPDC.js +263 -0
- package/dist/workflow-host.d.ts +6 -0
- package/dist/workflow-host.js +11 -0
- package/dist/workflow-pages-D-7ByLTB.d.ts +68 -0
- package/dist/workflow-pages.d.ts +3 -0
- package/dist/workflow-pages.js +115 -0
- package/dist/workflow-preview-canvas-CO8yzdE3.js +848 -0
- package/dist/workflow-preview.d.ts +65 -0
- package/dist/workflow-preview.js +4 -0
- package/dist/workflow-route.d.ts +33 -0
- package/dist/workflow-route.js +4 -0
- package/dist/workflow-save-state-D0l-DkLf.js +767 -0
- package/dist/workflow-transfer-CQnQC-ke.js +104 -0
- package/dist/workflowRouteData-BkfVOc-O.js +169 -0
- package/dist/workflows-list.d.ts +10 -0
- package/dist/workflows-list.js +5 -0
- package/package.json +320 -4
|
@@ -0,0 +1,1929 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as __exportAll } from "./rolldown-runtime-hDbaFkMy.js";
|
|
3
|
+
import { t as Icon } from "./Icon-BtQ0HXLh.js";
|
|
4
|
+
import { t as describeOperationError } from "./errors-ClKb5sEt.js";
|
|
5
|
+
import { r as useTr } from "./TranslationBridge-Da-TPgQm.js";
|
|
6
|
+
import { i as SdkPermissionButton, s as useFluidGridsPermission, t as FLUIDGRIDS_PERMISSIONS } from "./constants-DlRnHBfQ.js";
|
|
7
|
+
import { a as useRunners, i as useRunnerActions, r as runnerInstallCommand } from "./useRunners-URUc5quU.js";
|
|
8
|
+
import { t as RunnerStatusPill } from "./RunnerStatusPill-C1v967iq.js";
|
|
9
|
+
import { t as FluidGridsDocsLink } from "./FluidGridsDocsLink-bX0Hnhxr.js";
|
|
10
|
+
import { n as useNavigationV2 } from "./useNavigationV2-C2WeqN7d.js";
|
|
11
|
+
import { t as ConfirmActionDialog } from "./ConfirmActionDialog-DHWTDRbp.js";
|
|
12
|
+
import { _ as ViewOnlyPill, c as CompactRow, d as RowIcon, f as RowSummary, g as MoreToolsPage, h as MoreToolsHeader, i as Panel, l as FilterChips, m as Dot, o as ToneAlert, s as CompactList, t as KeyValueList, u as ListToolbar, v as WhatIsLink } from "./panels-PfBBAToE.js";
|
|
13
|
+
import { i as copyText, t as CodeLine } from "./secrets-Re_wSiE3.js";
|
|
14
|
+
import { a as useClampedPage, o as useSearchDraft, r as readChoice, s as useUrlListState, t as RowMenu } from "./menus-CU3hDGYl.js";
|
|
15
|
+
import { c as NETWORK_ALLOW_EXAMPLE, d as ruleSteps, f as runnerSandboxLabel, l as RUNNER_FILTERS, n as useTrackedRunner, o as HOST_EXEC_DISABLE_EXAMPLE, p as runnerSystemLabel, s as HOST_EXEC_ENABLE_EXAMPLE, t as useRunnerList, u as rulePorts } from "./useRunnerList-Dbi59i1K.js";
|
|
16
|
+
import { t as Disclosure } from "./Disclosure-BNKij7-v.js";
|
|
17
|
+
import { a as NoResultsPanel, c as ResultsPager, d as formatShortDateTime, f as MORE_TOOLS_PAGE_SIZE, n as ListSkeleton, o as PagedBody, r as LoadErrorPanel, t as EmptyPanel, u as formatCount } from "./results-CwK_yDxK.js";
|
|
18
|
+
import { t as SearchBox } from "./SearchBox-BGtYjvfs.js";
|
|
19
|
+
import { n as Status, t as ReasonLine } from "./status-CessxGpm.js";
|
|
20
|
+
import { n as formatRelativeTime, t as formatExactTime } from "./relative-time-Dxt8ZIIu.js";
|
|
21
|
+
import { r as getFluidGridsConfig } from "./config-DO68jw5k.js";
|
|
22
|
+
import { t as TechnicalDetails } from "./TechnicalDetails-B0Oi4aZw.js";
|
|
23
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
24
|
+
import { Link, useLocation, useNavigate, useSearchParams } from "react-router";
|
|
25
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
26
|
+
import { ArrowLeft, CheckCircle2, Copy, KeyRound, Plus, Server, Trash2, TriangleAlert, X } from "lucide-react";
|
|
27
|
+
import { toast } from "sonner";
|
|
28
|
+
import { Badge, Card, CardHeader, CompactMarkOr, Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, EmptyState, Input, Label, ResponsiveDialog, ResponsiveDialogContent, ResponsiveDialogDescription, ResponsiveDialogFooter, ResponsiveDialogHeader, ResponsiveDialogTitle, SpinnerIcon, Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@burdenoff/fe-libs/ui";
|
|
29
|
+
import { Button as Button$1 } from "@burdenoff/fe-libs/button";
|
|
30
|
+
import { useActorProfiles } from "@burdenoff/fe-libs/shared";
|
|
31
|
+
|
|
32
|
+
// src/modules/runners/components/RunnerDialogsV2.tsx
|
|
33
|
+
/**
|
|
34
|
+
* The redesigned Runners dialogs (BOFF-15502, Navigation v2):
|
|
35
|
+
*
|
|
36
|
+
* - Add a runner: a name, then the install command and the connection key
|
|
37
|
+
* (each with Copy), "the key is shown only once", and a line that waits for
|
|
38
|
+
* the runner to connect;
|
|
39
|
+
* - the new key after "Get a new connection key", with the same steps.
|
|
40
|
+
*
|
|
41
|
+
* The key is never shown again, so closing either dialog before the key was
|
|
42
|
+
* copied asks first; a runner that already connected with it needs no check.
|
|
43
|
+
*/
|
|
44
|
+
/** The two steps on the machine: run the install command, paste the key. */
|
|
45
|
+
function RunnerInstallSteps({ issued, onKeyCopied }) {
|
|
46
|
+
const tr = useTr();
|
|
47
|
+
const command = runnerInstallCommand(issued.bridgeUrl);
|
|
48
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
49
|
+
className: "space-y-4",
|
|
50
|
+
children: [/* @__PURE__ */ jsxs("ol", {
|
|
51
|
+
className: "space-y-4",
|
|
52
|
+
children: [/* @__PURE__ */ jsxs("li", {
|
|
53
|
+
className: "space-y-1.5",
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsx("p", {
|
|
56
|
+
className: "text-sm font-semibold text-text-primary",
|
|
57
|
+
children: tr("fluidgrids.moreTools.runners.install.runTitle", "1. Run this on the machine")
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsx("p", {
|
|
60
|
+
className: "text-xs text-text-secondary",
|
|
61
|
+
children: tr("fluidgrids.moreTools.runners.install.runHint", "Linux, or a Mac with Apple silicon. It installs the runner and its sandbox and starts it in the background.")
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsx(CodeLine, {
|
|
64
|
+
value: command,
|
|
65
|
+
what: tr("fluidgrids.moreTools.runners.install.commandWhat", "install command"),
|
|
66
|
+
testId: "runner-install-command"
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}), /* @__PURE__ */ jsxs("li", {
|
|
70
|
+
className: "space-y-1.5",
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsx("p", {
|
|
73
|
+
className: "text-sm font-semibold text-text-primary",
|
|
74
|
+
children: tr("fluidgrids.moreTools.runners.install.keyTitle", "2. Paste this key when it asks")
|
|
75
|
+
}),
|
|
76
|
+
/* @__PURE__ */ jsx("p", {
|
|
77
|
+
className: "text-xs text-text-secondary",
|
|
78
|
+
children: tr("fluidgrids.moreTools.runners.install.keyHint", "It is not part of the command, so it never lands in your shell history.")
|
|
79
|
+
}),
|
|
80
|
+
/* @__PURE__ */ jsx(CodeLine, {
|
|
81
|
+
value: issued.token,
|
|
82
|
+
what: tr("fluidgrids.moreTools.runners.install.keyWhat", "connection key"),
|
|
83
|
+
onCopied: onKeyCopied,
|
|
84
|
+
testId: "runner-key"
|
|
85
|
+
}),
|
|
86
|
+
/* @__PURE__ */ jsxs("p", {
|
|
87
|
+
className: "flex items-start gap-1.5 text-xs text-status-warning-text",
|
|
88
|
+
children: [/* @__PURE__ */ jsx(TriangleAlert, {
|
|
89
|
+
className: "mt-0.5 size-3.5 shrink-0",
|
|
90
|
+
"aria-hidden": "true"
|
|
91
|
+
}), tr("fluidgrids.moreTools.runners.install.keyOnce", "The key is shown only once. If you lose it, get a new one from the runner's page.")]
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})]
|
|
95
|
+
}), /* @__PURE__ */ jsx(Disclosure, {
|
|
96
|
+
closedLabel: tr("fluidgrids.moreTools.runners.install.noTerminal", "Installing without a terminal (cloud-init or scripts)?"),
|
|
97
|
+
openLabel: tr("fluidgrids.moreTools.runners.install.noTerminal", "Installing without a terminal (cloud-init or scripts)?"),
|
|
98
|
+
"data-testid": "runner-token-file-hint",
|
|
99
|
+
children: /* @__PURE__ */ jsx("p", {
|
|
100
|
+
className: "text-xs text-text-secondary",
|
|
101
|
+
children: tr("fluidgrids.moreTools.runners.install.tokenFile", "Save the key to a file only you can read, then add --token-file <path> to the command.")
|
|
102
|
+
})
|
|
103
|
+
})]
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/** "Close without copying the key?", in front of a key dialog. */
|
|
107
|
+
function CloseWithoutCopyingCheck({ open, onStay, onClose, testId }) {
|
|
108
|
+
const tr = useTr();
|
|
109
|
+
return /* @__PURE__ */ jsx(ConfirmActionDialog, {
|
|
110
|
+
open,
|
|
111
|
+
onOpenChange: (next) => {
|
|
112
|
+
if (!next) onStay();
|
|
113
|
+
},
|
|
114
|
+
title: tr("fluidgrids.moreTools.runners.closeCheck.title", "Close without copying the key?"),
|
|
115
|
+
description: tr("fluidgrids.moreTools.runners.closeCheck.body", "The key is shown only once. If you close now, you will need to get a new one from the runner's page."),
|
|
116
|
+
confirmLabel: tr("fluidgrids.moreTools.common.closeAnyway", "Close anyway"),
|
|
117
|
+
cancelLabel: tr("fluidgrids.moreTools.common.goBack", "Go back"),
|
|
118
|
+
destructive: true,
|
|
119
|
+
onConfirm: onClose,
|
|
120
|
+
"data-testid": testId
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Add a runner. The body is mounted only while open, so every opening starts
|
|
125
|
+
* with an empty name, no key and no pending question.
|
|
126
|
+
*/
|
|
127
|
+
function AddRunnerDialogV2({ open, ...rest }) {
|
|
128
|
+
return open ? /* @__PURE__ */ jsx(AddRunnerBody$1, { ...rest }) : null;
|
|
129
|
+
}
|
|
130
|
+
function AddRunnerBody$1({ onOpenChange, onCreated }) {
|
|
131
|
+
const tr = useTr();
|
|
132
|
+
const { createRunner, busy } = useRunnerActions();
|
|
133
|
+
const [name, setName] = useState("");
|
|
134
|
+
const [issued, setIssued] = useState(null);
|
|
135
|
+
const [copied, setCopied] = useState(false);
|
|
136
|
+
const [checking, setChecking] = useState(false);
|
|
137
|
+
const connected = useTrackedRunner(issued ? issued.runner.id : null).runner?.status === "ONLINE";
|
|
138
|
+
const requestClose = useCallback(() => {
|
|
139
|
+
if (busy) return;
|
|
140
|
+
if (issued && !copied && !connected) {
|
|
141
|
+
setChecking(true);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
onOpenChange(false);
|
|
145
|
+
}, [
|
|
146
|
+
busy,
|
|
147
|
+
connected,
|
|
148
|
+
copied,
|
|
149
|
+
issued,
|
|
150
|
+
onOpenChange
|
|
151
|
+
]);
|
|
152
|
+
const submit = useCallback(async () => {
|
|
153
|
+
const trimmed = name.trim();
|
|
154
|
+
if (!trimmed || busy) return;
|
|
155
|
+
try {
|
|
156
|
+
setIssued(await createRunner(trimmed));
|
|
157
|
+
onCreated();
|
|
158
|
+
} catch (err) {
|
|
159
|
+
toast.error(describeOperationError(err, tr("fluidgrids.moreTools.runners.add.failed", "Couldn't add the runner")));
|
|
160
|
+
}
|
|
161
|
+
}, [
|
|
162
|
+
busy,
|
|
163
|
+
createRunner,
|
|
164
|
+
name,
|
|
165
|
+
onCreated,
|
|
166
|
+
tr
|
|
167
|
+
]);
|
|
168
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ResponsiveDialog, {
|
|
169
|
+
open: !checking,
|
|
170
|
+
onOpenChange: (next) => {
|
|
171
|
+
if (!next) requestClose();
|
|
172
|
+
},
|
|
173
|
+
children: /* @__PURE__ */ jsxs(ResponsiveDialogContent, {
|
|
174
|
+
className: "sm:max-w-2xl",
|
|
175
|
+
"data-testid": "add-runner-dialog",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsxs(ResponsiveDialogHeader, { children: [/* @__PURE__ */ jsx(ResponsiveDialogTitle, { children: issued ? tr("fluidgrids.moreTools.runners.add.installTitle", "Install {{name}}", { name: issued.runner.name }) : tr("fluidgrids.moreTools.runners.add.title", "Add a runner") }), /* @__PURE__ */ jsx(ResponsiveDialogDescription, { children: issued ? tr("fluidgrids.moreTools.runners.add.installSubtitle", "Two steps on the machine") : tr("fluidgrids.moreTools.runners.add.subtitle", "A machine of yours that runs chosen steps") })] }),
|
|
178
|
+
!issued ? /* @__PURE__ */ jsxs("div", {
|
|
179
|
+
className: "space-y-1.5",
|
|
180
|
+
children: [
|
|
181
|
+
/* @__PURE__ */ jsx(Label, {
|
|
182
|
+
htmlFor: "runner-name",
|
|
183
|
+
children: tr("fluidgrids.moreTools.runners.add.name", "Name")
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ jsx(Input, {
|
|
186
|
+
id: "runner-name",
|
|
187
|
+
value: name,
|
|
188
|
+
maxLength: 100,
|
|
189
|
+
autoComplete: "off",
|
|
190
|
+
placeholder: tr("fluidgrids.moreTools.runners.add.namePlaceholder", "build-server or my-laptop"),
|
|
191
|
+
"aria-describedby": "runner-name-hint",
|
|
192
|
+
onChange: (event) => setName(event.target.value),
|
|
193
|
+
onKeyDown: (event) => {
|
|
194
|
+
if (event.key === "Enter") submit();
|
|
195
|
+
},
|
|
196
|
+
"data-testid": "runner-name-input"
|
|
197
|
+
}),
|
|
198
|
+
/* @__PURE__ */ jsx("p", {
|
|
199
|
+
id: "runner-name-hint",
|
|
200
|
+
className: "text-xs text-text-muted",
|
|
201
|
+
children: tr("fluidgrids.moreTools.runners.add.nameHint", "You pick this name when you set a step to run on it.")
|
|
202
|
+
})
|
|
203
|
+
]
|
|
204
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
205
|
+
className: "space-y-4",
|
|
206
|
+
children: [/* @__PURE__ */ jsx(RunnerInstallSteps, {
|
|
207
|
+
issued,
|
|
208
|
+
onKeyCopied: () => setCopied(true)
|
|
209
|
+
}), /* @__PURE__ */ jsx("p", {
|
|
210
|
+
role: "status",
|
|
211
|
+
className: "flex items-center gap-2 text-sm",
|
|
212
|
+
"data-testid": "runner-connect-status",
|
|
213
|
+
"data-connected": connected ? "" : void 0,
|
|
214
|
+
children: connected ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CheckCircle2, {
|
|
215
|
+
className: "size-4 shrink-0 text-status-success-text",
|
|
216
|
+
"aria-hidden": "true"
|
|
217
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
218
|
+
className: "text-status-success-text",
|
|
219
|
+
children: tr("fluidgrids.moreTools.runners.add.connected", "Connected. Pick it in a step's settings under “Run on”.")
|
|
220
|
+
})] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(SpinnerIcon, {
|
|
221
|
+
className: "size-4 shrink-0 text-text-secondary motion-safe:animate-spin",
|
|
222
|
+
"aria-hidden": "true"
|
|
223
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
224
|
+
className: "text-text-secondary",
|
|
225
|
+
children: tr("fluidgrids.moreTools.runners.add.waiting", "Waiting for the runner to connect…")
|
|
226
|
+
})] })
|
|
227
|
+
})]
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ jsx(ResponsiveDialogFooter, { children: !issued ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Button$1, {
|
|
230
|
+
variant: "outline",
|
|
231
|
+
onClick: requestClose,
|
|
232
|
+
disabled: busy,
|
|
233
|
+
"data-testid": "runner-create-cancel",
|
|
234
|
+
children: tr("fluidgrids.moreTools.runners.add.cancel", "Cancel")
|
|
235
|
+
}), /* @__PURE__ */ jsx(Button$1, {
|
|
236
|
+
onClick: () => void submit(),
|
|
237
|
+
disabled: busy || !name.trim(),
|
|
238
|
+
"data-testid": "runner-create-submit",
|
|
239
|
+
children: tr("fluidgrids.moreTools.runners.add.create", "Create runner")
|
|
240
|
+
})] }) : /* @__PURE__ */ jsx(Button$1, {
|
|
241
|
+
onClick: requestClose,
|
|
242
|
+
"data-testid": "runner-dialog-done",
|
|
243
|
+
children: tr("fluidgrids.moreTools.common.done", "Done")
|
|
244
|
+
}) })
|
|
245
|
+
]
|
|
246
|
+
})
|
|
247
|
+
}), /* @__PURE__ */ jsx(CloseWithoutCopyingCheck, {
|
|
248
|
+
open: checking,
|
|
249
|
+
onStay: () => setChecking(false),
|
|
250
|
+
onClose: () => {
|
|
251
|
+
setChecking(false);
|
|
252
|
+
onOpenChange(false);
|
|
253
|
+
},
|
|
254
|
+
testId: "confirm-close-uncopied"
|
|
255
|
+
})] });
|
|
256
|
+
}
|
|
257
|
+
/** The new key after "Get a new connection key", shown once. */
|
|
258
|
+
function RunnerKeyDialogV2({ issued, onClose }) {
|
|
259
|
+
return issued ? /* @__PURE__ */ jsx(RunnerKeyBody, {
|
|
260
|
+
issued,
|
|
261
|
+
onClose
|
|
262
|
+
}, issued.token) : null;
|
|
263
|
+
}
|
|
264
|
+
function RunnerKeyBody({ issued, onClose }) {
|
|
265
|
+
const tr = useTr();
|
|
266
|
+
const [copied, setCopied] = useState(false);
|
|
267
|
+
const [checking, setChecking] = useState(false);
|
|
268
|
+
const requestClose = () => {
|
|
269
|
+
if (!copied) {
|
|
270
|
+
setChecking(true);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
onClose();
|
|
274
|
+
};
|
|
275
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ResponsiveDialog, {
|
|
276
|
+
open: !checking,
|
|
277
|
+
onOpenChange: (next) => {
|
|
278
|
+
if (!next) requestClose();
|
|
279
|
+
},
|
|
280
|
+
children: /* @__PURE__ */ jsxs(ResponsiveDialogContent, {
|
|
281
|
+
className: "sm:max-w-2xl",
|
|
282
|
+
"data-testid": "rotated-dialog",
|
|
283
|
+
children: [
|
|
284
|
+
/* @__PURE__ */ jsxs(ResponsiveDialogHeader, { children: [/* @__PURE__ */ jsx(ResponsiveDialogTitle, { children: tr("fluidgrids.moreTools.runners.newKey.title", "Your new connection key") }), /* @__PURE__ */ jsx(ResponsiveDialogDescription, { children: tr("fluidgrids.moreTools.runners.newKey.subtitle", "The old key no longer works and {{name}} was disconnected. Run the install command again on that machine and paste the new key when it asks.", { name: issued.runner.name }) })] }),
|
|
285
|
+
/* @__PURE__ */ jsx(RunnerInstallSteps, {
|
|
286
|
+
issued,
|
|
287
|
+
onKeyCopied: () => setCopied(true)
|
|
288
|
+
}),
|
|
289
|
+
/* @__PURE__ */ jsx(ResponsiveDialogFooter, { children: /* @__PURE__ */ jsx(Button$1, {
|
|
290
|
+
onClick: requestClose,
|
|
291
|
+
"data-testid": "rotated-dialog-done",
|
|
292
|
+
children: tr("fluidgrids.moreTools.common.done", "Done")
|
|
293
|
+
}) })
|
|
294
|
+
]
|
|
295
|
+
})
|
|
296
|
+
}), /* @__PURE__ */ jsx(CloseWithoutCopyingCheck, {
|
|
297
|
+
open: checking,
|
|
298
|
+
onStay: () => setChecking(false),
|
|
299
|
+
onClose: () => {
|
|
300
|
+
setChecking(false);
|
|
301
|
+
onClose();
|
|
302
|
+
},
|
|
303
|
+
testId: "confirm-close-rotated"
|
|
304
|
+
})] });
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/modules/runners/components/RunnerRowParts.tsx
|
|
308
|
+
/**
|
|
309
|
+
* Small pieces the redesigned Runners list and runner page share (BOFF-15502):
|
|
310
|
+
* a runner's status in the operator's colours, where its steps can reach, and
|
|
311
|
+
* when it was last seen.
|
|
312
|
+
*/
|
|
313
|
+
/** "How runners work": the page's purpose, one click away, with the guide. */
|
|
314
|
+
function RunnersWhatIs() {
|
|
315
|
+
const tr = useTr();
|
|
316
|
+
return /* @__PURE__ */ jsxs(WhatIsLink, {
|
|
317
|
+
label: tr("fluidgrids.moreTools.runners.whatIs.label", "How runners work"),
|
|
318
|
+
title: tr("fluidgrids.moreTools.runners.whatIs.title", "How runners work"),
|
|
319
|
+
docsTopic: "runners",
|
|
320
|
+
children: [
|
|
321
|
+
/* @__PURE__ */ jsx("p", { children: tr("fluidgrids.moreTools.runners.whatIs.body", "A runner is a machine of yours. A step set to “Run on” a runner executes there inside a local sandbox, and the rest of the workflow keeps running in FluidGrids.") }),
|
|
322
|
+
/* @__PURE__ */ jsx("p", { children: tr("fluidgrids.moreTools.runners.whatIs.network", "Steps reach the public internet only. To open a private address, run this on the runner machine:") }),
|
|
323
|
+
/* @__PURE__ */ jsx("code", {
|
|
324
|
+
className: "block overflow-x-auto whitespace-nowrap rounded-md bg-bg-sunken px-2 py-1 font-mono text-xs text-text-primary",
|
|
325
|
+
children: NETWORK_ALLOW_EXAMPLE
|
|
326
|
+
})
|
|
327
|
+
]
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
/** Online is quiet green text, Offline neutral, Not connected yet yellow. */
|
|
331
|
+
const RUNNER_STATUS_TONE = {
|
|
332
|
+
ONLINE: "quiet",
|
|
333
|
+
OFFLINE: "neutral",
|
|
334
|
+
NEVER_CONNECTED: "warning"
|
|
335
|
+
};
|
|
336
|
+
function runnerStatusLabel(tr, status) {
|
|
337
|
+
if (status === "ONLINE") return tr("fluidgrids.moreTools.runners.status.online", "Online");
|
|
338
|
+
if (status === "OFFLINE") return tr("fluidgrids.moreTools.runners.status.offline", "Offline");
|
|
339
|
+
return tr("fluidgrids.moreTools.runners.status.never", "Not connected yet");
|
|
340
|
+
}
|
|
341
|
+
/** The line under a status: when an offline runner was seen, or what it waits for. */
|
|
342
|
+
function runnerStatusReason(tr, runner) {
|
|
343
|
+
if (runner.status === "OFFLINE") return tr("fluidgrids.moreTools.runners.status.seen", "Seen {{when}}", { when: formatRelativeTime(tr, runner.lastSeenAt) });
|
|
344
|
+
if (runner.status === "NEVER_CONNECTED") return tr("fluidgrids.moreTools.runners.status.waiting", "Waiting for the install");
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
function RunnerStatusCell({ runner, withReason = false }) {
|
|
348
|
+
const tr = useTr();
|
|
349
|
+
const tone = RUNNER_STATUS_TONE[runner.status];
|
|
350
|
+
const reason = withReason ? runnerStatusReason(tr, runner) : null;
|
|
351
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
352
|
+
className: "min-w-0",
|
|
353
|
+
children: [/* @__PURE__ */ jsx(Status, {
|
|
354
|
+
tone,
|
|
355
|
+
"data-testid": "runner-status",
|
|
356
|
+
className: "align-middle",
|
|
357
|
+
children: runnerStatusLabel(tr, runner.status)
|
|
358
|
+
}), reason && /* @__PURE__ */ jsx(ReasonLine, {
|
|
359
|
+
tone: "neutral",
|
|
360
|
+
children: reason
|
|
361
|
+
})]
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
/** "Public internet only" or "3 private addresses". */
|
|
365
|
+
function runnerNetworkText(tr, runner) {
|
|
366
|
+
const count = runner.privateNetwork?.length ?? 0;
|
|
367
|
+
if (count === 0) return tr("fluidgrids.moreTools.runners.network.publicOnly", "Public internet only");
|
|
368
|
+
return count === 1 ? tr("fluidgrids.moreTools.runners.network.oneAddress", "1 private address") : tr("fluidgrids.moreTools.runners.network.addresses", "{{count}} private addresses", { count });
|
|
369
|
+
}
|
|
370
|
+
/** "Host commands: off" or "Host commands: on (echo, git status)". */
|
|
371
|
+
function runnerHostExecSummary(tr, runner) {
|
|
372
|
+
const hostExec = runner.hostExec;
|
|
373
|
+
if (!hostExec?.enabled || hostExec.allow.length === 0) return tr("fluidgrids.moreTools.runners.hostExec.offSummary", "Host commands: off");
|
|
374
|
+
return tr("fluidgrids.moreTools.runners.hostExec.onSummary", "Host commands: on ({{allow}})", { allow: hostExec.allow.includes("*") ? tr("fluidgrids.moreTools.runners.hostExec.anyCommand", "* (any command)") : hostExec.allow.join(", ") });
|
|
375
|
+
}
|
|
376
|
+
/** "Now" for a connected runner, "5m ago", or "Never". */
|
|
377
|
+
function RunnerLastSeen({ runner }) {
|
|
378
|
+
const tr = useTr();
|
|
379
|
+
if (runner.status === "ONLINE") return /* @__PURE__ */ jsx("span", { children: tr("fluidgrids.moreTools.runners.lastSeen.now", "Now") });
|
|
380
|
+
if (!runner.lastSeenAt) return /* @__PURE__ */ jsx("span", {
|
|
381
|
+
className: "text-text-muted",
|
|
382
|
+
children: tr("fluidgrids.moreTools.runners.lastSeen.never", "Never")
|
|
383
|
+
});
|
|
384
|
+
return /* @__PURE__ */ jsx("span", {
|
|
385
|
+
title: formatExactTime(runner.lastSeenAt),
|
|
386
|
+
children: formatRelativeTime(tr, runner.lastSeenAt)
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
// src/modules/runners/components/runnerListHelpers.ts
|
|
391
|
+
/** The Runner, Status, Network, Last seen and actions columns, from `sm` up. */
|
|
392
|
+
const RUNNER_COLUMNS = "sm:grid-cols-[2rem_minmax(0,1fr)_8.5rem_8rem_5rem_9.5rem]";
|
|
393
|
+
/** Loaded, and none of the write permissions is held. */
|
|
394
|
+
function isRunnerViewOnly(permissions) {
|
|
395
|
+
return !permissions.loading && !permissions.canCreate && !permissions.canRotate && !permissions.canRemove;
|
|
396
|
+
}
|
|
397
|
+
/** "All" is the service's count; the others only when every runner is in hand. */
|
|
398
|
+
function buildRunnerChips(tr, total, counts) {
|
|
399
|
+
return [
|
|
400
|
+
{
|
|
401
|
+
value: "all",
|
|
402
|
+
label: tr("fluidgrids.moreTools.runners.chips.all", "All"),
|
|
403
|
+
count: total ?? void 0
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
value: "online",
|
|
407
|
+
label: tr("fluidgrids.moreTools.runners.chips.online", "Online"),
|
|
408
|
+
count: counts?.online
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
value: "offline",
|
|
412
|
+
label: tr("fluidgrids.moreTools.runners.chips.offline", "Offline"),
|
|
413
|
+
count: counts?.offline
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
value: "never",
|
|
417
|
+
label: tr("fluidgrids.moreTools.runners.chips.never", "Not connected yet"),
|
|
418
|
+
count: counts?.never
|
|
419
|
+
}
|
|
420
|
+
];
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// src/modules/runners/components/RunnerListParts.tsx
|
|
424
|
+
/** The Add runner button, behind the sandbox create permission. */
|
|
425
|
+
function AddRunnerButton({ testId, label, onAdd }) {
|
|
426
|
+
const tr = useTr();
|
|
427
|
+
return /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
428
|
+
permission: FLUIDGRIDS_PERMISSIONS.SANDBOX_CREATE,
|
|
429
|
+
deniedTooltip: tr("fluidgrids.moreTools.runners.addDenied", "You don't have permission to add runners"),
|
|
430
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
431
|
+
onClick: onAdd,
|
|
432
|
+
"data-testid": testId,
|
|
433
|
+
"data-tour": testId === "runner-add" ? "fluidgrids-runners-add" : void 0,
|
|
434
|
+
children: [/* @__PURE__ */ jsx(Plus, {
|
|
435
|
+
className: "size-4",
|
|
436
|
+
"aria-hidden": "true"
|
|
437
|
+
}), label]
|
|
438
|
+
})
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
function runnersLabel(tr, total) {
|
|
442
|
+
if (total === 1) return tr("fluidgrids.moreTools.runners.facts.one", "1 runner");
|
|
443
|
+
return tr("fluidgrids.moreTools.runners.facts.count", "{{count}} runners", { count: formatCount(total) });
|
|
444
|
+
}
|
|
445
|
+
/** The header's fact line: counts, the explainer and the view-only pill. */
|
|
446
|
+
function RunnersFacts({ total, counts, viewOnly }) {
|
|
447
|
+
const tr = useTr();
|
|
448
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
449
|
+
total !== null && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
450
|
+
className: "tabular-nums",
|
|
451
|
+
"data-testid": "runners-facts-count",
|
|
452
|
+
children: runnersLabel(tr, total)
|
|
453
|
+
}), /* @__PURE__ */ jsx(Dot, {})] }),
|
|
454
|
+
counts && total !== 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
|
|
455
|
+
className: "tabular-nums",
|
|
456
|
+
"data-testid": "runners-facts-online",
|
|
457
|
+
children: tr("fluidgrids.moreTools.runners.facts.online", "{{count}} online", { count: formatCount(counts.online) })
|
|
458
|
+
}), /* @__PURE__ */ jsx(Dot, {})] }),
|
|
459
|
+
/* @__PURE__ */ jsx(RunnersWhatIs, {}),
|
|
460
|
+
viewOnly && /* @__PURE__ */ jsx(ViewOnlyPill, {})
|
|
461
|
+
] });
|
|
462
|
+
}
|
|
463
|
+
/** The panel for a workspace with no runner yet. */
|
|
464
|
+
function RunnersEmpty({ onAdd }) {
|
|
465
|
+
const tr = useTr();
|
|
466
|
+
return /* @__PURE__ */ jsx(EmptyPanel, {
|
|
467
|
+
illustration: "servers",
|
|
468
|
+
icon: /* @__PURE__ */ jsx(Server, {
|
|
469
|
+
className: "size-5 text-text-secondary",
|
|
470
|
+
"aria-hidden": "true"
|
|
471
|
+
}),
|
|
472
|
+
title: tr("fluidgrids.moreTools.runners.empty.title", "No runners yet"),
|
|
473
|
+
text: tr("fluidgrids.moreTools.runners.empty.text", "A runner is a machine of yours that runs chosen steps inside a local sandbox, so they can reach things in your network. The rest of the workflow keeps running in FluidGrids."),
|
|
474
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
475
|
+
className: "flex flex-wrap items-center justify-center gap-3",
|
|
476
|
+
children: [/* @__PURE__ */ jsx(AddRunnerButton, {
|
|
477
|
+
testId: "runner-empty-add",
|
|
478
|
+
label: tr("fluidgrids.moreTools.runners.empty.add", "Add a runner"),
|
|
479
|
+
onAdd
|
|
480
|
+
}), /* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
481
|
+
topic: "runners",
|
|
482
|
+
children: tr("fluidgrids.moreTools.runners.whatIs.label", "How runners work")
|
|
483
|
+
})]
|
|
484
|
+
})
|
|
485
|
+
});
|
|
486
|
+
}
|
|
487
|
+
/** The rows, the no-results panel, or a skeleton for a page past the end. */
|
|
488
|
+
function RunnerResults({ view, exact, page, pageLoading, runnerLink, actingId, onClearFilters, onPage, searching, ...actions }) {
|
|
489
|
+
const tr = useTr();
|
|
490
|
+
if (exact && exact.slice.total > 0 && exact.slice.items.length === 0) return /* @__PURE__ */ jsx(ListSkeleton, { rows: 5 });
|
|
491
|
+
if (exact && exact.slice.total === 0) return /* @__PURE__ */ jsx(NoResultsPanel, {
|
|
492
|
+
kind: searching ? "no-results" : "filtered",
|
|
493
|
+
title: tr("fluidgrids.moreTools.runners.noResults.title", "No runners match"),
|
|
494
|
+
text: tr("fluidgrids.moreTools.runners.noResults.text", "Try another name or status."),
|
|
495
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
496
|
+
variant: "outline",
|
|
497
|
+
onClick: onClearFilters,
|
|
498
|
+
children: [/* @__PURE__ */ jsx(X, {
|
|
499
|
+
className: "size-4",
|
|
500
|
+
"aria-hidden": "true"
|
|
501
|
+
}), tr("fluidgrids.moreTools.runners.noResults.clear", "Clear filters")]
|
|
502
|
+
})
|
|
503
|
+
});
|
|
504
|
+
return /* @__PURE__ */ jsxs(PagedBody, {
|
|
505
|
+
pageLoading,
|
|
506
|
+
page,
|
|
507
|
+
busy: pageLoading,
|
|
508
|
+
children: [/* @__PURE__ */ jsx(CompactList, {
|
|
509
|
+
label: tr("fluidgrids.moreTools.runners.title", "Runners"),
|
|
510
|
+
columns: RUNNER_COLUMNS,
|
|
511
|
+
headings: [
|
|
512
|
+
"",
|
|
513
|
+
tr("fluidgrids.moreTools.runners.columns.runner", "Runner"),
|
|
514
|
+
tr("fluidgrids.moreTools.runners.columns.status", "Status"),
|
|
515
|
+
tr("fluidgrids.moreTools.runners.columns.network", "Network"),
|
|
516
|
+
tr("fluidgrids.moreTools.runners.columns.lastSeen", "Last seen"),
|
|
517
|
+
""
|
|
518
|
+
],
|
|
519
|
+
testId: "runner-list",
|
|
520
|
+
children: view.slice.items.map((runner) => /* @__PURE__ */ jsx(RunnerRow, {
|
|
521
|
+
runner,
|
|
522
|
+
link: runnerLink(runner),
|
|
523
|
+
acting: actingId === runner.id,
|
|
524
|
+
...actions
|
|
525
|
+
}, runner.id))
|
|
526
|
+
}), /* @__PURE__ */ jsx(ResultsPager, {
|
|
527
|
+
page: view.slice.page,
|
|
528
|
+
total: view.slice.total,
|
|
529
|
+
onPage
|
|
530
|
+
})]
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
/** The loaded list: chips and search, a stale warning, then the results. */
|
|
534
|
+
function RunnersLoaded({ chips, filter, onFilter, draft, onDraft, searching, error, onRetry, ...results }) {
|
|
535
|
+
const tr = useTr();
|
|
536
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
537
|
+
/* @__PURE__ */ jsxs(ListToolbar, { children: [/* @__PURE__ */ jsx(FilterChips, {
|
|
538
|
+
label: tr("fluidgrids.moreTools.runners.chips.label", "Filter runners"),
|
|
539
|
+
options: chips,
|
|
540
|
+
value: filter,
|
|
541
|
+
onChange: onFilter,
|
|
542
|
+
testId: "runner-chips"
|
|
543
|
+
}), /* @__PURE__ */ jsx(SearchBox, {
|
|
544
|
+
value: draft,
|
|
545
|
+
onChange: onDraft,
|
|
546
|
+
placeholder: tr("fluidgrids.moreTools.runners.search", "Search runners"),
|
|
547
|
+
className: "sm:ms-auto"
|
|
548
|
+
})] }),
|
|
549
|
+
!!error && /* @__PURE__ */ jsx(ToneAlert, {
|
|
550
|
+
tone: "warning",
|
|
551
|
+
title: tr("fluidgrids.moreTools.runners.error.stale", "Couldn't refresh the runners. What you see may be out of date."),
|
|
552
|
+
actions: /* @__PURE__ */ jsx(Button$1, {
|
|
553
|
+
size: "sm",
|
|
554
|
+
variant: "outline",
|
|
555
|
+
onClick: onRetry,
|
|
556
|
+
children: tr("fluidgrids.moreTools.common.tryAgain", "Try again")
|
|
557
|
+
}),
|
|
558
|
+
testId: "runners-stale"
|
|
559
|
+
}),
|
|
560
|
+
/* @__PURE__ */ jsx(RunnerResults, {
|
|
561
|
+
...results,
|
|
562
|
+
searching
|
|
563
|
+
})
|
|
564
|
+
] });
|
|
565
|
+
}
|
|
566
|
+
function buildRowMenu(tr, runner, acting, onOpen, { permissions, onRotate, onRemove, onCopyId }) {
|
|
567
|
+
const items = [{
|
|
568
|
+
id: "open",
|
|
569
|
+
label: tr("fluidgrids.moreTools.runners.menu.open", "Open"),
|
|
570
|
+
icon: /* @__PURE__ */ jsx(Server, {
|
|
571
|
+
className: "size-4",
|
|
572
|
+
"aria-hidden": "true"
|
|
573
|
+
}),
|
|
574
|
+
onSelect: onOpen
|
|
575
|
+
}];
|
|
576
|
+
if (permissions.canRotate) items.push({
|
|
577
|
+
id: "rotate",
|
|
578
|
+
label: tr("fluidgrids.moreTools.runners.menu.newKey", "Get a new connection key…"),
|
|
579
|
+
icon: /* @__PURE__ */ jsx(KeyRound, {
|
|
580
|
+
className: "size-4",
|
|
581
|
+
"aria-hidden": "true"
|
|
582
|
+
}),
|
|
583
|
+
onSelect: () => onRotate(runner),
|
|
584
|
+
disabled: acting
|
|
585
|
+
});
|
|
586
|
+
items.push({
|
|
587
|
+
id: "copy-id",
|
|
588
|
+
label: tr("fluidgrids.moreTools.runners.menu.copyId", "Copy runner ID"),
|
|
589
|
+
icon: /* @__PURE__ */ jsx(Copy, {
|
|
590
|
+
className: "size-4",
|
|
591
|
+
"aria-hidden": "true"
|
|
592
|
+
}),
|
|
593
|
+
onSelect: () => onCopyId(runner)
|
|
594
|
+
});
|
|
595
|
+
if (permissions.canRemove) items.push({
|
|
596
|
+
id: "remove",
|
|
597
|
+
label: tr("fluidgrids.moreTools.runners.menu.remove", "Remove…"),
|
|
598
|
+
icon: /* @__PURE__ */ jsx(Trash2, {
|
|
599
|
+
className: "size-4",
|
|
600
|
+
"aria-hidden": "true"
|
|
601
|
+
}),
|
|
602
|
+
onSelect: () => onRemove(runner),
|
|
603
|
+
danger: true,
|
|
604
|
+
separatorBefore: true,
|
|
605
|
+
disabled: acting
|
|
606
|
+
});
|
|
607
|
+
return items;
|
|
608
|
+
}
|
|
609
|
+
function RunnerRow({ runner, link, acting, ...actions }) {
|
|
610
|
+
const tr = useTr();
|
|
611
|
+
const navigate = useNavigate();
|
|
612
|
+
const { permissions } = actions;
|
|
613
|
+
const system = runnerSystemLabel(runner.os, runner.arch);
|
|
614
|
+
const machine = runner.hostname ? [runner.hostname, system].filter(Boolean).join(" · ") : tr("fluidgrids.moreTools.runners.row.noMachine", "No machine yet");
|
|
615
|
+
const reason = runnerStatusReason(tr, runner);
|
|
616
|
+
const never = runner.status === "NEVER_CONNECTED";
|
|
617
|
+
const items = buildRowMenu(tr, runner, acting, () => void navigate(link), actions);
|
|
618
|
+
return /* @__PURE__ */ jsxs(CompactRow, {
|
|
619
|
+
columns: RUNNER_COLUMNS,
|
|
620
|
+
attention: never ? "warning" : void 0,
|
|
621
|
+
testId: "runner-row",
|
|
622
|
+
children: [
|
|
623
|
+
/* @__PURE__ */ jsx(RowIcon, { children: /* @__PURE__ */ jsx(Server, {
|
|
624
|
+
className: "size-4",
|
|
625
|
+
"aria-hidden": "true"
|
|
626
|
+
}) }),
|
|
627
|
+
/* @__PURE__ */ jsxs("div", {
|
|
628
|
+
className: "min-w-0",
|
|
629
|
+
children: [
|
|
630
|
+
/* @__PURE__ */ jsx(Link, {
|
|
631
|
+
to: link,
|
|
632
|
+
className: "block truncate font-medium text-text-primary hover:underline",
|
|
633
|
+
"data-testid": "runner-row-name",
|
|
634
|
+
children: runner.name
|
|
635
|
+
}),
|
|
636
|
+
/* @__PURE__ */ jsx("p", {
|
|
637
|
+
className: "truncate text-xs text-text-muted",
|
|
638
|
+
children: machine
|
|
639
|
+
}),
|
|
640
|
+
/* @__PURE__ */ jsxs(RowSummary, { children: [/* @__PURE__ */ jsx(Status, {
|
|
641
|
+
tone: RUNNER_STATUS_TONE[runner.status],
|
|
642
|
+
children: runnerStatusLabel(tr, runner.status)
|
|
643
|
+
}), reason && /* @__PURE__ */ jsx("span", { children: reason })] })
|
|
644
|
+
]
|
|
645
|
+
}),
|
|
646
|
+
/* @__PURE__ */ jsx("div", {
|
|
647
|
+
className: "max-sm:hidden",
|
|
648
|
+
children: /* @__PURE__ */ jsx(RunnerStatusCell, {
|
|
649
|
+
runner,
|
|
650
|
+
withReason: true
|
|
651
|
+
})
|
|
652
|
+
}),
|
|
653
|
+
/* @__PURE__ */ jsxs("div", {
|
|
654
|
+
className: "min-w-0 max-sm:hidden",
|
|
655
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
656
|
+
className: "truncate text-sm text-text-secondary",
|
|
657
|
+
children: runnerNetworkText(tr, runner)
|
|
658
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
659
|
+
className: "truncate text-xs text-text-muted",
|
|
660
|
+
"data-testid": "runner-row-host-exec",
|
|
661
|
+
children: runnerHostExecSummary(tr, runner)
|
|
662
|
+
})]
|
|
663
|
+
}),
|
|
664
|
+
/* @__PURE__ */ jsx("div", {
|
|
665
|
+
className: "text-sm tabular-nums text-text-secondary max-sm:hidden",
|
|
666
|
+
children: /* @__PURE__ */ jsx(RunnerLastSeen, { runner })
|
|
667
|
+
}),
|
|
668
|
+
/* @__PURE__ */ jsxs("div", {
|
|
669
|
+
className: "flex items-center justify-end gap-2",
|
|
670
|
+
children: [never && permissions.canRotate && /* @__PURE__ */ jsx(Button$1, {
|
|
671
|
+
asChild: true,
|
|
672
|
+
size: "sm",
|
|
673
|
+
variant: "outline",
|
|
674
|
+
className: "max-lg:hidden",
|
|
675
|
+
children: /* @__PURE__ */ jsx(Link, {
|
|
676
|
+
to: link,
|
|
677
|
+
"data-testid": "runner-finish-setup",
|
|
678
|
+
children: tr("fluidgrids.moreTools.runners.row.finishSetup", "Finish setup")
|
|
679
|
+
})
|
|
680
|
+
}), /* @__PURE__ */ jsx(RowMenu, {
|
|
681
|
+
label: tr("fluidgrids.moreTools.runners.menu.label", "Actions for {{name}}", { name: runner.name }),
|
|
682
|
+
items,
|
|
683
|
+
testId: "runner-actions-menu"
|
|
684
|
+
})]
|
|
685
|
+
})
|
|
686
|
+
]
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
// src/modules/runners/components/RunnerListV2.tsx
|
|
691
|
+
/**
|
|
692
|
+
* The Runners list (BOFF-15502, Navigation v2, the prototype's "Rows"): one
|
|
693
|
+
* compact header, status chips with counts, a search, compact rows with fixed
|
|
694
|
+
* columns and the Templates pager. Each runner opens its own page
|
|
695
|
+
* (`?runner=<id>`).
|
|
696
|
+
*
|
|
697
|
+
* Counts the service does not give (runners per status, "N online") show
|
|
698
|
+
* only while every runner is in hand; see `useRunnerList`.
|
|
699
|
+
*/
|
|
700
|
+
function RunnerListV2({ list, filter, search, page, onFilter, onSearch, onClearFilters, setPage, permissions, runnerLink, actingId, onAdd, onRotate, onRemove, onCopyId }) {
|
|
701
|
+
const tr = useTr();
|
|
702
|
+
const [draft, setDraft] = useSearchDraft(search, onSearch);
|
|
703
|
+
const { total, view, pageLoading, error, refetch } = list;
|
|
704
|
+
const counts = view?.counts ?? null;
|
|
705
|
+
const exact = view?.exact ? view : null;
|
|
706
|
+
useClampedPage(page, exact?.slice.total ?? 0, MORE_TOOLS_PAGE_SIZE, exact !== null, setPage);
|
|
707
|
+
const listTop = useRef(null);
|
|
708
|
+
const changePage = (next) => {
|
|
709
|
+
setPage(next);
|
|
710
|
+
listTop.current?.scrollIntoView?.({ block: "start" });
|
|
711
|
+
};
|
|
712
|
+
let body;
|
|
713
|
+
if (error && !exact) body = /* @__PURE__ */ jsx(LoadErrorPanel, {
|
|
714
|
+
title: tr("fluidgrids.moreTools.runners.error.title", "Couldn't load your runners"),
|
|
715
|
+
text: tr("fluidgrids.moreTools.runners.error.text", "The runner service did not answer. Steps set to run on a runner keep their setting."),
|
|
716
|
+
error,
|
|
717
|
+
onRetry: () => void refetch()
|
|
718
|
+
});
|
|
719
|
+
else if (!view) body = /* @__PURE__ */ jsx(ListSkeleton, { rows: 5 });
|
|
720
|
+
else if (total === 0) body = /* @__PURE__ */ jsx(RunnersEmpty, { onAdd });
|
|
721
|
+
else body = /* @__PURE__ */ jsx(RunnersLoaded, {
|
|
722
|
+
chips: buildRunnerChips(tr, total, counts),
|
|
723
|
+
filter,
|
|
724
|
+
onFilter,
|
|
725
|
+
draft,
|
|
726
|
+
onDraft: setDraft,
|
|
727
|
+
searching: search.trim() !== "",
|
|
728
|
+
error,
|
|
729
|
+
onRetry: () => void refetch(),
|
|
730
|
+
view,
|
|
731
|
+
exact,
|
|
732
|
+
page,
|
|
733
|
+
pageLoading,
|
|
734
|
+
runnerLink,
|
|
735
|
+
actingId,
|
|
736
|
+
onClearFilters,
|
|
737
|
+
onPage: changePage,
|
|
738
|
+
permissions,
|
|
739
|
+
onRotate,
|
|
740
|
+
onRemove,
|
|
741
|
+
onCopyId
|
|
742
|
+
});
|
|
743
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
|
|
744
|
+
"data-tour": "fluidgrids-runners-header",
|
|
745
|
+
children: /* @__PURE__ */ jsx(MoreToolsHeader, {
|
|
746
|
+
title: tr("fluidgrids.moreTools.runners.title", "Runners"),
|
|
747
|
+
titleTestId: "runners-title",
|
|
748
|
+
facts: /* @__PURE__ */ jsx(RunnersFacts, {
|
|
749
|
+
total,
|
|
750
|
+
counts,
|
|
751
|
+
viewOnly: isRunnerViewOnly(permissions)
|
|
752
|
+
}),
|
|
753
|
+
actions: /* @__PURE__ */ jsx(AddRunnerButton, {
|
|
754
|
+
testId: "runner-add",
|
|
755
|
+
label: tr("fluidgrids.moreTools.runners.add", "Add runner"),
|
|
756
|
+
onAdd
|
|
757
|
+
})
|
|
758
|
+
})
|
|
759
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
760
|
+
ref: listTop,
|
|
761
|
+
"data-tour": "fluidgrids-runners-table",
|
|
762
|
+
children: body
|
|
763
|
+
})] });
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
// src/modules/runners/hooks/usePersonName.ts
|
|
767
|
+
/**
|
|
768
|
+
* The name of the person who added a runner (BOFF-15502), only once the
|
|
769
|
+
* workspace's directory has answered: while it loads, or when it cannot be
|
|
770
|
+
* read, there is no name, because the fallback ("User 8a7b…1234") is an ID
|
|
771
|
+
* and IDs stay under "Show technical details".
|
|
772
|
+
*/
|
|
773
|
+
function usePersonName(userId) {
|
|
774
|
+
const config = getFluidGridsConfig();
|
|
775
|
+
const actors = useMemo(() => userId ? [{
|
|
776
|
+
actorId: userId,
|
|
777
|
+
actorType: "user"
|
|
778
|
+
}] : [], [userId]);
|
|
779
|
+
const profiles = useActorProfiles(actors, {
|
|
780
|
+
workspaceId: config.workspaceId || void 0,
|
|
781
|
+
orgId: config.organizationId,
|
|
782
|
+
authToken: config.authToken
|
|
783
|
+
});
|
|
784
|
+
const profile = userId ? profiles[userId] : void 0;
|
|
785
|
+
return profile?.resolved ? profile.displayName : null;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
// src/modules/runners/components/runnerDetailHelpers.ts
|
|
789
|
+
/** "Since …" while online, else when it was last seen (or never). */
|
|
790
|
+
function runnerConnectedText(tr, runner) {
|
|
791
|
+
if (runner.status === "ONLINE") {
|
|
792
|
+
if (!runner.connectedAt) return tr("fluidgrids.moreTools.runners.lastSeen.now", "Now");
|
|
793
|
+
return tr("fluidgrids.moreTools.runners.machine.connectedSince", "Since {{time}}", { time: formatShortDateTime(runner.connectedAt) });
|
|
794
|
+
}
|
|
795
|
+
if (!runner.lastSeenAt) return tr("fluidgrids.moreTools.runners.lastSeen.never", "Never");
|
|
796
|
+
return tr("fluidgrids.moreTools.runners.machine.lastSeen", "Last seen {{when}}", { when: formatRelativeTime(tr, runner.lastSeenAt) });
|
|
797
|
+
}
|
|
798
|
+
/** "{time} by {name}", or just the time while the name is unknown. */
|
|
799
|
+
function runnerAddedText(tr, runner, addedBy) {
|
|
800
|
+
if (!addedBy) return formatShortDateTime(runner.createdAt);
|
|
801
|
+
return tr("fluidgrids.moreTools.runners.machine.addedBy", "{{time}} by {{name}}", {
|
|
802
|
+
time: formatShortDateTime(runner.createdAt),
|
|
803
|
+
name: addedBy
|
|
804
|
+
});
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
// src/modules/runners/components/RunnerDetailParts.tsx
|
|
808
|
+
/** "Get a new key", behind the sandbox update permission. */
|
|
809
|
+
function NewKeyButton({ runner, acting, onRotate, testId, label, small = false }) {
|
|
810
|
+
const tr = useTr();
|
|
811
|
+
return /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
812
|
+
permission: FLUIDGRIDS_PERMISSIONS.SANDBOX_UPDATE,
|
|
813
|
+
deniedTooltip: tr("fluidgrids.moreTools.runners.newKeyDenied", "You don't have permission to get a new connection key"),
|
|
814
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
815
|
+
variant: "outline",
|
|
816
|
+
size: small ? "sm" : "default",
|
|
817
|
+
onClick: () => onRotate(runner),
|
|
818
|
+
disabled: acting,
|
|
819
|
+
"data-testid": testId,
|
|
820
|
+
children: [/* @__PURE__ */ jsx(KeyRound, {
|
|
821
|
+
className: "size-4",
|
|
822
|
+
"aria-hidden": "true"
|
|
823
|
+
}), label]
|
|
824
|
+
})
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
function buildRunnerMenu(tr, runner, { permissions, acting, onRemove, onCopyId }) {
|
|
828
|
+
const menu = [{
|
|
829
|
+
id: "copy-id",
|
|
830
|
+
label: tr("fluidgrids.moreTools.runners.menu.copyId", "Copy runner ID"),
|
|
831
|
+
icon: /* @__PURE__ */ jsx(Copy, {
|
|
832
|
+
className: "size-4",
|
|
833
|
+
"aria-hidden": "true"
|
|
834
|
+
}),
|
|
835
|
+
onSelect: () => onCopyId(runner)
|
|
836
|
+
}];
|
|
837
|
+
if (permissions.canRemove) menu.push({
|
|
838
|
+
id: "remove",
|
|
839
|
+
label: tr("fluidgrids.moreTools.runners.menu.remove", "Remove…"),
|
|
840
|
+
icon: /* @__PURE__ */ jsx(Trash2, {
|
|
841
|
+
className: "size-4",
|
|
842
|
+
"aria-hidden": "true"
|
|
843
|
+
}),
|
|
844
|
+
onSelect: () => onRemove(runner),
|
|
845
|
+
danger: true,
|
|
846
|
+
separatorBefore: true,
|
|
847
|
+
disabled: acting
|
|
848
|
+
});
|
|
849
|
+
return menu;
|
|
850
|
+
}
|
|
851
|
+
function RunnerDetailHeader({ runner, back, system, actions }) {
|
|
852
|
+
const tr = useTr();
|
|
853
|
+
return /* @__PURE__ */ jsx(MoreToolsHeader, {
|
|
854
|
+
back,
|
|
855
|
+
title: runner.name,
|
|
856
|
+
titleTestId: "runner-detail-title",
|
|
857
|
+
facts: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
858
|
+
/* @__PURE__ */ jsx(RunnerStatusCell, { runner }),
|
|
859
|
+
runner.hostname && /* @__PURE__ */ jsx("span", { children: runner.hostname }),
|
|
860
|
+
system && /* @__PURE__ */ jsx("span", { children: system })
|
|
861
|
+
] }),
|
|
862
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(NewKeyButton, {
|
|
863
|
+
runner,
|
|
864
|
+
acting: actions.acting,
|
|
865
|
+
onRotate: actions.onRotate,
|
|
866
|
+
testId: "runner-detail-new-key",
|
|
867
|
+
label: tr("fluidgrids.moreTools.runners.detail.newKey", "Get a new connection key")
|
|
868
|
+
}), /* @__PURE__ */ jsx(RowMenu, {
|
|
869
|
+
label: tr("fluidgrids.moreTools.runners.menu.moreLabel", "More actions for {{name}}", { name: runner.name }),
|
|
870
|
+
items: buildRunnerMenu(tr, runner, actions),
|
|
871
|
+
testId: "runner-detail-menu",
|
|
872
|
+
triggerClassName: "size-10 border border-border-default"
|
|
873
|
+
})] })
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
function offlineTitle(tr, runner) {
|
|
877
|
+
if (!runner.lastSeenAt) return tr("fluidgrids.moreTools.runners.status.offline", "Offline");
|
|
878
|
+
return tr("fluidgrids.moreTools.runners.detail.offlineSince", "Offline since {{time}}", { time: formatShortDateTime(runner.lastSeenAt) });
|
|
879
|
+
}
|
|
880
|
+
/** The alert for a runner that never connected, or one that is offline. */
|
|
881
|
+
function RunnerAlerts({ runner, actions }) {
|
|
882
|
+
const tr = useTr();
|
|
883
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [runner.status === "NEVER_CONNECTED" && /* @__PURE__ */ jsx(ToneAlert, {
|
|
884
|
+
tone: "warning",
|
|
885
|
+
title: tr("fluidgrids.moreTools.runners.detail.neverTitle", "{{name}} has not connected yet", { name: runner.name }),
|
|
886
|
+
actions: actions.permissions.canRotate ? /* @__PURE__ */ jsx(NewKeyButton, {
|
|
887
|
+
runner,
|
|
888
|
+
acting: actions.acting,
|
|
889
|
+
onRotate: actions.onRotate,
|
|
890
|
+
testId: "runner-alert-new-key",
|
|
891
|
+
label: tr("fluidgrids.moreTools.runners.detail.newKeyShort", "Get a new key"),
|
|
892
|
+
small: true
|
|
893
|
+
}) : void 0,
|
|
894
|
+
testId: "runner-alert-never",
|
|
895
|
+
children: tr("fluidgrids.moreTools.runners.detail.neverText", "Run the install command on the machine and paste its key. Lost the key? Get a new one.")
|
|
896
|
+
}), runner.status === "OFFLINE" && /* @__PURE__ */ jsx(ToneAlert, {
|
|
897
|
+
tone: "neutral",
|
|
898
|
+
title: offlineTitle(tr, runner),
|
|
899
|
+
testId: "runner-alert-offline",
|
|
900
|
+
children: tr("fluidgrids.moreTools.runners.detail.offlineText", "Steps set to run here will fail until it is back or moved to another runner.")
|
|
901
|
+
})] });
|
|
902
|
+
}
|
|
903
|
+
function NetworkRules({ rules }) {
|
|
904
|
+
const tr = useTr();
|
|
905
|
+
if (!rules || rules.length === 0) return /* @__PURE__ */ jsx("p", {
|
|
906
|
+
className: "mb-3 text-sm text-text-secondary",
|
|
907
|
+
children: tr("fluidgrids.moreTools.runners.network.none", "Steps on this runner can reach the public internet only.")
|
|
908
|
+
});
|
|
909
|
+
return /* @__PURE__ */ jsxs("table", {
|
|
910
|
+
className: "mb-3 w-full text-sm",
|
|
911
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsxs("tr", {
|
|
912
|
+
className: "text-start text-xs text-text-muted",
|
|
913
|
+
children: [
|
|
914
|
+
/* @__PURE__ */ jsx("th", {
|
|
915
|
+
scope: "col",
|
|
916
|
+
className: "pb-1.5 pe-3 text-start font-medium",
|
|
917
|
+
children: tr("fluidgrids.moreTools.runners.network.address", "Address")
|
|
918
|
+
}),
|
|
919
|
+
/* @__PURE__ */ jsx("th", {
|
|
920
|
+
scope: "col",
|
|
921
|
+
className: "pb-1.5 pe-3 text-start font-medium",
|
|
922
|
+
children: tr("fluidgrids.moreTools.runners.network.ports", "Ports")
|
|
923
|
+
}),
|
|
924
|
+
/* @__PURE__ */ jsx("th", {
|
|
925
|
+
scope: "col",
|
|
926
|
+
className: "pb-1.5 text-start font-medium",
|
|
927
|
+
children: tr("fluidgrids.moreTools.runners.network.steps", "Steps")
|
|
928
|
+
})
|
|
929
|
+
]
|
|
930
|
+
}) }), /* @__PURE__ */ jsx("tbody", { children: rules.map((rule, index) => /* @__PURE__ */ jsxs("tr", {
|
|
931
|
+
className: "border-t border-border-subtle align-top",
|
|
932
|
+
"data-testid": "runner-network-rule",
|
|
933
|
+
children: [
|
|
934
|
+
/* @__PURE__ */ jsx("td", {
|
|
935
|
+
className: "py-1.5 pe-3",
|
|
936
|
+
children: /* @__PURE__ */ jsx("code", {
|
|
937
|
+
className: "break-all font-mono text-xs text-text-primary",
|
|
938
|
+
children: rule.target
|
|
939
|
+
})
|
|
940
|
+
}),
|
|
941
|
+
/* @__PURE__ */ jsx("td", {
|
|
942
|
+
className: "py-1.5 pe-3 tabular-nums text-text-secondary",
|
|
943
|
+
children: rulePorts(rule) ?? tr("fluidgrids.moreTools.runners.network.allPorts", "All ports")
|
|
944
|
+
}),
|
|
945
|
+
/* @__PURE__ */ jsx("td", {
|
|
946
|
+
className: "py-1.5 text-text-secondary",
|
|
947
|
+
title: rule.nodes.join(", ") || void 0,
|
|
948
|
+
children: ruleSteps(rule) ?? tr("fluidgrids.moreTools.runners.network.everyStep", "Every step")
|
|
949
|
+
})
|
|
950
|
+
]
|
|
951
|
+
}, `${rule.target}-${index}`)) })]
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
/** The private network the runner's steps may reach, and how to add to it. */
|
|
955
|
+
function RunnerNetworkPanel({ runner }) {
|
|
956
|
+
const tr = useTr();
|
|
957
|
+
return /* @__PURE__ */ jsxs(Panel, {
|
|
958
|
+
title: tr("fluidgrids.moreTools.runners.network.title", "Private network"),
|
|
959
|
+
end: /* @__PURE__ */ jsx("span", {
|
|
960
|
+
className: "text-xs text-text-muted",
|
|
961
|
+
children: runnerNetworkText(tr, runner)
|
|
962
|
+
}),
|
|
963
|
+
testId: "runner-network",
|
|
964
|
+
children: [
|
|
965
|
+
/* @__PURE__ */ jsx(NetworkRules, { rules: runner.privateNetwork ?? [] }),
|
|
966
|
+
/* @__PURE__ */ jsx("p", {
|
|
967
|
+
className: "mb-1.5 text-xs text-text-secondary",
|
|
968
|
+
children: tr("fluidgrids.moreTools.runners.network.howTo", "To let steps reach something inside your network, run this on the runner machine:")
|
|
969
|
+
}),
|
|
970
|
+
/* @__PURE__ */ jsx(CodeLine, {
|
|
971
|
+
value: NETWORK_ALLOW_EXAMPLE,
|
|
972
|
+
what: tr("fluidgrids.moreTools.runners.network.commandWhat", "network command"),
|
|
973
|
+
testId: "runner-network-command"
|
|
974
|
+
})
|
|
975
|
+
]
|
|
976
|
+
});
|
|
977
|
+
}
|
|
978
|
+
/** Host command execution opt-in and allow-list, as reported by the runner machine. */
|
|
979
|
+
function RunnerHostExecPanel({ runner }) {
|
|
980
|
+
const tr = useTr();
|
|
981
|
+
const hostExec = runner.hostExec;
|
|
982
|
+
const enabled = Boolean(hostExec?.enabled && hostExec.allow.length > 0);
|
|
983
|
+
return /* @__PURE__ */ jsx(Panel, {
|
|
984
|
+
title: tr("fluidgrids.moreTools.runners.hostExec.title", "Host commands"),
|
|
985
|
+
end: /* @__PURE__ */ jsx("span", {
|
|
986
|
+
className: "text-xs text-text-muted",
|
|
987
|
+
"data-testid": "runner-host-exec-status",
|
|
988
|
+
children: enabled ? tr("fluidgrids.moreTools.runners.hostExec.on", "On") : tr("fluidgrids.moreTools.runners.hostExec.off", "Off")
|
|
989
|
+
}),
|
|
990
|
+
testId: "runner-host-exec",
|
|
991
|
+
children: enabled ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
992
|
+
/* @__PURE__ */ jsx("p", {
|
|
993
|
+
className: "mb-2 text-sm text-text-secondary",
|
|
994
|
+
children: runnerHostExecSummary(tr, runner)
|
|
995
|
+
}),
|
|
996
|
+
/* @__PURE__ */ jsx("ul", {
|
|
997
|
+
className: "mb-3 flex flex-wrap gap-1.5",
|
|
998
|
+
"data-testid": "runner-host-exec-allowlist",
|
|
999
|
+
children: hostExec.allow.map((prefix) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx("code", {
|
|
1000
|
+
className: "rounded bg-bg-sunken px-1.5 py-0.5 font-mono text-xs text-text-primary",
|
|
1001
|
+
children: prefix
|
|
1002
|
+
}) }, prefix))
|
|
1003
|
+
}),
|
|
1004
|
+
hostExec?.user && /* @__PURE__ */ jsx("p", {
|
|
1005
|
+
className: "mb-3 text-xs text-text-secondary",
|
|
1006
|
+
"data-testid": "runner-host-exec-user",
|
|
1007
|
+
children: tr("fluidgrids.moreTools.runners.hostExec.runAs", "Run as user: {{user}}", { user: hostExec.user })
|
|
1008
|
+
}),
|
|
1009
|
+
/* @__PURE__ */ jsx("p", {
|
|
1010
|
+
className: "mb-1.5 text-xs text-text-secondary",
|
|
1011
|
+
children: tr("fluidgrids.moreTools.runners.hostExec.disableHowTo", "Configured only on the runner machine. To turn host commands off, run:")
|
|
1012
|
+
}),
|
|
1013
|
+
/* @__PURE__ */ jsx(CodeLine, {
|
|
1014
|
+
value: HOST_EXEC_DISABLE_EXAMPLE,
|
|
1015
|
+
what: tr("fluidgrids.moreTools.runners.hostExec.disableCommandWhat", "disable host commands"),
|
|
1016
|
+
testId: "runner-host-exec-disable-command"
|
|
1017
|
+
})
|
|
1018
|
+
] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
1019
|
+
/* @__PURE__ */ jsx("p", {
|
|
1020
|
+
className: "mb-3 text-sm text-text-secondary",
|
|
1021
|
+
children: tr("fluidgrids.moreTools.runners.hostExec.offDescription", "Host commands: off. Execute Command nodes targeting this runner fail until the machine owner enables an allow-list locally.")
|
|
1022
|
+
}),
|
|
1023
|
+
/* @__PURE__ */ jsx("p", {
|
|
1024
|
+
className: "mb-1.5 text-xs text-text-secondary",
|
|
1025
|
+
children: tr("fluidgrids.moreTools.runners.hostExec.enableHowTo", "To allow specific command prefixes on this runner host, run:")
|
|
1026
|
+
}),
|
|
1027
|
+
/* @__PURE__ */ jsx(CodeLine, {
|
|
1028
|
+
value: HOST_EXEC_ENABLE_EXAMPLE,
|
|
1029
|
+
what: tr("fluidgrids.moreTools.runners.hostExec.enableCommandWhat", "enable host commands"),
|
|
1030
|
+
testId: "runner-host-exec-enable-command"
|
|
1031
|
+
})
|
|
1032
|
+
] })
|
|
1033
|
+
});
|
|
1034
|
+
}
|
|
1035
|
+
/** The machine's facts as a key/value list. */
|
|
1036
|
+
function RunnerMachinePanel({ runner, system, addedBy }) {
|
|
1037
|
+
const tr = useTr();
|
|
1038
|
+
return /* @__PURE__ */ jsx(Panel, {
|
|
1039
|
+
title: tr("fluidgrids.moreTools.runners.machine.title", "Machine"),
|
|
1040
|
+
testId: "runner-machine",
|
|
1041
|
+
children: /* @__PURE__ */ jsx(KeyValueList, { items: [
|
|
1042
|
+
{
|
|
1043
|
+
term: tr("fluidgrids.moreTools.runners.machine.slots", "Slots"),
|
|
1044
|
+
value: tr("fluidgrids.moreTools.runners.machine.slotsValue", "{{count}} steps at a time", { count: formatCount(runner.capacity) })
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
term: tr("fluidgrids.moreTools.runners.machine.hostname", "Hostname"),
|
|
1048
|
+
value: runner.hostname || "—"
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
term: tr("fluidgrids.moreTools.runners.machine.system", "System"),
|
|
1052
|
+
value: system ?? "—"
|
|
1053
|
+
},
|
|
1054
|
+
{
|
|
1055
|
+
term: tr("fluidgrids.moreTools.runners.machine.sandbox", "Sandbox"),
|
|
1056
|
+
value: runnerSandboxLabel(runner.driver) ?? "—"
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
term: tr("fluidgrids.moreTools.runners.machine.version", "Version"),
|
|
1060
|
+
value: runner.version || "—"
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
term: tr("fluidgrids.moreTools.runners.machine.connected", "Connected"),
|
|
1064
|
+
value: runnerConnectedText(tr, runner)
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
term: tr("fluidgrids.moreTools.runners.machine.added", "Added"),
|
|
1068
|
+
value: runnerAddedText(tr, runner, addedBy)
|
|
1069
|
+
}
|
|
1070
|
+
] })
|
|
1071
|
+
});
|
|
1072
|
+
}
|
|
1073
|
+
/** The connection key's prefix and how to get a new one. */
|
|
1074
|
+
function RunnerKeyPanel({ runner, actions }) {
|
|
1075
|
+
const tr = useTr();
|
|
1076
|
+
return /* @__PURE__ */ jsxs(Panel, {
|
|
1077
|
+
title: tr("fluidgrids.moreTools.runners.key.title", "Connection key"),
|
|
1078
|
+
testId: "runner-key-panel",
|
|
1079
|
+
children: [
|
|
1080
|
+
/* @__PURE__ */ jsx("p", {
|
|
1081
|
+
className: "text-sm text-text-primary",
|
|
1082
|
+
children: tr("fluidgrids.moreTools.runners.key.startsWith", "Starts with {{prefix}}…", { prefix: runner.tokenPrefix })
|
|
1083
|
+
}),
|
|
1084
|
+
/* @__PURE__ */ jsx("p", {
|
|
1085
|
+
className: "mt-1 mb-3 text-xs text-text-secondary",
|
|
1086
|
+
children: tr("fluidgrids.moreTools.runners.key.hint", "Getting a new key disconnects the runner until the install command runs again with the new key.")
|
|
1087
|
+
}),
|
|
1088
|
+
/* @__PURE__ */ jsx(NewKeyButton, {
|
|
1089
|
+
runner,
|
|
1090
|
+
acting: actions.acting,
|
|
1091
|
+
onRotate: actions.onRotate,
|
|
1092
|
+
testId: "runner-key-new",
|
|
1093
|
+
label: tr("fluidgrids.moreTools.runners.detail.newKeyShort", "Get a new key"),
|
|
1094
|
+
small: true
|
|
1095
|
+
})
|
|
1096
|
+
]
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
/** The runner and creator ids, behind the technical-details toggle. */
|
|
1100
|
+
function RunnerTechnical({ runner }) {
|
|
1101
|
+
const tr = useTr();
|
|
1102
|
+
return /* @__PURE__ */ jsx(TechnicalDetails, {
|
|
1103
|
+
className: "mt-4",
|
|
1104
|
+
"data-testid": "runner-technical",
|
|
1105
|
+
children: /* @__PURE__ */ jsxs("dl", {
|
|
1106
|
+
className: "grid gap-x-4 gap-y-1 text-xs text-text-secondary sm:grid-cols-[auto_1fr]",
|
|
1107
|
+
children: [
|
|
1108
|
+
/* @__PURE__ */ jsx("dt", { children: tr("fluidgrids.moreTools.runners.technical.id", "Runner ID") }),
|
|
1109
|
+
/* @__PURE__ */ jsx("dd", {
|
|
1110
|
+
className: "break-all font-mono text-text-primary",
|
|
1111
|
+
children: runner.id
|
|
1112
|
+
}),
|
|
1113
|
+
/* @__PURE__ */ jsx("dt", { children: tr("fluidgrids.moreTools.runners.technical.addedBy", "Added by (user ID)") }),
|
|
1114
|
+
/* @__PURE__ */ jsx("dd", {
|
|
1115
|
+
className: "break-all font-mono text-text-primary",
|
|
1116
|
+
children: runner.createdBy
|
|
1117
|
+
})
|
|
1118
|
+
]
|
|
1119
|
+
})
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
|
|
1123
|
+
// src/modules/runners/components/RunnerDetailV2.tsx
|
|
1124
|
+
/**
|
|
1125
|
+
* One runner's page (BOFF-15502, Navigation v2), opened with `?runner=<id>`
|
|
1126
|
+
* on the Runners route: its status and what it means, the private network its
|
|
1127
|
+
* steps may reach, the machine, and the connection key. Facts the service
|
|
1128
|
+
* does not report (steps that run here, available updates) are left out
|
|
1129
|
+
* rather than guessed.
|
|
1130
|
+
*/
|
|
1131
|
+
function RunnerDetailV2({ runner, loading, error, onRetry, backTo, permissions, acting, onRotate, onRemove, onCopyId }) {
|
|
1132
|
+
const tr = useTr();
|
|
1133
|
+
const back = {
|
|
1134
|
+
to: backTo,
|
|
1135
|
+
label: tr("fluidgrids.moreTools.runners.title", "Runners")
|
|
1136
|
+
};
|
|
1137
|
+
if (!runner) {
|
|
1138
|
+
if (loading) return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MoreToolsHeader, {
|
|
1139
|
+
back,
|
|
1140
|
+
title: back.label
|
|
1141
|
+
}), /* @__PURE__ */ jsx(ListSkeleton, { rows: 3 })] });
|
|
1142
|
+
if (error) return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MoreToolsHeader, {
|
|
1143
|
+
back,
|
|
1144
|
+
title: back.label
|
|
1145
|
+
}), /* @__PURE__ */ jsx(LoadErrorPanel, {
|
|
1146
|
+
title: tr("fluidgrids.moreTools.runners.error.title", "Couldn't load your runners"),
|
|
1147
|
+
text: tr("fluidgrids.moreTools.runners.error.text", "The runner service did not answer. Steps set to run on a runner keep their setting."),
|
|
1148
|
+
error,
|
|
1149
|
+
onRetry
|
|
1150
|
+
})] });
|
|
1151
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(MoreToolsHeader, {
|
|
1152
|
+
back,
|
|
1153
|
+
title: tr("fluidgrids.moreTools.runners.missing.title", "Runner not found")
|
|
1154
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
1155
|
+
"data-testid": "runner-missing",
|
|
1156
|
+
children: /* @__PURE__ */ jsx(EmptyPanel, {
|
|
1157
|
+
kind: "not-found",
|
|
1158
|
+
icon: /* @__PURE__ */ jsx(Server, {
|
|
1159
|
+
className: "size-5 text-text-secondary",
|
|
1160
|
+
"aria-hidden": "true"
|
|
1161
|
+
}),
|
|
1162
|
+
title: tr("fluidgrids.moreTools.runners.missing.heading", "This runner no longer exists"),
|
|
1163
|
+
text: tr("fluidgrids.moreTools.runners.missing.text", "It may have been removed. Steps set to run on it now fail until they are moved."),
|
|
1164
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
1165
|
+
asChild: true,
|
|
1166
|
+
variant: "outline",
|
|
1167
|
+
children: /* @__PURE__ */ jsxs(Link, {
|
|
1168
|
+
to: backTo,
|
|
1169
|
+
children: [/* @__PURE__ */ jsx(ArrowLeft, {
|
|
1170
|
+
className: "size-4 rtl:rotate-180",
|
|
1171
|
+
"aria-hidden": "true"
|
|
1172
|
+
}), tr("fluidgrids.moreTools.runners.missing.back", "All runners")]
|
|
1173
|
+
})
|
|
1174
|
+
})
|
|
1175
|
+
})
|
|
1176
|
+
})] });
|
|
1177
|
+
}
|
|
1178
|
+
return /* @__PURE__ */ jsx(RunnerDetailBody, {
|
|
1179
|
+
runner,
|
|
1180
|
+
back,
|
|
1181
|
+
permissions,
|
|
1182
|
+
acting,
|
|
1183
|
+
onRotate,
|
|
1184
|
+
onRemove,
|
|
1185
|
+
onCopyId
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
function RunnerDetailBody({ runner, back, ...actions }) {
|
|
1189
|
+
const addedBy = usePersonName(runner.createdBy);
|
|
1190
|
+
const system = runnerSystemLabel(runner.os, runner.arch);
|
|
1191
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1192
|
+
"data-testid": "runner-detail",
|
|
1193
|
+
children: [
|
|
1194
|
+
/* @__PURE__ */ jsx(RunnerDetailHeader, {
|
|
1195
|
+
runner,
|
|
1196
|
+
back,
|
|
1197
|
+
system,
|
|
1198
|
+
actions
|
|
1199
|
+
}),
|
|
1200
|
+
/* @__PURE__ */ jsx(RunnerAlerts, {
|
|
1201
|
+
runner,
|
|
1202
|
+
actions
|
|
1203
|
+
}),
|
|
1204
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1205
|
+
className: "grid items-start gap-4 lg:grid-cols-2",
|
|
1206
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
1207
|
+
className: "grid gap-4",
|
|
1208
|
+
children: [/* @__PURE__ */ jsx(RunnerNetworkPanel, { runner }), /* @__PURE__ */ jsx(RunnerHostExecPanel, { runner })]
|
|
1209
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1210
|
+
className: "grid gap-4",
|
|
1211
|
+
children: [/* @__PURE__ */ jsx(RunnerMachinePanel, {
|
|
1212
|
+
runner,
|
|
1213
|
+
system,
|
|
1214
|
+
addedBy
|
|
1215
|
+
}), /* @__PURE__ */ jsx(RunnerKeyPanel, {
|
|
1216
|
+
runner,
|
|
1217
|
+
actions
|
|
1218
|
+
})]
|
|
1219
|
+
})]
|
|
1220
|
+
}),
|
|
1221
|
+
/* @__PURE__ */ jsx(RunnerTechnical, { runner })
|
|
1222
|
+
]
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
// src/modules/runners/pages/RunnersPageV2.tsx
|
|
1227
|
+
/**
|
|
1228
|
+
* Runners, redesigned (BOFF-15502, Navigation v2 only): the list of the
|
|
1229
|
+
* workspace's runners, and one runner's page on the same route
|
|
1230
|
+
* (`?runner=<id>`), so Back, Forward and shared links work. The list keeps
|
|
1231
|
+
* its chip (`?status=`), search (`?q=`) and page (`?page=`) in the address.
|
|
1232
|
+
*
|
|
1233
|
+
* Getting a new connection key and removing a runner ask first; a new key is
|
|
1234
|
+
* shown once, and closing it before it was copied asks first too.
|
|
1235
|
+
*
|
|
1236
|
+
* Only what is on screen is read: the list's page (`useRunnerList`) or the
|
|
1237
|
+
* one runner (`useTrackedRunner`). An add, a new key or a removal reads it
|
|
1238
|
+
* again through `refreshKey`.
|
|
1239
|
+
*/
|
|
1240
|
+
/** `params` with `name` set to `value` (or removed), as "?…" or "". */
|
|
1241
|
+
function searchWith(params, name, value) {
|
|
1242
|
+
const next = new URLSearchParams(params);
|
|
1243
|
+
if (value === null) next.delete(name);
|
|
1244
|
+
else next.set(name, value);
|
|
1245
|
+
const text = next.toString();
|
|
1246
|
+
return text ? `?${text}` : "";
|
|
1247
|
+
}
|
|
1248
|
+
function RunnersPageV2() {
|
|
1249
|
+
const tr = useTr();
|
|
1250
|
+
const { pathname } = useLocation();
|
|
1251
|
+
const [, setSearchParams] = useSearchParams();
|
|
1252
|
+
const { params, page, set, setPage } = useUrlListState();
|
|
1253
|
+
const filter = readChoice(params, "status", RUNNER_FILTERS, "all");
|
|
1254
|
+
const search = params.get("q") ?? "";
|
|
1255
|
+
const runnerId = params.get("runner");
|
|
1256
|
+
const { rotateToken, deleteRunner } = useRunnerActions();
|
|
1257
|
+
const [refreshKey, setRefreshKey] = useState(0);
|
|
1258
|
+
const refresh = useCallback(() => setRefreshKey((key) => key + 1), []);
|
|
1259
|
+
const create = useFluidGridsPermission(FLUIDGRIDS_PERMISSIONS.SANDBOX_CREATE);
|
|
1260
|
+
const permissions = {
|
|
1261
|
+
canCreate: create.allowed,
|
|
1262
|
+
canRotate: useFluidGridsPermission(FLUIDGRIDS_PERMISSIONS.SANDBOX_UPDATE).allowed,
|
|
1263
|
+
canRemove: useFluidGridsPermission(FLUIDGRIDS_PERMISSIONS.SANDBOX_DELETE).allowed,
|
|
1264
|
+
loading: create.isLoading
|
|
1265
|
+
};
|
|
1266
|
+
const [actingId, setActingId] = useState(null);
|
|
1267
|
+
const [adding, setAdding] = useState(false);
|
|
1268
|
+
const [rotating, setRotating] = useState(null);
|
|
1269
|
+
const [rotated, setRotated] = useState(null);
|
|
1270
|
+
const [removing, setRemoving] = useState(null);
|
|
1271
|
+
const backTo = searchWith(params, "runner", null) || pathname;
|
|
1272
|
+
const runnerLink = useCallback((runner) => ({ search: searchWith(params, "runner", runner.id) }), [params]);
|
|
1273
|
+
const copyId = useCallback(async (runner) => {
|
|
1274
|
+
if (await copyText(runner.id)) toast.success(tr("fluidgrids.moreTools.runners.copiedId", "Runner ID copied"));
|
|
1275
|
+
else toast.error(tr("fluidgrids.moreTools.common.copyFailed", "Couldn't copy. Select the text and copy it yourself."));
|
|
1276
|
+
}, [tr]);
|
|
1277
|
+
const confirmRotate = useCallback(async () => {
|
|
1278
|
+
const runner = rotating;
|
|
1279
|
+
if (!runner) return;
|
|
1280
|
+
setActingId(runner.id);
|
|
1281
|
+
try {
|
|
1282
|
+
setRotated(await rotateToken(runner.id));
|
|
1283
|
+
setRotating(null);
|
|
1284
|
+
refresh();
|
|
1285
|
+
} catch (err) {
|
|
1286
|
+
toast.error(describeOperationError(err, tr("fluidgrids.moreTools.runners.newKey.failed", "Couldn't get a new connection key")));
|
|
1287
|
+
} finally {
|
|
1288
|
+
setActingId(null);
|
|
1289
|
+
}
|
|
1290
|
+
}, [
|
|
1291
|
+
refresh,
|
|
1292
|
+
rotateToken,
|
|
1293
|
+
rotating,
|
|
1294
|
+
tr
|
|
1295
|
+
]);
|
|
1296
|
+
const confirmRemove = useCallback(async () => {
|
|
1297
|
+
const runner = removing;
|
|
1298
|
+
if (!runner) return;
|
|
1299
|
+
setActingId(runner.id);
|
|
1300
|
+
try {
|
|
1301
|
+
await deleteRunner(runner.id);
|
|
1302
|
+
toast.success(tr("fluidgrids.moreTools.runners.remove.done", "{{name}} was removed", { name: runner.name }));
|
|
1303
|
+
setRemoving(null);
|
|
1304
|
+
if (runnerId === runner.id) setSearchParams((previous) => {
|
|
1305
|
+
const next = new URLSearchParams(previous);
|
|
1306
|
+
next.delete("runner");
|
|
1307
|
+
return next;
|
|
1308
|
+
}, { replace: true });
|
|
1309
|
+
refresh();
|
|
1310
|
+
} catch (err) {
|
|
1311
|
+
toast.error(describeOperationError(err, tr("fluidgrids.moreTools.runners.remove.failed", "Couldn't remove the runner")));
|
|
1312
|
+
} finally {
|
|
1313
|
+
setActingId(null);
|
|
1314
|
+
}
|
|
1315
|
+
}, [
|
|
1316
|
+
deleteRunner,
|
|
1317
|
+
refresh,
|
|
1318
|
+
removing,
|
|
1319
|
+
runnerId,
|
|
1320
|
+
setSearchParams,
|
|
1321
|
+
tr
|
|
1322
|
+
]);
|
|
1323
|
+
return /* @__PURE__ */ jsxs(MoreToolsPage, {
|
|
1324
|
+
testId: "runners-page",
|
|
1325
|
+
children: [
|
|
1326
|
+
runnerId !== null ? /* @__PURE__ */ jsx(RunnerDetailView, {
|
|
1327
|
+
runnerId,
|
|
1328
|
+
refreshKey,
|
|
1329
|
+
backTo,
|
|
1330
|
+
permissions,
|
|
1331
|
+
acting: actingId === runnerId,
|
|
1332
|
+
onRotate: setRotating,
|
|
1333
|
+
onRemove: setRemoving,
|
|
1334
|
+
onCopyId: (runner) => void copyId(runner)
|
|
1335
|
+
}) : /* @__PURE__ */ jsx(RunnerListView, {
|
|
1336
|
+
refreshKey,
|
|
1337
|
+
filter,
|
|
1338
|
+
search,
|
|
1339
|
+
page,
|
|
1340
|
+
onFilter: (next) => set({ status: next === "all" ? null : next }),
|
|
1341
|
+
onSearch: (next) => set({ q: next.trim() ? next : null }),
|
|
1342
|
+
onClearFilters: () => set({
|
|
1343
|
+
status: null,
|
|
1344
|
+
q: null
|
|
1345
|
+
}),
|
|
1346
|
+
setPage,
|
|
1347
|
+
permissions,
|
|
1348
|
+
runnerLink,
|
|
1349
|
+
actingId,
|
|
1350
|
+
onAdd: () => setAdding(true),
|
|
1351
|
+
onRotate: setRotating,
|
|
1352
|
+
onRemove: setRemoving,
|
|
1353
|
+
onCopyId: (runner) => void copyId(runner)
|
|
1354
|
+
}),
|
|
1355
|
+
/* @__PURE__ */ jsx(AddRunnerDialogV2, {
|
|
1356
|
+
open: adding,
|
|
1357
|
+
onOpenChange: setAdding,
|
|
1358
|
+
onCreated: refresh
|
|
1359
|
+
}),
|
|
1360
|
+
/* @__PURE__ */ jsx(ConfirmActionDialog, {
|
|
1361
|
+
open: rotating !== null,
|
|
1362
|
+
onOpenChange: (open) => {
|
|
1363
|
+
if (!open && actingId === null) setRotating(null);
|
|
1364
|
+
},
|
|
1365
|
+
title: tr("fluidgrids.moreTools.runners.newKey.confirmTitle", "Get a new connection key for {{name}}?", { name: rotating?.name ?? "" }),
|
|
1366
|
+
description: tr("fluidgrids.moreTools.runners.newKey.confirmBody", "{{name}} disconnects right away and its old key stops working. Run the install command again on that machine with the new key.", { name: rotating?.name ?? "" }),
|
|
1367
|
+
confirmLabel: tr("fluidgrids.moreTools.runners.newKey.confirm", "Get a new key"),
|
|
1368
|
+
cancelLabel: tr("fluidgrids.moreTools.runners.newKey.keep", "Keep the current key"),
|
|
1369
|
+
destructive: true,
|
|
1370
|
+
busy: actingId !== null,
|
|
1371
|
+
onConfirm: () => void confirmRotate(),
|
|
1372
|
+
"data-testid": "confirm-rotate"
|
|
1373
|
+
}),
|
|
1374
|
+
/* @__PURE__ */ jsx(RunnerKeyDialogV2, {
|
|
1375
|
+
issued: rotated,
|
|
1376
|
+
onClose: () => setRotated(null)
|
|
1377
|
+
}),
|
|
1378
|
+
/* @__PURE__ */ jsx(ConfirmActionDialog, {
|
|
1379
|
+
open: removing !== null,
|
|
1380
|
+
onOpenChange: (open) => {
|
|
1381
|
+
if (!open && actingId === null) setRemoving(null);
|
|
1382
|
+
},
|
|
1383
|
+
title: tr("fluidgrids.moreTools.runners.remove.confirmTitle", "Remove {{name}}?", { name: removing?.name ?? "" }),
|
|
1384
|
+
description: tr("fluidgrids.moreTools.runners.remove.confirmBody", "It disconnects and its key stops working. Steps set to run on it will fail until you pick another runner or FluidGrids Cloud."),
|
|
1385
|
+
confirmLabel: tr("fluidgrids.moreTools.runners.remove.confirm", "Remove runner"),
|
|
1386
|
+
cancelLabel: tr("fluidgrids.moreTools.runners.remove.keep", "Keep the runner"),
|
|
1387
|
+
destructive: true,
|
|
1388
|
+
busy: actingId !== null,
|
|
1389
|
+
onConfirm: () => void confirmRemove(),
|
|
1390
|
+
"data-testid": "confirm-remove"
|
|
1391
|
+
})
|
|
1392
|
+
]
|
|
1393
|
+
});
|
|
1394
|
+
}
|
|
1395
|
+
/** The list, reading only its own page (or every runner for a chip or a search). */
|
|
1396
|
+
function RunnerListView({ refreshKey, filter, search, page, ...rest }) {
|
|
1397
|
+
const list = useRunnerList({
|
|
1398
|
+
filter,
|
|
1399
|
+
search,
|
|
1400
|
+
page,
|
|
1401
|
+
refreshKey
|
|
1402
|
+
});
|
|
1403
|
+
return /* @__PURE__ */ jsx(RunnerListV2, {
|
|
1404
|
+
list,
|
|
1405
|
+
filter,
|
|
1406
|
+
search,
|
|
1407
|
+
page,
|
|
1408
|
+
...rest
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
/** One runner's page, reading only that runner. */
|
|
1412
|
+
function RunnerDetailView({ runnerId, refreshKey, ...rest }) {
|
|
1413
|
+
const tracked = useTrackedRunner(runnerId, refreshKey);
|
|
1414
|
+
return /* @__PURE__ */ jsx(RunnerDetailV2, {
|
|
1415
|
+
runner: tracked.runner,
|
|
1416
|
+
loading: tracked.loading,
|
|
1417
|
+
error: tracked.error,
|
|
1418
|
+
onRetry: () => void tracked.refetch(),
|
|
1419
|
+
...rest
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
// src/modules/runners/pages/RunnersPage.tsx
|
|
1424
|
+
/**
|
|
1425
|
+
* Runners Page — self-hosted runners.
|
|
1426
|
+
*
|
|
1427
|
+
* Under FluidGrids' Navigation v2 the page is the redesign (BOFF-15502,
|
|
1428
|
+
* `RunnersPageV2`); every other app keeps the classic page below.
|
|
1429
|
+
*
|
|
1430
|
+
* A runner is a small program a customer installs on their own VM or laptop.
|
|
1431
|
+
* It connects out to FluidGrids, and any workflow node whose Settings →
|
|
1432
|
+
* "Run on" names it executes on that machine, inside a local sandbox.
|
|
1433
|
+
*
|
|
1434
|
+
* Adding a runner issues a token that is shown ONCE, inside a ready-to-paste
|
|
1435
|
+
* install command; the dialog then waits for the runner to come online.
|
|
1436
|
+
*/
|
|
1437
|
+
var RunnersPage_exports = /* @__PURE__ */ __exportAll({
|
|
1438
|
+
RunnersPage: () => RunnersPage,
|
|
1439
|
+
describePrivateRule: () => describePrivateRule
|
|
1440
|
+
});
|
|
1441
|
+
function formatSeen(iso) {
|
|
1442
|
+
if (!iso) return "—";
|
|
1443
|
+
const seconds = Math.max(0, Math.round((Date.now() - new Date(iso).getTime()) / 1e3));
|
|
1444
|
+
if (seconds < 60) return `${seconds}s ago`;
|
|
1445
|
+
if (seconds < 3600) return `${Math.round(seconds / 60)}m ago`;
|
|
1446
|
+
if (seconds < 86400) return `${Math.round(seconds / 3600)}h ago`;
|
|
1447
|
+
return new Date(iso).toLocaleDateString();
|
|
1448
|
+
}
|
|
1449
|
+
/** Rules shown inline before folding the rest behind "+N more". */
|
|
1450
|
+
const PRIVATE_NETWORK_INLINE = 3;
|
|
1451
|
+
/** "10.0.5.12:5432" / "db.corp (all ports)" for one rule. */
|
|
1452
|
+
function describePrivateRule(rule, allPorts) {
|
|
1453
|
+
return rule.ports.length > 0 ? `${rule.target}:${rule.ports.join(",")}` : `${rule.target} (${allPorts})`;
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* What a runner's nodes may reach besides the public internet. Read-only: the
|
|
1457
|
+
* list is set on the runner machine (`fluidgrids-runner network allow`), never
|
|
1458
|
+
* here, so a FluidGrids account cannot open a path into the customer's network.
|
|
1459
|
+
*/
|
|
1460
|
+
function PrivateNetworkCell({ rules }) {
|
|
1461
|
+
const tr = useTr();
|
|
1462
|
+
const [expanded, setExpanded] = useState(false);
|
|
1463
|
+
if (rules.length === 0) return /* @__PURE__ */ jsx("span", {
|
|
1464
|
+
"data-testid": "runner-private-network-none",
|
|
1465
|
+
children: tr("fluidgrids.runners.publicOnly", "Public internet only")
|
|
1466
|
+
});
|
|
1467
|
+
const allPorts = tr("fluidgrids.runners.allPorts", "all ports");
|
|
1468
|
+
const everyNode = tr("fluidgrids.runners.everyNode", "every node");
|
|
1469
|
+
const hidden = rules.length - PRIVATE_NETWORK_INLINE;
|
|
1470
|
+
const shown = expanded || hidden <= 0 ? rules : rules.slice(0, PRIVATE_NETWORK_INLINE);
|
|
1471
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1472
|
+
"data-testid": "runner-private-network",
|
|
1473
|
+
children: [/* @__PURE__ */ jsx("ul", {
|
|
1474
|
+
className: "space-y-0.5",
|
|
1475
|
+
children: shown.map((rule, index) => /* @__PURE__ */ jsxs("li", { children: [/* @__PURE__ */ jsx("span", {
|
|
1476
|
+
className: "font-mono text-xs text-text-primary",
|
|
1477
|
+
children: describePrivateRule(rule, allPorts)
|
|
1478
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1479
|
+
className: "ml-1 text-xs",
|
|
1480
|
+
children: rule.nodes.length > 0 ? rule.nodes.join(", ") : everyNode
|
|
1481
|
+
})] }, `${rule.target}-${index}`))
|
|
1482
|
+
}), hidden > 0 && /* @__PURE__ */ jsx(Button$1, {
|
|
1483
|
+
variant: "link",
|
|
1484
|
+
size: "sm",
|
|
1485
|
+
className: "h-auto p-0 text-xs",
|
|
1486
|
+
"aria-expanded": expanded,
|
|
1487
|
+
onClick: () => setExpanded((open) => !open),
|
|
1488
|
+
"data-testid": "runner-private-network-toggle",
|
|
1489
|
+
children: expanded ? tr("fluidgrids.runners.showFewer", "Show fewer") : tr("fluidgrids.runners.moreRules", "+{{count}} more", { count: hidden })
|
|
1490
|
+
})]
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
function HostExecCell({ hostExec }) {
|
|
1494
|
+
const tr = useTr();
|
|
1495
|
+
if (!Boolean(hostExec?.enabled && hostExec.allow.length > 0)) return /* @__PURE__ */ jsx("div", {
|
|
1496
|
+
className: "mt-1 text-xs text-text-muted",
|
|
1497
|
+
"data-testid": "runner-host-exec-off",
|
|
1498
|
+
children: tr("fluidgrids.runners.hostExecOff", "Host commands: off")
|
|
1499
|
+
});
|
|
1500
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1501
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
1502
|
+
"data-testid": "runner-host-exec-on",
|
|
1503
|
+
children: [
|
|
1504
|
+
tr("fluidgrids.runners.hostExecOn", "Host commands: on"),
|
|
1505
|
+
" ",
|
|
1506
|
+
/* @__PURE__ */ jsx("code", {
|
|
1507
|
+
className: "rounded bg-bg-sunken px-1 font-mono text-text-primary",
|
|
1508
|
+
children: hostExec.allow.join(", ")
|
|
1509
|
+
})
|
|
1510
|
+
]
|
|
1511
|
+
});
|
|
1512
|
+
}
|
|
1513
|
+
/** Install command + copy button, with the "shown once" warning. */
|
|
1514
|
+
function CopyableValue({ value, copied, testId, copyTestId, onCopied }) {
|
|
1515
|
+
const tr = useTr();
|
|
1516
|
+
const copy = useCallback(async () => {
|
|
1517
|
+
try {
|
|
1518
|
+
await navigator.clipboard.writeText(value);
|
|
1519
|
+
onCopied?.();
|
|
1520
|
+
toast.success(copied);
|
|
1521
|
+
} catch {
|
|
1522
|
+
toast.error(tr("fluidgrids.runners.copyFailed", "Could not copy — select the text and copy it manually"));
|
|
1523
|
+
}
|
|
1524
|
+
}, [
|
|
1525
|
+
value,
|
|
1526
|
+
copied,
|
|
1527
|
+
onCopied,
|
|
1528
|
+
tr
|
|
1529
|
+
]);
|
|
1530
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1531
|
+
className: "flex items-start gap-2",
|
|
1532
|
+
children: [/* @__PURE__ */ jsx("pre", {
|
|
1533
|
+
className: "flex-1 overflow-x-auto whitespace-pre-wrap break-all rounded-md border border-border bg-muted p-3 font-mono text-xs",
|
|
1534
|
+
"data-testid": testId,
|
|
1535
|
+
children: value
|
|
1536
|
+
}), /* @__PURE__ */ jsxs(Button$1, {
|
|
1537
|
+
variant: "outline",
|
|
1538
|
+
size: "sm",
|
|
1539
|
+
onClick: copy,
|
|
1540
|
+
"data-testid": copyTestId,
|
|
1541
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1542
|
+
icon: "lucide:copy",
|
|
1543
|
+
className: "mr-1 h-4 w-4"
|
|
1544
|
+
}), tr("fluidgrids.runners.copy", "Copy")]
|
|
1545
|
+
})]
|
|
1546
|
+
});
|
|
1547
|
+
}
|
|
1548
|
+
/**
|
|
1549
|
+
* Install command + token, kept apart: the command carries no token, and the
|
|
1550
|
+
* installer asks for it with hidden input — so the token never lands in shell
|
|
1551
|
+
* history or the machine's process list.
|
|
1552
|
+
*/
|
|
1553
|
+
function InstallCommand({ issued }) {
|
|
1554
|
+
const tr = useTr();
|
|
1555
|
+
const command = runnerInstallCommand(issued.bridgeUrl);
|
|
1556
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1557
|
+
className: "space-y-3",
|
|
1558
|
+
children: [
|
|
1559
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1560
|
+
className: "space-y-2",
|
|
1561
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
1562
|
+
className: "text-sm text-text-secondary",
|
|
1563
|
+
children: tr("fluidgrids.runners.installHint", "1. Run this on the machine that should run your nodes (Linux, or a Mac with Apple silicon). It installs the runner and its sandbox, and starts it in the background.")
|
|
1564
|
+
}), /* @__PURE__ */ jsx(CopyableValue, {
|
|
1565
|
+
value: command,
|
|
1566
|
+
copied: tr("fluidgrids.runners.copied", "Install command copied"),
|
|
1567
|
+
testId: "runner-install-command",
|
|
1568
|
+
copyTestId: "runner-copy-command"
|
|
1569
|
+
})]
|
|
1570
|
+
}),
|
|
1571
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1572
|
+
className: "space-y-2",
|
|
1573
|
+
children: [/* @__PURE__ */ jsx("p", {
|
|
1574
|
+
className: "text-sm text-text-secondary",
|
|
1575
|
+
children: tr("fluidgrids.runners.tokenHint", "2. Paste this token when the installer asks for it. It is not part of the command, so it never ends up in your shell history.")
|
|
1576
|
+
}), /* @__PURE__ */ jsx(CopyableValue, {
|
|
1577
|
+
value: issued.token,
|
|
1578
|
+
copied: tr("fluidgrids.runners.tokenCopied", "Token copied"),
|
|
1579
|
+
testId: "runner-token",
|
|
1580
|
+
copyTestId: "runner-copy-token"
|
|
1581
|
+
})]
|
|
1582
|
+
}),
|
|
1583
|
+
/* @__PURE__ */ jsx("p", {
|
|
1584
|
+
className: "text-xs text-status-warning-text",
|
|
1585
|
+
children: tr("fluidgrids.runners.tokenOnce", "The token is shown only once. Rotate it from the runner list if it is lost.")
|
|
1586
|
+
}),
|
|
1587
|
+
/* @__PURE__ */ jsx("p", {
|
|
1588
|
+
className: "text-xs text-text-secondary",
|
|
1589
|
+
children: tr("fluidgrids.runners.tokenAutomation", "Installing without a terminal (cloud-init, scripts)? Save the token to a file only you can read and add --token-file <path> to the command.")
|
|
1590
|
+
})
|
|
1591
|
+
]
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
/**
|
|
1595
|
+
* Add-runner dialog: name → command → waits for the runner to connect.
|
|
1596
|
+
* The body is mounted only while open, so every opening starts with an empty
|
|
1597
|
+
* name and no issued key.
|
|
1598
|
+
*/
|
|
1599
|
+
function AddRunnerDialog({ open, ...rest }) {
|
|
1600
|
+
return open ? /* @__PURE__ */ jsx(AddRunnerBody, { ...rest }) : null;
|
|
1601
|
+
}
|
|
1602
|
+
function AddRunnerBody({ onOpenChange, runners, onCreated }) {
|
|
1603
|
+
const tr = useTr();
|
|
1604
|
+
const { createRunner, busy } = useRunnerActions();
|
|
1605
|
+
const [name, setName] = useState("");
|
|
1606
|
+
const [issued, setIssued] = useState(null);
|
|
1607
|
+
const live = issued ? runners.find((r) => r.id === issued.runner.id) : void 0;
|
|
1608
|
+
const submit = useCallback(async () => {
|
|
1609
|
+
try {
|
|
1610
|
+
setIssued(await createRunner(name.trim()));
|
|
1611
|
+
onCreated();
|
|
1612
|
+
} catch (err) {
|
|
1613
|
+
toast.error(describeOperationError(err, tr("fluidgrids.runners.createFailed", "Could not add the runner")));
|
|
1614
|
+
}
|
|
1615
|
+
}, [
|
|
1616
|
+
createRunner,
|
|
1617
|
+
name,
|
|
1618
|
+
onCreated,
|
|
1619
|
+
tr
|
|
1620
|
+
]);
|
|
1621
|
+
return /* @__PURE__ */ jsx(Dialog, {
|
|
1622
|
+
open: true,
|
|
1623
|
+
onOpenChange,
|
|
1624
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
1625
|
+
className: "sm:max-w-2xl",
|
|
1626
|
+
"data-testid": "add-runner-dialog",
|
|
1627
|
+
children: [
|
|
1628
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: tr("fluidgrids.runners.addTitle", "Add a runner") }) }),
|
|
1629
|
+
!issued ? /* @__PURE__ */ jsxs("div", {
|
|
1630
|
+
className: "space-y-2",
|
|
1631
|
+
children: [/* @__PURE__ */ jsx(Label, {
|
|
1632
|
+
htmlFor: "runner-name",
|
|
1633
|
+
children: tr("fluidgrids.runners.name", "Name")
|
|
1634
|
+
}), /* @__PURE__ */ jsx(Input, {
|
|
1635
|
+
id: "runner-name",
|
|
1636
|
+
value: name,
|
|
1637
|
+
maxLength: 100,
|
|
1638
|
+
placeholder: tr("fluidgrids.runners.namePlaceholder", "e.g. build-server or my-laptop"),
|
|
1639
|
+
onChange: (e) => setName(e.target.value),
|
|
1640
|
+
onKeyDown: (e) => {
|
|
1641
|
+
if (e.key === "Enter" && name.trim()) submit();
|
|
1642
|
+
},
|
|
1643
|
+
"data-testid": "runner-name-input"
|
|
1644
|
+
})]
|
|
1645
|
+
}) : /* @__PURE__ */ jsxs("div", {
|
|
1646
|
+
className: "space-y-4",
|
|
1647
|
+
children: [/* @__PURE__ */ jsx(InstallCommand, { issued }), /* @__PURE__ */ jsx("div", {
|
|
1648
|
+
className: "flex items-center gap-2 text-sm",
|
|
1649
|
+
"data-testid": "runner-connect-status",
|
|
1650
|
+
children: live?.status === "ONLINE" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
1651
|
+
icon: "lucide:check-circle-2",
|
|
1652
|
+
className: "h-4 w-4 text-status-success-text"
|
|
1653
|
+
}), tr("fluidgrids.runners.connected", "Connected. You can now pick this runner in a node's Settings → Run on.")] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CompactMarkOr, {
|
|
1654
|
+
today: /* @__PURE__ */ jsx(Icon, {
|
|
1655
|
+
icon: "lucide:loader-2",
|
|
1656
|
+
className: "h-4 w-4 animate-spin text-text-secondary"
|
|
1657
|
+
}),
|
|
1658
|
+
className: "size-4"
|
|
1659
|
+
}), tr("fluidgrids.runners.waiting", "Waiting for the runner to connect…")] })
|
|
1660
|
+
})]
|
|
1661
|
+
}),
|
|
1662
|
+
/* @__PURE__ */ jsx(DialogFooter, { children: !issued ? /* @__PURE__ */ jsx(Button$1, {
|
|
1663
|
+
onClick: submit,
|
|
1664
|
+
disabled: busy || !name.trim(),
|
|
1665
|
+
"data-testid": "runner-create-submit",
|
|
1666
|
+
children: tr("fluidgrids.runners.create", "Create runner")
|
|
1667
|
+
}) : /* @__PURE__ */ jsx(Button$1, {
|
|
1668
|
+
variant: "outline",
|
|
1669
|
+
onClick: () => onOpenChange(false),
|
|
1670
|
+
"data-testid": "runner-dialog-done",
|
|
1671
|
+
children: tr("fluidgrids.runners.done", "Done")
|
|
1672
|
+
}) })
|
|
1673
|
+
]
|
|
1674
|
+
})
|
|
1675
|
+
});
|
|
1676
|
+
}
|
|
1677
|
+
/**
|
|
1678
|
+
* The page: Navigation v2 (FluidGrids) shows the redesign, every other app
|
|
1679
|
+
* the classic page. Nothing else is read before the choice.
|
|
1680
|
+
*/
|
|
1681
|
+
function RunnersPage() {
|
|
1682
|
+
return useNavigationV2() ? /* @__PURE__ */ jsx(RunnersPageV2, {}) : /* @__PURE__ */ jsx(RunnersClassicPage, {});
|
|
1683
|
+
}
|
|
1684
|
+
function RunnersClassicPage() {
|
|
1685
|
+
const tr = useTr();
|
|
1686
|
+
const { runners, loading, error, refetch } = useRunners({ pollMs: 5e3 });
|
|
1687
|
+
const { rotateToken, deleteRunner } = useRunnerActions();
|
|
1688
|
+
const [actingId, setActingId] = useState(null);
|
|
1689
|
+
const [adding, setAdding] = useState(false);
|
|
1690
|
+
const [rotated, setRotated] = useState(null);
|
|
1691
|
+
const [removing, setRemoving] = useState(null);
|
|
1692
|
+
const handleRotate = useCallback(async (runner) => {
|
|
1693
|
+
setActingId(runner.id);
|
|
1694
|
+
try {
|
|
1695
|
+
setRotated(await rotateToken(runner.id));
|
|
1696
|
+
refetch();
|
|
1697
|
+
} catch (err) {
|
|
1698
|
+
toast.error(describeOperationError(err, tr("fluidgrids.runners.rotateFailed", "Could not rotate the token")));
|
|
1699
|
+
} finally {
|
|
1700
|
+
setActingId(null);
|
|
1701
|
+
}
|
|
1702
|
+
}, [
|
|
1703
|
+
refetch,
|
|
1704
|
+
rotateToken,
|
|
1705
|
+
tr
|
|
1706
|
+
]);
|
|
1707
|
+
const handleRemove = useCallback(async () => {
|
|
1708
|
+
if (!removing) return;
|
|
1709
|
+
setActingId(removing.id);
|
|
1710
|
+
try {
|
|
1711
|
+
await deleteRunner(removing.id);
|
|
1712
|
+
toast.success(tr("fluidgrids.runners.removed", "Runner removed"));
|
|
1713
|
+
setRemoving(null);
|
|
1714
|
+
refetch();
|
|
1715
|
+
} catch (err) {
|
|
1716
|
+
toast.error(describeOperationError(err, tr("fluidgrids.runners.removeFailed", "Could not remove the runner")));
|
|
1717
|
+
} finally {
|
|
1718
|
+
setActingId(null);
|
|
1719
|
+
}
|
|
1720
|
+
}, [
|
|
1721
|
+
deleteRunner,
|
|
1722
|
+
refetch,
|
|
1723
|
+
removing,
|
|
1724
|
+
tr
|
|
1725
|
+
]);
|
|
1726
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1727
|
+
className: "space-y-6 p-6",
|
|
1728
|
+
"data-testid": "runners-page",
|
|
1729
|
+
children: [
|
|
1730
|
+
/* @__PURE__ */ jsxs("div", {
|
|
1731
|
+
className: "flex items-start justify-between gap-4",
|
|
1732
|
+
"data-tour": "fluidgrids-runners-header",
|
|
1733
|
+
children: [/* @__PURE__ */ jsxs("div", { children: [
|
|
1734
|
+
/* @__PURE__ */ jsx("h1", {
|
|
1735
|
+
className: "text-2xl font-semibold text-text-primary",
|
|
1736
|
+
children: tr("fluidgrids.runners.title", "Runners")
|
|
1737
|
+
}),
|
|
1738
|
+
/* @__PURE__ */ jsx("p", {
|
|
1739
|
+
className: "mt-1 max-w-2xl text-sm text-text-secondary",
|
|
1740
|
+
children: tr("fluidgrids.runners.subtitle", "Run workflow nodes on your own machines. A node set to Run on a runner executes there, inside a local sandbox; the rest of the workflow keeps running in FluidGrids.")
|
|
1741
|
+
}),
|
|
1742
|
+
/* @__PURE__ */ jsxs("p", {
|
|
1743
|
+
className: "mt-1 max-w-2xl text-sm text-text-secondary",
|
|
1744
|
+
"data-testid": "runners-private-network-hint",
|
|
1745
|
+
children: [
|
|
1746
|
+
tr("fluidgrids.runners.privateNetworkHint", "Nodes reach the public internet only. To let them reach something inside your network, open it on the runner machine:"),
|
|
1747
|
+
" ",
|
|
1748
|
+
/* @__PURE__ */ jsx("code", {
|
|
1749
|
+
className: "rounded bg-muted px-1 font-mono text-xs text-text-primary",
|
|
1750
|
+
children: "fluidgrids-runner network allow 10.0.5.12 --port 5432"
|
|
1751
|
+
})
|
|
1752
|
+
]
|
|
1753
|
+
}),
|
|
1754
|
+
/* @__PURE__ */ jsx(FluidGridsDocsLink, {
|
|
1755
|
+
topic: "runners",
|
|
1756
|
+
className: "mt-1"
|
|
1757
|
+
})
|
|
1758
|
+
] }), /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
1759
|
+
permission: FLUIDGRIDS_PERMISSIONS.SANDBOX_CREATE,
|
|
1760
|
+
deniedTooltip: tr("fluidgrids.runners.addDeniedTooltip", "You don't have permission to add runners"),
|
|
1761
|
+
children: /* @__PURE__ */ jsxs(Button$1, {
|
|
1762
|
+
onClick: () => setAdding(true),
|
|
1763
|
+
"data-testid": "runner-add",
|
|
1764
|
+
"data-tour": "fluidgrids-runners-add",
|
|
1765
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
1766
|
+
icon: "lucide:plus",
|
|
1767
|
+
className: "mr-1 h-4 w-4"
|
|
1768
|
+
}), tr("fluidgrids.runners.add", "Add runner")]
|
|
1769
|
+
})
|
|
1770
|
+
})]
|
|
1771
|
+
}),
|
|
1772
|
+
error && /* @__PURE__ */ jsx("div", {
|
|
1773
|
+
role: "alert",
|
|
1774
|
+
className: "rounded-md border border-status-error-border bg-status-error-bg-subtle p-3 text-sm text-status-error-text",
|
|
1775
|
+
children: error.message
|
|
1776
|
+
}),
|
|
1777
|
+
/* @__PURE__ */ jsx(Card, {
|
|
1778
|
+
"data-tour": "fluidgrids-runners-table",
|
|
1779
|
+
children: /* @__PURE__ */ jsx(CardHeader, {
|
|
1780
|
+
className: "p-0",
|
|
1781
|
+
children: /* @__PURE__ */ jsxs(Table, { children: [/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
1782
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.name", "Name") }),
|
|
1783
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.status", "Status") }),
|
|
1784
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.machine", "Machine") }),
|
|
1785
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.sandbox", "Sandbox") }),
|
|
1786
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.privateNetwork", "Private network") }),
|
|
1787
|
+
/* @__PURE__ */ jsx(TableHead, { children: tr("fluidgrids.runners.lastSeen", "Last seen") }),
|
|
1788
|
+
/* @__PURE__ */ jsx(TableHead, {
|
|
1789
|
+
className: "text-right",
|
|
1790
|
+
children: tr("fluidgrids.runners.actions", "Actions")
|
|
1791
|
+
})
|
|
1792
|
+
] }) }), /* @__PURE__ */ jsxs(TableBody, { children: [runners.map((runner) => /* @__PURE__ */ jsxs(TableRow, {
|
|
1793
|
+
"data-testid": "runner-row",
|
|
1794
|
+
children: [
|
|
1795
|
+
/* @__PURE__ */ jsxs(TableCell, { children: [/* @__PURE__ */ jsx("div", {
|
|
1796
|
+
className: "font-medium text-text-primary",
|
|
1797
|
+
children: runner.name
|
|
1798
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1799
|
+
className: "font-mono text-xs text-text-secondary",
|
|
1800
|
+
children: [runner.tokenPrefix, "…"]
|
|
1801
|
+
})] }),
|
|
1802
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(RunnerStatusPill, { status: runner.status }) }),
|
|
1803
|
+
/* @__PURE__ */ jsx(TableCell, {
|
|
1804
|
+
className: "text-sm text-text-secondary",
|
|
1805
|
+
children: runner.hostname ? `${runner.hostname} · ${runner.os ?? "?"}/${runner.arch ?? "?"}` : "—"
|
|
1806
|
+
}),
|
|
1807
|
+
/* @__PURE__ */ jsxs(TableCell, {
|
|
1808
|
+
className: "text-sm text-text-secondary",
|
|
1809
|
+
children: [runner.driver ? /* @__PURE__ */ jsx(Badge, {
|
|
1810
|
+
variant: "outline",
|
|
1811
|
+
children: runner.driver
|
|
1812
|
+
}) : "—", runner.version && /* @__PURE__ */ jsxs("span", {
|
|
1813
|
+
className: "ml-2 text-xs",
|
|
1814
|
+
children: ["v", runner.version]
|
|
1815
|
+
})]
|
|
1816
|
+
}),
|
|
1817
|
+
/* @__PURE__ */ jsxs(TableCell, {
|
|
1818
|
+
className: "text-sm text-text-secondary",
|
|
1819
|
+
children: [/* @__PURE__ */ jsx(PrivateNetworkCell, { rules: runner.privateNetwork ?? [] }), /* @__PURE__ */ jsx(HostExecCell, { hostExec: runner.hostExec })]
|
|
1820
|
+
}),
|
|
1821
|
+
/* @__PURE__ */ jsx(TableCell, {
|
|
1822
|
+
className: "text-sm text-text-secondary",
|
|
1823
|
+
children: formatSeen(runner.lastSeenAt)
|
|
1824
|
+
}),
|
|
1825
|
+
/* @__PURE__ */ jsxs(TableCell, {
|
|
1826
|
+
className: "text-right",
|
|
1827
|
+
children: [/* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
1828
|
+
permission: FLUIDGRIDS_PERMISSIONS.SANDBOX_UPDATE,
|
|
1829
|
+
deniedTooltip: tr("fluidgrids.runners.rotateDeniedTooltip", "You don't have permission to rotate runner tokens"),
|
|
1830
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
1831
|
+
"data-agent": "confirm",
|
|
1832
|
+
variant: "ghost",
|
|
1833
|
+
size: "sm",
|
|
1834
|
+
title: tr("fluidgrids.runners.rotate", "Rotate token"),
|
|
1835
|
+
"aria-label": tr("fluidgrids.runners.rotate", "Rotate token"),
|
|
1836
|
+
onClick: () => handleRotate(runner),
|
|
1837
|
+
disabled: actingId === runner.id,
|
|
1838
|
+
"data-testid": "runner-rotate",
|
|
1839
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1840
|
+
icon: "lucide:key-round",
|
|
1841
|
+
className: "h-4 w-4"
|
|
1842
|
+
})
|
|
1843
|
+
})
|
|
1844
|
+
}), /* @__PURE__ */ jsx(SdkPermissionButton, {
|
|
1845
|
+
permission: FLUIDGRIDS_PERMISSIONS.SANDBOX_DELETE,
|
|
1846
|
+
deniedTooltip: tr("fluidgrids.runners.removeDeniedTooltip", "You don't have permission to remove runners"),
|
|
1847
|
+
children: /* @__PURE__ */ jsx(Button$1, {
|
|
1848
|
+
variant: "ghost",
|
|
1849
|
+
size: "sm",
|
|
1850
|
+
title: tr("fluidgrids.runners.remove", "Remove"),
|
|
1851
|
+
"aria-label": tr("fluidgrids.runners.remove", "Remove"),
|
|
1852
|
+
onClick: () => setRemoving(runner),
|
|
1853
|
+
disabled: actingId === runner.id,
|
|
1854
|
+
"data-testid": "runner-remove",
|
|
1855
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
1856
|
+
icon: "lucide:trash-2",
|
|
1857
|
+
className: "h-4 w-4 text-destructive"
|
|
1858
|
+
})
|
|
1859
|
+
})
|
|
1860
|
+
})]
|
|
1861
|
+
})
|
|
1862
|
+
]
|
|
1863
|
+
}, runner.id)), !loading && runners.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, {
|
|
1864
|
+
colSpan: 7,
|
|
1865
|
+
children: /* @__PURE__ */ jsx(EmptyState, {
|
|
1866
|
+
kind: "first-use",
|
|
1867
|
+
illustration: "servers",
|
|
1868
|
+
size: "table",
|
|
1869
|
+
compact: true,
|
|
1870
|
+
icon: null,
|
|
1871
|
+
title: tr("fluidgrids.runners.empty", "No runners yet. Add one to run nodes on your own machine.")
|
|
1872
|
+
})
|
|
1873
|
+
}) })] })] })
|
|
1874
|
+
})
|
|
1875
|
+
}),
|
|
1876
|
+
/* @__PURE__ */ jsx(AddRunnerDialog, {
|
|
1877
|
+
open: adding,
|
|
1878
|
+
onOpenChange: setAdding,
|
|
1879
|
+
runners,
|
|
1880
|
+
onCreated: () => void refetch()
|
|
1881
|
+
}),
|
|
1882
|
+
/* @__PURE__ */ jsx(Dialog, {
|
|
1883
|
+
open: rotated !== null,
|
|
1884
|
+
onOpenChange: (open) => !open && setRotated(null),
|
|
1885
|
+
children: /* @__PURE__ */ jsxs(DialogContent, {
|
|
1886
|
+
className: "sm:max-w-2xl",
|
|
1887
|
+
"data-testid": "rotated-dialog",
|
|
1888
|
+
children: [
|
|
1889
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: tr("fluidgrids.runners.rotatedTitle", "New token issued") }) }),
|
|
1890
|
+
/* @__PURE__ */ jsx("p", {
|
|
1891
|
+
className: "text-sm text-text-secondary",
|
|
1892
|
+
children: tr("fluidgrids.runners.rotatedHint", "The old token no longer works and the runner was disconnected. Re-run the command below on that machine and paste the new token when it asks.")
|
|
1893
|
+
}),
|
|
1894
|
+
rotated && /* @__PURE__ */ jsx(InstallCommand, { issued: rotated }),
|
|
1895
|
+
/* @__PURE__ */ jsx(DialogFooter, { children: /* @__PURE__ */ jsx(Button$1, {
|
|
1896
|
+
variant: "outline",
|
|
1897
|
+
onClick: () => setRotated(null),
|
|
1898
|
+
children: tr("fluidgrids.runners.done", "Done")
|
|
1899
|
+
}) })
|
|
1900
|
+
]
|
|
1901
|
+
})
|
|
1902
|
+
}),
|
|
1903
|
+
/* @__PURE__ */ jsx(Dialog, {
|
|
1904
|
+
open: removing !== null,
|
|
1905
|
+
onOpenChange: (open) => !open && setRemoving(null),
|
|
1906
|
+
children: /* @__PURE__ */ jsxs(DialogContent, { children: [
|
|
1907
|
+
/* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsx(DialogTitle, { children: tr("fluidgrids.runners.removeTitle", "Remove this runner?") }) }),
|
|
1908
|
+
/* @__PURE__ */ jsx("p", {
|
|
1909
|
+
className: "text-sm text-text-secondary",
|
|
1910
|
+
children: tr("fluidgrids.runners.removeHint", "It is disconnected and its token stops working. Nodes set to run on it will fail until you pick another runner or FluidGrids Cloud.")
|
|
1911
|
+
}),
|
|
1912
|
+
/* @__PURE__ */ jsxs(DialogFooter, { children: [/* @__PURE__ */ jsx(Button$1, {
|
|
1913
|
+
variant: "outline",
|
|
1914
|
+
onClick: () => setRemoving(null),
|
|
1915
|
+
children: tr("fluidgrids.runners.cancel", "Cancel")
|
|
1916
|
+
}), /* @__PURE__ */ jsx(Button$1, {
|
|
1917
|
+
variant: "destructive",
|
|
1918
|
+
onClick: handleRemove,
|
|
1919
|
+
disabled: actingId !== null,
|
|
1920
|
+
"data-testid": "runner-remove-confirm",
|
|
1921
|
+
children: tr("fluidgrids.runners.remove", "Remove")
|
|
1922
|
+
})] })
|
|
1923
|
+
] })
|
|
1924
|
+
})
|
|
1925
|
+
]
|
|
1926
|
+
});
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
export { RunnersPage_exports as n, RunnersPage as t };
|