@samyx/preview-stacks-ui 0.35.0 → 0.36.0
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/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-pLJQfFvY.js → ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-pLJQfFvY.js.map → ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js.map} +1 -1
- package/dist/assets/{AxesTab-Bb8UjmaR.js → AxesTab-C0OeAG-v.js} +2 -2
- package/dist/assets/{AxesTab-Bb8UjmaR.js.map → AxesTab-C0OeAG-v.js.map} +1 -1
- package/dist/assets/{ConfigTab-DLjvLYzj.js → ConfigTab-CqQK7vQl.js} +2 -2
- package/dist/assets/{ConfigTab-DLjvLYzj.js.map → ConfigTab-CqQK7vQl.js.map} +1 -1
- package/dist/assets/{ConfigView-BO_yZHja.js → ConfigView-D6Ourc5o.js} +2 -2
- package/dist/assets/{ConfigView-BO_yZHja.js.map → ConfigView-D6Ourc5o.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-Bjozh4Jr.js → ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-Bjozh4Jr.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js.map} +1 -1
- package/dist/assets/ControlView-G6A_-Og_.js +2 -0
- package/dist/assets/ControlView-G6A_-Og_.js.map +1 -0
- package/dist/assets/{DangerTab-DFtbEcU-.js → DangerTab-Cn06aqx9.js} +2 -2
- package/dist/assets/{DangerTab-DFtbEcU-.js.map → DangerTab-Cn06aqx9.js.map} +1 -1
- package/dist/assets/{DashboardView-BWa1V1EI.js → DashboardView-CpJmNcFL.js} +2 -2
- package/dist/assets/{DashboardView-BWa1V1EI.js.map → DashboardView-CpJmNcFL.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-Cs1sMvRs.js → DeploymentDetailView-CP2ANsF3.js} +2 -2
- package/dist/assets/{DeploymentDetailView-Cs1sMvRs.js.map → DeploymentDetailView-CP2ANsF3.js.map} +1 -1
- package/dist/assets/{DeploymentsView-CD84qmqw.js → DeploymentsView-CXQxjAem.js} +2 -2
- package/dist/assets/{DeploymentsView-CD84qmqw.js.map → DeploymentsView-CXQxjAem.js.map} +1 -1
- package/dist/assets/{DialogTrigger-BKNFZDUU.js → DialogTrigger-BlkbgxBa.js} +2 -2
- package/dist/assets/{DialogTrigger-BKNFZDUU.js.map → DialogTrigger-BlkbgxBa.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-DSNG3Ig1.js → EquivalentCommand-CbJfYQaC.js} +2 -2
- package/dist/assets/{EquivalentCommand-DSNG3Ig1.js.map → EquivalentCommand-CbJfYQaC.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BaTXNX-q.js → ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BaTXNX-q.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-BhdwErsB.js → HelpModal.vue_vue_type_script_setup_true_lang-CjoiZrMf.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-BhdwErsB.js.map → HelpModal.vue_vue_type_script_setup_true_lang-CjoiZrMf.js.map} +1 -1
- package/dist/assets/{JobDetailView-DeRVlajk.js → JobDetailView-lYBZcOSg.js} +2 -2
- package/dist/assets/{JobDetailView-DeRVlajk.js.map → JobDetailView-lYBZcOSg.js.map} +1 -1
- package/dist/assets/{JobsView-BMWq45ys.js → JobsView-CyZXyEfc.js} +2 -2
- package/dist/assets/{JobsView-BMWq45ys.js.map → JobsView-CyZXyEfc.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-Bj66MDSl.js → LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js} +2 -2
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-Bj66MDSl.js.map → LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js.map} +1 -1
- package/dist/assets/{LoginView-Docai9d6.js → LoginView-Do6LVtZ6.js} +2 -2
- package/dist/assets/{LoginView-Docai9d6.js.map → LoginView-Do6LVtZ6.js.map} +1 -1
- package/dist/assets/{LogsTab-Cfauurch.js → LogsTab-DMj2p8j8.js} +2 -2
- package/dist/assets/{LogsTab-Cfauurch.js.map → LogsTab-DMj2p8j8.js.map} +1 -1
- package/dist/assets/{NotFoundView-D7OvnAVF.js → NotFoundView-DyiW8m6P.js} +2 -2
- package/dist/assets/{NotFoundView-D7OvnAVF.js.map → NotFoundView-DyiW8m6P.js.map} +1 -1
- package/dist/assets/{NotifiersView-DPXRy0Ml.js → NotifiersView-CIWU3Ohd.js} +2 -2
- package/dist/assets/{NotifiersView-DPXRy0Ml.js.map → NotifiersView-CIWU3Ohd.js.map} +1 -1
- package/dist/assets/{OverviewTab-BKYsu11o.js → OverviewTab-tJGh_KZG.js} +2 -2
- package/dist/assets/{OverviewTab-BKYsu11o.js.map → OverviewTab-tJGh_KZG.js.map} +1 -1
- package/dist/assets/{PublicLogsView-DWtP1KLG.js → PublicLogsView-CwLsI-Nz.js} +2 -2
- package/dist/assets/{PublicLogsView-DWtP1KLG.js.map → PublicLogsView-CwLsI-Nz.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-zOMuwEGt.js → RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-zOMuwEGt.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js.map} +1 -1
- package/dist/assets/{RegistriesView-CXFrbpKU.js → RegistriesView-399hTPKi.js} +2 -2
- package/dist/assets/{RegistriesView-CXFrbpKU.js.map → RegistriesView-399hTPKi.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-DmifGQCq.js → RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-DmifGQCq.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js.map} +1 -1
- package/dist/assets/{RequiresTab-DzIjJaLx.js → RequiresTab-B53DZ6Dn.js} +2 -2
- package/dist/assets/{RequiresTab-DzIjJaLx.js.map → RequiresTab-B53DZ6Dn.js.map} +1 -1
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-mCKpGvoV.js → RouteTarget.vue_vue_type_script_setup_true_lang-B1xfCOxN.js} +2 -2
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-mCKpGvoV.js.map → RouteTarget.vue_vue_type_script_setup_true_lang-B1xfCOxN.js.map} +1 -1
- package/dist/assets/{RoutingView-BOH2ypa8.js → RoutingView-B5gwI-1h.js} +2 -2
- package/dist/assets/{RoutingView-BOH2ypa8.js.map → RoutingView-B5gwI-1h.js.map} +1 -1
- package/dist/assets/{RuntimeTab-DZ3MZE_K.js → RuntimeTab-B9lDbflh.js} +2 -2
- package/dist/assets/{RuntimeTab-DZ3MZE_K.js.map → RuntimeTab-B9lDbflh.js.map} +1 -1
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CEOgxUqO.js → SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CEOgxUqO.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js.map} +1 -1
- package/dist/assets/{SettingsView-B0DeldbW.js → SettingsView-DGor_LCJ.js} +2 -2
- package/dist/assets/{SettingsView-B0DeldbW.js.map → SettingsView-DGor_LCJ.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Veni2uNM.js → SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Veni2uNM.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js.map} +1 -1
- package/dist/assets/{SpecDetailView-CYTsg3dA.js → SpecDetailView-B0IAuWzl.js} +2 -2
- package/dist/assets/{SpecDetailView-CYTsg3dA.js.map → SpecDetailView-B0IAuWzl.js.map} +1 -1
- package/dist/assets/{SpecsView-DioO-zqq.js → SpecsView-BTD2qo9l.js} +2 -2
- package/dist/assets/{SpecsView-DioO-zqq.js.map → SpecsView-BTD2qo9l.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-DYn0Yyze.js → SsoMark.vue_vue_type_script_setup_true_lang-BXhQGdjJ.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-DYn0Yyze.js.map → SsoMark.vue_vue_type_script_setup_true_lang-BXhQGdjJ.js.map} +1 -1
- package/dist/assets/{SsoView-B_gXfZwB.js → SsoView-B_GrAR_X.js} +2 -2
- package/dist/assets/{SsoView-B_gXfZwB.js.map → SsoView-B_GrAR_X.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DABjKwrU.js → StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DABjKwrU.js.map → StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js.map} +1 -1
- package/dist/assets/{SubmitView-D3dRZ8OV.js → SubmitView-D5UffFTS.js} +2 -2
- package/dist/assets/{SubmitView-D3dRZ8OV.js.map → SubmitView-D5UffFTS.js.map} +1 -1
- package/dist/assets/{SwarmView-_n42sP13.js → SwarmView-BG2DN4OG.js} +2 -2
- package/dist/assets/{SwarmView-_n42sP13.js.map → SwarmView-BG2DN4OG.js.map} +1 -1
- package/dist/assets/{Teleport-Cy-A7RhK.js → Teleport-DwPgOPS3.js} +3 -3
- package/dist/assets/{Teleport-Cy-A7RhK.js.map → Teleport-DwPgOPS3.js.map} +1 -1
- package/dist/assets/{TerminalTab-DdbwvvIy.js → TerminalTab-BLjzwPsG.js} +2 -2
- package/dist/assets/{TerminalTab-DdbwvvIy.js.map → TerminalTab-BLjzwPsG.js.map} +1 -1
- package/dist/assets/{UsersView-Dn9cLJCI.js → UsersView-BOGuCj7S.js} +2 -2
- package/dist/assets/{UsersView-Dn9cLJCI.js.map → UsersView-BOGuCj7S.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-Dyb8Lmxc.js → VarEditor.vue_vue_type_script_setup_true_lang-uS04X_Kj.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-Dyb8Lmxc.js.map → VarEditor.vue_vue_type_script_setup_true_lang-uS04X_Kj.js.map} +1 -1
- package/dist/assets/{VarIO-D7bwBO4U.js → VarIO-DkbGdmrU.js} +2 -2
- package/dist/assets/{VarIO-D7bwBO4U.js.map → VarIO-DkbGdmrU.js.map} +1 -1
- package/dist/assets/{VariablesView-CH3Ktrp1.js → VariablesView-C5XVfRcx.js} +3 -3
- package/dist/assets/{VariablesView-CH3Ktrp1.js.map → VariablesView-C5XVfRcx.js.map} +1 -1
- package/dist/assets/{index-ChQCta5r.js → index-BzdU0RNE.js} +4 -4
- package/dist/assets/{index-ChQCta5r.js.map → index-BzdU0RNE.js.map} +1 -1
- package/dist/assets/{useDeployment-DiChk3VG.js → useDeployment-D3f7oVQg.js} +2 -2
- package/dist/assets/{useDeployment-DiChk3VG.js.map → useDeployment-D3f7oVQg.js.map} +1 -1
- package/dist/index.html +4 -1
- package/package.json +1 -1
- package/dist/assets/ControlView-D-akBm65.js +0 -2
- package/dist/assets/ControlView-D-akBm65.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobDetailView-DeRVlajk.js","sources":["../../src/composables/useSteps.ts","../../src/components/StepList.vue","../../src/views/JobDetailView.vue"],"sourcesContent":["/**\n * Step classification — the single most important logic in this app.\n *\n * A job's outcome has four states that MUST NOT blur into one another. The whole product is the\n * distinction between the middle two:\n *\n * ok passed. A `down` step is ALWAYS ok and may still carry a \"non-fatal:\" note —\n * teardown is best-effort by design, so the step really did pass.\n * unverifiable the axis defines no `assert_gone`, so `verify` had nothing to check. NOT a pass.\n * A green here would be exactly the false confidence this tool exists to remove.\n * leaked `assert_gone` FAILED — the resource survived teardown. Nothing else will clean\n * it up. This is the signal the whole tool exists for, and the CLI's exit code 2.\n * failed any other non-zero step.\n *\n * Order matters: `unverifiable` is matched on the message FIRST, exactly as the CLI's own report\n * does. `skipped` alone is not enough — a dry run also skips.\n */\n\nimport type { StepResult } from '../api/types';\n\nexport type StepState = 'ok' | 'unverifiable' | 'leaked' | 'failed';\n\nexport function stepState(s: StepResult): StepState {\n if (s.message?.startsWith('unverifiable')) return 'unverifiable';\n if (!s.ok) return s.phase === 'assert_gone' ? 'leaked' : 'failed';\n return 'ok';\n}\n\nexport function stepMark(s: StepResult): string {\n return { ok: '✓', unverifiable: '?', leaked: '!', failed: '✗' }[stepState(s)];\n}\n\nexport function stepText(s: StepResult): string {\n if (s.message) return s.message;\n if (s.skipped) return 'skipped';\n return stepState(s) === 'ok' ? 'ok' : `exit ${s.code}`;\n}\n\n/** Only a failed `assert_gone` is a leak. Every other non-zero step is a plain failure. */\nexport function leakedAxes(steps: StepResult[]): string[] {\n return steps.filter((s) => s.phase === 'assert_gone' && !s.ok).map((s) => s.axis);\n}\n\nexport function countUnverifiable(steps: StepResult[]): number {\n return steps.filter((s) => stepState(s) === 'unverifiable').length;\n}\n","<script setup lang=\"ts\">\n/**\n * A job's step results.\n *\n * The legend is part of the component because the four states only mean anything together:\n * `unverifiable` is not a pass, and `leaked` is not the same problem as `failed`.\n */\nimport type { StepResult } from '../api/types';\nimport { stepMark, stepState, stepText } from '../composables/useSteps';\n\ndefineProps<{ steps: StepResult[] }>();\n</script>\n\n<template>\n <div>\n <ul class=\"steps stagger\">\n <li\n v-for=\"(s, i) in steps\"\n :key=\"`${s.phase}-${s.axis}-${i}`\"\n class=\"step\"\n :style=\"{ '--i': i }\"\n >\n <span class=\"mark\" :class=\"`s-${stepState(s)}`\" aria-hidden=\"true\">{{ stepMark(s) }}</span>\n <span>\n <span class=\"who\">{{ s.axis }}</span>\n <span class=\"dim\" style=\"font-size: var(--t-sm)\"> · {{ s.phase }}</span>\n <span class=\"badge\" :class=\"stepState(s)\" style=\"margin-left: var(--s2)\">\n {{ stepState(s) }}\n </span>\n <div class=\"msg\" :class=\"`s-${stepState(s)}`\">{{ stepText(s) }}</div>\n </span>\n </li>\n </ul>\n\n <p class=\"hint\">\n <span class=\"s-ok\">✓ ok</span> ·\n <span class=\"s-failed\">✗ failed</span> ·\n <span class=\"s-leaked\">! leaked — survived teardown</span> ·\n <span class=\"s-unverifiable\">? unverifiable — nothing to check, not a pass</span>.\n A <code>down</code> step marked ok may still carry a <code>non-fatal:</code> note: teardown is\n best-effort by design, so aborting halfway would leave more behind than continuing.\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One job: its live log while it runs, then the step table that says what actually happened.\n *\n * The log streams over `EventSource`. The server replays the whole buffered history first and then\n * sends live events, so attaching late still shows the beginning — no polling, no gap to reconcile.\n * A final `{done:true,state}` ends the stream; we close the source then and fetch the job once more\n * to pick up `outcome`, which only exists after the job finishes.\n *\n * A QUEUED JOB HAS A STREAM TOO, and it is open and silent until the job dispatches. That is the\n * one case where \"no events yet\" is not a broken connection, so the page says what it is waiting\n * for instead of showing an empty log: the panel reads \"waiting to start\", and a banner above it\n * says WHY — behind its own stack, or behind the host's job cap. The first line to arrive IS the\n * dispatch, and nothing else would re-fetch, so it triggers one `load()`; without that the badge\n * would still read \"Queued\" while output scrolled past underneath it.\n */\nimport { computed, onBeforeUnmount, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Job, LogEvent } from '../api/types';\nimport { state } from '../composables/useControlPlane';\nimport { isTerminal, supersededBy, waitReason } from '../composables/useJobQueue';\nimport { leakedAxes, countUnverifiable } from '../composables/useSteps';\nimport { actionLabel, stamp, took } from '../composables/useFormat';\nimport LogViewer from '../components/LogViewer.vue';\nimport type { LogRow } from '../components/log-viewer-types';\nimport StepList from '../components/StepList.vue';\nimport StateBadge from '../components/StateBadge.vue';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport { toast } from '../composables/useToasts';\n\nconst props = defineProps<{ jobId: string }>();\n\nconst job = ref<Job | null>(null);\nconst lines = ref<LogEvent[]>([]);\nconst error = ref('');\nconst loading = ref(true);\nconst streaming = ref(false);\n\n/** Job events → viewer rows. The date repeats for hundreds of lines, so it appears once per DAY as\n * a separator and each row carries only the clock; the full stamp survives in the tooltip. */\nconst logRows = computed<LogRow[]>(() => {\n const out: LogRow[] = [];\n let lastDay = '';\n for (const l of lines.value) {\n const d = new Date(l.at);\n const day = d.toLocaleDateString('sv');\n if (day !== lastDay) {\n out.push({ key: `day-${day}-${l.seq}`, separator: true, text: day });\n lastDay = day;\n }\n out.push({\n key: l.seq,\n gutter: d.toTimeString().slice(0, 8),\n gutterTitle: stamp(l.at),\n text: l.message,\n tone: l.level,\n });\n }\n return out;\n});\n\nlet source: EventSource | null = null;\n\n/** Terminal is forever. NEVER `state !== 'running'` — that is true of a job that has not started. */\nconst terminal = computed(() => !!job.value && isTerminal(job.value.state));\nconst queued = computed(() => job.value?.state === 'queued');\n\n/**\n * Why this job is still waiting, and which job replaced it — both read the shell's polled job list,\n * which is loaded on every route. On a deep link before the first poll the list is empty and both\n * fall back to saying nothing rather than guessing.\n */\nconst wait = computed(() => (job.value ? waitReason(job.value, state.jobs) : null));\nconst replacement = computed(() => (job.value ? supersededBy(job.value, state.jobs) : null));\n\nconst leaks = computed(() => (job.value?.outcome ? leakedAxes(job.value.outcome.steps) : []));\nconst unverifiable = computed(() =>\n job.value?.outcome ? countUnverifiable(job.value.outcome.steps) : 0,\n);\n\n/** Returns the job it loaded, so callers need not re-read the ref — see the note at the watcher. */\nasync function load(): Promise<Job | null> {\n const r = await api.get<{ job: Job }>(`/api/jobs/${encodeURIComponent(props.jobId)}`);\n loading.value = false;\n if (!r.ok) {\n error.value = problem(r, 'load job');\n return null;\n }\n error.value = '';\n job.value = r.body.job;\n // The job carries its buffered log too. Seed from it so a finished job renders instantly without\n // opening a stream that would only replay and close.\n if (r.body.job.log?.length && lines.value.length === 0) lines.value = [...r.body.job.log];\n return r.body.job;\n}\n\nfunction closeStream(): void {\n source?.close();\n source = null;\n streaming.value = false;\n}\n\nfunction stream(): void {\n closeStream();\n /*\n * The stream REPLAYS the whole buffer before going live, and `load()` has already seeded `lines`\n * from the same buffer — so every line the job had produced before the page opened was rendered\n * twice, with the count to match. Clearing here is the honest fix: the replay is complete by\n * definition, so the seed is only ever the placeholder that keeps a finished job from flashing\n * empty.\n */\n lines.value = [];\n // A queued job's stream carries nothing until it dispatches, and the first line to arrive is that\n // dispatch. Re-read the job once when it does, or the header keeps saying \"Queued\".\n let awaitingDispatch = queued.value;\n source = new EventSource(api.url(`/api/jobs/${encodeURIComponent(props.jobId)}/stream`));\n streaming.value = true;\n\n source.onmessage = (ev) => {\n let payload: unknown;\n try {\n payload = JSON.parse(ev.data as string);\n } catch {\n return; // a frame we cannot parse is not worth tearing the stream down for\n }\n const done = payload as { done?: boolean };\n if (done.done) {\n closeStream();\n void load(); // `outcome` only exists once the job has ended\n return;\n }\n if (awaitingDispatch) {\n awaitingDispatch = false;\n void load(); // it started: pick up `running` and the `startedAt` it now has\n }\n lines.value.push(payload as LogEvent);\n };\n\n // An error here is usually the job having ended between the fetch and the connect, or the API\n // becoming unreachable. Either way stop rather than let the browser reconnect forever.\n source.onerror = () => {\n closeStream();\n void load();\n };\n}\n\n\nwatch(\n () => props.jobId,\n async () => {\n lines.value = [];\n job.value = null;\n loading.value = true;\n // Use what `load` returned rather than re-reading the ref: control-flow analysis still has\n // `job.value` narrowed to the `null` assigned above, because it cannot see that an awaited\n // call reassigned it.\n const loaded = await load();\n // Queued as well as running: the stream is what tells this page the job began.\n if (loaded && !isTerminal(loaded.state)) stream();\n },\n { immediate: true },\n);\n\nconst cancelling = ref(false);\n\n/**\n * Stop the job.\n *\n * The stream is deliberately left open: the server writes the cancellation into the SAME log the\n * page is already watching, so the operator sees the run stop where it stopped instead of watching a\n * page that has gone quiet. `load()` afterwards picks up the final state and `cancelledBy`.\n */\nasync function cancel(): Promise<void> {\n cancelling.value = true;\n const r = await api.post<{ warning?: string }>(\n `/api/jobs/${encodeURIComponent(props.jobId)}/cancel`,\n );\n cancelling.value = false;\n if (!r.ok) {\n // 409 means it finished on its own between the click and the request — not an error worth an\n // alarm, just a stale page.\n toast(r.status === 409 ? 'info' : 'error', problem(r, 'stop this job'));\n void load();\n return;\n }\n toast('ok', r.body.warning ?? 'Stopped.');\n void load();\n}\n\nonBeforeUnmount(closeStream);\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n <RouterLink to=\"/jobs\" class=\"mute\">Jobs</RouterLink>\n <span class=\"mute\"> / </span>{{ job ? actionLabel(job.action) : '…' }}\n </h1>\n <div class=\"sub\">\n <template v-if=\"job\">\n <code>{{ job.stack }}</code>\n <template v-if=\"job.startedAt\"> · started {{ stamp(job.startedAt) }}</template>\n <template v-else-if=\"queued\"> · not started yet</template>\n <template v-else> · never started</template>\n <template v-if=\"job.startedAt && job.endedAt\">\n · took {{ took(job.startedAt, job.endedAt) }}\n </template>\n </template>\n <template v-else>{{ jobId }}</template>\n </div>\n </div>\n <span class=\"grow\" />\n <StateBadge v-if=\"job\" :state=\"job.state\" />\n <!--\n Stopping is destructive in the way that matters here: it does not undo, so the confirmation\n says what will be left behind rather than asking \"are you sure\".\n -->\n <ActionButton\n v-if=\"job && !terminal\"\n variant=\"danger\"\n :pending=\"cancelling\"\n :confirm=\"queued ? 'Drop it? It never ran.' : 'Stop it? Nothing is undone.'\"\n :title=\"\n queued\n ? 'It has not started, so there is nothing left behind to clean up.'\n : 'Kills the command in flight. Anything already created or destroyed stays that way.'\n \"\n @run=\"cancel\"\n >\n {{ queued ? 'Drop' : 'Stop' }}\n </ActionButton>\n </div>\n\n <!--\n A queued job and a broken page look identical — an open connection, an empty log, nothing\n moving. So this says which it is, and WHY it waits, because the two waits have different\n fixes: behind its own stack, wait or stop the job ahead; behind the host's cap, raise\n PSTACK_MAX_JOBS or deploy fewer things at once. Neutral chrome on purpose — waiting is the\n system working, not an alarm.\n -->\n <section v-if=\"queued\" class=\"panel\">\n <b>Waiting to start — nothing has run yet.</b>\n <p v-if=\"wait?.kind === 'stack'\" class=\"mute\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(wait.blocker.id)}`\">{{\n actionLabel(wait.blocker.action)\n }}</RouterLink>\n is already running on <code>{{ job?.stack }}</code\n >. One job runs per stack at a time — a teardown racing a deploy over the same database is\n the failure that rule exists to prevent — so this one starts when that one ends.\n </p>\n <p v-else-if=\"wait?.kind === 'slot'\" class=\"mute\">\n Nothing is running on <code>{{ job?.stack }}</code\n >, so the wait is host-wide: {{ wait.running }} jobs hold a slot across every stack, and the\n host runs at most <code>PSTACK_MAX_JOBS</code> at once (4 unless this server was told\n otherwise). This one starts as soon as a slot frees.\n </p>\n <p v-else class=\"mute\">\n It starts once its own stack is free and the host has a spare job slot.\n </p>\n <p class=\"mute\">Dropping it now costs nothing — it has not touched anything yet.</p>\n </section>\n\n <!--\n The mirror image of the cancelled banner below, and the reason `superseded` is its own state:\n a stopped job leaves partial state to hunt for, a superseded one cannot, because it never ran.\n -->\n <section v-if=\"job?.state === 'superseded'\" class=\"panel\">\n <b>Superseded — this job never ran.</b>\n <p class=\"mute\">\n <template v-if=\"replacement\">\n A newer\n <RouterLink :to=\"`/jobs/${encodeURIComponent(replacement.id)}`\">{{\n actionLabel(replacement.action).toLowerCase()\n }}</RouterLink>\n for <code>{{ job.stack }}</code> replaced it while it was queued.\n </template>\n <template v-else>\n A newer job for <code>{{ job.stack }}</code> replaced it while it was queued.\n </template>\n The queue is one deep, so a burst of pushes runs the first deploy and then exactly one more\n carrying the newest spec. Nothing was created or destroyed here — there is no partial state\n to go looking for, and nothing to verify.\n </p>\n </section>\n\n <!--\n Not a badge's worth of information. A cancelled job is the one state where the record is\n complete and the INFRASTRUCTURE is not, and the next step is a person's to take.\n -->\n <section v-if=\"job?.state === 'cancelled'\" class=\"panel banner-panel warn\">\n <b>Stopped by {{ job.cancelledBy ?? 'an operator' }} — nothing was undone.</b>\n <p>\n Whatever this job had already created or destroyed is still that way. Run\n <b>Verify</b> on the deployment to see what actually exists.\n </p>\n </section>\n\n <ErrorNote v-if=\"error\" :text=\"error\" />\n\n <!--\n Leaked is called out above everything else. It means a resource survived teardown and nothing\n else is going to clean it up — the one outcome that needs a human.\n -->\n <section v-if=\"leaks.length\" class=\"panel leaked-banner\">\n <strong>Leaked:</strong> {{ leaks.join(', ') }}\n <div class=\"mute\">\n These axes' <code>assert_gone</code> failed, so the resources are still present. They will\n not be retried — tear them down by hand, then re-run <code>verify</code>.\n </div>\n </section>\n\n <section v-if=\"job?.error\" class=\"panel\">\n <strong class=\"bad\">The job crashed</strong>\n <pre class=\"pre\">{{ job.error }}</pre>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Log</h2>\n </div>\n\n <!-- Time-of-day gutter with a date separator when the day flips — the full 19-character\n timestamp per line is what used to wrap every entry onto five or six lines. -->\n <LogViewer\n :rows=\"logRows\"\n :live=\"streaming\"\n :empty-text=\"\n loading\n ? 'Loading…'\n : queued\n ? 'Waiting to start — there is no output until it does.'\n : 'No output.'\n \"\n >\n <template #actions>\n <button v-if=\"!streaming && job && !terminal\" class=\"ghost sm\" @click=\"stream\">\n Reconnect\n </button>\n </template>\n </LogViewer>\n </section>\n\n <section v-if=\"job?.outcome\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Steps</h2>\n <span v-if=\"unverifiable\" class=\"mute\">\n {{ unverifiable }} unverifiable — no <code>assert_gone</code>, so nothing was checked\n </span>\n </div>\n <StepList :steps=\"job.outcome.steps\" />\n </section>\n </div>\n</template>\n"],"names":["stepState","s","_a","stepMark","stepText","leakedAxes","steps","countUnverifiable","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","__props","i","_normalizeClass","_unref","_toDisplayString","_hoisted_2","_hoisted_3","props","job","ref","lines","error","loading","streaming","logRows","computed","out","lastDay","l","d","day","stamp","source","terminal","isTerminal","queued","wait","waitReason","state","replacement","supersededBy","leaks","unverifiable","load","r","api","problem","closeStream","stream","awaitingDispatch","ev","payload","watch","loaded","cancelling","cancel","toast","onBeforeUnmount","_createVNode","_component_RouterLink","_cache","_createTextVNode","actionLabel","_createBlock","StateBadge","ActionButton","_hoisted_4","_b","_c","_hoisted_5","_d","_hoisted_6","_e","_hoisted_7","_hoisted_8","_f","_hoisted_9","ErrorNote","_hoisted_10","_g","_hoisted_11","_hoisted_12","_hoisted_13","LogViewer","_h","_hoisted_14","_hoisted_15","_hoisted_16","StepList"],"mappings":"mnBAsBO,SAASA,EAAUC,EAA0B,OAClD,OAAIC,EAAAD,EAAE,UAAF,MAAAC,EAAW,WAAW,gBAAwB,eAC7CD,EAAE,GACA,KADWA,EAAE,QAAU,cAAgB,SAAW,QAE3D,CAEO,SAASE,GAASF,EAAuB,CAC9C,MAAO,CAAE,GAAI,IAAK,aAAc,IAAK,OAAQ,IAAK,OAAQ,GAAA,EAAMD,EAAUC,CAAC,CAAC,CAC9E,CAEO,SAASG,GAASH,EAAuB,CAC9C,OAAIA,EAAE,QAAgBA,EAAE,QACpBA,EAAE,QAAgB,UACfD,EAAUC,CAAC,IAAM,KAAO,KAAO,QAAQA,EAAE,IAAI,EACtD,CAGO,SAASI,GAAWC,EAA+B,CACxD,OAAO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AO4C,CAAA,EAAQ,aAE/E,sDAKSoC,EAAAlE,EAAA,QAAA,MAAAkE,EAAK,SAApB7E,IAAAH,EAQU,UARViF,GAQU,CAPRhF,EAKM,MALNiF,GAKM,CAJJ1B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAvD,EAAkC,KAAA,CAA9B,MAAM,aAAA,EAAc,QAAK,EAAA,GACjBqC,EAAA,OAAZnC,EAAA,EAAAH,EAEO,OAFPmF,GAEO,CADF1B,EAAA/C,EAAA4B,EAAA,KAAY,EAAG,sBAAmB,CAAA,EAAAkB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAvD,EAAwB,YAAlB,cAAW,EAAA,mBAAO,4BAC/D,EAAA,EAAA,eAEFqD,EAAuC8B,GAAA,CAA5B,MAAOtE,EAAA,MAAI,QAAQ,KAAA"}
|
|
1
|
+
{"version":3,"file":"JobDetailView-lYBZcOSg.js","sources":["../../src/composables/useSteps.ts","../../src/components/StepList.vue","../../src/views/JobDetailView.vue"],"sourcesContent":["/**\n * Step classification — the single most important logic in this app.\n *\n * A job's outcome has four states that MUST NOT blur into one another. The whole product is the\n * distinction between the middle two:\n *\n * ok passed. A `down` step is ALWAYS ok and may still carry a \"non-fatal:\" note —\n * teardown is best-effort by design, so the step really did pass.\n * unverifiable the axis defines no `assert_gone`, so `verify` had nothing to check. NOT a pass.\n * A green here would be exactly the false confidence this tool exists to remove.\n * leaked `assert_gone` FAILED — the resource survived teardown. Nothing else will clean\n * it up. This is the signal the whole tool exists for, and the CLI's exit code 2.\n * failed any other non-zero step.\n *\n * Order matters: `unverifiable` is matched on the message FIRST, exactly as the CLI's own report\n * does. `skipped` alone is not enough — a dry run also skips.\n */\n\nimport type { StepResult } from '../api/types';\n\nexport type StepState = 'ok' | 'unverifiable' | 'leaked' | 'failed';\n\nexport function stepState(s: StepResult): StepState {\n if (s.message?.startsWith('unverifiable')) return 'unverifiable';\n if (!s.ok) return s.phase === 'assert_gone' ? 'leaked' : 'failed';\n return 'ok';\n}\n\nexport function stepMark(s: StepResult): string {\n return { ok: '✓', unverifiable: '?', leaked: '!', failed: '✗' }[stepState(s)];\n}\n\nexport function stepText(s: StepResult): string {\n if (s.message) return s.message;\n if (s.skipped) return 'skipped';\n return stepState(s) === 'ok' ? 'ok' : `exit ${s.code}`;\n}\n\n/** Only a failed `assert_gone` is a leak. Every other non-zero step is a plain failure. */\nexport function leakedAxes(steps: StepResult[]): string[] {\n return steps.filter((s) => s.phase === 'assert_gone' && !s.ok).map((s) => s.axis);\n}\n\nexport function countUnverifiable(steps: StepResult[]): number {\n return steps.filter((s) => stepState(s) === 'unverifiable').length;\n}\n","<script setup lang=\"ts\">\n/**\n * A job's step results.\n *\n * The legend is part of the component because the four states only mean anything together:\n * `unverifiable` is not a pass, and `leaked` is not the same problem as `failed`.\n */\nimport type { StepResult } from '../api/types';\nimport { stepMark, stepState, stepText } from '../composables/useSteps';\n\ndefineProps<{ steps: StepResult[] }>();\n</script>\n\n<template>\n <div>\n <ul class=\"steps stagger\">\n <li\n v-for=\"(s, i) in steps\"\n :key=\"`${s.phase}-${s.axis}-${i}`\"\n class=\"step\"\n :style=\"{ '--i': i }\"\n >\n <span class=\"mark\" :class=\"`s-${stepState(s)}`\" aria-hidden=\"true\">{{ stepMark(s) }}</span>\n <span>\n <span class=\"who\">{{ s.axis }}</span>\n <span class=\"dim\" style=\"font-size: var(--t-sm)\"> · {{ s.phase }}</span>\n <span class=\"badge\" :class=\"stepState(s)\" style=\"margin-left: var(--s2)\">\n {{ stepState(s) }}\n </span>\n <div class=\"msg\" :class=\"`s-${stepState(s)}`\">{{ stepText(s) }}</div>\n </span>\n </li>\n </ul>\n\n <p class=\"hint\">\n <span class=\"s-ok\">✓ ok</span> ·\n <span class=\"s-failed\">✗ failed</span> ·\n <span class=\"s-leaked\">! leaked — survived teardown</span> ·\n <span class=\"s-unverifiable\">? unverifiable — nothing to check, not a pass</span>.\n A <code>down</code> step marked ok may still carry a <code>non-fatal:</code> note: teardown is\n best-effort by design, so aborting halfway would leave more behind than continuing.\n </p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * One job: its live log while it runs, then the step table that says what actually happened.\n *\n * The log streams over `EventSource`. The server replays the whole buffered history first and then\n * sends live events, so attaching late still shows the beginning — no polling, no gap to reconcile.\n * A final `{done:true,state}` ends the stream; we close the source then and fetch the job once more\n * to pick up `outcome`, which only exists after the job finishes.\n *\n * A QUEUED JOB HAS A STREAM TOO, and it is open and silent until the job dispatches. That is the\n * one case where \"no events yet\" is not a broken connection, so the page says what it is waiting\n * for instead of showing an empty log: the panel reads \"waiting to start\", and a banner above it\n * says WHY — behind its own stack, or behind the host's job cap. The first line to arrive IS the\n * dispatch, and nothing else would re-fetch, so it triggers one `load()`; without that the badge\n * would still read \"Queued\" while output scrolled past underneath it.\n */\nimport { computed, onBeforeUnmount, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Job, LogEvent } from '../api/types';\nimport { state } from '../composables/useControlPlane';\nimport { isTerminal, supersededBy, waitReason } from '../composables/useJobQueue';\nimport { leakedAxes, countUnverifiable } from '../composables/useSteps';\nimport { actionLabel, stamp, took } from '../composables/useFormat';\nimport LogViewer from '../components/LogViewer.vue';\nimport type { LogRow } from '../components/log-viewer-types';\nimport StepList from '../components/StepList.vue';\nimport StateBadge from '../components/StateBadge.vue';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport { toast } from '../composables/useToasts';\n\nconst props = defineProps<{ jobId: string }>();\n\nconst job = ref<Job | null>(null);\nconst lines = ref<LogEvent[]>([]);\nconst error = ref('');\nconst loading = ref(true);\nconst streaming = ref(false);\n\n/** Job events → viewer rows. The date repeats for hundreds of lines, so it appears once per DAY as\n * a separator and each row carries only the clock; the full stamp survives in the tooltip. */\nconst logRows = computed<LogRow[]>(() => {\n const out: LogRow[] = [];\n let lastDay = '';\n for (const l of lines.value) {\n const d = new Date(l.at);\n const day = d.toLocaleDateString('sv');\n if (day !== lastDay) {\n out.push({ key: `day-${day}-${l.seq}`, separator: true, text: day });\n lastDay = day;\n }\n out.push({\n key: l.seq,\n gutter: d.toTimeString().slice(0, 8),\n gutterTitle: stamp(l.at),\n text: l.message,\n tone: l.level,\n });\n }\n return out;\n});\n\nlet source: EventSource | null = null;\n\n/** Terminal is forever. NEVER `state !== 'running'` — that is true of a job that has not started. */\nconst terminal = computed(() => !!job.value && isTerminal(job.value.state));\nconst queued = computed(() => job.value?.state === 'queued');\n\n/**\n * Why this job is still waiting, and which job replaced it — both read the shell's polled job list,\n * which is loaded on every route. On a deep link before the first poll the list is empty and both\n * fall back to saying nothing rather than guessing.\n */\nconst wait = computed(() => (job.value ? waitReason(job.value, state.jobs) : null));\nconst replacement = computed(() => (job.value ? supersededBy(job.value, state.jobs) : null));\n\nconst leaks = computed(() => (job.value?.outcome ? leakedAxes(job.value.outcome.steps) : []));\nconst unverifiable = computed(() =>\n job.value?.outcome ? countUnverifiable(job.value.outcome.steps) : 0,\n);\n\n/** Returns the job it loaded, so callers need not re-read the ref — see the note at the watcher. */\nasync function load(): Promise<Job | null> {\n const r = await api.get<{ job: Job }>(`/api/jobs/${encodeURIComponent(props.jobId)}`);\n loading.value = false;\n if (!r.ok) {\n error.value = problem(r, 'load job');\n return null;\n }\n error.value = '';\n job.value = r.body.job;\n // The job carries its buffered log too. Seed from it so a finished job renders instantly without\n // opening a stream that would only replay and close.\n if (r.body.job.log?.length && lines.value.length === 0) lines.value = [...r.body.job.log];\n return r.body.job;\n}\n\nfunction closeStream(): void {\n source?.close();\n source = null;\n streaming.value = false;\n}\n\nfunction stream(): void {\n closeStream();\n /*\n * The stream REPLAYS the whole buffer before going live, and `load()` has already seeded `lines`\n * from the same buffer — so every line the job had produced before the page opened was rendered\n * twice, with the count to match. Clearing here is the honest fix: the replay is complete by\n * definition, so the seed is only ever the placeholder that keeps a finished job from flashing\n * empty.\n */\n lines.value = [];\n // A queued job's stream carries nothing until it dispatches, and the first line to arrive is that\n // dispatch. Re-read the job once when it does, or the header keeps saying \"Queued\".\n let awaitingDispatch = queued.value;\n source = new EventSource(api.url(`/api/jobs/${encodeURIComponent(props.jobId)}/stream`));\n streaming.value = true;\n\n source.onmessage = (ev) => {\n let payload: unknown;\n try {\n payload = JSON.parse(ev.data as string);\n } catch {\n return; // a frame we cannot parse is not worth tearing the stream down for\n }\n const done = payload as { done?: boolean };\n if (done.done) {\n closeStream();\n void load(); // `outcome` only exists once the job has ended\n return;\n }\n if (awaitingDispatch) {\n awaitingDispatch = false;\n void load(); // it started: pick up `running` and the `startedAt` it now has\n }\n lines.value.push(payload as LogEvent);\n };\n\n // An error here is usually the job having ended between the fetch and the connect, or the API\n // becoming unreachable. Either way stop rather than let the browser reconnect forever.\n source.onerror = () => {\n closeStream();\n void load();\n };\n}\n\n\nwatch(\n () => props.jobId,\n async () => {\n lines.value = [];\n job.value = null;\n loading.value = true;\n // Use what `load` returned rather than re-reading the ref: control-flow analysis still has\n // `job.value` narrowed to the `null` assigned above, because it cannot see that an awaited\n // call reassigned it.\n const loaded = await load();\n // Queued as well as running: the stream is what tells this page the job began.\n if (loaded && !isTerminal(loaded.state)) stream();\n },\n { immediate: true },\n);\n\nconst cancelling = ref(false);\n\n/**\n * Stop the job.\n *\n * The stream is deliberately left open: the server writes the cancellation into the SAME log the\n * page is already watching, so the operator sees the run stop where it stopped instead of watching a\n * page that has gone quiet. `load()` afterwards picks up the final state and `cancelledBy`.\n */\nasync function cancel(): Promise<void> {\n cancelling.value = true;\n const r = await api.post<{ warning?: string }>(\n `/api/jobs/${encodeURIComponent(props.jobId)}/cancel`,\n );\n cancelling.value = false;\n if (!r.ok) {\n // 409 means it finished on its own between the click and the request — not an error worth an\n // alarm, just a stale page.\n toast(r.status === 409 ? 'info' : 'error', problem(r, 'stop this job'));\n void load();\n return;\n }\n toast('ok', r.body.warning ?? 'Stopped.');\n void load();\n}\n\nonBeforeUnmount(closeStream);\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>\n <RouterLink to=\"/jobs\" class=\"mute\">Jobs</RouterLink>\n <span class=\"mute\"> / </span>{{ job ? actionLabel(job.action) : '…' }}\n </h1>\n <div class=\"sub\">\n <template v-if=\"job\">\n <code>{{ job.stack }}</code>\n <template v-if=\"job.startedAt\"> · started {{ stamp(job.startedAt) }}</template>\n <template v-else-if=\"queued\"> · not started yet</template>\n <template v-else> · never started</template>\n <template v-if=\"job.startedAt && job.endedAt\">\n · took {{ took(job.startedAt, job.endedAt) }}\n </template>\n </template>\n <template v-else>{{ jobId }}</template>\n </div>\n </div>\n <span class=\"grow\" />\n <StateBadge v-if=\"job\" :state=\"job.state\" />\n <!--\n Stopping is destructive in the way that matters here: it does not undo, so the confirmation\n says what will be left behind rather than asking \"are you sure\".\n -->\n <ActionButton\n v-if=\"job && !terminal\"\n variant=\"danger\"\n :pending=\"cancelling\"\n :confirm=\"queued ? 'Drop it? It never ran.' : 'Stop it? Nothing is undone.'\"\n :title=\"\n queued\n ? 'It has not started, so there is nothing left behind to clean up.'\n : 'Kills the command in flight. Anything already created or destroyed stays that way.'\n \"\n @run=\"cancel\"\n >\n {{ queued ? 'Drop' : 'Stop' }}\n </ActionButton>\n </div>\n\n <!--\n A queued job and a broken page look identical — an open connection, an empty log, nothing\n moving. So this says which it is, and WHY it waits, because the two waits have different\n fixes: behind its own stack, wait or stop the job ahead; behind the host's cap, raise\n PSTACK_MAX_JOBS or deploy fewer things at once. Neutral chrome on purpose — waiting is the\n system working, not an alarm.\n -->\n <section v-if=\"queued\" class=\"panel\">\n <b>Waiting to start — nothing has run yet.</b>\n <p v-if=\"wait?.kind === 'stack'\" class=\"mute\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(wait.blocker.id)}`\">{{\n actionLabel(wait.blocker.action)\n }}</RouterLink>\n is already running on <code>{{ job?.stack }}</code\n >. One job runs per stack at a time — a teardown racing a deploy over the same database is\n the failure that rule exists to prevent — so this one starts when that one ends.\n </p>\n <p v-else-if=\"wait?.kind === 'slot'\" class=\"mute\">\n Nothing is running on <code>{{ job?.stack }}</code\n >, so the wait is host-wide: {{ wait.running }} jobs hold a slot across every stack, and the\n host runs at most <code>PSTACK_MAX_JOBS</code> at once (4 unless this server was told\n otherwise). This one starts as soon as a slot frees.\n </p>\n <p v-else class=\"mute\">\n It starts once its own stack is free and the host has a spare job slot.\n </p>\n <p class=\"mute\">Dropping it now costs nothing — it has not touched anything yet.</p>\n </section>\n\n <!--\n The mirror image of the cancelled banner below, and the reason `superseded` is its own state:\n a stopped job leaves partial state to hunt for, a superseded one cannot, because it never ran.\n -->\n <section v-if=\"job?.state === 'superseded'\" class=\"panel\">\n <b>Superseded — this job never ran.</b>\n <p class=\"mute\">\n <template v-if=\"replacement\">\n A newer\n <RouterLink :to=\"`/jobs/${encodeURIComponent(replacement.id)}`\">{{\n actionLabel(replacement.action).toLowerCase()\n }}</RouterLink>\n for <code>{{ job.stack }}</code> replaced it while it was queued.\n </template>\n <template v-else>\n A newer job for <code>{{ job.stack }}</code> replaced it while it was queued.\n </template>\n The queue is one deep, so a burst of pushes runs the first deploy and then exactly one more\n carrying the newest spec. Nothing was created or destroyed here — there is no partial state\n to go looking for, and nothing to verify.\n </p>\n </section>\n\n <!--\n Not a badge's worth of information. A cancelled job is the one state where the record is\n complete and the INFRASTRUCTURE is not, and the next step is a person's to take.\n -->\n <section v-if=\"job?.state === 'cancelled'\" class=\"panel banner-panel warn\">\n <b>Stopped by {{ job.cancelledBy ?? 'an operator' }} — nothing was undone.</b>\n <p>\n Whatever this job had already created or destroyed is still that way. Run\n <b>Verify</b> on the deployment to see what actually exists.\n </p>\n </section>\n\n <ErrorNote v-if=\"error\" :text=\"error\" />\n\n <!--\n Leaked is called out above everything else. It means a resource survived teardown and nothing\n else is going to clean it up — the one outcome that needs a human.\n -->\n <section v-if=\"leaks.length\" class=\"panel leaked-banner\">\n <strong>Leaked:</strong> {{ leaks.join(', ') }}\n <div class=\"mute\">\n These axes' <code>assert_gone</code> failed, so the resources are still present. They will\n not be retried — tear them down by hand, then re-run <code>verify</code>.\n </div>\n </section>\n\n <section v-if=\"job?.error\" class=\"panel\">\n <strong class=\"bad\">The job crashed</strong>\n <pre class=\"pre\">{{ job.error }}</pre>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Log</h2>\n </div>\n\n <!-- Time-of-day gutter with a date separator when the day flips — the full 19-character\n timestamp per line is what used to wrap every entry onto five or six lines. -->\n <LogViewer\n :rows=\"logRows\"\n :live=\"streaming\"\n :empty-text=\"\n loading\n ? 'Loading…'\n : queued\n ? 'Waiting to start — there is no output until it does.'\n : 'No output.'\n \"\n >\n <template #actions>\n <button v-if=\"!streaming && job && !terminal\" class=\"ghost sm\" @click=\"stream\">\n Reconnect\n </button>\n </template>\n </LogViewer>\n </section>\n\n <section v-if=\"job?.outcome\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"phead-title\">Steps</h2>\n <span v-if=\"unverifiable\" class=\"mute\">\n {{ unverifiable }} unverifiable — no <code>assert_gone</code>, so nothing was checked\n </span>\n </div>\n <StepList :steps=\"job.outcome.steps\" />\n </section>\n </div>\n</template>\n"],"names":["stepState","s","_a","stepMark","stepText","leakedAxes","steps","countUnverifiable","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_Fragment","_renderList","__props","i","_normalizeClass","_unref","_toDisplayString","_hoisted_2","_hoisted_3","props","job","ref","lines","error","loading","streaming","logRows","computed","out","lastDay","l","d","day","stamp","source","terminal","isTerminal","queued","wait","waitReason","state","replacement","supersededBy","leaks","unverifiable","load","r","api","problem","closeStream","stream","awaitingDispatch","ev","payload","watch","loaded","cancelling","cancel","toast","onBeforeUnmount","_createVNode","_component_RouterLink","_cache","_createTextVNode","actionLabel","_createBlock","StateBadge","ActionButton","_hoisted_4","_b","_c","_hoisted_5","_d","_hoisted_6","_e","_hoisted_7","_hoisted_8","_f","_hoisted_9","ErrorNote","_hoisted_10","_g","_hoisted_11","_hoisted_12","_hoisted_13","LogViewer","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A,EAAA,IAAAA,EAAA,EAAA,EAAAvD,EAA4C,SAAA,CAApC,MAAM,KAAA,EAAM,kBAAe,EAAA,GACnCA,EAAsC,MAAtC4E,GAAsCnE,EAAlBI,EAAA,MAAI,KAAK,EAAA,CAAA,CAAA,aAG/Bb,EAwBU,UAxBV6E,GAwBU,eAvBR7E,EAEM,MAAA,CAFD,MAAM,SAAO,CAChBA,EAAgC,KAAA,CAA5B,MAAM,aAAA,EAAc,KAAG,CAAA,OAK7BqD,EAgBYyB,GAAA,CAfT,KAAM3D,EAAA,MACN,KAAMD,EAAA,MACN,aAAuBD,EAAA,iBAA+Ca,EAAA,4EAQ5D,UACT,IAES,EAFMZ,EAAA,OAAaL,EAAA,OAAG,CAAKe,EAAA,WAApC7B,EAES,SAAA,OAFqC,MAAM,WAAY,QAAO4C,CAAA,EAAQ,aAE/E,sDAKSoC,EAAAlE,EAAA,QAAA,MAAAkE,EAAK,SAApB7E,IAAAH,EAQU,UARViF,GAQU,CAPRhF,EAKM,MALNiF,GAKM,CAJJ1B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAvD,EAAkC,KAAA,CAA9B,MAAM,aAAA,EAAc,QAAK,EAAA,GACjBqC,EAAA,OAAZnC,EAAA,EAAAH,EAEO,OAFPmF,GAEO,CADF1B,EAAA/C,EAAA4B,EAAA,KAAY,EAAG,sBAAmB,CAAA,EAAAkB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAvD,EAAwB,YAAlB,cAAW,EAAA,mBAAO,4BAC/D,EAAA,EAAA,eAEFqD,EAAuC8B,GAAA,CAA5B,MAAOtE,EAAA,MAAI,QAAQ,KAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as C,c as o,a as e,f as n,e as r,w as _,_ as x,u as i,K as V,i as $,v as L,g as k,A as d,t as u,z as S,F as c,r as A,j as v,k as R,o as a,D as B,G as w,I as N,l as I}from"./index-
|
|
2
|
-
//# sourceMappingURL=JobsView-
|
|
1
|
+
import{d as C,c as o,a as e,f as n,e as r,w as _,_ as x,u as i,K as V,i as $,v as L,g as k,A as d,t as u,z as S,F as c,r as A,j as v,k as R,o as a,D as B,G as w,I as N,l as I}from"./index-BzdU0RNE.js";import{_ as T}from"./StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js";import{_ as U}from"./SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js";import{_ as q}from"./RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js";import{_ as F}from"./SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js";import{w as J,s as D}from"./useJobQueue-JaWoydCt.js";import{_ as E}from"./RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js";import{_ as M}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-DwPgOPS3.js";const z={class:"page-head"},G={class:"sub"},K={class:"panel"},O={class:"phead"},Q={class:"searchbox"},j={key:0},H={key:0,class:"s-failed"},P={key:2,class:"cards"},W={class:"stagger"},X={"data-label":"state"},Y={key:0,class:"mute nowrap wait-why"},Z={key:1,class:"mute nowrap wait-why"},ee={"data-label":"action"},te={class:"name","data-label":"stack"},se={class:"dim nowrap","data-label":"started"},ae={class:"dim nowrap","data-label":"took"},oe={class:"dim","data-label":"steps"},le={key:0},ne={colspan:"6",class:"mute"},re=C({__name:"JobsView",setup(ie){const p=v(""),m=v("all");function y(l){const t=J(l,d.jobs);return t.kind==="stack"?"behind this stack’s own job":t.kind==="slot"?`at the host cap · ${t.running} running`:"waiting its turn"}function h(l){return D(l,d.jobs)}const f=R(()=>{const l=p.value.trim().toLowerCase();return d.jobs.filter(t=>m.value!=="all"&&t.state!==m.value?!1:l?t.stack.toLowerCase().includes(l)||t.action.includes(l):!0)});return(l,t)=>{const b=I("RouterLink");return a(),o("div",null,[e("div",z,[e("div",null,[t[4]||(t[4]=e("h1",null,"Jobs",-1)),e("div",G,[t[3]||(t[3]=n(" Most recent first, capped at the last 50 ",-1)),r(x,{label:"why old jobs disappear"},{default:_(()=>[...t[2]||(t[2]=[n(" The history is held in memory and a server restart clears it. A job record is the transcript of an attempt, not the truth about what exists — that truth lives in the containers themselves and in each axis's own probe. ",-1)])]),_:1})])]),t[5]||(t[5]=e("span",{class:"grow"},null,-1)),r(E,{run:i(V)},null,8,["run"])]),e("section",K,[e("div",O,[e("div",Q,[t[6]||(t[6]=e("svg",{viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},[e("circle",{cx:"11",cy:"11",r:"7",fill:"none",stroke:"currentColor","stroke-width":"2"}),e("path",{d:"M16.5 16.5 21 21",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),$(e("input",{id:"jq","onUpdate:modelValue":t[0]||(t[0]=s=>p.value=s),"data-search":"",type:"search","aria-label":"Search jobs",placeholder:"Search by stack or action",spellcheck:"false"},null,512),[[L,p.value]]),p.value?k("",!0):(a(),o("kbd",j,"/"))]),r(F,{id:"js",modelValue:m.value,"onUpdate:modelValue":t[1]||(t[1]=s=>m.value=s),label:"Filter by state",options:[{value:"all",label:"All states"},{value:"queued",label:"Queued"},{value:"running",label:"Running"},{value:"ok",label:"Ok"},{value:"leaked",label:"Leaked"},{value:"failed",label:"Failed"},{value:"cancelled",label:"Cancelled"},{value:"superseded",label:"Superseded"}]},null,8,["modelValue"])]),i(d).jobsError?(a(),o("p",H,u(i(d).jobsError),1)):i(d).jobsLoaded?(a(),o("table",P,[t[8]||(t[8]=e("thead",null,[e("tr",null,[e("th",null,"State"),e("th",null,"Action"),e("th",null,"Stack"),e("th",null,"Started"),e("th",null,"Took"),e("th",null,"Steps")])],-1)),e("tbody",W,[(a(!0),o(c,null,A(f.value,(s,g)=>(a(),o("tr",{key:s.id,style:B({"--i":g})},[e("td",X,[r(b,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:_(()=>[r(T,{state:s.state},null,8,["state"])]),_:2},1032,["to"]),s.state==="queued"?(a(),o("div",Y,u(y(s)),1)):s.state==="superseded"?(a(),o("div",Z,[h(s)?(a(),o(c,{key:0},[t[7]||(t[7]=n(" replaced by ",-1)),r(b,{to:`/jobs/${encodeURIComponent(h(s).id)}`},{default:_(()=>[n(" a newer "+u(i(w)(h(s).action).toLowerCase()),1)]),_:2},1032,["to"])],64)):(a(),o(c,{key:1},[n("never ran")],64))])):k("",!0)]),e("td",ee,u(i(w)(s.action)),1),e("td",te,[r(b,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:_(()=>[n(u(s.stack),1)]),_:2},1032,["to"])]),e("td",se,[r(q,{at:s.startedAt},null,8,["at"])]),e("td",ae,u(i(N)(s.startedAt,s.endedAt)),1),e("td",oe,u(s.outcome?s.outcome.steps.length:"—"),1)],4))),128)),f.value.length?k("",!0):(a(),o("tr",le,[e("td",ne,[i(d).jobs.length?(a(),o(c,{key:0},[n("Nothing matches this filter.")],64)):(a(),o(c,{key:1},[n("No jobs recorded.")],64))])]))])])):(a(),S(U,{key:1,rows:5}))])])}}}),fe=M(re,[["__scopeId","data-v-4854a837"]]);export{fe as default};
|
|
2
|
+
//# sourceMappingURL=JobsView-CyZXyEfc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsView-BMWq45ys.js","sources":["../../src/views/JobsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** Job history. Polled by the shell already, so this view only filters what is in memory. */\nimport { computed, ref } from 'vue';\nimport { loadJobs, state } from '../composables/useControlPlane';\nimport { actionLabel, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport type { Job, JobState } from '../api/types';\nimport { supersededBy, waitReason } from '../composables/useJobQueue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst q = ref('');\nconst only = ref<'all' | JobState>('all');\n\n/**\n * Why a queued row is not moving, in the width of a table cell.\n *\n * The two waits are different problems: behind its own stack is the one-job-per-stack guarantee\n * doing its job, and the fix is to wait or stop the job ahead; at the host cap is a machine-wide\n * capacity fact, and the fix is PSTACK_MAX_JOBS. The job page spells both out.\n */\nfunction waitText(j: Job): string {\n const w = waitReason(j, state.jobs);\n if (w.kind === 'stack') return 'behind this stack\\u2019s own job';\n if (w.kind === 'slot') return `at the host cap \\u00b7 ${w.running} running`;\n return 'waiting its turn';\n}\n\n/** The newer job that took a superseded one's place, when it is still in the kept 50. */\nfunction replacement(j: Job): Job | null {\n return supersededBy(j, state.jobs);\n}\n\nconst rows = computed(() => {\n const needle = q.value.trim().toLowerCase();\n return state.jobs.filter((j) => {\n if (only.value !== 'all' && j.state !== only.value) return false;\n if (!needle) return true;\n return j.stack.toLowerCase().includes(needle) || j.action.includes(needle);\n });\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Jobs</h1>\n <div class=\"sub\">\n Most recent first, capped at the last 50\n <InfoHint label=\"why old jobs disappear\">\n The history is held in memory and a server restart clears it. A job record is the\n transcript of an attempt, not the truth about what exists — that truth lives in the\n containers themselves and in each axis's own probe.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"loadJobs\" />\n </div>\n\n <section class=\"panel\">\n <!-- Same one-row toolbar as Deployments — this page had kept the old stacked-label layout,\n and two list pages with two different toolbars reads as two different products. -->\n <div class=\"phead\">\n <div class=\"searchbox\">\n <svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n <path d=\"M16.5 16.5 21 21\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n <input\n id=\"jq\"\n v-model=\"q\"\n data-search\n type=\"search\"\n aria-label=\"Search jobs\"\n placeholder=\"Search by stack or action\"\n spellcheck=\"false\"\n />\n <kbd v-if=\"!q\">/</kbd>\n </div>\n <SelectMenu\n id=\"js\"\n v-model=\"only\"\n label=\"Filter by state\"\n :options=\"[\n { value: 'all', label: 'All states' },\n { value: 'queued', label: 'Queued' },\n { value: 'running', label: 'Running' },\n { value: 'ok', label: 'Ok' },\n { value: 'leaked', label: 'Leaked' },\n { value: 'failed', label: 'Failed' },\n { value: 'cancelled', label: 'Cancelled' },\n { value: 'superseded', label: 'Superseded' },\n ]\"\n />\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"5\" />\n\n <table v-else class=\"cards\">\n <thead>\n <tr>\n <th>State</th>\n <th>Action</th>\n <th>Stack</th>\n <th>Started</th>\n <th>Took</th>\n <th>Steps</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(j, i) in rows\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <td data-label=\"state\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n <StateBadge :state=\"j.state\" />\n </RouterLink>\n <!-- A badge says \"queued\"; it cannot say WHY, and why is the whole question when a\n deploy looks stuck. Same for superseded: the useful fact is which job won. -->\n <div v-if=\"j.state === 'queued'\" class=\"mute nowrap wait-why\">{{ waitText(j) }}</div>\n <div v-else-if=\"j.state === 'superseded'\" class=\"mute nowrap wait-why\">\n <template v-if=\"replacement(j)\">\n replaced by\n <RouterLink :to=\"`/jobs/${encodeURIComponent(replacement(j)!.id)}`\">\n a newer {{ actionLabel(replacement(j)!.action).toLowerCase() }}\n </RouterLink>\n </template>\n <template v-else>never ran</template>\n </div>\n </td>\n <td data-label=\"action\">{{ actionLabel(j.action) }}</td>\n <td class=\"name\" data-label=\"stack\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">{{ j.stack }}</RouterLink>\n </td>\n <td class=\"dim nowrap\" data-label=\"started\"><RelativeTime :at=\"j.startedAt\" /></td>\n <td class=\"dim nowrap\" data-label=\"took\">{{ took(j.startedAt, j.endedAt) }}</td>\n <td class=\"dim\" data-label=\"steps\">{{ j.outcome ? j.outcome.steps.length : '—' }}</td>\n </tr>\n <tr v-if=\"!rows.length\">\n <td colspan=\"6\" class=\"mute\">\n <template v-if=\"state.jobs.length\">Nothing matches this filter.</template>\n <template v-else>No jobs recorded.</template>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n</template>\n\n<style scoped>\n/* The one line under a badge. Same size as the badge itself so the cell reads as one unit, and\n scoped here rather than in app.css because nothing else has a second line under a state. */\n.wait-why {\n font-size: var(--t-xs);\n margin-top: var(--s1);\n}\n</style>\n"],"names":["q","ref","only","waitText","j","w","waitReason","state","replacement","supersededBy","rows","computed","needle","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","RefreshButton","_unref","loadJobs","_hoisted_3","_hoisted_4","_hoisted_5","$event","_openBlock","SelectMenu","_hoisted_7","_toDisplayString","_hoisted_8","_hoisted_9","_Fragment","_renderList","i","_hoisted_10","_component_RouterLink","StateBadge","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_createTextVNode","_hoisted_15","RelativeTime","_hoisted_16","took","_hoisted_17","_hoisted_18","_hoisted_19","_createBlock","SkeletonList"],"mappings":"iyCAcA,MAAMA,EAAIC,EAAI,EAAE,EACVC,EAAOD,EAAsB,KAAK,EASxC,SAASE,EAASC,EAAgB,CAChC,MAAMC,EAAIC,EAAWF,EAAGG,EAAM,IAAI,EAClC,OAAIF,EAAE,OAAS,QAAgB,8BAC3BA,EAAE,OAAS,OAAe,qBAA0BA,EAAE,OAAO,WAC1D,kBACT,CAGA,SAASG,EAAYJ,EAAoB,CACvC,OAAOK,EAAaL,EAAGG,EAAM,IAAI,CACnC,CAEA,MAAMG,EAAOC,EAAS,IAAM,CAC1B,MAAMC,EAASZ,EAAE,MAAM,KAAA,EAAO,YAAA,EAC9B,OAAOO,EAAM,KAAK,OAAQH,GACpBF,EAAK,QAAU,OAASE,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S,EAAqCoB,EAAA,CAAA,IAAA,GAAA,GAApB,WAAS,CAAA,qBAG9BnB,EAAwD,KAAxD2B,GAAwDX,EAA7BT,KAAYjB,EAAE,MAAM,CAAA,EAAA,CAAA,EAC/CU,EAEK,KAFL4B,GAEK,CADHxB,EAAgFmB,EAAA,CAAnE,GAAE,SAAW,mBAAmBjC,EAAE,EAAE,CAAA,EAAA,aAAK,IAAa,CAAVuC,EAAAb,EAAA1B,EAAE,KAAK,EAAA,CAAA,CAAA,uBAElEU,EAAmF,KAAnF8B,GAAmF,CAAvC1B,EAAkC2B,EAAA,CAAnB,GAAIzC,EAAE,SAAA,mBACjEU,EAAgF,KAAhFgC,GAAgFhB,EAApCT,EAAA0B,CAAA,EAAK3C,EAAE,UAAWA,EAAE,OAAO,CAAA,EAAA,CAAA,EACvEU,EAAsF,KAAtFkC,GAAsFlB,EAAhD1B,EAAE,QAAUA,EAAE,QAAQ,MAAM,OAAM,GAAA,EAAA,CAAA,CAAA,aAE/DM,EAAA,MAAK,qBAAhBG,EAKK,KAAAoC,GAAA,CAJHnC,EAGK,KAHLoC,GAGK,CAFa7B,EAAAd,CAAA,EAAM,KAAK,YAA3BM,EAA0EoB,EAAA,CAAA,IAAA,CAAA,EAAA,GAAvC,8BAA4B,CAAA,YAC/DpB,EAA6CoB,EAAA,CAAA,IAAA,GAAA,GAA5B,mBAAiB,CAAA,sBA3C1CkB,EAAwDC,EAAA,OAAX,KAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"JobsView-CyZXyEfc.js","sources":["../../src/views/JobsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** Job history. Polled by the shell already, so this view only filters what is in memory. */\nimport { computed, ref } from 'vue';\nimport { loadJobs, state } from '../composables/useControlPlane';\nimport { actionLabel, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport type { Job, JobState } from '../api/types';\nimport { supersededBy, waitReason } from '../composables/useJobQueue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst q = ref('');\nconst only = ref<'all' | JobState>('all');\n\n/**\n * Why a queued row is not moving, in the width of a table cell.\n *\n * The two waits are different problems: behind its own stack is the one-job-per-stack guarantee\n * doing its job, and the fix is to wait or stop the job ahead; at the host cap is a machine-wide\n * capacity fact, and the fix is PSTACK_MAX_JOBS. The job page spells both out.\n */\nfunction waitText(j: Job): string {\n const w = waitReason(j, state.jobs);\n if (w.kind === 'stack') return 'behind this stack\\u2019s own job';\n if (w.kind === 'slot') return `at the host cap \\u00b7 ${w.running} running`;\n return 'waiting its turn';\n}\n\n/** The newer job that took a superseded one's place, when it is still in the kept 50. */\nfunction replacement(j: Job): Job | null {\n return supersededBy(j, state.jobs);\n}\n\nconst rows = computed(() => {\n const needle = q.value.trim().toLowerCase();\n return state.jobs.filter((j) => {\n if (only.value !== 'all' && j.state !== only.value) return false;\n if (!needle) return true;\n return j.stack.toLowerCase().includes(needle) || j.action.includes(needle);\n });\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Jobs</h1>\n <div class=\"sub\">\n Most recent first, capped at the last 50\n <InfoHint label=\"why old jobs disappear\">\n The history is held in memory and a server restart clears it. A job record is the\n transcript of an attempt, not the truth about what exists — that truth lives in the\n containers themselves and in each axis's own probe.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"loadJobs\" />\n </div>\n\n <section class=\"panel\">\n <!-- Same one-row toolbar as Deployments — this page had kept the old stacked-label layout,\n and two list pages with two different toolbars reads as two different products. -->\n <div class=\"phead\">\n <div class=\"searchbox\">\n <svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n <path d=\"M16.5 16.5 21 21\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n <input\n id=\"jq\"\n v-model=\"q\"\n data-search\n type=\"search\"\n aria-label=\"Search jobs\"\n placeholder=\"Search by stack or action\"\n spellcheck=\"false\"\n />\n <kbd v-if=\"!q\">/</kbd>\n </div>\n <SelectMenu\n id=\"js\"\n v-model=\"only\"\n label=\"Filter by state\"\n :options=\"[\n { value: 'all', label: 'All states' },\n { value: 'queued', label: 'Queued' },\n { value: 'running', label: 'Running' },\n { value: 'ok', label: 'Ok' },\n { value: 'leaked', label: 'Leaked' },\n { value: 'failed', label: 'Failed' },\n { value: 'cancelled', label: 'Cancelled' },\n { value: 'superseded', label: 'Superseded' },\n ]\"\n />\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"5\" />\n\n <table v-else class=\"cards\">\n <thead>\n <tr>\n <th>State</th>\n <th>Action</th>\n <th>Stack</th>\n <th>Started</th>\n <th>Took</th>\n <th>Steps</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(j, i) in rows\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <td data-label=\"state\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n <StateBadge :state=\"j.state\" />\n </RouterLink>\n <!-- A badge says \"queued\"; it cannot say WHY, and why is the whole question when a\n deploy looks stuck. Same for superseded: the useful fact is which job won. -->\n <div v-if=\"j.state === 'queued'\" class=\"mute nowrap wait-why\">{{ waitText(j) }}</div>\n <div v-else-if=\"j.state === 'superseded'\" class=\"mute nowrap wait-why\">\n <template v-if=\"replacement(j)\">\n replaced by\n <RouterLink :to=\"`/jobs/${encodeURIComponent(replacement(j)!.id)}`\">\n a newer {{ actionLabel(replacement(j)!.action).toLowerCase() }}\n </RouterLink>\n </template>\n <template v-else>never ran</template>\n </div>\n </td>\n <td data-label=\"action\">{{ actionLabel(j.action) }}</td>\n <td class=\"name\" data-label=\"stack\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">{{ j.stack }}</RouterLink>\n </td>\n <td class=\"dim nowrap\" data-label=\"started\"><RelativeTime :at=\"j.startedAt\" /></td>\n <td class=\"dim nowrap\" data-label=\"took\">{{ took(j.startedAt, j.endedAt) }}</td>\n <td class=\"dim\" data-label=\"steps\">{{ j.outcome ? j.outcome.steps.length : '—' }}</td>\n </tr>\n <tr v-if=\"!rows.length\">\n <td colspan=\"6\" class=\"mute\">\n <template v-if=\"state.jobs.length\">Nothing matches this filter.</template>\n <template v-else>No jobs recorded.</template>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n</template>\n\n<style scoped>\n/* The one line under a badge. Same size as the badge itself so the cell reads as one unit, and\n scoped here rather than in app.css because nothing else has a second line under a state. */\n.wait-why {\n font-size: var(--t-xs);\n margin-top: var(--s1);\n}\n</style>\n"],"names":["q","ref","only","waitText","j","w","waitReason","state","replacement","supersededBy","rows","computed","needle","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","RefreshButton","_unref","loadJobs","_hoisted_3","_hoisted_4","_hoisted_5","$event","_openBlock","SelectMenu","_hoisted_7","_toDisplayString","_hoisted_8","_hoisted_9","_Fragment","_renderList","i","_hoisted_10","_component_RouterLink","StateBadge","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_createTextVNode","_hoisted_15","RelativeTime","_hoisted_16","took","_hoisted_17","_hoisted_18","_hoisted_19","_createBlock","SkeletonList"],"mappings":"iyCAcA,MAAMA,EAAIC,EAAI,EAAE,EACVC,EAAOD,EAAsB,KAAK,EASxC,SAASE,EAASC,EAAgB,CAChC,MAAMC,EAAIC,EAAWF,EAAGG,EAAM,IAAI,EAClC,OAAIF,EAAE,OAAS,QAAgB,8BAC3BA,EAAE,OAAS,OAAe,qBAA0BA,EAAE,OAAO,WAC1D,kBACT,CAGA,SAASG,EAA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as n,f as C,g as c,a6 as B,F as m,r as N,j as y,a7 as S,U as g,k as V,o as l,E as j}from"./index-BzdU0RNE.js";const F={class:"lv"},H={class:"lv-bar"},E={class:"lv-count"},L={key:0,class:"badge running"},U=["disabled"],z={key:0,class:"lv-empty"},D={key:0,class:"lv-sep"},M=["title"],O=["title"],P={class:"lv-msg"},$=x({__name:"LogViewer",props:{rows:{},live:{type:Boolean},copyText:{},emptyText:{}},setup(i){const r=i,d=y(null),u=y(!0);function k(){const t=d.value;return!!t&&t.scrollHeight-t.scrollTop-t.clientHeight<24}function f(){u.value=k()}async function v(){await S();const t=d.value;t&&u.value&&(t.scrollTop=t.scrollHeight)}b(()=>r.rows.length,v),_(v);function h(){u.value=!0,v()}async function w(){const t=r.copyText??r.rows.filter(o=>!o.separator).map(o=>[o.time,o.gutter,o.text].filter(Boolean).join(" ")).join(`
|
|
2
2
|
`);try{await navigator.clipboard.writeText(t),g("ok","Copied.")}catch{g("error","Could not copy — your browser blocked clipboard access.")}}const p=V(()=>r.rows.filter(t=>!t.separator).length);return T(()=>{}),(t,o)=>(l(),s("div",F,[a("div",H,[a("span",E,n(p.value)+" line"+n(p.value===1?"":"s"),1),i.live?(l(),s("span",L,[...o[0]||(o[0]=[a("span",{class:"dot pulse"},null,-1),C("live",-1)])])):c("",!0),o[1]||(o[1]=a("span",{class:"grow"},null,-1)),i.live&&!u.value?(l(),s("button",{key:1,class:"ghost sm",onClick:h},"↓ Follow")):c("",!0),a("button",{class:"ghost sm",disabled:!p.value,onClick:w},"Copy",8,U),B(t.$slots,"actions")]),a("div",{ref_key:"box",ref:d,class:"lv-box",role:"log","aria-live":"polite",onScrollPassive:f},[i.rows.length?c("",!0):(l(),s("p",z,n(i.emptyText??"No output."),1)),(l(!0),s(m,null,N(i.rows,e=>(l(),s(m,{key:e.key},[e.separator?(l(),s("div",D,[a("span",null,n(e.text),1)])):(l(),s("div",{key:1,class:j(["lv-row",e.tone])},[e.time!==void 0?(l(),s("span",{key:0,class:"lv-time",title:e.timeTitle},n(e.time),9,M)):c("",!0),e.gutter!==void 0?(l(),s("span",{key:1,class:"lv-gutter",title:e.gutterTitle},n(e.gutter),9,O)):c("",!0),a("span",P,n(e.text),1)],2))],64))),128))],544)]))}});export{$ as _};
|
|
3
|
-
//# sourceMappingURL=LogViewer.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
//# sourceMappingURL=LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogViewer.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js","sources":["../../src/components/LogViewer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The log surface — used by the job page (structured events) and the container-logs tab (raw text\n * that the parent parses into rows).\n *\n * WHY NOT A LIBRARY. There is no widely-adopted Vue log viewer to reach for (the React ones —\n * react-lazylog and friends — have no Vue counterpart with real adoption), and xterm — already a\n * dependency for the terminal — renders to canvas, so log text would stop being selectable,\n * copyable and findable with ⌘F. For LOGS those are the whole point. What a log view actually\n * needs is small: a gutter that never wraps, a message that wraps with a hanging indent, stickiness\n * at the bottom, and cheap rendering for thousands of rows (`content-visibility: auto` — the\n * browser skips layout for off-screen rows, no virtualisation library required).\n *\n * THE GUTTER IS TIME-OF-DAY, NOT A FULL TIMESTAMP. `2026-08-04 03:47:45` per line is 19 characters\n * of the same date repeated hundreds of times — on a narrow panel it wrapped every entry onto five\n * or six lines. Within one log the date almost never changes, so each row carries `03:47:45` and a\n * date SEPARATOR row appears only when the day actually flips. The full stamp survives in the\n * row's tooltip.\n *\n * FOLLOW IS A STATE THE USER CONTROLS BY SCROLLING. Pinned to the bottom, new lines keep it there;\n * one scroll up releases it (reading must never be yanked away); the \"Follow\" chip puts it back.\n */\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { toast } from '../composables/useToasts';\nimport type { LogRow } from './log-viewer-types';\n\nconst props = defineProps<{\n rows: LogRow[];\n /** Renders the live pulse and keeps follow meaningful; a finished log needs neither. */\n live?: boolean;\n /** What Copy puts on the clipboard — the parent knows the faithful raw form, this view does not. */\n copyText?: string;\n emptyText?: string;\n}>();\n\nconst box = ref<HTMLElement | null>(null);\nconst follow = ref(true);\n\nfunction atBottom(): boolean {\n const el = box.value;\n return !!el && el.scrollHeight - el.scrollTop - el.clientHeight < 24;\n}\n\nfunction onScroll(): void {\n // The USER moved — follow reflects where they left the viewport, with no flag juggling for\n // programmatic scrolls: after scrollTo(bottom), atBottom() is simply true.\n follow.value = atBottom();\n}\n\nasync function stick(): Promise<void> {\n await nextTick();\n const el = box.value;\n if (el && follow.value) el.scrollTop = el.scrollHeight;\n}\n\nwatch(() => props.rows.length, stick);\nonMounted(stick);\n\nfunction resume(): void {\n follow.value = true;\n void stick();\n}\n\nasync function copy(): Promise<void> {\n const text =\n props.copyText ??\n props.rows\n .filter((r) => !r.separator)\n .map((r) => [r.time, r.gutter, r.text].filter(Boolean).join(' '))\n .join('\\n');\n try {\n await navigator.clipboard.writeText(text);\n toast('ok', 'Copied.');\n } catch {\n toast('error', 'Could not copy — your browser blocked clipboard access.');\n }\n}\n\nconst count = computed(() => props.rows.filter((r) => !r.separator).length);\n\n// A page-level listener would steal browser find; scoping ⌘F to the box when it has focus would be\n// surprising. The box is plain DOM precisely so the browser's own find works — nothing to do here.\nonBeforeUnmount(() => {});\n</script>\n\n<template>\n <div class=\"lv\">\n <div class=\"lv-bar\">\n <span class=\"lv-count\">{{ count }} line{{ count === 1 ? '' : 's' }}</span>\n <span v-if=\"live\" class=\"badge running\"><span class=\"dot pulse\" />live</span>\n <span class=\"grow\" />\n <button v-if=\"live && !follow\" class=\"ghost sm\" @click=\"resume\">↓ Follow</button>\n <button class=\"ghost sm\" :disabled=\"!count\" @click=\"copy\">Copy</button>\n <slot name=\"actions\" />\n </div>\n\n <div ref=\"box\" class=\"lv-box\" role=\"log\" aria-live=\"polite\" @scroll.passive=\"onScroll\">\n <p v-if=\"!rows.length\" class=\"lv-empty\">{{ emptyText ?? 'No output.' }}</p>\n <template v-for=\"r in rows\" :key=\"r.key\">\n <div v-if=\"r.separator\" class=\"lv-sep\"><span>{{ r.text }}</span></div>\n <div v-else class=\"lv-row\" :class=\"r.tone\">\n <span v-if=\"r.time !== undefined\" class=\"lv-time\" :title=\"r.timeTitle\">{{ r.time }}</span>\n <span v-if=\"r.gutter !== undefined\" class=\"lv-gutter\" :title=\"r.gutterTitle\">{{ r.gutter }}</span>\n <span class=\"lv-msg\">{{ r.text }}</span>\n </div>\n </template>\n </div>\n </div>\n</template>\n"],"names":["props","__props","box","ref","follow","atBottom","el","onScroll","stick","nextTick","watch","onMounted","resume","copy","text","r","toast","count","computed","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_toDisplayString","_hoisted_4","_cache","_hoisted_5","_renderSlot","_ctx","_hoisted_6","_Fragment","_renderList","_hoisted_7","_normalizeClass","_hoisted_8","_hoisted_9","_hoisted_10"],"mappings":"qcA0BA,MAAMA,EAAQC,EASRC,EAAMC,EAAwB,IAAI,EAClCC,EAASD,EAAI,EAAI,EAEvB,SAASE,GAAoB,CAC3B,MAAMC,EAAKJ,EAAI,MACf,MAAO,CAAC,CAACI,GAAMA,EAAG,aAAeA,EAAG,UAAYA,EAAG,aAAe,EACpE,CAEA,SAASC,GAAiB,CAGxBH,EAAO,MAAQC,EAAA,CACjB,CAEA,eAAeG,GAAuB,CACpC,MAAMC,EAAA,EACN,MAAMH,EAAKJ,EAAI,MACXI,GAAMF,EAAO,QAAOE,EAAG,UAAYA,EAAG,aAC5C,CAEAI,EAAM,IAAMV,EAAM,KAAK,OAAQQ,CAAK,EACpCG,EAAUH,CAAK,EAEf,SAASI,GAAe,CACtBR,EAAO,MAAQ,GACVI,EAAA,CACP,CAEA,eAAeK,GAAsB,CACnC,MAAMC,EACJd,EAAM,UACNA,EAA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WAAS,YAAA,EAAA,CAAA,UACpDoB,EAOWY,EAAA,KAAAC,EAPWjC,EAAA,KAALc,aAAiB,IAAAA,EAAE,GAAA,GACvBA,EAAE,WAAbK,EAAA,EAAAC,EAAsE,MAAtEc,EAAsE,CAA/BZ,EAAyB,OAAA,KAAAG,EAAhBX,EAAE,IAAI,EAAA,CAAA,CAAA,SACtDM,EAIM,MAAA,OAJM,MAAKe,EAAA,CAAC,SAAiBrB,EAAE,IAAI,CAAA,CAAA,GAC3BA,EAAE,OAAS,YAAvBM,EAA0F,OAAA,OAAxD,MAAM,UAAW,MAAON,EAAE,SAAA,EAAcW,EAAAX,EAAE,IAAI,EAAA,EAAAsB,CAAA,YACpEtB,EAAE,SAAW,YAAzBM,EAAkG,OAAA,OAA9D,MAAM,YAAa,MAAON,EAAE,WAAA,EAAgBW,EAAAX,EAAE,MAAM,EAAA,EAAAuB,CAAA,YACxFf,EAAwC,OAAxCgB,EAAwCb,EAAhBX,EAAE,IAAI,EAAA,CAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as T,c as n,a as t,u as E,b as x,F as w,e as r,f as i,w as c,_ as C,g,h as I,i as S,v as q,t as p,r as L,j as y,k as h,l as N,m as P,n as B,o as a,p as z,q as A,s as D}from"./index-
|
|
2
|
-
//# sourceMappingURL=LoginView-
|
|
1
|
+
import{d as T,c as n,a as t,u as E,b as x,F as w,e as r,f as i,w as c,_ as C,g,h as I,i as S,v as q,t as p,r as L,j as y,k as h,l as N,m as P,n as B,o as a,p as z,q as A,s as D}from"./index-BzdU0RNE.js";import{_ as F}from"./ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js";import{E as M}from"./EquivalentCommand-CbJfYQaC.js";import{_ as W}from"./SsoMark.vue_vue_type_script_setup_true_lang-BXhQGdjJ.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";const O={class:"login-wrap"},G={class:"login-card panel"},H={class:"banner plain",style:{"margin-top":"var(--s3)"}},J={class:"mute",style:{"margin-top":"var(--s3)"}},K={class:"field",style:{"margin-top":"var(--s4)"}},Q={class:"field"},X={key:0,class:"banner failed",style:{"margin-top":"var(--s3)"}},Y={class:"row",style:{"margin-top":"var(--s4)"}},Z={key:0,class:"banner failed",style:{"margin-bottom":"var(--s3)"}},ee={class:"sso-list"},te=["onClick"],se=T({__name:"LoginView",setup(oe){const V=P(),l=B(),v=y(""),u=y(""),d=y(!1),m=y(""),b=h(()=>typeof l.query.next=="string"&&l.query.next.startsWith("/")?l.query.next:"/"),k=h(()=>typeof l.query.sso_error=="string"?l.query.sso_error:""),f=h(()=>{var s;return((s=x.sso)==null?void 0:s.providers)??[]}),U=h(()=>{const s=f.value.length===1?f.value[0]:void 0;return s?`Signing in with ${s.label} did not work.`:"Signing in did not work."});function $(s){window.location.assign(z.url(`/api/auth/sso/start?provider=${encodeURIComponent(s)}&next=${encodeURIComponent(b.value)}`))}async function _(){d.value=!0,m.value="";const s=await A(v.value.trim(),u.value);if(d.value=!1,s){m.value=s,u.value="";return}await D(),V.replace(b.value)}return(s,e)=>{const R=N("RouterLink");return a(),n("div",O,[t("div",G,[e[13]||(e[13]=t("h1",{style:{"font-size":"var(--t-xl)","margin-bottom":"var(--s2)"}},"Sign in",-1)),E(x).hasUsers===!1?(a(),n(w,{key:0},[e[6]||(e[6]=t("p",{class:"dim"}," No accounts exist on this server yet — create the first one, then sign in. ",-1)),t("div",H,[e[4]||(e[4]=t("b",null,"Create the first account",-1)),e[5]||(e[5]=t("p",null," This has to be done with the host token, from a terminal — a browser has no way to prove it is allowed to claim a fresh server. ",-1)),r(M,{what:"creating the first account",method:"POST",path:"/api/auth/bootstrap",body:{username:"you",password:"…"}}),t("p",J,[e[3]||(e[3]=i(" It can also be set up ahead of time when the host is first provisioned. ",-1)),r(C,{label:"how"},{default:c(()=>[...e[2]||(e[2]=[i(" Set the admin username and password in the environment before running the setup command on the host. They are honoured only while no account exists, so they cannot overwrite one later. ",-1)])]),_:1})])])],64)):g("",!0),t("form",{onSubmit:I(_,["prevent"])},[t("div",K,[e[7]||(e[7]=t("label",{for:"u"},"Username",-1)),S(t("input",{id:"u","onUpdate:modelValue":e[0]||(e[0]=o=>v.value=o),type:"text",autocomplete:"username",spellcheck:"false"},null,512),[[q,v.value]])]),t("div",Q,[e[8]||(e[8]=t("label",{for:"p"},"Password",-1)),S(t("input",{id:"p","onUpdate:modelValue":e[1]||(e[1]=o=>u.value=o),type:"password",autocomplete:"current-password"},null,512),[[q,u.value]])]),m.value?(a(),n("div",X,[t("p",null,p(m.value),1)])):g("",!0),t("div",Y,[r(F,{variant:"primary",pending:d.value,disabled:d.value||!v.value.trim()||!u.value,onClick:_},{default:c(()=>[i(p(d.value?"Signing in…":"Sign in"),1)]),_:1},8,["pending","disabled"]),e[11]||(e[11]=t("span",{class:"grow"},null,-1)),r(R,{to:"/settings",class:"mute"},{default:c(()=>[e[10]||(e[10]=i(" Use a token instead ",-1)),r(C,{label:"token access",align:"end"},{default:c(()=>[...e[9]||(e[9]=[i(" A bearer token in Settings — the machine token from ",-1),t("code",null,"pstack init",-1),i(", or a personal token from your account — authenticates every request without a session. ",-1)])]),_:1})]),_:1})])],32),f.value.length?(a(),n(w,{key:1},[e[12]||(e[12]=t("div",{class:"row",style:{margin:"var(--s4) 0","align-items":"center",gap:"var(--s3)"}},[t("hr",{style:{flex:"1",border:"0","border-top":"1px solid var(--line)"}}),t("span",{class:"mute",style:{"font-size":"var(--t-sm)"}},"or"),t("hr",{style:{flex:"1",border:"0","border-top":"1px solid var(--line)"}})],-1)),k.value?(a(),n("div",Z,[t("b",null,p(U.value),1),t("p",null,p(k.value),1)])):g("",!0),t("div",ee,[(a(!0),n(w,null,L(f.value,o=>(a(),n("button",{key:o.key,class:"sso-btn",onClick:ne=>$(o.key)},[r(W,{preset:o.preset},null,8,["preset"]),t("span",null,"Continue with "+p(o.label),1)],8,te))),128))])],64)):g("",!0)])])}}}),de=j(se,[["__scopeId","data-v-39e6ac69"]]);export{de as default};
|
|
2
|
+
//# sourceMappingURL=LoginView-Do6LVtZ6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoginView-Docai9d6.js","sources":["../../src/views/LoginView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Sign in — the one page reachable without a session.\n *\n * Two states it must distinguish, because they need opposite instructions:\n * - accounts exist → the form\n * - no accounts yet → bootstrap guidance. A dead login form with no way to create the\n * account it asks for is the worst version of this page.\n *\n * A bearer token in Settings also authenticates (CI-style access); the link stays visible for\n * operators who have the machine token and no account yet.\n */\nimport { computed, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { authState, checkAuth, login } from '../composables/useAuth';\nimport { api } from '../api/client';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\nimport SsoMark from '../components/SsoMark.vue';\n\nconst router = useRouter();\nconst route = useRoute();\n\nconst username = ref('');\nconst password = ref('');\nconst pending = ref(false);\nconst error = ref('');\n\n/** Where the guard wanted to go. Also what the SSO round trip carries and comes back to. */\nconst next = computed(() =>\n typeof route.query.next === 'string' && route.query.next.startsWith('/') ? route.query.next : '/',\n);\n\n/**\n * The provider failed or refused. It arrives in the query string because the callback is a REDIRECT\n * — there is no fetch to read a body from — and it is the provider's own words, so it renders as\n * text and never as markup.\n */\nconst ssoError = computed(() => (typeof route.query.sso_error === 'string' ? route.query.sso_error : ''));\n\n/** The enabled providers, one button each. Empty until /api/health has answered. */\nconst ssoProviders = computed(() => authState.sso?.providers ?? []);\n\n/**\n * The banner must name the provider that failed. With one provider that is known locally; with\n * several, the server prefixes its label onto the message itself, so the generic title is enough.\n */\nconst ssoErrorTitle = computed(() => {\n const only = ssoProviders.value.length === 1 ? ssoProviders.value[0] : undefined;\n return only ? `Signing in with ${only.label} did not work.` : 'Signing in did not work.';\n});\n\n/**\n * A full navigation, not a fetch: the whole point is to leave this origin for the provider's\n * consent screen. `api.url` so a dev session pointed at a tunnelled host still reaches its API.\n */\nfunction signInWithProvider(key: string): void {\n window.location.assign(\n api.url(`/api/auth/sso/start?provider=${encodeURIComponent(key)}&next=${encodeURIComponent(next.value)}`),\n );\n}\n\nasync function submit(): Promise<void> {\n pending.value = true;\n error.value = '';\n const failure = await login(username.value.trim(), password.value);\n pending.value = false;\n if (failure) {\n error.value = failure;\n password.value = '';\n return;\n }\n await checkAuth();\n // Back to wherever the guard bounced them from, or home.\n void router.replace(next.value);\n}\n</script>\n\n<template>\n <div class=\"login-wrap\">\n <div class=\"login-card panel\">\n <h1 style=\"font-size: var(--t-xl); margin-bottom: var(--s2)\">Sign in</h1>\n\n <template v-if=\"authState.hasUsers === false\">\n <p class=\"dim\">\n No accounts exist on this server yet — create the first one, then sign in.\n </p>\n <!--\n A curl block used to sit here permanently, on the FIRST screen anyone sees. It is needed\n exactly once per host and by one person; behind the button it costs a click then and\n nothing on every later visit — and it is generated, so it cannot drift from the route.\n -->\n <div class=\"banner plain\" style=\"margin-top: var(--s3)\">\n <b>Create the first account</b>\n <p>\n This has to be done with the host token, from a terminal — a browser has no way to prove\n it is allowed to claim a fresh server.\n </p>\n <EquivalentCommand\n what=\"creating the first account\"\n method=\"POST\"\n path=\"/api/auth/bootstrap\"\n :body=\"{ username: 'you', password: '…' }\"\n />\n <p class=\"mute\" style=\"margin-top: var(--s3)\">\n It can also be set up ahead of time when the host is first provisioned.\n <InfoHint label=\"how\">\n Set the admin username and password in the environment before running the setup\n command on the host. They are honoured only while no account exists, so they cannot\n overwrite one later.\n </InfoHint>\n </p>\n </div>\n </template>\n\n <form @submit.prevent=\"submit\">\n <div class=\"field\" style=\"margin-top: var(--s4)\">\n <label for=\"u\">Username</label>\n <input id=\"u\" v-model=\"username\" type=\"text\" autocomplete=\"username\" spellcheck=\"false\" />\n </div>\n <div class=\"field\">\n <label for=\"p\">Password</label>\n <input id=\"p\" v-model=\"password\" type=\"password\" autocomplete=\"current-password\" />\n </div>\n\n <div v-if=\"error\" class=\"banner failed\" style=\"margin-top: var(--s3)\">\n <p>{{ error }}</p>\n </div>\n\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending\"\n :disabled=\"pending || !username.trim() || !password\"\n @click=\"submit\"\n >\n {{ pending ? 'Signing in…' : 'Sign in' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink to=\"/settings\" class=\"mute\">\n Use a token instead\n <InfoHint label=\"token access\" align=\"end\">\n A bearer token in Settings — the machine token from <code>pstack init</code>, or a\n personal token from your account — authenticates every request without a session.\n </InfoHint>\n </RouterLink>\n </div>\n </form>\n\n <!-- ── the providers, below the form: one full-width button each, so one configured\n provider and five lay out the same way. Below rather than above because the health\n probe answers after first paint — buttons appearing UNDER the form do not shove the\n username field out from beneath the pointer. -->\n <template v-if=\"ssoProviders.length\">\n <div class=\"row\" style=\"margin: var(--s4) 0; align-items: center; gap: var(--s3)\">\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">or</span>\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n </div>\n <div v-if=\"ssoError\" class=\"banner failed\" style=\"margin-bottom: var(--s3)\">\n <b>{{ ssoErrorTitle }}</b>\n <!-- The provider's (or server's) own words — arrives via redirect query, rendered as\n text and never as markup. -->\n <p>{{ ssoError }}</p>\n </div>\n <div class=\"sso-list\">\n <button v-for=\"p in ssoProviders\" :key=\"p.key\" class=\"sso-btn\" @click=\"signInWithProvider(p.key)\">\n <SsoMark :preset=\"p.preset\" />\n <span>Continue with {{ p.label }}</span>\n </button>\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<style scoped>\n/* The shell centres this now — see `.shell.no-rail .view`. A second centring context here would\n * fight it, and `min-height: 70vh` was what pinned the card toward the top of the window. */\n/* `100%`, not `92vw`: the shell already insets this by its own padding, so a viewport-relative\n * width added on top overflowed the right edge on a phone (measured 32px/0px at 390). */\n.login-wrap {\n width: min(420px, 100%);\n}\n.login-card {\n width: 100%;\n}\n\n/* One neutral button per provider: the brand mark carries the identity, the button stays the\n * app's own control — a row of provider-branded buttons is a ransom note. */\n.sso-list {\n display: flex;\n flex-direction: column;\n gap: var(--s2);\n}\n.sso-btn {\n width: 100%;\n justify-content: center;\n}\n.sso-btn svg {\n flex: none;\n}\n</style>\n"],"names":["router","useRouter","route","useRoute","username","ref","password","pending","error","next","computed","ssoError","ssoProviders","_a","authState","ssoErrorTitle","only","signInWithProvider","key","api","submit","failure","login","checkAuth","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_unref","_Fragment","_hoisted_3","_createVNode","EquivalentCommand","_hoisted_4","InfoHint","_hoisted_5","$event","_hoisted_6","_hoisted_7","_hoisted_8","ActionButton","_component_RouterLink","_hoisted_9","_hoisted_10","_renderList","p","SsoMark","_toDisplayString"],"mappings":"q8BAqBA,MAAMA,EAASC,EAAA,EACTC,EAAQC,EAAA,EAERC,EAAWC,EAAI,EAAE,EACjBC,EAAWD,EAAI,EAAE,EACjBE,EAAUF,EAAI,EAAK,EACnBG,EAAQH,EAAI,EAAE,EAGdI,EAAOC,EAAS,IACpB,OAAOR,EAAM,MAAM,MAAS,UAAYA,EAAM,MAAM,KAAK,WAAW,GAAG,EAAIA,EAAM,MAAM,KAAO,GAAA,EAQ1FS,EAAWD,EAAS,IAAO,OAAOR,EAAM,MAAM,WAAc,SAAWA,EAAM,MAAM,UAAY,EAAG,EAGlGU,EAAeF,EAAS,IAAA,OAAM,QAAAG,EAAAC,EAAU,MAAV,YAAAD,EAAe,YAAa,GAAE,EAM5DE,EAAgBL,EAAS,IAAM,CACnC,MAAMM,EAAOJ,EAAa,MAAM,SAAW,EAAIA,EAAa,MAAM,CAAC,EAAI,OACvE,OAAOI,EAAO,mBAAmBA,EAAK,KAAK,iBAAmB,0BAChE,CAAC,EAMD,SAASC,EAAmBC,EAAmB,CAC7C,OAAO,SAAS,O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MAAa,YAA7Ba,EAkBWM,EAAA,CAAA,IAAA,GAAA,eAjBTJ,EAIM,MAAA,CAJD,MAAM,MAAM,MAAA,CAAA,OAAA,cAAA,cAAA,SAAA,IAAA,WAAA,CAAA,GACfA,EAAoE,KAAA,CAAhE,MAAA,CAAA,KAAA,IAAA,OAAA,IAAA,aAAA,uBAAA,CAAA,CAA6D,EACjEA,EAA2D,OAAA,CAArD,MAAM,OAAO,MAAA,CAAA,YAAA,aAAA,CAAA,EAA+B,IAAE,EACpDA,EAAoE,KAAA,CAAhE,MAAA,CAAA,KAAA,IAAA,OAAA,IAAA,aAAA,wBAAA,CAA6D,CAAA,OAExDhB,EAAA,OAAXa,EAAA,EAAAC,EAKM,MALNmB,EAKM,CAJJjB,EAA0B,WAApBZ,EAAA,KAAa,EAAA,CAAA,EAGnBY,EAAqB,WAAfhB,EAAA,KAAQ,EAAA,CAAA,CAAA,aAEhBgB,EAKM,MALNkB,GAKM,QAJJpB,EAGSM,EAAA,KAAAe,EAHWlC,EAAA,MAALmC,QAAftB,EAGS,SAAA,CAH0B,IAAKsB,EAAE,IAAK,MAAM,UAAW,QAAKT,IAAErB,EAAmB8B,EAAE,GAAG,CAAA,GAC7Fd,EAA8Be,EAAA,CAApB,OAAQD,EAAE,MAAA,qBACpBpB,EAAwC,OAAA,KAAlC,iBAAcsB,EAAGF,EAAE,KAAK,EAAA,CAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"LoginView-Do6LVtZ6.js","sources":["../../src/views/LoginView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Sign in — the one page reachable without a session.\n *\n * Two states it must distinguish, because they need opposite instructions:\n * - accounts exist → the form\n * - no accounts yet → bootstrap guidance. A dead login form with no way to create the\n * account it asks for is the worst version of this page.\n *\n * A bearer token in Settings also authenticates (CI-style access); the link stays visible for\n * operators who have the machine token and no account yet.\n */\nimport { computed, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { authState, checkAuth, login } from '../composables/useAuth';\nimport { api } from '../api/client';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\nimport SsoMark from '../components/SsoMark.vue';\n\nconst router = useRouter();\nconst route = useRoute();\n\nconst username = ref('');\nconst password = ref('');\nconst pending = ref(false);\nconst error = ref('');\n\n/** Where the guard wanted to go. Also what the SSO round trip carries and comes back to. */\nconst next = computed(() =>\n typeof route.query.next === 'string' && route.query.next.startsWith('/') ? route.query.next : '/',\n);\n\n/**\n * The provider failed or refused. It arrives in the query string because the callback is a REDIRECT\n * — there is no fetch to read a body from — and it is the provider's own words, so it renders as\n * text and never as markup.\n */\nconst ssoError = computed(() => (typeof route.query.sso_error === 'string' ? route.query.sso_error : ''));\n\n/** The enabled providers, one button each. Empty until /api/health has answered. */\nconst ssoProviders = computed(() => authState.sso?.providers ?? []);\n\n/**\n * The banner must name the provider that failed. With one provider that is known locally; with\n * several, the server prefixes its label onto the message itself, so the generic title is enough.\n */\nconst ssoErrorTitle = computed(() => {\n const only = ssoProviders.value.length === 1 ? ssoProviders.value[0] : undefined;\n return only ? `Signing in with ${only.label} did not work.` : 'Signing in did not work.';\n});\n\n/**\n * A full navigation, not a fetch: the whole point is to leave this origin for the provider's\n * consent screen. `api.url` so a dev session pointed at a tunnelled host still reaches its API.\n */\nfunction signInWithProvider(key: string): void {\n window.location.assign(\n api.url(`/api/auth/sso/start?provider=${encodeURIComponent(key)}&next=${encodeURIComponent(next.value)}`),\n );\n}\n\nasync function submit(): Promise<void> {\n pending.value = true;\n error.value = '';\n const failure = await login(username.value.trim(), password.value);\n pending.value = false;\n if (failure) {\n error.value = failure;\n password.value = '';\n return;\n }\n await checkAuth();\n // Back to wherever the guard bounced them from, or home.\n void router.replace(next.value);\n}\n</script>\n\n<template>\n <div class=\"login-wrap\">\n <div class=\"login-card panel\">\n <h1 style=\"font-size: var(--t-xl); margin-bottom: var(--s2)\">Sign in</h1>\n\n <template v-if=\"authState.hasUsers === false\">\n <p class=\"dim\">\n No accounts exist on this server yet — create the first one, then sign in.\n </p>\n <!--\n A curl block used to sit here permanently, on the FIRST screen anyone sees. It is needed\n exactly once per host and by one person; behind the button it costs a click then and\n nothing on every later visit — and it is generated, so it cannot drift from the route.\n -->\n <div class=\"banner plain\" style=\"margin-top: var(--s3)\">\n <b>Create the first account</b>\n <p>\n This has to be done with the host token, from a terminal — a browser has no way to prove\n it is allowed to claim a fresh server.\n </p>\n <EquivalentCommand\n what=\"creating the first account\"\n method=\"POST\"\n path=\"/api/auth/bootstrap\"\n :body=\"{ username: 'you', password: '…' }\"\n />\n <p class=\"mute\" style=\"margin-top: var(--s3)\">\n It can also be set up ahead of time when the host is first provisioned.\n <InfoHint label=\"how\">\n Set the admin username and password in the environment before running the setup\n command on the host. They are honoured only while no account exists, so they cannot\n overwrite one later.\n </InfoHint>\n </p>\n </div>\n </template>\n\n <form @submit.prevent=\"submit\">\n <div class=\"field\" style=\"margin-top: var(--s4)\">\n <label for=\"u\">Username</label>\n <input id=\"u\" v-model=\"username\" type=\"text\" autocomplete=\"username\" spellcheck=\"false\" />\n </div>\n <div class=\"field\">\n <label for=\"p\">Password</label>\n <input id=\"p\" v-model=\"password\" type=\"password\" autocomplete=\"current-password\" />\n </div>\n\n <div v-if=\"error\" class=\"banner failed\" style=\"margin-top: var(--s3)\">\n <p>{{ error }}</p>\n </div>\n\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending\"\n :disabled=\"pending || !username.trim() || !password\"\n @click=\"submit\"\n >\n {{ pending ? 'Signing in…' : 'Sign in' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink to=\"/settings\" class=\"mute\">\n Use a token instead\n <InfoHint label=\"token access\" align=\"end\">\n A bearer token in Settings — the machine token from <code>pstack init</code>, or a\n personal token from your account — authenticates every request without a session.\n </InfoHint>\n </RouterLink>\n </div>\n </form>\n\n <!-- ── the providers, below the form: one full-width button each, so one configured\n provider and five lay out the same way. Below rather than above because the health\n probe answers after first paint — buttons appearing UNDER the form do not shove the\n username field out from beneath the pointer. -->\n <template v-if=\"ssoProviders.length\">\n <div class=\"row\" style=\"margin: var(--s4) 0; align-items: center; gap: var(--s3)\">\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">or</span>\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n </div>\n <div v-if=\"ssoError\" class=\"banner failed\" style=\"margin-bottom: var(--s3)\">\n <b>{{ ssoErrorTitle }}</b>\n <!-- The provider's (or server's) own words — arrives via redirect query, rendered as\n text and never as markup. -->\n <p>{{ ssoError }}</p>\n </div>\n <div class=\"sso-list\">\n <button v-for=\"p in ssoProviders\" :key=\"p.key\" class=\"sso-btn\" @click=\"signInWithProvider(p.key)\">\n <SsoMark :preset=\"p.preset\" />\n <span>Continue with {{ p.label }}</span>\n </button>\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<style scoped>\n/* The shell centres this now — see `.shell.no-rail .view`. A second centring context here would\n * fight it, and `min-height: 70vh` was what pinned the card toward the top of the window. */\n/* `100%`, not `92vw`: the shell already insets this by its own padding, so a viewport-relative\n * width added on top overflowed the right edge on a phone (measured 32px/0px at 390). */\n.login-wrap {\n width: min(420px, 100%);\n}\n.login-card {\n width: 100%;\n}\n\n/* One neutral button per provider: the brand mark carries the identity, the button stays the\n * app's own control — a row of provider-branded buttons is a ransom note. */\n.sso-list {\n display: flex;\n flex-direction: column;\n gap: var(--s2);\n}\n.sso-btn {\n width: 100%;\n justify-content: center;\n}\n.sso-btn svg {\n flex: none;\n}\n</style>\n"],"names":["router","useRouter","route","useRoute","username","ref","password","pending","error","next","computed","ssoError","ssoProviders","_a","authState","ssoErrorTitle","only","signInWithProvider","key","api","submit","failure","login","checkAuth","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_unref","_Fragment","_hoisted_3","_createVNode","EquivalentCommand","_hoisted_4","InfoHint","_hoisted_5","$event","_hoisted_6","_hoisted_7","_hoisted_8","ActionButton","_component_RouterLink","_hoisted_9","_hoisted_10","_renderList","p","SsoMark","_toDisplayString"],"mappings":"q8BAqBA,MAAMA,EAASC,EAAA,EACTC,EAAQC,EAAA,EAERC,EAAWC,EAAI,EAAE,EACjBC,EAAWD,EAAI,EAAE,EACjBE,EAAUF,EAAI,EAAK,EACnBG,EAAQH,EAAI,EAAE,EAGdI,EAAOC,EAAS,IACpB,OAAOR,EAAM,MAAM,MAAS,UAAYA,EAAM,MAAM,KAAK,WAAW,GAAG,EAAIA,EAAM,MAAM,KAAO,GAAA,EAQ1FS,EAAWD,EAAS,IAAO,OAAOR,EAAM,MAAM,WAAc,SAAWA,EAAM,MAAM,UAAY,EAAG,EAGlGU,EAAeF,EAAS,IAAA,OAAM,QAAAG,EAAAC,EAAU,MAAV,YAAAD,EAAe,YAAa,GAAE,EAM5DE,EAAgBL,EAAS,IAAM,CACnC,MAAMM,EAAOJ,EAAa,MAAM,SAAW,EAAIA,EAAa,MAAM,CAAC,EAAI,OACvE,OAAOI,EAAO,mBAAmBA,EAAK,KAAK,iBAAmB,0BAChE,CAAC,EAMD,SAASC,EAAmBC,EAAmB,CAC7C,OAAO,SAAS,OACdC,EAAI,IAAI,gCAAgC,mBAAmBD,CAAG,CAAC,SAAS,mBAAmBT,EAAK,KAAK,CAAC,EAAE,CAAA,CAE5G,CAEA,eAAeW,GAAwB,CACrCb,EAAQ,MAAQ,GAChBC,EAAM,MAAQ,GACd,MAAMa,EAAU,MAAMC,EAAMlB,EAAS,MAAM,KAAA,EAAQE,EAAS,KAAK,EAEjE,GADAC,EAAQ,MAAQ,GACZc,EAAS,CACXb,EAAM,MAAQa,EACdf,EAAS,MAAQ,GACjB,MACF,CACA,MAAMiB,EAAA,EAEDvB,EAAO,QAAQS,EAAK,KAAK,CAChC,uCAIE,OAAAe,EAAA,EAAAC,EA8FM,MA9FNC,EA8F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,EAAAC,EAKM,MALNmB,EAKM,CAJJjB,EAA0B,WAApBZ,EAAA,KAAa,EAAA,CAAA,EAGnBY,EAAqB,WAAfhB,EAAA,KAAQ,EAAA,CAAA,CAAA,aAEhBgB,EAKM,MALNkB,GAKM,QAJJpB,EAGSM,EAAA,KAAAe,EAHWlC,EAAA,MAALmC,QAAftB,EAGS,SAAA,CAH0B,IAAKsB,EAAE,IAAK,MAAM,UAAW,QAAKT,IAAErB,EAAmB8B,EAAE,GAAG,CAAA,GAC7Fd,EAA8Be,EAAA,CAApB,OAAQD,EAAE,MAAA,qBACpBpB,EAAwC,OAAA,KAAlC,iBAAcsB,EAAGF,EAAE,KAAK,EAAA,CAAA,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{d as ue,N as O,Q as de,c as n,a as s,e as M,i as W,L as G,f as i,u as w,E as A,t as r,g as x,F as y,r as ve,v as me,w as K,_ as Y,z as ce,j as c,k as I,p as H,V as P,C as pe,n as fe,m as he,o as a,M as ge}from"./index-
|
|
1
|
+
import{d as ue,N as O,Q as de,c as n,a as s,e as M,i as W,L as G,f as i,u as w,E as A,t as r,g as x,F as y,r as ve,v as me,w as K,_ as Y,z as ce,j as c,k as I,p as H,V as P,C as pe,n as fe,m as he,o as a,M as ge}from"./index-BzdU0RNE.js";import{d as u}from"./useDeployment-D3f7oVQg.js";import{_ as ee}from"./SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js";import{_ as ye}from"./LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js";import"./useVars-VN9gYdR6.js";import"./Teleport-DwPgOPS3.js";const be={class:"panel"},ke={class:"phead"},we={class:"field inline"},xe={class:"field inline"},Ce={class:"check"},_e=["disabled","title"],Le=["disabled","title"],Se={key:0,class:"progress","aria-hidden":"true"},$e={key:0,class:"mute"},Fe={key:1,class:"mute"},Re={key:0,class:"banner failed"},Te={key:1,class:"banner warn"},Ve={class:"logs-split"},Ne={class:"clist","aria-label":"Containers"},Ue={class:"clist-sub"},Ee=["onClick"],Me={class:"clist-name"},Ae={key:0,class:"badge warn"},Ie={class:"clist-sub mono"},qe={key:0,class:"hint"},Be={class:"logs-main"},je={class:"row",style:{"margin-bottom":"var(--s3)"}},ze={class:"field grow"},De={class:"check"},Oe={key:0,class:"log"},We={key:2,class:"hint"},He={key:3,class:"hint"},Pe={key:1,class:"mute"},X=5e3,et=ue({__name:"LogsTab",setup(Xe){const J=fe(),te=he(),S=c(200),R=c(""),$=c(!1),f=c(""),p=c([]),g=I(()=>p.value.find(t=>t.name===f.value)??null),q=I(()=>{var t;return((t=g.value)==null?void 0:t.service)??""});async function se(){const t=await H.get(`/api/deployments/${encodeURIComponent(u.id)}/runtime${P(u.vars)}`);t.ok&&(p.value=[...t.body.containers].sort((e,l)=>(e.service??e.name).localeCompare(l.service??l.name)))}const T=c(""),d=c(null),V=c(""),C=c(!1);O(()=>{var t;return[u.id,!!((t=u.detail)!=null&&t.compose)]},([t,e],l)=>{(!l||l[0]!==t)&&(p.value=[],f.value="",d.value=null),e&&p.value.length===0&&se()},{immediate:!0}),O([p,()=>J.query.container],([t,e])=>{const l=typeof e=="string"?e:"";!l||!t.length||f.value===l||t.some(m=>m.name===l)&&(f.value=l,B())},{immediate:!0});function Q(t){f.value!==t&&(f.value=t,te.replace({query:{...J.query,container:t||void 0}}),B())}async function B(){var m;if(!((m=u.detail)!=null&&m.compose))return;const t=u.id;C.value=!0,V.value="";const e=q.value,l=await H.get(`/api/deployments/${encodeURIComponent(t)}/logs${P(u.vars,{tail:S.value,...e?{service:e}:{},...R.value?{since:R.value}:{},...$.value?{timestamps:1}:{}})}`);if(C.value=!1,u.id===t&&!(l.ok&&(l.body.service??"")!==e)){if(!l.ok){d.value=null,V.value=pe(l,"load the logs");return}d.value={...l.body,ok:l.body.ok!==!1,text:l.body.text??""}}}const v=c(!1),h=c([]);let b=null;function F(){b==null||b.close(),b=null,v.value=!1}function Z(){F(),h.value=[];const t=P(u.vars,{tail:S.value,...q.value?{service:q.value}:{},...$.value?{timestamps:1}:{}});b=new EventSource(H.url(`/api/deployments/${encodeURIComponent(u.id)}/logs/stream${t}`)),v.value=!0,b.onmessage=e=>{const l=JSON.parse(e.data);if(l.done){h.value.push(`— ${l.reason??"stream ended"} —`),F();return}l.line!==void 0&&(h.value.push(l.line),h.value.length>X&&h.value.splice(0,h.value.length-X))},b.onerror=()=>F()}function le(){v.value?F():Z()}O([f,$,S],()=>{v.value&&Z()}),de(F);const j=I(()=>{var m;const t=v.value||h.value.length?h.value.join(`
|
|
2
2
|
`):((m=d.value)==null?void 0:m.text)??"",e=T.value.trim().toLowerCase();if(!e)return t;const l=t.split(`
|
|
3
3
|
`).filter(k=>k.toLowerCase().includes(e));return l.length?l.join(`
|
|
4
4
|
`):`(no line matches "${T.value}")`}),z=c(!1),oe=/^(\S+)\s+\| /,ae=/^(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\s/,ne=I(()=>{var k;const t=j.value;if(!t||t.startsWith("(no line matches"))return[];const e=new Map,l=((k=g.value)==null?void 0:k.name)??"",m=[];return t.split(`
|
|
5
5
|
`).forEach((_,o)=>{const N=oe.exec(_);if(!N){m.push({key:o,text:_});return}const L=N[1];if(l&&L!==l&&p.value.some(re=>re.name===L))return;let U=_.slice(N[0].length),E;const D=ae.exec(U);D&&(E=D[1],U=U.slice(D[0].length)),e.has(L)||e.set(L,e.size%6),m.push({key:o,gutter:L,text:U,tone:`svc-${e.get(L)}`,...E?{time:new Date(E).toTimeString().slice(0,8),timeTitle:E}:{}})}),m}),ie=t=>t.state==="running"&&t.health!=="unhealthy"?"s-ok":t.state==="exited"&&t.exitCode===0?"mute":"s-failed";return(t,e)=>{var l,m,k,_;return a(),n("section",be,[s("div",ke,[e[9]||(e[9]=s("h2",{class:"section"},"Compose logs",-1)),e[10]||(e[10]=s("span",{class:"grow"},null,-1)),s("div",we,[e[6]||(e[6]=s("label",{for:"tail"},"Lines",-1)),M(ee,{id:"tail","model-value":String(S.value),label:"How many lines",options:[{value:"50",label:"50"},{value:"200",label:"200"},{value:"500",label:"500"},{value:"1000",label:"1000"},{value:"2000",label:"2000"}],"onUpdate:modelValue":e[0]||(e[0]=o=>S.value=Number(o))},null,8,["model-value"])]),s("div",xe,[e[7]||(e[7]=s("label",{for:"since"},"Since",-1)),M(ee,{id:"since",modelValue:R.value,"onUpdate:modelValue":e[1]||(e[1]=o=>R.value=o),label:"How far back",options:[{value:"",label:"Anything kept"},{value:"5m",label:"Last 5 minutes"},{value:"30m",label:"Last 30 minutes"},{value:"1h",label:"Last hour"},{value:"24h",label:"Last day"}]},null,8,["modelValue"])]),s("label",Ce,[W(s("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>$.value=o),type:"checkbox"},null,512),[[G,$.value]]),e[8]||(e[8]=i(" Timestamps ",-1))]),s("button",{class:A(v.value?"danger":""),disabled:!((l=w(u).detail)!=null&&l.compose),title:v.value?"Stop streaming":"Stream new lines as they arrive",onClick:le},r(v.value?"Stop following":"Follow"),11,_e),s("button",{class:"primary",disabled:C.value||v.value||!((m=w(u).detail)!=null&&m.compose),title:v.value?"Already streaming live.":void 0,onClick:B},[i(r(C.value?"Reading…":d.value?"Refresh":"Fetch")+" ",1),C.value?(a(),n("span",Se)):x("",!0)],8,Le)]),w(u).detail?w(u).detail.compose?(a(),n(y,{key:2},[V.value?(a(),n("div",Re,r(V.value),1)):d.value&&!d.value.ok?(a(),n("div",Te,[s("b",null,r(((k=w(u).detail)==null?void 0:k.orchestrator)==="swarm"?"docker service logs":"Compose")+" exited non-zero.",1),s("p",null,[(_=w(u).detail)!=null&&_.asleep?(a(),n(y,{key:0},[e[12]||(e[12]=i(" This deployment is ",-1)),e[13]||(e[13]=s("b",null,"asleep",-1)),e[14]||(e[14]=i(" — its containers are gone until something wakes it, and there is nothing to read logs from. ",-1))],64)):(a(),n(y,{key:1},[i(" Most often the project does not exist yet (nothing has been brought up), or a profile is missing. Any output it did produce is below. ")],64))])])):x("",!0),s("div",Ve,[s("aside",Ne,[s("button",{class:A(["clist-item",{on:f.value===""}]),onClick:e[3]||(e[3]=o=>Q(""))},[e[15]||(e[15]=s("span",{class:"clist-name"},"All services",-1)),s("span",Ue,r(p.value.length)+" container"+r(p.value.length===1?"":"s"),1)],2),(a(!0),n(y,null,ve(p.value,o=>(a(),n("button",{key:o.id,class:A(["clist-item",{on:f.value===o.name}]),onClick:N=>Q(o.name)},[s("span",Me,[i(r(o.service??o.name)+" ",1),o.restartCount>0?(a(),n("span",Ae,r(o.restartCount)+"×",1)):x("",!0)]),s("span",Ie,r(o.name),1),s("span",{class:A(["clist-state",ie(o)])},r(w(ge)(o.health??o.state)),3)],10,Ee))),128)),p.value.length?x("",!0):(a(),n("p",qe," No containers. Nothing has been brought up, or their profile is not selected. "))]),s("div",Be,[s("div",je,[s("div",ze,[e[16]||(e[16]=s("label",{for:"lf"},"Search in these lines",-1)),W(s("input",{id:"lf","onUpdate:modelValue":e[4]||(e[4]=o=>T.value=o),"data-search":"",type:"search",placeholder:"Substring",spellcheck:"false"},null,512),[[me,T.value]])]),s("label",De,[W(s("input",{"onUpdate:modelValue":e[5]||(e[5]=o=>z.value=o),type:"checkbox"},null,512),[[G,z.value]]),e[18]||(e[18]=i(" Raw output ",-1)),M(Y,{label:"when raw matters"},{default:K(()=>[...e[17]||(e[17]=[i(" The pretty view lifts each line's container prefix into a coloured column and its timestamp into the time gutter. Raw is the exact text the server sent — the form to paste into a bug report or compare with someone else's copy. ",-1)])]),_:1})])]),d.value||v.value||h.value.length?(a(),n(y,{key:0},[z.value?(a(),n("pre",Oe,r(j.value||"(no output)"),1)):(a(),ce(ye,{key:1,rows:ne.value,live:v.value,"copy-text":j.value,"empty-text":v.value?"Waiting for output…":"(no output)"},null,8,["rows","live","copy-text","empty-text"])),v.value?(a(),n("p",We," Following "+r(g.value?g.value.name:"the whole stack")+" — new lines appear as they are written, up to "+r(X.toLocaleString())+" kept on screen. ",1)):d.value?(a(),n("p",He,[i(r(d.value.lines??0)+" line"+r((d.value.lines??0)===1?"":"s")+" ",1),g.value?(a(),n(y,{key:0},[e[19]||(e[19]=i("from ",-1)),s("b",null,r(g.value.name),1)],64)):(a(),n(y,{key:1},[i("across the stack")],64)),d.value.since?(a(),n(y,{key:2},[i(", last "+r(d.value.since),1)],64)):x("",!0),i(", tail "+r(d.value.tail)+". Redacted on the host before sending: credentials inside URLs, ",1),e[21]||(e[21]=s("code",null,"NAME=value",-1)),e[22]||(e[22]=i(" pairs whose name reads as a secret, and this server's own token. ",-1)),M(Y,{label:"why this is not live"},{default:K(()=>[...e[20]||(e[20]=[i(" Fetched on demand, never polled: an auto-refresh against a chatty stack would hammer the host that runs everyone else's previews. ",-1)])]),_:1})])):x("",!0)],64)):C.value?x("",!0):(a(),n("p",Pe,[e[23]||(e[23]=i(" Press ",-1)),e[24]||(e[24]=s("b",null,"Fetch",-1)),e[25]||(e[25]=i(" for the last lines, or ",-1)),e[26]||(e[26]=s("b",null,"Follow",-1)),i(" to stream them live"+r(g.value?` from ${g.value.name}`:"")+". ",1)]))])])],64)):(a(),n("p",Fe,[...e[11]||(e[11]=[i(" This spec has no ",-1),s("code",null,"compose:",-1),i(" section, so there are no compose logs to read. Its axes may still have created resources — check those at their own source. ",-1)])])):(a(),n("p",$e,"Unavailable until the spec resolves."))])}}});export{et as default};
|
|
6
|
-
//# sourceMappingURL=LogsTab-
|
|
6
|
+
//# sourceMappingURL=LogsTab-DMj2p8j8.js.map
|