@omnitron-dev/omnitron 0.3.5 → 0.4.6
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 +296 -6
- package/bin/{pnpmfile-sdk.mjs → pnpmfile-sdk.js} +13 -0
- package/bin/sdk.d.ts +19 -0
- package/bin/sdk.js +932 -0
- package/dist/BUILD.json +2 -2
- package/dist/cli/omnitron.js +14 -6
- package/dist/cli/omnitron.js.map +1 -1
- package/dist/commands/stack.d.ts +2 -5
- package/dist/commands/stack.d.ts.map +1 -1
- package/dist/commands/stack.js +32 -0
- package/dist/commands/stack.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +1 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/daemon/daemon-client.d.ts +3 -15
- package/dist/daemon/daemon-client.d.ts.map +1 -1
- package/dist/daemon/daemon-client.js +4 -0
- package/dist/daemon/daemon-client.js.map +1 -1
- package/dist/daemon/daemon.d.ts +5 -11
- package/dist/daemon/daemon.d.ts.map +1 -1
- package/dist/daemon/daemon.js +28 -42
- package/dist/daemon/daemon.js.map +1 -1
- package/dist/daemon/daemon.rpc-service.d.ts +3 -15
- package/dist/daemon/daemon.rpc-service.d.ts.map +1 -1
- package/dist/daemon/daemon.rpc-service.js +27 -3
- package/dist/daemon/daemon.rpc-service.js.map +1 -1
- package/dist/daemon/darwin-owner-evidence.js +1 -1
- package/dist/daemon/darwin-owner-evidence.js.map +1 -1
- package/dist/daemon/execution-capabilities.d.ts +1 -1
- package/dist/daemon/execution-capabilities.d.ts.map +1 -1
- package/dist/daemon/execution-capabilities.js +3 -3
- package/dist/daemon/execution-capabilities.js.map +1 -1
- package/dist/daemon/execution-client.d.ts +4 -0
- package/dist/daemon/execution-client.d.ts.map +1 -1
- package/dist/daemon/execution-client.js +28 -6
- package/dist/daemon/execution-client.js.map +1 -1
- package/dist/daemon/execution-host.d.ts +4 -11
- package/dist/daemon/execution-host.d.ts.map +1 -1
- package/dist/daemon/execution-host.js +3 -9
- package/dist/daemon/execution-host.js.map +1 -1
- package/dist/daemon/execution-owner.d.ts.map +1 -1
- package/dist/daemon/execution-owner.js +2 -16
- package/dist/daemon/execution-owner.js.map +1 -1
- package/dist/daemon/execution-shutdown.d.ts +1 -1
- package/dist/daemon/execution-shutdown.d.ts.map +1 -1
- package/dist/daemon/managed-owner-build.d.ts +4 -0
- package/dist/daemon/managed-owner-build.d.ts.map +1 -1
- package/dist/daemon/managed-owner-build.js +14 -2
- package/dist/daemon/managed-owner-build.js.map +1 -1
- package/dist/daemon/managed-runtime.js +1 -1
- package/dist/daemon/managed-runtime.js.map +1 -1
- package/dist/daemon/owner-reconciliation.d.ts.map +1 -1
- package/dist/daemon/owner-reconciliation.js +1 -2
- package/dist/daemon/owner-reconciliation.js.map +1 -1
- package/dist/daemon/system-guardian-cgroup.js +1 -1
- package/dist/daemon/system-guardian-cgroup.js.map +1 -1
- package/dist/infrastructure/existing-containers.d.ts +25 -0
- package/dist/infrastructure/existing-containers.d.ts.map +1 -0
- package/dist/infrastructure/existing-containers.js +183 -0
- package/dist/infrastructure/existing-containers.js.map +1 -0
- package/dist/infrastructure/infrastructure.service.d.ts +14 -1
- package/dist/infrastructure/infrastructure.service.d.ts.map +1 -1
- package/dist/infrastructure/infrastructure.service.js +118 -9
- package/dist/infrastructure/infrastructure.service.js.map +1 -1
- package/dist/infrastructure/stack-infra-manager.d.ts +8 -2
- package/dist/infrastructure/stack-infra-manager.d.ts.map +1 -1
- package/dist/infrastructure/stack-infra-manager.js +46 -9
- package/dist/infrastructure/stack-infra-manager.js.map +1 -1
- package/dist/monitoring/log-journal.d.ts.map +1 -1
- package/dist/monitoring/log-journal.js +1 -2
- package/dist/monitoring/log-journal.js.map +1 -1
- package/dist/operations.d.ts +1 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +1 -0
- package/dist/operations.js.map +1 -1
- package/dist/orchestrator/bootstrap-loader.d.ts +2 -0
- package/dist/orchestrator/bootstrap-loader.d.ts.map +1 -1
- package/dist/orchestrator/bootstrap-loader.js +2 -1
- package/dist/orchestrator/bootstrap-loader.js.map +1 -1
- package/dist/orchestrator/classic-launcher.d.ts.map +1 -1
- package/dist/orchestrator/classic-launcher.js +2 -1
- package/dist/orchestrator/classic-launcher.js.map +1 -1
- package/dist/orchestrator/execution-contract.d.ts +2 -3
- package/dist/orchestrator/execution-contract.d.ts.map +1 -1
- package/dist/orchestrator/file-watcher.d.ts +11 -23
- package/dist/orchestrator/file-watcher.d.ts.map +1 -1
- package/dist/orchestrator/file-watcher.js +57 -42
- package/dist/orchestrator/file-watcher.js.map +1 -1
- package/dist/orchestrator/orchestrator.service.d.ts +10 -5
- package/dist/orchestrator/orchestrator.service.d.ts.map +1 -1
- package/dist/orchestrator/orchestrator.service.js +117 -20
- package/dist/orchestrator/orchestrator.service.js.map +1 -1
- package/dist/project/bootstrap-metadata.d.ts +1 -1
- package/dist/project/bootstrap-metadata.d.ts.map +1 -1
- package/dist/project/bootstrap-metadata.js +3 -2
- package/dist/project/bootstrap-metadata.js.map +1 -1
- package/dist/project/node-stack-stop.d.ts +2 -1
- package/dist/project/node-stack-stop.d.ts.map +1 -1
- package/dist/project/node-stack-stop.js +5 -1
- package/dist/project/node-stack-stop.js.map +1 -1
- package/dist/release/closure-library-path.d.ts +8 -2
- package/dist/release/closure-library-path.d.ts.map +1 -1
- package/dist/release/closure-library-path.js +72 -28
- package/dist/release/closure-library-path.js.map +1 -1
- package/dist/release/local-installation.d.ts +2 -0
- package/dist/release/local-installation.d.ts.map +1 -1
- package/dist/release/local-installation.js +1 -1
- package/dist/release/local-installation.js.map +1 -1
- package/dist/release/portable-archive.d.ts +3 -0
- package/dist/release/portable-archive.d.ts.map +1 -1
- package/dist/release/portable-archive.js +13 -7
- package/dist/release/portable-archive.js.map +1 -1
- package/dist/release/registry-framework.d.ts +25 -0
- package/dist/release/registry-framework.d.ts.map +1 -1
- package/dist/release/registry-framework.js +51 -3
- package/dist/release/registry-framework.js.map +1 -1
- package/dist/release/target-runtime.d.ts +4 -0
- package/dist/release/target-runtime.d.ts.map +1 -1
- package/dist/release/target-runtime.js +9 -0
- package/dist/release/target-runtime.js.map +1 -1
- package/dist/services/host-upgrade.d.ts +2 -0
- package/dist/services/host-upgrade.d.ts.map +1 -1
- package/dist/services/host-upgrade.js +6 -2
- package/dist/services/host-upgrade.js.map +1 -1
- package/dist/services/infrastructure.rpc-service.d.ts +8 -0
- package/dist/services/infrastructure.rpc-service.d.ts.map +1 -1
- package/dist/services/infrastructure.rpc-service.js +90 -10
- package/dist/services/infrastructure.rpc-service.js.map +1 -1
- package/dist/services/kernel-rollout.service.d.ts.map +1 -1
- package/dist/services/kernel-rollout.service.js +1 -2
- package/dist/services/kernel-rollout.service.js.map +1 -1
- package/dist/services/migration-process.d.ts +1 -0
- package/dist/services/migration-process.d.ts.map +1 -1
- package/dist/services/migration-process.js +4 -2
- package/dist/services/migration-process.js.map +1 -1
- package/dist/services/pipeline-definition.d.ts.map +1 -1
- package/dist/services/pipeline-definition.js +32 -6
- package/dist/services/pipeline-definition.js.map +1 -1
- package/dist/services/pipeline.service.d.ts +7 -1
- package/dist/services/pipeline.service.d.ts.map +1 -1
- package/dist/services/pipeline.service.js +106 -13
- package/dist/services/pipeline.service.js.map +1 -1
- package/dist/services/project.rpc-service.d.ts +6 -5
- package/dist/services/project.rpc-service.d.ts.map +1 -1
- package/dist/services/project.rpc-service.js +13 -0
- package/dist/services/project.rpc-service.js.map +1 -1
- package/dist/services/project.service.d.ts +24 -6
- package/dist/services/project.service.d.ts.map +1 -1
- package/dist/services/project.service.js +327 -59
- package/dist/services/project.service.js.map +1 -1
- package/dist/services/remote-deployer.service.d.ts.map +1 -1
- package/dist/services/remote-deployer.service.js +3 -0
- package/dist/services/remote-deployer.service.js.map +1 -1
- package/dist/shared/dto/backend.d.ts +3 -0
- package/dist/shared/dto/backend.d.ts.map +1 -1
- package/dist/shared/dto/backend.js.map +1 -1
- package/dist/shared/dto/pipelines.d.ts +54 -5
- package/dist/shared/dto/pipelines.d.ts.map +1 -1
- package/dist/shared/dto/pipelines.js +0 -7
- package/dist/shared/dto/pipelines.js.map +1 -1
- package/dist/shared/dto/project.d.ts +60 -0
- package/dist/shared/dto/project.d.ts.map +1 -1
- package/dist/shared/dto/services.d.ts +26 -17
- package/dist/shared/dto/services.d.ts.map +1 -1
- package/dist/shared/dto/services.js.map +1 -1
- package/dist/workers/system-worker-manager.d.ts +1 -2
- package/dist/workers/system-worker-manager.d.ts.map +1 -1
- package/dist/workers/system-worker-manager.js +5 -3
- package/dist/workers/system-worker-manager.js.map +1 -1
- package/package.json +17 -16
- package/webapp/dist/BUILD.json +2 -2
- package/webapp/dist/assets/{access-DUjabwNX.js → access-B2gXuoMG.js} +1 -1
- package/webapp/dist/assets/{access-BvKK9dEv.js → access-I0f72P9m.js} +1 -1
- package/webapp/dist/assets/{admin-data-table-BKSDI8sU.js → admin-data-table-CAEL2f-m.js} +1 -1
- package/webapp/dist/assets/{alert-uBG6r9NW.js → alert-BdJ2uaY0.js} +1 -1
- package/webapp/dist/assets/{alerts-CzN6OqX5.js → alerts-DeVkMXWo.js} +1 -1
- package/webapp/dist/assets/{apps-G_Lm6m4F.js → apps-9SuDvyGQ.js} +1 -1
- package/webapp/dist/assets/{audit-CLMpdBzG.js → audit-DT8cY7Ys.js} +1 -1
- package/webapp/dist/assets/backend-status.store-BbBE9cn8.js +4 -0
- package/webapp/dist/assets/{card-DkH32gMY.js → card-DaUEmUI5.js} +1 -1
- package/webapp/dist/assets/{chart-BpGXlCJc.js → chart-BKXP2ter.js} +1 -1
- package/webapp/dist/assets/{client-DFnuv2z3.js → client-CgyTwq9g.js} +1 -1
- package/webapp/dist/assets/{code-editor-DK6Tmmxv.js → code-editor-JVuQ4m-z.js} +1 -1
- package/webapp/dist/assets/{comparison-bars-BtC0dHjF.js → comparison-bars-Ds5Dt1oj.js} +1 -1
- package/webapp/dist/assets/{confirm-dialog-BbGsAz7_.js → confirm-dialog-BayExVbF.js} +1 -1
- package/webapp/dist/assets/{console-keyboard-D3YCA0yU.js → console-keyboard-uSLt92dB.js} +1 -1
- package/webapp/dist/assets/{containers-BsFwprq4.js → containers-DkXTgcrY.js} +1 -1
- package/webapp/dist/assets/{controls-C5W8gHU4.js → controls-CqeGPnaF.js} +1 -1
- package/webapp/dist/assets/{dashboard-BN7rKE5n.js → dashboard-By5yPuOf.js} +1 -1
- package/webapp/dist/assets/{dashboard-builder-BXFxWjXP.js → dashboard-builder-C0hvBwkd.js} +1 -1
- package/webapp/dist/assets/{deploy-progress-CUUwlYtQ.js → deploy-progress-B39cvvCE.js} +1 -1
- package/webapp/dist/assets/{deploy-release-dialog-58lGZDNk.js → deploy-release-dialog-CnzaO_xL.js} +1 -1
- package/webapp/dist/assets/{deployments-DEzjHerg.js → deployments-BXP943hA.js} +1 -1
- package/webapp/dist/assets/{detail-pXPk4O0E.js → detail-B84RgiOb.js} +1 -1
- package/webapp/dist/assets/{detail-Dj3gxaH0.js → detail-CVXDks9-.js} +1 -1
- package/webapp/dist/assets/{detail-CBn9pjJU.js → detail-D9DixtaK.js} +1 -1
- package/webapp/dist/assets/{empty-content-7jOFhG4C.js → empty-content-eyDOuOVp.js} +1 -1
- package/webapp/dist/assets/{error-boundary-CLLI8PWw.js → error-boundary-CQmDr_HS.js} +1 -1
- package/webapp/dist/assets/{event-fields-CiyqrRO8.js → event-fields-C7p2a2HY.js} +1 -1
- package/webapp/dist/assets/{files-DigwXndm.js → files-BsfGT3t6.js} +2 -2
- package/webapp/dist/assets/{icons-OboZgWSt.js → icons-B9Ct8PJ9.js} +1 -1
- package/webapp/dist/assets/index-BEfv96EF.js +1 -0
- package/webapp/dist/assets/{label-B1SF0RTL.js → label-avMhe08g.js} +1 -1
- package/webapp/dist/assets/{log-level-filter-Bcn31D1F.js → log-level-filter-oaUGdbpk.js} +1 -1
- package/webapp/dist/assets/{logs-DrsBbLfb.js → logs-iC1OEDv3.js} +1 -1
- package/webapp/dist/assets/{metric-chart-M-kI-XOt.js → metric-chart-CSa_qv4F.js} +1 -1
- package/webapp/dist/assets/{metrics-D5cDZTEo.js → metrics-CKCmcGKw.js} +1 -1
- package/webapp/dist/assets/{mui-Cd711nOk.js → mui-B3fJdIMc.js} +1 -1
- package/webapp/dist/assets/{mui-CdB_p2lt.js → mui-Bdr6Ks5j.js} +1 -1
- package/webapp/dist/assets/{mui-Db5J-QUd.js → mui-CADnFGCx.js} +1 -1
- package/webapp/dist/assets/{mui-AnEgAVjz.js → mui-CMWGTMXv.js} +1 -1
- package/webapp/dist/assets/{mui-DyT2n1lx.js → mui-CN3dT7bb.js} +1 -1
- package/webapp/dist/assets/{mui-BwsIrivo.js → mui-CPEkFAPo.js} +1 -1
- package/webapp/dist/assets/{mui-dLCwWoMw.js → mui-D3qAWvfZ.js} +1 -1
- package/webapp/dist/assets/{mui-D5m7fDCh.js → mui-D7tBU80e.js} +1 -1
- package/webapp/dist/assets/{mui-59N0OVRa.js → mui-DaJavAoc.js} +1 -1
- package/webapp/dist/assets/{mui-BXSXx9c9.js → mui-SNRRJ_vi.js} +1 -1
- package/webapp/dist/assets/{nodes-CwwZZuu4.js → nodes-DtLyXH0V.js} +1 -1
- package/webapp/dist/assets/{operation-status-Bm1x1wTz.js → operation-status-DHyYOT7G.js} +1 -1
- package/webapp/dist/assets/{page-breadcrumbs-fR7Jmpp4.js → page-breadcrumbs-3R8RZ3nA.js} +1 -1
- package/webapp/dist/assets/pipelines-Do2NAAqK.js +3 -0
- package/webapp/dist/assets/{project.store-DuCgv6Eq.js → project.store-D5IR3fo9.js} +1 -1
- package/webapp/dist/assets/{projects-TBAdpCeX.js → projects-BqlGbzeG.js} +1 -1
- package/webapp/dist/assets/{realtime.store-hfxZD2DU.js → realtime.store-C8D235-B.js} +1 -1
- package/webapp/dist/assets/{release-bits-BJ6i23y0.js → release-bits-IehuBssK.js} +1 -1
- package/webapp/dist/assets/{release-build-panel-BNXkwNE1.js → release-build-panel-C48hP_9w.js} +1 -1
- package/webapp/dist/assets/{release-deployment-state-gN8ZT3aq.js → release-deployment-state-BfmxZP4Y.js} +1 -1
- package/webapp/dist/assets/{releases-CXXKUh-v.js → releases-Cm0RV5Xu.js} +1 -1
- package/webapp/dist/assets/{search-input-C0MHI8vO.js → search-input-SWD1dXxD.js} +1 -1
- package/webapp/dist/assets/settings-DwuEPQGg.js +1 -0
- package/webapp/dist/assets/sign-in-CQ-WeS5A.js +1 -0
- package/webapp/dist/assets/{skeleton-BmWDJWF9.js → skeleton-BnVxAoeX.js} +1 -1
- package/webapp/dist/assets/{snackbar-DSPmjMyi.js → snackbar-CRX6eqRT.js} +1 -1
- package/webapp/dist/assets/{stack-health-status-BIv2C10x.js → stack-health-status-DfErRNb1.js} +1 -1
- package/webapp/dist/assets/{stack-start-notice-D-AH_bzn.js → stack-start-notice-NkYDjR-f.js} +1 -1
- package/webapp/dist/assets/{stacks-WY_ynkON.js → stacks-BOGCfW90.js} +1 -1
- package/webapp/dist/assets/{store-bqUBn2A4.js → store-DtTtbc9H.js} +1 -1
- package/webapp/dist/assets/{system-info-DXMwo6gl.js → system-info-Cw-xywgI.js} +1 -1
- package/webapp/dist/assets/{table-BOWT6Y9d.js → table-D-so_B1p.js} +1 -1
- package/webapp/dist/assets/{table-viewport-Bp4pq-c_.js → table-viewport-DdZ1yAKm.js} +1 -1
- package/webapp/dist/assets/{tabs-k5NPGLnJ.js → tabs-DGqBkXh_.js} +1 -1
- package/webapp/dist/assets/{terminal-QWBau-Us.js → terminal-Bbl0XNeB.js} +1 -1
- package/webapp/dist/assets/{topology-C_Qp1RqW.js → topology-DmrRy7nN.js} +1 -1
- package/webapp/dist/assets/{topology-metadata-dialog-BivuU2y6.js → topology-metadata-dialog-Dpfp4YF1.js} +1 -1
- package/webapp/dist/assets/{traces-By0rdfDC.js → traces-CKHsOabJ.js} +1 -1
- package/webapp/dist/assets/{use-stack-context-8yaHaN8L.js → use-stack-context-BuraYaeY.js} +1 -1
- package/webapp/dist/assets/webapp-D8h_eabt.js +35 -0
- package/webapp/dist/console-version.json +1 -1
- package/webapp/dist/index.html +34 -34
- package/webapp/dist/logo.svg +1 -80
- package/bin/sdk.d.mts +0 -8
- package/bin/sdk.mjs +0 -580
- package/dist/monitoring/process-lifetime.d.ts +0 -11
- package/dist/monitoring/process-lifetime.d.ts.map +0 -1
- package/dist/monitoring/process-lifetime.js +0 -45
- package/dist/monitoring/process-lifetime.js.map +0 -1
- package/dist/shared/host-boot-identity.d.ts +0 -12
- package/dist/shared/host-boot-identity.d.ts.map +0 -1
- package/dist/shared/host-boot-identity.js +0 -89
- package/dist/shared/host-boot-identity.js.map +0 -1
- package/webapp/dist/assets/index-Bo9An3pJ.js +0 -1
- package/webapp/dist/assets/omnitron-logo-koMCbsCv.js +0 -1
- package/webapp/dist/assets/pipelines-BrfTjf6Y.js +0 -3
- package/webapp/dist/assets/settings-B3egRvbI.js +0 -1
- package/webapp/dist/assets/sign-in-9q-Nfy83.js +0 -1
- package/webapp/dist/assets/webapp-BO_WoB_z.js +0 -35
- package/webapp/dist/favicon.png +0 -0
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import { execFileSync } from 'node:child_process';
|
|
3
|
-
const uuid = /^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i;
|
|
4
|
-
const weekdays = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
5
|
-
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6
|
-
function isNativeBirthDate(value) {
|
|
7
|
-
const match = /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) {1,2}(\d{1,2}) (\d{2}):(\d{2}):(\d{2}) ([1-9]\d{3})$/.exec(value);
|
|
8
|
-
if (!match)
|
|
9
|
-
return false;
|
|
10
|
-
const [, day, month, date, hours, minutes, seconds, year] = match;
|
|
11
|
-
const instant = new Date(Date.UTC(Number(year), months.indexOf(month), Number(date), Number(hours), Number(minutes), Number(seconds)));
|
|
12
|
-
return instant.getUTCFullYear() === Number(year) && instant.getUTCMonth() === months.indexOf(month) &&
|
|
13
|
-
instant.getUTCDate() === Number(date) && instant.getUTCHours() === Number(hours) && instant.getUTCMinutes() === Number(minutes) &&
|
|
14
|
-
instant.getUTCSeconds() === Number(seconds) && weekdays[instant.getUTCDay()] === day;
|
|
15
|
-
}
|
|
16
|
-
export const isStableDarwinBootIdentity = (value) => typeof value === 'string' && value.startsWith('darwin:') && uuid.test(value.slice(7));
|
|
17
|
-
/** Callers must collect native lstart with LC_ALL=C and TZ=UTC. */
|
|
18
|
-
export function formatDarwinProcessLifetime(boot, start) {
|
|
19
|
-
if (!isStableDarwinBootIdentity(boot) || !isNativeBirthDate(start))
|
|
20
|
-
throw new Error('Cannot verify the macOS process birth');
|
|
21
|
-
return `${boot.toLowerCase()}:utc:${start.replace(/ +/g, ' ')}`;
|
|
22
|
-
}
|
|
23
|
-
export function isLegacyDarwinBootIdentity(value) {
|
|
24
|
-
if (typeof value !== 'string')
|
|
25
|
-
return false;
|
|
26
|
-
const match = /^\{ *sec *= *(\d+), *usec *= *(\d+) *\} (.+)$/.exec(value);
|
|
27
|
-
return !!match && Number.isSafeInteger(Number(match[1])) && Number(match[1]) > 0 &&
|
|
28
|
-
Number.isSafeInteger(Number(match[2])) && Number(match[2]) < 1_000_000 && isNativeBirthDate(match[3]);
|
|
29
|
-
}
|
|
30
|
-
export const isStableHostBootIdentity = (value) => typeof value === 'string' && (isStableDarwinBootIdentity(value) || uuid.test(value));
|
|
31
|
-
/** kern.boottime can change after clock adjustments; it is never a boot fence. */
|
|
32
|
-
export function readHostBootIdentity() {
|
|
33
|
-
if (process.platform === 'linux') {
|
|
34
|
-
const value = fs.readFileSync('/proc/sys/kernel/random/boot_id', 'utf8').trim().toLowerCase();
|
|
35
|
-
if (!uuid.test(value))
|
|
36
|
-
throw new Error('Cannot verify the Linux boot identity');
|
|
37
|
-
return value;
|
|
38
|
-
}
|
|
39
|
-
if (process.platform === 'darwin') {
|
|
40
|
-
const value = execFileSync('/usr/sbin/sysctl', ['-n', 'kern.bootsessionuuid'], {
|
|
41
|
-
encoding: 'utf8', timeout: 1000, maxBuffer: 1024,
|
|
42
|
-
stdio: ['ignore', 'pipe', 'pipe'], env: { ...process.env, LC_ALL: 'C' },
|
|
43
|
-
}).trim().toLowerCase();
|
|
44
|
-
if (!uuid.test(value))
|
|
45
|
-
throw new Error('Cannot verify the macOS boot session');
|
|
46
|
-
return 'darwin:' + value;
|
|
47
|
-
}
|
|
48
|
-
throw new Error('Cannot verify this host boot identity');
|
|
49
|
-
}
|
|
50
|
-
/** Only comparable stable IDs can prove a reboot; legacy wall-clock text cannot. */
|
|
51
|
-
export function provesDifferentHostBoot(previous, current) {
|
|
52
|
-
return isStableHostBootIdentity(previous) && isStableHostBootIdentity(current) &&
|
|
53
|
-
isStableDarwinBootIdentity(previous) === isStableDarwinBootIdentity(current) && previous.toLowerCase() !== current.toLowerCase();
|
|
54
|
-
}
|
|
55
|
-
/** A different wall-clock rendering is not proof that a Darwin writer died. */
|
|
56
|
-
export function compareProcessLifetimes(previous, current) {
|
|
57
|
-
const format = (value) => {
|
|
58
|
-
if (value.startsWith('darwin:')) {
|
|
59
|
-
if (!isStableDarwinBootIdentity(value.slice(0, 43)) || value[43] !== ':')
|
|
60
|
-
return null;
|
|
61
|
-
const utc = value.slice(44).startsWith('utc:');
|
|
62
|
-
if (!isNativeBirthDate(value.slice(utc ? 48 : 44)))
|
|
63
|
-
return null;
|
|
64
|
-
return utc ? 'darwin-utc' : 'darwin';
|
|
65
|
-
}
|
|
66
|
-
// The former rollout reader used '/' between the same Linux boot UUID and ticks.
|
|
67
|
-
const ticks = value.slice(37);
|
|
68
|
-
return uuid.test(value.slice(0, 36)) && [':', '/'].includes(value[36]) &&
|
|
69
|
-
/^\d{1,20}$/.test(ticks) && BigInt(ticks) <= 18446744073709551615n ? 'linux' : null;
|
|
70
|
-
};
|
|
71
|
-
const before = format(previous), after = format(current);
|
|
72
|
-
if (!before || !after || (before === 'linux') !== (after === 'linux'))
|
|
73
|
-
return 'unknown';
|
|
74
|
-
if (before !== 'linux') {
|
|
75
|
-
if (previous.slice(0, 43).toLowerCase() !== current.slice(0, 43).toLowerCase())
|
|
76
|
-
return 'different';
|
|
77
|
-
if (before !== after)
|
|
78
|
-
return 'unknown';
|
|
79
|
-
const offset = before === 'darwin-utc' ? 48 : 44;
|
|
80
|
-
if (previous.slice(offset).replace(/ +/g, ' ') === current.slice(offset).replace(/ +/g, ' '))
|
|
81
|
-
return 'same';
|
|
82
|
-
// Legacy records did not retain TZ. Even two valid native dates can describe
|
|
83
|
-
// one live process, so keep its unfinished messages until death is observed.
|
|
84
|
-
return before === 'darwin-utc' ? 'different' : 'unknown';
|
|
85
|
-
}
|
|
86
|
-
const normalize = (value) => value.slice(0, 36).toLowerCase() + ':' + BigInt(value.slice(37)).toString();
|
|
87
|
-
return normalize(previous) === normalize(current) ? 'same' : 'different';
|
|
88
|
-
}
|
|
89
|
-
//# sourceMappingURL=host-boot-identity.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"host-boot-identity.js","sourceRoot":"","sources":["../../src/shared/host-boot-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,IAAI,GAAG,gDAAgD,CAAC;AAC9D,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnE,MAAM,MAAM,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,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qLIAi.js";import{H as n,V as r}from"./mui-BXSXx9c9.js";import{n as i,t as a}from"./react-CEuifcaQ.js";function o(e,t,n){return e===502||e===503?`down`:(t??``).includes(`text/html`)||e<200||e>=300||n===null?`unreachable`:n.status===`online`?`up`:`down`}function s(e,t){return e===`up`?{status:`online`,consecutiveUnreachable:0}:e===`down`?{status:`offline`,consecutiveUnreachable:0}:{status:`degraded`,consecutiveUnreachable:t+1}}async function c(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),d),n=await fetch(`/api/health`,{signal:e.signal,cache:`no-store`});clearTimeout(t);let r=n.headers.get(`content-type`),i=n.ok?await n.json().catch(()=>null):null;return o(n.status,r,i)}catch{return`unreachable`}}async function l(e,t){let n=s(await c(),t().consecutiveUnreachable);e({status:n.status,consecutiveUnreachable:n.consecutiveUnreachable,lastChecked:Date.now()})}var u,d,f,p,m;function h(){return(h=e((()=>{i(),u=3e4,d=15e3,f=a((e,t)=>({status:`unknown`,lastChecked:null,consecutiveUnreachable:0,probe:async()=>{await l(e,t)},startPolling:()=>{l(e,t);let n=setInterval(()=>void l(e,t),u);return()=>clearInterval(n)}})),p=()=>f(e=>e.status!==`offline`),m=()=>f(e=>e.status)})))()}function g({size:e=32,sx:t}){return(0,_.jsxs)(r,{component:`svg`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 210 210`,sx:{width:e,height:e,flexShrink:0,...t},children:[(0,_.jsx)(`defs`,{children:(0,_.jsxs)(`linearGradient`,{id:`omni-logo-grad`,x1:`105`,y1:`165.47`,x2:`105`,y2:`52.73`,gradientUnits:`userSpaceOnUse`,children:[(0,_.jsx)(`stop`,{offset:`0`,stopColor:`#ff4fff`}),(0,_.jsx)(`stop`,{offset:`0.01`,stopColor:`#ff51fb`}),(0,_.jsx)(`stop`,{offset:`0.29`,stopColor:`#ff75af`}),(0,_.jsx)(`stop`,{offset:`0.53`,stopColor:`#ff9272`}),(0,_.jsx)(`stop`,{offset:`0.73`,stopColor:`#ffa747`}),(0,_.jsx)(`stop`,{offset:`0.89`,stopColor:`#ffb32c`}),(0,_.jsx)(`stop`,{offset:`0.98`,stopColor:`#ffb822`})]})}),(0,_.jsx)(`path`,{fill:`url(#omni-logo-grad)`,d:`M66.92,144.68l-27,15.59L102,52.73V83.92Zm3,5.2-27,15.59H167.09l-27-15.59Zm100.17,10.39L108,52.73V83.92l35.08,60.76Zm-34.4-16.39L105,90.72,74.31,143.88Z`})]})}var _;function v(){return(v=e((()=>{n(),_=t()})))()}export{m as a,p as i,v as n,f as o,h as r,g as t};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{b as r,h as i,y as a}from"./client-DFnuv2z3.js";import{F as o,H as s,I as c,Q as l,V as u,Z as d,c as f,d as p,f as m,g as h,h as ee,m as g,n as _,p as te,s as ne,t as v}from"./mui-BXSXx9c9.js";import{B as y,a as b,o as x,z as S}from"./mui-Cd711nOk.js";import{E as C,T as w,it as T,l as E,rt as D,u as O}from"./mui-AnEgAVjz.js";import{_ as k,v as A}from"./mui-BwsIrivo.js";import{r as j,t as M}from"./alert-uBG6r9NW.js";import{n as N,s as P}from"./access-BvKK9dEv.js";import{n as F,t as I}from"./use-polled-resource-B22hhr5L.js";import{A as L,G as R,M as re,k as ie,l as ae}from"./icons-OboZgWSt.js";import{n as z,t as B}from"./operation-status-Bm1x1wTz.js";import{n as V,t as oe}from"./page-breadcrumbs-fR7Jmpp4.js";import{n as H,t as se}from"./admin-data-table-BKSDI8sU.js";import{n as U,t as ce}from"./confirm-dialog-BbGsAz7_.js";import{r as le,t as ue}from"./formatters-RnRy4bXm.js";import{n as de,t as W}from"./settled-pair-B-wgSZl6.js";import{n as fe,r as G}from"./tabs-k5NPGLnJ.js";function pe({definition:e,onClose:t,onSaved:n}){let[i,s]=(0,K.useState)(e?.name??``),[c,l]=(0,K.useState)(e?.description??``),[d,f]=(0,K.useState)(e?.steps??[{name:`inspect`,kind:`xec`,run:J}]),[m,h]=(0,K.useState)(`0`),[g,_]=(0,K.useState)(!1),[v,y]=(0,K.useState)(``),[x,C]=(0,K.useState)(null),[w,T]=(0,K.useState)(!1),[D,O]=(0,K.useState)(!1),[A,j]=(0,K.useState)(!1),N=F(()=>a.listNodes(),{intervalMs:3e4}),P=Number(m),I=d[P],L=e=>{f(t=>t.map((t,n)=>n===P?{...t,...e}:t)),O(!0)},R=()=>{w||(D?j(!0):t())};return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(ee,{open:!0,onClose:R,maxWidth:`lg`,fullWidth:!0,slotProps:{paper:{sx:{maxHeight:`calc(100dvh - 32px)`,m:2,width:`calc(100% - 32px)`}}},children:[(0,q.jsx)(ne,{children:e?`Edit automation`:`New automation`}),(0,q.jsxs)(p,{dividers:!0,sx:{minWidth:0},children:[(0,q.jsx)(B,{active:w,label:`Saving automation definition`}),(0,q.jsxs)(k,{spacing:2,children:[x&&(0,q.jsx)(M,{severity:`error`,variant:`outlined`,children:x}),(0,q.jsxs)(k,{direction:{xs:`column`,sm:`row`},spacing:2,children:[(0,q.jsx)(b,{autoFocus:!0,label:`Name`,size:`small`,value:i,fullWidth:!0,onChange:e=>{s(e.target.value),O(!0)}}),(0,q.jsx)(b,{label:`Description`,size:`small`,value:c,fullWidth:!0,onChange:e=>{l(e.target.value),O(!0)}})]}),(0,q.jsxs)(k,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,flexWrap:`wrap`,gap:1},children:[(0,q.jsx)(S,{variant:`caption`,color:`text.secondary`,children:`Save a definition, then review its target before running.`}),(0,q.jsx)(o,{size:`small`,onClick:()=>{if(!g)y(JSON.stringify(d,null,2)),_(!0);else try{let e=JSON.parse(v);if(!Array.isArray(e)||!e.length||e.some(e=>typeof e?.name!=`string`||typeof e?.run!=`string`))throw Error(`A non-empty array of named steps is required`);f(e),h(`0`),_(!1),C(null)}catch(e){C(String(e))}},children:g?`Step editor`:`Advanced JSON`})]}),g?(0,q.jsx)(b,{label:`Steps JSON`,multiline:!0,minRows:14,maxRows:28,fullWidth:!0,value:v,onChange:e=>{y(e.target.value),O(!0)},slotProps:{input:{sx:{fontFamily:`monospace`,fontSize:13}},htmlInput:{spellCheck:!1}}}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(fe,{value:m,onChange:h,variant:`scrollable`,scrollButtons:`auto`,"aria-label":`Automation steps`,tabs:d.map((e,t)=>({value:String(t),label:e.name||`Step ${t+1}`,closable:d.length>1})),onClose:e=>{let t=Number(e);f(e=>e.filter((e,n)=>n!==t)),h(String(Math.max(0,Math.min(P-+(t<P),d.length-2)))),O(!0)},action:(0,q.jsx)(o,{size:`small`,disabled:d.length>=32,onClick:()=>{f(e=>[...e,{name:`step-${e.length+1}`,kind:`xec`,run:J}]),h(String(d.length)),O(!0)},children:`Add step`})}),(0,q.jsxs)(u,{sx:{display:`grid`,gap:2,gridTemplateColumns:{xs:`1fr`,md:`minmax(0, 1fr) 260px`},minWidth:0},children:[(0,q.jsx)(b,{label:I.kind===`xec`?`Xec · TypeScript`:`Shell command`,multiline:!0,minRows:13,maxRows:26,fullWidth:!0,value:I.run,onChange:e=>L({run:e.target.value}),helperText:I.kind===`xec`?`$ runs locally · $target uses the selected node · params contains run input`:`Parameters are JSON in OMNITRON_PARAMS; shell interpolation is disabled`,slotProps:{input:{sx:{fontFamily:`monospace`,fontSize:13,lineHeight:1.7}},htmlInput:{spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`}}}),(0,q.jsxs)(k,{spacing:2,children:[(0,q.jsx)(b,{label:`Step name`,size:`small`,value:I.name,onChange:e=>L({name:e.target.value})}),(0,q.jsxs)(b,{select:!0,label:`Executor`,size:`small`,value:I.kind??`shell`,onChange:e=>L({kind:e.target.value}),children:[(0,q.jsx)(E,{value:`xec`,children:`Xec · TypeScript`}),(0,q.jsx)(E,{value:`shell`,children:`Shell`})]}),(0,q.jsxs)(b,{select:!0,label:`Target`,size:`small`,value:I.nodeId??`local`,onChange:e=>L({nodeId:e.target.value}),children:[(0,q.jsx)(E,{value:`local`,children:`Local daemon host`}),(N.data??[]).filter(e=>!e.isLocal).map(e=>(0,q.jsx)(E,{value:e.id,children:e.name},e.id)),I.nodeId&&I.nodeId!==`local`&&!N.data?.some(e=>e.id===I.nodeId)&&(0,q.jsxs)(E,{value:I.nodeId,children:[`Unavailable · `,I.nodeId]})]}),N.error&&(0,q.jsxs)(M,{severity:`warning`,variant:`outlined`,children:[`Node list unavailable: `,N.error]}),(0,q.jsx)(b,{label:`Working directory`,size:`small`,value:I.cwd??``,placeholder:`Daemon working directory`,onChange:e=>L({cwd:e.target.value||void 0})}),(0,q.jsx)(b,{label:`Timeout (seconds)`,type:`number`,size:`small`,value:(I.timeout??3e5)/1e3,onChange:e=>L({timeout:Number(e.target.value)*1e3})}),(0,q.jsx)(b,{label:`Depends on`,size:`small`,value:(I.dependsOn??[]).join(`, `),helperText:`Step names, separated by commas`,onChange:e=>L({dependsOn:e.target.value.split(`,`).map(e=>e.trim()).filter(Boolean)})})]})]}),(0,q.jsx)(S,{variant:`caption`,color:`text.secondary`,children:`Scripts run with the daemon host's OS permissions. Remote targets require a trusted SSH host key. Use only reviewed code.`})]})]})]}),(0,q.jsxs)(te,{children:[(0,q.jsx)(o,{onClick:R,disabled:w,children:`Cancel`}),(0,q.jsx)(o,{variant:`contained`,loading:w,onClick:async()=>{T(!0),C(null);try{let a={name:i,description:c,steps:g?JSON.parse(v):d,triggers:e?.triggers??[]};if(e){if(!e.conditionalUpdates)throw Error(`Update the daemon to support conditional pipeline edits`);await r.updatePipeline({id:e.id,definition:a,expectedRevision:e.revision})}else await r.createPipeline(a);n(),t()}catch(e){C(e instanceof Error?e.message:`Could not save the pipeline`)}finally{T(!1)}},disabled:w||!i.trim(),children:w?`Saving…`:`Save definition`})]})]}),(0,q.jsx)(ce,{open:A,onClose:()=>j(!1),onConfirm:t,title:`Discard edits?`,content:`Your unsaved automation changes will be lost.`,confirmLabel:`Discard`,confirmColor:`error`})]})}var K,q,J;function me(){return(me=e((()=>{z(),K=t(),s(),c(),h(),g(),m(),f(),O(),A(),x(),y(),G(),j(),U(),i(),I(),q=n(),J=`const result = await $target\`uname -s\`;
|
|
2
|
-
console.log(result.stdout);
|
|
3
|
-
`})))()}function he({run:e,targetLabel:t=e=>e??`Local daemon host`}){return(0,X.jsxs)(k,{spacing:2,sx:{minWidth:0},children:[(0,X.jsxs)(k,{direction:`row`,sx:{flexWrap:`wrap`,gap:1,alignItems:`center`},children:[(0,X.jsx)(d,{size:`small`,label:e.status,color:Z[e.status]??`default`}),(0,X.jsxs)(S,{variant:`caption`,children:[ue(e.startedAt),` · `,e.triggeredBy]})]}),(0,X.jsx)(S,{variant:`caption`,sx:{fontFamily:`monospace`,overflowWrap:`anywhere`},children:e.id}),Q(e)&&(0,X.jsx)(w,{"aria-label":`Automation in progress`}),e.status===`interrupted`&&(0,X.jsx)(M,{severity:`warning`,variant:`outlined`,children:`The executor stopped before recording completion. Inspect effects before starting another run.`}),e.steps.map(e=>(0,X.jsxs)(u,{sx:{border:1,borderColor:`divider`,borderRadius:1,p:1.5,minWidth:0},children:[(0,X.jsxs)(k,{direction:`row`,sx:{flexWrap:`wrap`,alignItems:`center`,gap:1,mb:1},children:[(0,X.jsx)(S,{variant:`subtitle2`,sx:{flex:1,overflowWrap:`anywhere`},children:e.name}),(0,X.jsx)(d,{size:`small`,label:e.status,color:Z[e.status]??`default`}),(0,X.jsxs)(S,{variant:`caption`,color:`text.secondary`,children:[le(e.duration),e.attempts?` · attempt ${e.attempts}`:``,e.exitCode!==void 0&&` · exit ${e.exitCode}`]})]}),(0,X.jsxs)(S,{variant:`caption`,color:`text.secondary`,sx:{display:`block`,mb:1,overflowWrap:`anywhere`},children:[e.kind??`shell`,` · `,t(e.nodeId)]}),e.error&&(0,X.jsx)(M,{severity:`error`,variant:`outlined`,sx:{mb:1,overflowWrap:`anywhere`},children:e.error}),e.output&&(0,X.jsx)(u,{component:`pre`,"aria-label":`${e.name} stdout`,tabIndex:0,sx:$,children:e.output}),e.stderr&&(0,X.jsx)(u,{component:`pre`,"aria-label":`${e.name} stderr`,tabIndex:0,sx:{...$,mt:1},children:e.stderr}),e.outputTruncated&&(0,X.jsx)(S,{variant:`caption`,color:`warning.main`,children:`Output retention limit reached; earlier content was omitted.`}),e.sourceHash&&(0,X.jsxs)(S,{variant:`caption`,color:`text.secondary`,sx:{display:`block`,mt:1,overflowWrap:`anywhere`,fontFamily:`monospace`},children:[`SHA-256 `,e.sourceHash]})]},e.name))]})}function ge(){let[e,t]=(0,Y.useState)(null),[n,i]=(0,Y.useState)(`definitions`),[s,c]=(0,Y.useState)(null),[l,f]=(0,Y.useState)(null),[m,h]=(0,Y.useState)(`{}`),[g,_]=(0,Y.useState)(null),[y,x]=(0,Y.useState)(!1),[C,w]=(0,Y.useState)(null),[T,E]=(0,Y.useState)(0),[O,A]=(0,Y.useState)(25),j=F(()=>a.listNodes(),{intervalMs:3e4,enabled:!!(l||s)}),P=e=>!e||e===`local`?`Local daemon host`:j.data?.find(t=>t.id===e)?.name??e,{data:I,loading:R,error:z,refresh:B}=F(async()=>{let e=await de([r.listPipelines(),r.listRuns({limit:100})],[[],[]]);return{definitions:e.first,runs:e.second,partialFailure:e.partialFailure}},{intervalMs:3e3}),V=I?.definitions??[],H=I?.runs??[],U=F(()=>r.getRunStatus({runId:s}),{intervalMs:3e3,enabled:!!s,resourceKey:s}),W=U.data?.id===s?U.data:null,G=async e=>{x(!0),_(null);try{await e(),await B()}catch(e){_(_e(e))}finally{x(!1)}};return(0,X.jsxs)(k,{spacing:2,sx:{minWidth:0},children:[(0,X.jsx)(oe,{links:[{name:`Pipelines`}],action:(0,X.jsxs)(k,{direction:`row`,spacing:1,children:[(0,X.jsx)(D,{"data-console-command":`refresh`,size:`small`,title:`Refresh pipelines`,onClick:B,children:(0,X.jsx)(re,{})}),(0,X.jsx)(N,{permission:`OmnitronPipelines.createPipeline`,children:(0,X.jsx)(o,{size:`small`,variant:`contained`,startIcon:(0,X.jsx)(L,{}),onClick:()=>t(`new`),children:`New automation`})})]})}),(z||I?.partialFailure||g)&&(0,X.jsxs)(M,{severity:`warning`,variant:`outlined`,children:[g??z??I?.partialFailure,` · Displayed run state may be stale.`]}),(0,X.jsx)(fe,{value:n,onChange:e=>{i(e),E(0)},"aria-label":`Pipeline views`,tabs:[{value:`definitions`,label:`Automations · ${V.length}`},{value:`runs`,label:`Runs · ${H.length}`}]}),n===`definitions`?(0,X.jsx)(se,{data:V.slice(T*O,(T+1)*O),columns:[{key:`name`,header:`Automation`,render:e=>(0,X.jsx)(o,{size:`small`,onClick:()=>t(e),sx:{textAlign:`left`},children:e.name})},{key:`description`,header:`Description`,render:e=>e.description||`—`},{key:`steps`,header:`Steps`,render:e=>e.steps.length},{key:`actions`,header:``,align:`right`,render:e=>(0,X.jsxs)(k,{direction:`row`,sx:{justifyContent:`flex-end`,gap:1},children:[(0,X.jsx)(N,{permission:`OmnitronPipelines.executePipeline`,children:(0,X.jsx)(o,{size:`small`,startIcon:(0,X.jsx)(ie,{}),disabled:y,onClick:()=>{f(e),h(`{}`),_(null)},children:`Run`})}),(0,X.jsx)(N,{permission:`OmnitronPipelines.deletePipeline`,children:(0,X.jsx)(D,{size:`small`,title:`Delete ${e.name}`,disabled:y,onClick:()=>w(e),children:(0,X.jsx)(ae,{})})})]})}],rowKey:e=>e.id,total:V.length,page:T,pageSize:O,onPageChange:E,onPageSizeChange:e=>{A(e),E(0)},loading:R,loadError:z??I?.partialFailure,emptyMessage:`Create an automation to run Xec scripts and shell steps.`,minWidth:560,scrollLabel:`Automation definitions`,dense:!0}):(0,X.jsx)(se,{data:H.slice(T*O,(T+1)*O),columns:[{key:`name`,header:`Automation`,render:e=>(0,X.jsx)(o,{size:`small`,onClick:()=>c(e.id),children:V.find(t=>t.id===e.pipelineId)?.name??e.pipelineId.slice(0,8)})},{key:`status`,header:`Status`,render:e=>(0,X.jsx)(d,{size:`small`,label:e.status,color:Z[e.status]??`default`})},{key:`startedAt`,header:`Started`,render:e=>ue(e.startedAt)},{key:`duration`,header:`Duration`,render:e=>le(Date.parse(e.completedAt??new Date().toISOString())-Date.parse(e.startedAt))},{key:`triggeredBy`,header:`Actor`,render:e=>e.triggeredBy}],rowKey:e=>e.id,total:H.length,page:T,pageSize:O,onPageChange:E,onPageSizeChange:e=>{A(e),E(0)},loading:R,loadError:z??I?.partialFailure,emptyMessage:`No automation runs yet.`,minWidth:620,scrollLabel:`Automation run history`,dense:!0}),e&&(0,X.jsx)(pe,{...e===`new`?{}:{definition:e},onClose:()=>t(null),onSaved:()=>{B()}}),(0,X.jsxs)(ee,{open:!!l,onClose:()=>{y||f(null)},maxWidth:`md`,fullWidth:!0,children:[(0,X.jsxs)(ne,{children:[`Run `,l?.name]}),(0,X.jsx)(p,{dividers:!0,children:(0,X.jsxs)(k,{spacing:2,children:[g&&(0,X.jsx)(M,{severity:`error`,variant:`outlined`,children:g}),j.error&&(0,X.jsx)(M,{severity:`warning`,variant:`outlined`,children:`Node names unavailable; verify target IDs below.`}),l?.steps.map(e=>(0,X.jsxs)(u,{component:`details`,children:[(0,X.jsxs)(u,{component:`summary`,sx:{cursor:`pointer`,fontSize:13},children:[e.name,` · `,e.kind??`shell`,` · `,P(e.nodeId),` · `,(e.timeout??3e5)/1e3,`s`]}),(0,X.jsx)(u,{component:`pre`,sx:{...$,mt:1},children:e.run}),(0,X.jsx)(u,{component:`pre`,"aria-label":`${e.name} execution settings`,sx:{...$,mt:1},children:JSON.stringify({targetId:e.nodeId??`local`,cwd:e.cwd??`Daemon working directory`,dependsOn:e.dependsOn??[],retries:e.retries??0,condition:e.condition??null,env:e.env??{}},null,2)})]},e.name)),(0,X.jsx)(b,{label:`Parameters (JSON)`,value:m,onChange:e=>h(e.target.value),multiline:!0,minRows:3,fullWidth:!0,helperText:`Values are passed as data and are not stored in run history.`,slotProps:{input:{sx:{fontFamily:`monospace`,fontSize:13}}}})]})}),(0,X.jsxs)(te,{children:[(0,X.jsx)(o,{disabled:y,onClick:()=>f(null),children:`Cancel`}),(0,X.jsx)(o,{disabled:y,variant:`contained`,onClick:()=>G(async()=>{let e=await r.executePipeline({id:l.id,expectedRevision:l.revision,params:JSON.parse(m)});c(e.id),i(`runs`),E(0),f(null)}),children:y?`Starting…`:`Run automation`})]})]}),(0,X.jsxs)(v,{anchor:`right`,open:!!s,onClose:()=>c(null),slotProps:{paper:{sx:{width:{xs:`100%`,sm:640},maxWidth:`100vw`,p:2,boxSizing:`border-box`}}},children:[(0,X.jsxs)(k,{direction:`row`,sx:{alignItems:`center`,justifyContent:`space-between`,mb:2},children:[(0,X.jsx)(S,{variant:`subtitle2`,children:`Run details`}),(0,X.jsx)(D,{title:`Close run details`,onClick:()=>c(null),children:(0,X.jsx)(ae,{})})]}),U.error&&(0,X.jsx)(M,{severity:`warning`,variant:`outlined`,children:`Updates unavailable. The displayed state may be stale.`}),g&&(0,X.jsx)(M,{severity:`error`,variant:`outlined`,sx:{mb:2},children:g}),W?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(he,{run:W,targetLabel:P}),(0,X.jsx)(N,{permission:`OmnitronPipelines.cancelRun`,children:Q(W)&&(0,X.jsx)(o,{sx:{mt:2},color:`warning`,variant:`outlined`,disabled:y||W.status===`cancelling`,onClick:()=>G(async()=>{await r.cancelRun({runId:W.id}),await U.refresh()}),children:`Cancel run`})})]}):(0,X.jsx)(M,{severity:`info`,variant:`outlined`,children:U.loading?`Loading run state…`:`Run state is unavailable.`})]}),(0,X.jsx)(ce,{open:!!C,onClose:()=>{y||w(null)},onConfirm:()=>G(async()=>{await r.deletePipeline({id:C.id}),w(null)}),title:`Delete automation?`,content:`${C?.name??``} and its run history will be removed. Active runs must be stopped first.`,confirmLabel:`Delete`,confirmColor:`error`})]})}var Y,X,Z,Q,_e,$;function ve(){return(ve=e((()=>{Y=t(),s(),c(),l(),h(),g(),m(),f(),_(),T(),C(),A(),x(),y(),G(),H(),j(),U(),P(),R(),V(),me(),i(),I(),W(),X=n(),Z={success:`success`,failed:`error`,running:`info`,pending:`default`,cancelling:`warning`,interrupted:`warning`,cancelled:`default`},Q=e=>[`pending`,`running`,`cancelling`].includes(e.status),_e=e=>e instanceof Error?e.message:String(e),$={m:0,p:1.5,borderRadius:1,bgcolor:`action.hover`,fontFamily:`monospace`,fontSize:12,whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,maxHeight:320,overflow:`auto`,minWidth:0}})))()}ve();export{he as PipelineRunDetail,ge as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{h as r,i,o as a}from"./client-DFnuv2z3.js";import{n as o}from"./services-BddvcFi8.js";import{D as s,E as c,F as l,H as u,I as d,M as f,O as p,Q as m,T as h,V as g,Z as _,ct as v,i as y,j as b,r as x,st as S}from"./mui-BXSXx9c9.js";import{B as C,a as w,o as T,z as E}from"./mui-Cd711nOk.js";import{A as ee,G as D,K as te,U as O,W as ne,it as re,k,l as ie,rt as A,u as ae}from"./mui-AnEgAVjz.js";import{C as oe,_ as j,n as se,t as M,v as N,w as ce}from"./mui-BwsIrivo.js";import{n as P,r as F,t as I}from"./alert-uBG6r9NW.js";import{t as le}from"./auth-CcgjP7hR.js";import{n as L,t as ue}from"./store-bqUBn2A4.js";import{n as de,t as fe}from"./use-polled-resource-B22hhr5L.js";import{a as pe}from"./storage-CKXnhqkt.js";import{G as me,g as R,p as z}from"./icons-OboZgWSt.js";import{n as he,r as ge}from"./alert-expression-CSblScoa.js";import{a as _e,c as ve,l as B,n as V,r as H,s as U,t as ye}from"./alert-notify-settings-C_CHZrFm.js";import{n as be,t as xe}from"./table-BOWT6Y9d.js";import{n as Se,t as Ce}from"./page-breadcrumbs-fR7Jmpp4.js";import{l as we,n as W}from"./formatters-RnRy4bXm.js";import{n as Te,r as Ee,t as G}from"./tabs-k5NPGLnJ.js";function De(){let{data:e,error:t}=de(()=>a.status(),{intervalMs:5e3}),n=e?.connection;return(0,K.jsx)(b,{variant:`outlined`,sx:{minWidth:0,maxWidth:480},children:(0,K.jsx)(s,{sx:{p:2,"&:last-child":{pb:2}},children:(0,K.jsxs)(j,{spacing:1.5,children:[(0,K.jsx)(E,{variant:`subtitle2`,children:`Execution control`}),t&&(0,K.jsxs)(I,{severity:`warning`,children:[`Cannot refresh execution control: `,t,`. Any values below are the last observation.`]}),!e&&!t&&(0,K.jsx)(E,{variant:`body2`,color:`text.secondary`,children:`Waiting for the backend.`}),e&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(j,{direction:`row`,useFlexGap:!0,spacing:1,sx:{flexWrap:`wrap`},children:[(0,K.jsx)(_,{size:`small`,variant:`outlined`,label:e.mode===`resident`?`Resident owner`:`Coupled execution`}),n&&(0,K.jsx)(_,{size:`small`,variant:`outlined`,color:t?`default`:n.status===`connected`?`success`:`warning`,label:t?`Last observed`:n.status===`connected`?`Owner connected`:n.status===`owner-changed`?`Owner identity changed`:`Owner unavailable`})]}),e.owner&&(0,K.jsxs)(E,{variant:`body2`,sx:{fontVariantNumeric:`tabular-nums`,overflowWrap:`anywhere`},children:[`Owner PID `,e.owner.pid,` · epoch `,e.epoch,` · `,e.phase]}),e.supervision&&(0,K.jsxs)(E,{variant:`body2`,color:`text.secondary`,sx:{overflowWrap:`anywhere`},children:[`Independent OS supervision · guardian PID `,e.supervision.guardianPid]}),n?.observedAt&&(0,K.jsxs)(E,{variant:`caption`,color:`text.secondary`,children:[`Last owner observation: `,W(n.observedAt)]}),!t&&n?.error&&(0,K.jsxs)(I,{severity:`warning`,children:[n.error,`. Application state is unknown; a lost control channel does not establish that applications stopped.`]}),e.reason&&(0,K.jsx)(E,{variant:`body2`,color:`text.secondary`,children:e.reason}),e.mode===`resident`&&!n&&(0,K.jsx)(E,{variant:`body2`,color:`text.secondary`,children:`This backend does not report owner connection freshness.`}),e.recovery&&(0,K.jsxs)(E,{variant:`body2`,color:`text.secondary`,sx:{overflowWrap:`anywhere`},children:[`Recovery checkpoint: `,e.recovery.status,e.recovery.reason?` · ${e.recovery.reason}`:``]})]})]})})})}var K;function q(){return(q=e((()=>{f(),p(),m(),N(),C(),F(),r(),fe(),K=n()})))()}function J({label:e,value:t,mono:n}){return(0,X.jsxs)(j,{direction:`row`,sx:{justifyContent:`space-between`,alignItems:`center`,gap:2,minWidth:0,py:.5},children:[(0,X.jsx)(E,{variant:`body2`,sx:{color:`text.secondary`},children:e}),(0,X.jsx)(E,{component:`div`,variant:`body2`,sx:{fontWeight:600,minWidth:0,overflowWrap:`anywhere`,textAlign:`right`,...n&&{fontFamily:`monospace`,fontSize:`0.8rem`}},children:t})]})}function Oe(){let e=L(e=>e.user);return e?(0,X.jsxs)(j,{spacing:2,children:[(0,X.jsxs)(b,{variant:`outlined`,sx:{...Z,maxWidth:480},children:[(0,X.jsx)(h,{title:`Profile`,subheader:`Account information`}),(0,X.jsx)(s,{sx:{...Q,pt:0},children:(0,X.jsxs)(j,{spacing:.5,children:[(0,X.jsx)(J,{label:`Username`,value:e.username,mono:!0}),(0,X.jsx)(J,{label:`Display Name`,value:e.displayName}),(0,X.jsx)(J,{label:`Role`,value:(0,X.jsx)(_,{label:e.role,size:`small`,variant:`outlined`,sx:{height:22,fontSize:`0.7rem`,fontWeight:600}})}),(0,X.jsx)(J,{label:`User ID`,value:e.id,mono:!0})]})})]}),(0,X.jsx)(De,{})]}):null}function ke(){let[e,t]=(0,Y.useState)(``),[n,r]=(0,Y.useState)(``),[a,o]=(0,Y.useState)(``),[c,u]=(0,Y.useState)(!1),[d,f]=(0,Y.useState)(!1),[p,m]=(0,Y.useState)(!1),[g,_]=(0,Y.useState)(!1),[v,y]=(0,Y.useState)(null),x=async s=>{if(s.preventDefault(),y(null),_(!1),!e||!n){y(`All fields are required.`);return}if(n!==a){y(`New passwords do not match.`);return}let c=le(n);if(c)y(c);else{m(!0);try{await i.changePassword({oldPassword:e,newPassword:n}),_(!0),t(``),r(``),o(``)}catch(e){y(e?.message??`Failed to change password`)}finally{m(!1)}}};return(0,X.jsxs)(b,{variant:`outlined`,sx:{...Z,maxWidth:480},children:[(0,X.jsx)(h,{slotProps:{title:{variant:`subtitle1`,fontWeight:700},subheader:{variant:`caption`}},title:`Change Password`,subheader:`Update your account credentials`}),(0,X.jsxs)(s,{sx:{...Q,pt:0},children:[g&&(0,X.jsx)(I,{closable:!0,severity:`success`,variant:`outlined`,sx:{mb:2},onClose:()=>_(!1),children:`Password changed successfully.`}),v&&(0,X.jsx)(P,{sx:{mb:2},onClose:()=>y(null),children:v}),(0,X.jsx)(`form`,{onSubmit:x,noValidate:!0,children:(0,X.jsxs)(j,{spacing:2,children:[(0,X.jsx)(w,{size:`small`,label:`Current Password`,type:c?`text`:`password`,value:e,onChange:e=>t(e.target.value),autoComplete:`current-password`,fullWidth:!0,slotProps:{input:{endAdornment:(0,X.jsx)(k,{position:`end`,children:(0,X.jsx)(A,{size:`small`,onClick:()=>u(!c),edge:`end`,children:(0,X.jsx)(R,{open:c,sx:{fontSize:18}})})})}}}),(0,X.jsx)(w,{size:`small`,label:`New Password`,type:d?`text`:`password`,value:n,onChange:e=>r(e.target.value),autoComplete:`new-password`,fullWidth:!0,slotProps:{input:{endAdornment:(0,X.jsx)(k,{position:`end`,children:(0,X.jsx)(A,{size:`small`,onClick:()=>f(!d),edge:`end`,children:(0,X.jsx)(R,{open:d,sx:{fontSize:18}})})})}}}),(0,X.jsx)(w,{size:`small`,label:`Confirm New Password`,type:d?`text`:`password`,value:a,onChange:e=>o(e.target.value),autoComplete:`new-password`,fullWidth:!0}),(0,X.jsx)(l,{type:`submit`,variant:`contained`,size:`small`,disabled:p,startIcon:p?(0,X.jsx)(S,{size:16,color:`inherit`}):void 0,sx:{alignSelf:`flex-start`},children:p?`Changing...`:`Change Password`})]})})]})]})}function Ae(){let e=L(e=>e.user),[t,n]=(0,Y.useState)([]),[r,a]=(0,Y.useState)(!0),[o,s]=(0,Y.useState)(null),[c,u]=(0,Y.useState)(null),d=(0,Y.useCallback)(async()=>{if(e)try{let e=await i.getActiveSessions();n(Array.isArray(e)?e:[]),s(null)}catch(e){s(e?.message??`Failed to fetch sessions`)}finally{a(!1)}},[e]);(0,Y.useEffect)(()=>{d()},[d]);let f=async e=>{u(e);try{await i.signOut({sessionId:e}),n(t=>t.filter(t=>t.id!==e))}catch(e){s(`Failed to revoke: ${e?.message??`Unknown error`}`)}finally{u(null)}};return(0,X.jsxs)(b,{variant:`outlined`,sx:Z,children:[(0,X.jsx)(h,{slotProps:{subheader:{variant:`caption`},title:{variant:`subtitle1`,fontWeight:700}},title:`Active Sessions`,subheader:r?`Loading...`:`${t.length} active session${t.length===1?``:`s`}`,action:t.filter(e=>!e.current).length>1?(0,X.jsx)(l,{size:`small`,color:`error`,variant:`text`,onClick:async()=>{for(let e of t.filter(e=>!e.current))try{await i.signOut({sessionId:e.id})}catch{}await d()},sx:{fontSize:`0.7rem`},children:`Revoke All Others`}):void 0}),o&&(0,X.jsx)(P,{sx:{mx:2,mb:1},onClose:()=>s(null),children:o}),(0,X.jsx)(xe,{scrollLabel:`Active sessions`,sx:{minWidth:560},columns:[{id:`id`,label:`Session`,render:e=>(0,X.jsxs)(j,{direction:`row`,spacing:1,sx:{alignItems:`center`},children:[(0,X.jsxs)(E,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:12},children:[e.id.slice(0,8),`...`]}),e.current&&(0,X.jsx)(_,{label:`current`,size:`small`,color:`primary`,variant:`outlined`,sx:{height:20,fontSize:10}})]})},{id:`ipAddress`,label:`IP Address`,render:e=>(0,X.jsx)(E,{variant:`body2`,sx:{fontFamily:`monospace`,fontSize:12},children:e.ipAddress??`--`})},{id:`createdAt`,label:`Created`,render:e=>(0,X.jsx)(E,{variant:`caption`,sx:{color:`text.secondary`},children:we(e.createdAt)})},{id:`expiresAt`,label:`Expires`,render:e=>(0,X.jsx)(E,{variant:`caption`,sx:{color:`text.secondary`},children:W(e.expiresAt)})},{id:`actions`,label:`Actions`,align:`center`,render:e=>e.current?null:(0,X.jsx)(A,{size:`small`,color:`error`,disabled:c===e.id,onClick:()=>f(e.id),title:`Revoke session`,children:c===e.id?(0,X.jsx)(S,{size:16,color:`inherit`}):(0,X.jsx)(z,{sx:{fontSize:18}})})}],data:t,rowKey:e=>e.id,loading:r,loadingRows:2,dense:!0,containerSx:{border:`none`,borderRadius:0},emptyContent:(0,X.jsx)(E,{variant:`body2`,sx:{color:`text.secondary`},children:`No active sessions found.`})})]})}function je(){let[e,t]=(0,Y.useState)(()=>U(V,!1)),[n,r]=(0,Y.useState)(()=>U(H,!0)),[i,a]=(0,Y.useState)(()=>ve()),[o,c]=(0,Y.useState)(()=>typeof Notification<`u`?Notification.permission:`unsupported`),l=async(e,n)=>{if(n&&typeof Notification<`u`&&Notification.permission==="default"){let e=await Notification.requestPermission();if(c(e),e!==`granted`){t(!1),B(V,!1);return}}t(n),B(V,n)};return(0,X.jsxs)(b,{variant:`outlined`,sx:{...Z,maxWidth:480},children:[(0,X.jsx)(h,{slotProps:{subheader:{variant:`caption`},title:{variant:`subtitle1`,fontWeight:700}},title:`Notifications`,subheader:`Configure alert delivery preferences`}),(0,X.jsx)(s,{sx:{...Q,pt:0},children:(0,X.jsxs)(j,{spacing:3,children:[(0,X.jsx)(O,{control:(0,X.jsx)(M,{size:`small`,checked:e,onChange:l,disabled:o===`denied`}),label:(0,X.jsxs)(g,{children:[(0,X.jsx)(E,{variant:`body2`,sx:{fontWeight:600},children:`Desktop notifications`}),(0,X.jsx)(E,{variant:`caption`,sx:{color:`text.secondary`},children:o===`denied`?`Blocked by browser — enable in site settings`:o===`unsupported`?`Not supported`:`Show browser notifications for alerts`})]}),sx:{alignItems:`flex-start`,ml:0}}),(0,X.jsx)(O,{control:(0,X.jsx)(M,{size:`small`,checked:n,onChange:(e,t)=>{r(t),B(H,t)}}),label:(0,X.jsxs)(g,{children:[(0,X.jsx)(E,{variant:`body2`,sx:{fontWeight:600},children:`Sound alerts`}),(0,X.jsx)(E,{variant:`caption`,sx:{color:`text.secondary`},children:`Play a tone when an alert fires at or above the minimum severity`})]}),sx:{alignItems:`flex-start`,ml:0}}),(0,X.jsx)(x,{}),(0,X.jsxs)(g,{children:[(0,X.jsx)(E,{variant:`body2`,sx:{fontWeight:600,mb:1},children:`Minimum alert severity`}),(0,X.jsx)(E,{variant:`caption`,sx:{color:`text.secondary`,mb:1.5,display:`block`},children:`Only receive notifications at or above this level`}),(0,X.jsx)(D,{size:`small`,fullWidth:!0,children:(0,X.jsx)(oe,{inputProps:{"aria-label":`Minimum alert severity`},value:i,onChange:e=>{a(e.target.value),pe(ye,e.target.value)},children:he.map(e=>(0,X.jsx)(ie,{value:e,sx:{textTransform:`capitalize`},children:e},e))})})]})]})})]})}function Me(){return(0,X.jsxs)(j,{spacing:2,children:[(0,X.jsx)(Ce,{heading:`Settings`,links:[{name:`System`},{name:`Settings`}]}),(0,X.jsxs)(Te,{defaultValue:`general`,keepMounted:!0,children:[(0,X.jsx)(G,{value:`general`,label:`General`,children:(0,X.jsx)(Oe,{})}),(0,X.jsx)(G,{value:`security`,label:`Security`,children:(0,X.jsx)(ke,{})}),(0,X.jsx)(G,{value:`sessions`,label:`Sessions`,children:(0,X.jsx)(Ae,{})}),(0,X.jsx)(G,{value:`notifications`,label:`Notifications`,children:(0,X.jsx)(je,{})})]})]})}var Y,X,Z,Q;function $(){return($=e((()=>{Se(),q(),Y=t(),f(),p(),c(),C(),N(),T(),d(),re(),m(),ee(),v(),se(),ne(),ae(),ce(),te(),y(),u(),me(),F(),Ee(),be(),ue(),r(),o(),ge(),_e(),X=n(),Z={borderRadius:2},Q={p:3,"&:last-child":{pb:3}}})))()}$();export{Me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-CNOWq4Kh.js";import{i as t,t as n}from"./react-BN8qLIAi.js";import{U as r,V as i,z as a}from"./client-DFnuv2z3.js";import{F as o,I as s,ct as c,st as l}from"./mui-BXSXx9c9.js";import{B as u,a as d,o as f,z as p}from"./mui-Cd711nOk.js";import{A as m,it as h,k as g,rt as _}from"./mui-AnEgAVjz.js";import{_ as v,v as y}from"./mui-BwsIrivo.js";import{n as b,r as x}from"./alert-uBG6r9NW.js";import{a as S,n as C,r as w,t as T}from"./store-bqUBn2A4.js";import{i as E,n as D,r as O,t as k}from"./omnitron-logo-koMCbsCv.js";import{G as A,g as j}from"./icons-OboZgWSt.js";function M(){let e=i(),[t]=r(),n=C(e=>e.signIn),a=C(e=>e.initError),s=C(e=>e.clearInitError),c=E(),[u,f]=(0,N.useState)(``),[m,h]=(0,N.useState)(``),[y,x]=(0,N.useState)(!1),[T,D]=(0,N.useState)(``),[O,A]=(0,N.useState)(!1),M=S(t.get(`returnTo`));return(0,P.jsxs)(v,{spacing:3,sx:{maxWidth:420,mx:`auto`,width:1},children:[(0,P.jsxs)(v,{spacing:1.5,sx:{alignItems:`center`,textAlign:`center`},children:[(0,P.jsx)(k,{size:48}),(0,P.jsx)(p,{variant:`h4`,children:`Omnitron Console`}),(0,P.jsx)(p,{variant:`body2`,sx:{color:`text.secondary`},children:`Sign in to manage your infrastructure`})]}),a&&!T&&(0,P.jsx)(b,{severity:`warning`,onClose:s,children:a}),T&&(0,P.jsx)(b,{onClose:()=>D(``),children:T}),(0,P.jsx)(`form`,{onSubmit:async t=>{if(t.preventDefault(),u.trim()&&m.trim()){D(``),A(!0);try{await n(u,m),e(M,{replace:!0})}catch(e){h(``),D(w(e))}finally{A(!1)}}},noValidate:!0,children:(0,P.jsxs)(v,{spacing:2.5,children:[(0,P.jsx)(d,{fullWidth:!0,label:`Username`,autoComplete:`username`,autoFocus:!0,value:u,onChange:e=>f(e.target.value)}),(0,P.jsx)(d,{fullWidth:!0,label:`Password`,type:y?`text`:`password`,autoComplete:`current-password`,value:m,onChange:e=>h(e.target.value),slotProps:{input:{endAdornment:(0,P.jsx)(g,{position:`end`,children:(0,P.jsx)(_,{onClick:()=>x(!y),edge:`end`,children:(0,P.jsx)(j,{open:y})})})}}}),(0,P.jsx)(o,{fullWidth:!0,size:`large`,type:`submit`,variant:`contained`,disabled:O||!c,startIcon:O?(0,P.jsx)(l,{size:20,color:`inherit`}):void 0,children:O?`Signing in...`:c?`Sign In`:`Daemon offline`})]})})]})}var N,P;function F(){return(F=e((()=>{N=t(),x(),a(),y(),f(),u(),s(),m(),h(),c(),A(),T(),D(),O(),P=n()})))()}F();export{M as default};
|