@samyx/preview-stacks-ui 0.33.0 → 0.34.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-AGS1FKpY.js → ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-AGS1FKpY.js.map → ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js.map} +1 -1
- package/dist/assets/{AxesTab-DlGjhnwi.js → AxesTab-Bzm6UBFL.js} +2 -2
- package/dist/assets/{AxesTab-DlGjhnwi.js.map → AxesTab-Bzm6UBFL.js.map} +1 -1
- package/dist/assets/{ConfigTab-BiqFZrvm.js → ConfigTab-B5Mkn_Xr.js} +2 -2
- package/dist/assets/{ConfigTab-BiqFZrvm.js.map → ConfigTab-B5Mkn_Xr.js.map} +1 -1
- package/dist/assets/{ConfigView-CsQJIt52.js → ConfigView-BMINdC1p.js} +2 -2
- package/dist/assets/{ConfigView-CsQJIt52.js.map → ConfigView-BMINdC1p.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-BxG7GEFo.js → ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-BxG7GEFo.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js.map} +1 -1
- package/dist/assets/{DangerTab-COq-R4Dz.js → DangerTab-CLAU7ElD.js} +2 -2
- package/dist/assets/{DangerTab-COq-R4Dz.js.map → DangerTab-CLAU7ElD.js.map} +1 -1
- package/dist/assets/{DashboardView-DTI9n2-Z.js → DashboardView-C7Ofmm_R.js} +2 -2
- package/dist/assets/{DashboardView-DTI9n2-Z.js.map → DashboardView-C7Ofmm_R.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-BBMtQ9vE.js → DeploymentDetailView-BnEVV3jQ.js} +2 -2
- package/dist/assets/{DeploymentDetailView-BBMtQ9vE.js.map → DeploymentDetailView-BnEVV3jQ.js.map} +1 -1
- package/dist/assets/{DeploymentsView-BCXfIFud.js → DeploymentsView-BQUywd2O.js} +2 -2
- package/dist/assets/{DeploymentsView-BCXfIFud.js.map → DeploymentsView-BQUywd2O.js.map} +1 -1
- package/dist/assets/{DialogTrigger-D4yBGqUf.js → DialogTrigger-K-5IAbpM.js} +2 -2
- package/dist/assets/{DialogTrigger-D4yBGqUf.js.map → DialogTrigger-K-5IAbpM.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-D0dyw0Wd.js → EquivalentCommand-Bs9vCxV-.js} +2 -2
- package/dist/assets/{EquivalentCommand-D0dyw0Wd.js.map → EquivalentCommand-Bs9vCxV-.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BrBUwK6j.js → ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BrBUwK6j.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-CTbPBhLs.js → HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-CTbPBhLs.js.map → HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js.map} +1 -1
- package/dist/assets/{JobDetailView-DIEijrhl.js → JobDetailView-ClTF4h1t.js} +2 -2
- package/dist/assets/{JobDetailView-DIEijrhl.js.map → JobDetailView-ClTF4h1t.js.map} +1 -1
- package/dist/assets/{JobsView-Dw4-yNCj.js → JobsView-WFqrBzR6.js} +2 -2
- package/dist/assets/{JobsView-Dw4-yNCj.js.map → JobsView-WFqrBzR6.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-B3YVBpn-.js → LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js} +2 -2
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-B3YVBpn-.js.map → LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js.map} +1 -1
- package/dist/assets/{LoginView-NgcWC4N0.js → LoginView-B3SRuKRK.js} +2 -2
- package/dist/assets/{LoginView-NgcWC4N0.js.map → LoginView-B3SRuKRK.js.map} +1 -1
- package/dist/assets/{LogsTab-oWjSPx9O.js → LogsTab-DtcfNtY8.js} +2 -2
- package/dist/assets/{LogsTab-oWjSPx9O.js.map → LogsTab-DtcfNtY8.js.map} +1 -1
- package/dist/assets/{NotFoundView-DnQQJSu_.js → NotFoundView-1RdXOkoy.js} +2 -2
- package/dist/assets/{NotFoundView-DnQQJSu_.js.map → NotFoundView-1RdXOkoy.js.map} +1 -1
- package/dist/assets/{NotifiersView-CvP3L81J.js → NotifiersView-diZ_EMYq.js} +2 -2
- package/dist/assets/{NotifiersView-CvP3L81J.js.map → NotifiersView-diZ_EMYq.js.map} +1 -1
- package/dist/assets/{OverviewTab-C10J0ywh.js → OverviewTab--YuThIvA.js} +2 -2
- package/dist/assets/{OverviewTab-C10J0ywh.js.map → OverviewTab--YuThIvA.js.map} +1 -1
- package/dist/assets/{PublicLogsView-DqMmMbtf.js → PublicLogsView-gChlTDrp.js} +2 -2
- package/dist/assets/{PublicLogsView-DqMmMbtf.js.map → PublicLogsView-gChlTDrp.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-8Tme6z_i.js → RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-8Tme6z_i.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js.map} +1 -1
- package/dist/assets/{RegistriesView-DIa3mCyc.js → RegistriesView-Cich0dgu.js} +2 -2
- package/dist/assets/{RegistriesView-DIa3mCyc.js.map → RegistriesView-Cich0dgu.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-eoX10cnp.js → RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-eoX10cnp.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js.map} +1 -1
- package/dist/assets/{RequiresTab-Dde68lOF.js → RequiresTab-CxGBOMkm.js} +2 -2
- package/dist/assets/{RequiresTab-Dde68lOF.js.map → RequiresTab-CxGBOMkm.js.map} +1 -1
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-DgcXRES0.js → RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js} +2 -2
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-DgcXRES0.js.map → RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js.map} +1 -1
- package/dist/assets/{RoutingView-oXXCIL07.js → RoutingView-BXOGdZU4.js} +2 -2
- package/dist/assets/{RoutingView-oXXCIL07.js.map → RoutingView-BXOGdZU4.js.map} +1 -1
- package/dist/assets/{RuntimeTab-By55qdsQ.css → RuntimeTab-CXX0BGYC.css} +1 -1
- package/dist/assets/RuntimeTab-_QvQc5F2.js +3 -0
- package/dist/assets/RuntimeTab-_QvQc5F2.js.map +1 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-Bjd8KlYw.js → SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-Bjd8KlYw.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js.map} +1 -1
- package/dist/assets/SettingsView-BvscpTdq.js +2 -0
- package/dist/assets/SettingsView-BvscpTdq.js.map +1 -0
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CvoOnzDO.js → SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CvoOnzDO.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js.map} +1 -1
- package/dist/assets/{SpecDetailView-D10gsC8W.js → SpecDetailView-CAPlEmSg.js} +2 -2
- package/dist/assets/{SpecDetailView-D10gsC8W.js.map → SpecDetailView-CAPlEmSg.js.map} +1 -1
- package/dist/assets/{SpecsView-BU962Blv.js → SpecsView-BO0QMGrI.js} +2 -2
- package/dist/assets/{SpecsView-BU962Blv.js.map → SpecsView-BO0QMGrI.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-BzRkYwRn.js → SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-BzRkYwRn.js.map → SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js.map} +1 -1
- package/dist/assets/{SsoView-BJO4vMED.js → SsoView-2q_nGP-Q.js} +2 -2
- package/dist/assets/{SsoView-BJO4vMED.js.map → SsoView-2q_nGP-Q.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CzLuB-ZI.js → StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CzLuB-ZI.js.map → StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js.map} +1 -1
- package/dist/assets/{SubmitView-CChPoIvR.js → SubmitView-Dxre5OJU.js} +2 -2
- package/dist/assets/{SubmitView-CChPoIvR.js.map → SubmitView-Dxre5OJU.js.map} +1 -1
- package/dist/assets/{SwarmView-xPA-5INc.js → SwarmView-DtwrF08A.js} +2 -2
- package/dist/assets/{SwarmView-xPA-5INc.js.map → SwarmView-DtwrF08A.js.map} +1 -1
- package/dist/assets/{Teleport-Bg1yDCl9.js → Teleport-bdITH--T.js} +2 -2
- package/dist/assets/{Teleport-Bg1yDCl9.js.map → Teleport-bdITH--T.js.map} +1 -1
- package/dist/assets/{TerminalTab-jUQlwJpM.js → TerminalTab-CfcGPa8t.js} +2 -2
- package/dist/assets/{TerminalTab-jUQlwJpM.js.map → TerminalTab-CfcGPa8t.js.map} +1 -1
- package/dist/assets/{UsersView-DcjfdY6Q.js → UsersView-nIlVItsK.js} +2 -2
- package/dist/assets/{UsersView-DcjfdY6Q.js.map → UsersView-nIlVItsK.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-gohbG3IW.js → VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-gohbG3IW.js.map → VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js.map} +1 -1
- package/dist/assets/{VarIO-gtGLr9Br.js → VarIO-BcNlaWXO.js} +2 -2
- package/dist/assets/{VarIO-gtGLr9Br.js.map → VarIO-BcNlaWXO.js.map} +1 -1
- package/dist/assets/{VariablesView-DSXnmTTH.js → VariablesView-CzeCc-0m.js} +2 -2
- package/dist/assets/{VariablesView-DSXnmTTH.js.map → VariablesView-CzeCc-0m.js.map} +1 -1
- package/dist/assets/{index-DB2WhG8N.js → index-IvJmpI3b.js} +3 -3
- package/dist/assets/{index-DB2WhG8N.js.map → index-IvJmpI3b.js.map} +1 -1
- package/dist/assets/{useDeployment-B7wpJY-X.js → useDeployment-rA-pgUHZ.js} +2 -2
- package/dist/assets/{useDeployment-B7wpJY-X.js.map → useDeployment-rA-pgUHZ.js.map} +1 -1
- package/dist/assets/useJobQueue-JaWoydCt.js +2 -0
- package/dist/assets/{useJobQueue-D5JkRJNX.js.map → useJobQueue-JaWoydCt.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/RuntimeTab-DFxU8OLh.js +0 -2
- package/dist/assets/RuntimeTab-DFxU8OLh.js.map +0 -1
- package/dist/assets/SettingsView-DwSmnNbU.js +0 -2
- package/dist/assets/SettingsView-DwSmnNbU.js.map +0 -1
- package/dist/assets/useJobQueue-D5JkRJNX.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a0 as l,k as i,p as n,C as d,V as p,a1 as u}from"./index-
|
|
2
|
-
//# sourceMappingURL=useDeployment-
|
|
1
|
+
import{a0 as l,k as i,p as n,C as d,V as p,a1 as u}from"./index-IvJmpI3b.js";import{w as c,r as y}from"./useVars-VN9gYdR6.js";const e=l({id:"",detail:null,error:"",loading:!1,vars:[]}),f=i(()=>p(e.vars)),k=i(()=>u(e.id)),h=i(()=>{var a;return((a=e.detail)==null?void 0:a.kind)==="shared"}),b=i(()=>{var a;return(((a=e.detail)==null?void 0:a.axes)??[]).filter(s=>!s.verifiable).map(s=>s.name)});async function t(){const a=e.id;e.loading=!0;const s=await n.get(`/api/deployments/${encodeURIComponent(a)}${f.value}`);if(e.id!==a)return;if(e.loading=!1,!s.ok){e.detail=null,e.error=d(s,`GET /api/deployments/${a}`);return}e.error="";const r=s.body;e.detail={id:r.id??a,kind:r.kind==="shared"?"shared":"isolated",createdAt:r.createdAt,updatedAt:r.updatedAt,stack:typeof r.stack=="string"?r.stack:"",busy:r.busy??null,orchestrator:r.orchestrator??null,sleep:r.sleep??null,asleep:r.asleep??null,compose:r.compose?{file:r.compose.file??"?",profiles:r.compose.profiles??[],overlays:r.compose.overlays??[]}:null,requires:Array.isArray(r.requires)?r.requires:[],axes:(Array.isArray(r.axes)?r.axes:[]).map(o=>({name:o.name,hooks:Array.isArray(o.hooks)?o.hooks:[],verifiable:o.verifiable??(Array.isArray(o.hooks)&&o.hooks.includes("assert_gone"))})),env:Array.isArray(r.env)?r.env:[]}}function g(a){e.id===a&&(e.detail||e.error)||(e.id=a,e.detail=null,e.error="",e.vars=y(a),t())}function m(){c(e.id,e.vars)}function x(){m(),t()}export{x as a,e as d,h as i,t as l,g as o,m as p,k as r,b as u,f as v};
|
|
2
|
+
//# sourceMappingURL=useDeployment-rA-pgUHZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeployment-
|
|
1
|
+
{"version":3,"file":"useDeployment-rA-pgUHZ.js","sources":["../../src/composables/useDeployment.ts"],"sourcesContent":["/**\n * The deployment currently open in the detail view.\n *\n * A module singleton rather than provide/inject, because the six tabs are CHILD ROUTES: they are\n * siblings of each other and are mounted and unmounted independently, so passing the loaded\n * deployment down as a prop would mean re-fetching it on every tab change. Switching tabs must not\n * re-fetch or blank the panel — only opening a DIFFERENT deployment does.\n *\n * `vars` here are REQUEST-TIME variables, sent as `?query` on every route that resolves this\n * deployment. See `useVars.ts` for why they matter and what they can get wrong.\n */\n\nimport { computed, reactive } from 'vue';\nimport { api, problem, query } from '../api/client';\nimport type { Deployment, VarPair } from '../api/types';\nimport { readVars, writeVars } from './useVars';\nimport { rowFor } from './useControlPlane';\n\nexport const dep = reactive({\n id: '',\n detail: null as Deployment | null,\n /** The resolve failure, verbatim. It is a 400 that NAMES the missing variable. */\n error: '',\n loading: false,\n vars: [] as VarPair[],\n});\n\nexport const varsQuery = computed(() => query(dep.vars));\n\n/** The list row, which is the only place the server exposes stored `vars` and `specName` today. */\nexport const row = computed(() => rowFor(dep.id));\n\nexport const isShared = computed(() => dep.detail?.kind === 'shared');\n\nexport const unverifiableAxes = computed(() =>\n (dep.detail?.axes ?? []).filter((a) => !a.verifiable).map((a) => a.name),\n);\n\nexport async function loadDetail(): Promise<void> {\n const id = dep.id;\n dep.loading = true;\n const r = await api.get<Deployment>(`/api/deployments/${encodeURIComponent(id)}${varsQuery.value}`);\n // Navigated to another deployment while this was in flight: drop the answer rather than render\n // one deployment's spec under another's id.\n if (dep.id !== id) return;\n dep.loading = false;\n\n if (!r.ok) {\n dep.detail = null;\n dep.error = problem(r, `GET /api/deployments/${id}`);\n return;\n }\n dep.error = '';\n const b = r.body;\n dep.detail = {\n id: b.id ?? id,\n kind: b.kind === 'shared' ? 'shared' : 'isolated',\n createdAt: b.createdAt,\n updatedAt: b.updatedAt,\n stack: typeof b.stack === 'string' ? b.stack : '',\n busy: b.busy ?? null,\n orchestrator: b.orchestrator ?? null,\n sleep: b.sleep ?? null,\n asleep: b.asleep ?? null,\n compose: b.compose\n ? {\n file: b.compose.file ?? '?',\n profiles: b.compose.profiles ?? [],\n overlays: b.compose.overlays ?? [],\n }\n : null,\n requires: Array.isArray(b.requires) ? b.requires : [],\n axes: (Array.isArray(b.axes) ? b.axes : []).map((a) => ({\n name: a.name,\n hooks: Array.isArray(a.hooks) ? a.hooks : [],\n // Derive it if an older build omits the field. Defaulting to `false` would claim an axis is\n // unverifiable when it may define a perfectly good `assert_gone`.\n verifiable: a.verifiable ?? (Array.isArray(a.hooks) && a.hooks.includes('assert_gone')),\n })),\n env: Array.isArray(b.env) ? b.env : [],\n };\n}\n\n/** Point the singleton at a deployment. Resets everything a stale id could leak into the new one. */\nexport function openDeployment(id: string): void {\n if (dep.id === id && (dep.detail || dep.error)) return; // a tab change, not a navigation\n dep.id = id;\n dep.detail = null;\n dep.error = '';\n dep.vars = readVars(id);\n void loadDetail();\n}\n\nexport function persistVars(): void {\n writeVars(dep.id, dep.vars);\n}\n\nexport function applyVars(): void {\n persistVars();\n void loadDetail();\n}\n"],"names":["dep","reactive","varsQuery","computed","query","row","rowFor","isShared","_a","unverifiableAxes","a","loadDetail","id","r","api","problem","b","openDeployment","readVars","persistVars","writeVars","applyVars"],"mappings":"8HAkBO,MAAMA,EAAMC,EAAS,CAC1B,GAAI,GACJ,OAAQ,KAER,MAAO,GACP,QAAS,GACT,KAAM,CAAA,CACR,CAAC,EAEYC,EAAYC,EAAS,IAAMC,EAAMJ,EAAI,IAAI,CAAC,EAG1CK,EAAMF,EAAS,IAAMG,EAAON,EAAI,EAAE,CAAC,EAEnCO,EAAWJ,EAAS,IAAA,OAAM,QAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,QAAS,SAAQ,EAEvDC,EAAmBN,EAAS,IAAA,OACtC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AS,aAAa,EAAA,EACrF,EACF,IAAK,MAAM,QAAQM,EAAE,GAAG,EAAIA,EAAE,IAAM,CAAA,CAAC,CAEzC,CAGO,SAASC,EAAeL,EAAkB,CAC3CZ,EAAI,KAAOY,IAAOZ,EAAI,QAAUA,EAAI,SACxCA,EAAI,GAAKY,EACTZ,EAAI,OAAS,KACbA,EAAI,MAAQ,GACZA,EAAI,KAAOkB,EAASN,CAAE,EACjBD,EAAA,EACP,CAEO,SAASQ,GAAoB,CAClCC,EAAUpB,EAAI,GAAIA,EAAI,IAAI,CAC5B,CAEO,SAASqB,GAAkB,CAChCF,EAAA,EACKR,EAAA,CACP"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
function u(n){return n!=="queued"&&n!=="running"}function c(n,e){const r=e.filter(i=>i.id!==n.id),s=r.find(i=>i.state==="running"&&i.stack===n.stack);if(s)return{kind:"stack",blocker:s};const t=r.filter(i=>i.state==="running").length;return t>0?{kind:"slot",running:t}:{kind:"unknown"}}function o(n,e){const r=e.findIndex(t=>t.id===n.id);return r<0?null:e.slice(0,r).reverse().find(t=>t.stack===n.stack)??null}function a(n){const e=String(n).trim();if(!e)return"type a number first";const r=Number(e);return!Number.isInteger(r)||r<1?"the limit is a whole number, 1 or more":""}export{a as c,u as i,o as s,c as w};
|
|
2
|
+
//# sourceMappingURL=useJobQueue-JaWoydCt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useJobQueue-
|
|
1
|
+
{"version":3,"file":"useJobQueue-JaWoydCt.js","sources":["../../src/composables/useJobQueue.ts"],"sourcesContent":["/**\n * The queue facts the wire does not carry: why a job is still waiting, and what replaced it.\n *\n * A job record has a state and nothing about the queue it sits in — there is no `waitingOn` and no\n * `supersededBy`. Both are DERIVED here, from the job list the shell already polls every seven\n * seconds, rather than asked for as server fields that would exist only to spare this app an array\n * scan. Pure functions, same shape as `useSteps`, so a view can call them in a computed.\n *\n * WHY THE TWO WAITS ARE WORTH TELLING APART. \"Behind its own stack\" is the product working exactly\n * as designed — one job per stack is the guarantee — and the fix is to wait or stop the job ahead.\n * \"The host is at its job cap\" is a capacity fact about the whole machine, and the fix is\n * `PSTACK_MAX_JOBS` or fewer concurrent deploys. An operator debugging a slow deploy is asking\n * which of those two it is, and a single word \"queued\" answers neither.\n *\n * WHEN THE LIST IS EMPTY THEY SAY SO. A deep link to `/jobs/:id` before the first poll lands, or a\n * share-link page that never polls, has nothing to reason over. `unknown` renders as an unqualified\n * \"waiting its turn\" — true — rather than asserting a cap nobody measured.\n */\nimport type { Job, JobState } from '../api/types';\n\n/** Terminal is forever: the server's `State.Terminal()`, restated. NOT `state !== 'running'`. */\nexport function isTerminal(state: JobState): boolean {\n return state !== 'queued' && state !== 'running';\n}\n\n/** Why a queued job has not started. `running` is how many jobs hold a slot host-wide. */\nexport type Wait =\n | { kind: 'stack'; blocker: Job }\n | { kind: 'slot'; running: number }\n | { kind: 'unknown' };\n\nexport function waitReason(job: Job, jobs: Job[]): Wait {\n // Everything EXCEPT itself. Today's callers only ask about a queued job, which is never running,\n // but without this a running job asked why it waits answers \"behind itself\" — a banner linking to\n // the page you are already on, and a slot count that includes the slot it holds. A predicate only\n // correct for the two call sites that exist today is a trap for the third.\n const others = jobs.filter((j) => j.id !== job.id);\n const blocker = others.find((j) => j.state === 'running' && j.stack === job.stack);\n if (blocker) return { kind: 'stack', blocker };\n const running = others.filter((j) => j.state === 'running').length;\n // ponytail: the cap itself is not on the wire, so \"the host is full\" is inferred from other\n // stacks holding slots. A poll landing in the second between a slot freeing and the dispatch\n // shows this once and corrects itself on the next tick; serving `maxRunning` on /api/health is\n // the upgrade if that ever misleads anyone.\n return running > 0 ? { kind: 'slot', running } : { kind: 'unknown' };\n}\n\n/**\n * The job that replaced a superseded one, or null.\n *\n * The list is newest-first and the queue is ONE deep, so the nearest newer job for the same stack\n * is necessarily the one that took its place — there cannot have been another in between. Null\n * when the successor has aged out of the 50 kept transcripts, or when the list has not loaded;\n * a missing link is better than a wrong one.\n */\nexport function supersededBy(job: Job, jobs: Job[]): Job | null {\n const i = jobs.findIndex((j) => j.id === job.id);\n if (i < 0) return null;\n // Newest-first, so everything before it is newer; the nearest of those on the same stack wins.\n const newer = jobs.slice(0, i).reverse();\n return newer.find((j) => j.stack === job.stack) ?? null;\n}\n\n/**\n * Why the host's concurrency limit cannot be saved as typed, or `''` when it can.\n *\n * Takes `string | number` because that is what the box actually holds. `v-model` on\n * `<input type=\"number\">` hands back a NUMBER the moment the value parses — Vue casts for that\n * input TYPE, with or without the `.number` modifier — while an empty box and the value first read\n * from the server are strings. Assuming either one throws on the other, which is exactly how this\n * arrived: `.trim()` on the number the first keystroke produced.\n *\n * The server takes an integer ≥ 1 and refuses everything else; saying so here spares a round trip\n * and never replaces it — the 403 or 400 is still the enforcement.\n */\nexport function capProblem(draft: string | number): string {\n const raw = String(draft).trim();\n if (!raw) return 'type a number first';\n const n = Number(raw);\n if (!Number.isInteger(n) || n < 1) return 'the limit is a whole number, 1 or more';\n return '';\n}\n"],"names":["isTerminal","state","waitReason","job","jobs","others","j","blocker","running","supersededBy","i","capProblem","draft","raw","n"],"mappings":"AAqBO,SAASA,EAAWC,EAA0B,CACnD,OAAOA,IAAU,UAAYA,IAAU,SACzC,CAQO,SAASC,EAAWC,EAAUC,EAAmB,CAKtD,MAAMC,EAASD,EAAK,OAAQE,GAAMA,EAAE,KAAOH,EAAI,EAAE,EAC3CI,EAAUF,EAAO,KAAMC,GAAMA,EAAE,QAAU,WAAaA,EAAE,QAAUH,EAAI,KAAK,EACjF,GAAII,EAAS,MAAO,CAAE,KAAM,QAAS,QAAAA,CAAA,EACrC,MAAMC,EAAUH,EAAO,OAAQC,GAAMA,EAAE,QAAU,SAAS,EAAE,OAK5D,OAAOE,EAAU,EAAI,CAAE,KAAM,OAAQ,QAAAA,CAAA,EAAY,CAAE,KAAM,SAAA,CAC3D,CAUO,SAASC,EAAaN,EAAUC,EAAyB,CAC9D,MAAMM,EAAIN,EAAK,UAAWE,GAAMA,EAAE,KAAOH,EAAI,EAAE,EAC/C,OAAIO,EAAI,EAAU,KAEJN,EAAK,MAAM,EAAGM,CAAC,EAAE,QAAA,EAClB,KAAMJ,GAAMA,EAAE,QAAUH,EAAI,KAAK,GAAK,IACrD,CAcO,SAASQ,EAAWC,EAAgC,CACzD,MAAMC,EAAM,OAAOD,CAAK,EAAE,KAAA,EAC1B,GAAI,CAACC,EAAK,MAAO,sBACjB,MAAMC,EAAI,OAAOD,CAAG,EACpB,MAAI,CAAC,OAAO,UAAUC,CAAC,GAAKA,EAAI,EAAU,yCACnC,EACT"}
|
package/dist/index.html
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
/* private mode: fall through to the OS preference */
|
|
28
28
|
}
|
|
29
29
|
</script>
|
|
30
|
-
<script type="module" crossorigin src="/assets/index-
|
|
30
|
+
<script type="module" crossorigin src="/assets/index-IvJmpI3b.js"></script>
|
|
31
31
|
<link rel="stylesheet" crossorigin href="/assets/index-B1ONXQzZ.css">
|
|
32
32
|
</head>
|
|
33
33
|
<body>
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as M,z as b,w as m,u as f,g as u,o as n,e as h,a as t,t as l,E as w,f as r,c as o,r as C,F as y,k as x,N as V,x as W,_ as U,j as N,l as K,D as z,M as A,p as E,C as B,U as F}from"./index-DB2WhG8N.js";import{d as S,v as j}from"./useDeployment-B7wpJY-X.js";import{_ as H}from"./SkeletonList.vue_vue_type_script_setup_true_lang-CvoOnzDO.js";import{_ as L}from"./ActionButton.vue_vue_type_script_setup_true_lang-AGS1FKpY.js";import{_ as G}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BrBUwK6j.js";import{D as Q,a as q,b as J,c as X,d as Y,e as Z,f as ee}from"./DialogTrigger-D4yBGqUf.js";import{_ as O}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{_ as te}from"./RouteTarget.vue_vue_type_script_setup_true_lang-DgcXRES0.js";import{_ as se}from"./RefreshButton.vue_vue_type_script_setup_true_lang-8Tme6z_i.js";import"./useVars-VN9gYdR6.js";import"./Teleport-Bg1yDCl9.js";const ne={class:"help-head"},oe={class:"help-body"},le=M({__name:"FindingsModal",props:{findings:{}},setup(T){const i=T,k={error:0,warn:1,info:2},_=x(()=>[...i.findings].sort((p,v)=>k[p.level]-k[v.level])),g=x(()=>{var p;return((p=_.value[0])==null?void 0:p.level)??"info"}),I={error:"Blocking",warn:"Worth checking",info:"Notes"},$={error:"failed",warn:"warn",info:"info"},D={error:"failed",warn:"warn",info:"plain"};return(p,v)=>T.findings.length?(n(),b(f(Q),{key:0},{default:m(()=>[h(f(q),{class:w(["btn sm findings-btn",g.value])},{default:m(()=>[t("span",{class:w(["badge",$[g.value]])},l(T.findings.length),3),r(" "+l(I[g.value]),1)]),_:1},8,["class"]),h(f(ee),null,{default:m(()=>[h(f(J),{class:"scrim help-scrim"}),h(f(X),{class:"help-modal"},{default:m(()=>[t("div",ne,[h(f(Y),{class:"help-title"},{default:m(()=>[...v[0]||(v[0]=[r("What pstack noticed",-1)])]),_:1}),h(f(Z),{class:"ghost sm","aria-label":"Close"},{default:m(()=>[...v[1]||(v[1]=[r("Close",-1)])]),_:1})]),t("div",oe,[(n(!0),o(y,null,C(_.value,(R,a)=>(n(),o("div",{key:a,class:w(["banner",D[R.level]])},[t("b",null,l(I[R.level]),1),t("p",null,l(R.message),1)],2))),128))])]),_:1})]),_:1})]),_:1})):u("",!0)}}),ae=O(le,[["__scopeId","data-v-c92eabc7"]]),re={key:0,class:"banner warn"},ie={key:0,class:"row",style:{margin:"var(--s3) 0"}},de={key:1,class:"banner ok"},ue={class:"panel"},pe={class:"phead"},me={class:"mute",style:{"font-size":"var(--t-sm)"}},he={key:0,class:"table-scroll"},fe={class:"cards tbl-fixed t-routes"},ve={class:"stagger"},ce={class:"cell-wrap","data-label":"url"},ge=["href"],ye={key:1,class:"mono mute"},ke={key:0,class:"mute"},_e={"data-label":"forwards to"},be=["title"],we={"data-label":"router"},$e=["title"],Re={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},Ce={"data-label":"tls"},Se={key:0,class:"badge ok"},Te={key:1,class:"badge off"},Ie={key:1,class:"banner warn"},Ne={class:"panel"},xe={class:"phead"},De={class:"mute",style:{"font-size":"var(--t-sm)"}},Pe={key:0,class:"table-scroll"},Le={key:0,style:{width:"14ch"}},Ue={key:0},ze={class:"stagger"},Ae={class:"name","data-label":"service"},Ee=["title"],Be=["title"],Fe={key:0,"data-label":"node"},je=["title"],Me={key:0,class:"badge",title:"runs on another swarm node — logs reach it through the manager; a shell and stop/start do not"},Oe={"data-label":"state"},Ve={"data-label":"ports"},We={class:"mono"},Ke={key:0,class:"mute"},He={key:0,class:"mute"},Ge={"data-label":"networks"},Qe=["title"],qe=["title"],Je={class:"dim","data-label":"image"},Xe=["title"],Ye={class:"row-actions","data-label":""},Ze={key:0,class:"badge",title:"a one-shot job — it runs to completion; there is no long-lived container to start, stop, or open a shell in"},et={key:1,class:"mute",style:{"font-size":"var(--t-sm)"},title:"runs on another swarm node — redeploy the stack, or act on the worker itself"},tt=["href"],st={key:1,class:"mute"},nt=M({__name:"RuntimeTab",setup(T){const i=N(null),k=N(""),_=N(!0);async function g(){const a=await E.get(`/api/deployments/${encodeURIComponent(S.id)}/runtime${j.value}`);if(_.value=!1,!a.ok){k.value=B(a,"inspect what is running");return}k.value="",i.value=a.body}V(()=>S.id,()=>{_.value=!0,g()},{immediate:!0}),W(()=>void g(),8e3);const I=x(()=>{var a;return((a=i.value)==null?void 0:a.containers.filter(e=>e.state==="running").length)??0}),$=x(()=>{var a;return((a=i.value)==null?void 0:a.containers.some(e=>e.node))??!1});function D(a){const e=a.split(".");return e.length===3?`${e[1]}.${e[2]}`:a}const p=N("");async function v(a,e){p.value=`${e}:${a.name}`;const c=await E.post(`/api/deployments/${encodeURIComponent(S.id)}/containers/${encodeURIComponent(a.name)}/${e}${j.value}`);if(p.value="",!c.ok){F("error",B(c,`${e} ${a.name}`));return}F("ok",c.body.note??`${a.name}: ${e} done.`),g()}function R(a){var c;const e=(c=i.value)==null?void 0:c.routes.filter(s=>s.container===a.name||s.container===a.service).flatMap(s=>s.hosts).find(s=>!s.startsWith("(pattern)"));return e?`https://${e}`:null}return(a,e)=>{const c=K("RouterLink");return n(),o("div",null,[k.value?(n(),b(G,{key:0,text:k.value,title:"Could not inspect this deployment."},null,8,["text"])):u("",!0),_.value&&!i.value?(n(),b(H,{key:1,rows:5})):i.value?(n(),o(y,{key:2},[i.value.reachable?(n(),o(y,{key:1},[i.value.findings.length?(n(),o("div",ie,[h(ae,{findings:i.value.findings},null,8,["findings"])])):u("",!0),!i.value.findings.length&&i.value.containers.length?(n(),o("div",de,[...e[1]||(e[1]=[t("b",null,"Nothing looks wrong.",-1),t("p",null," Every container is attached to the ingress network and every router has a rule and a port. If a hostname still fails, the next suspects are DNS and the certificate. ",-1)])])):u("",!0),t("section",ue,[t("div",pe,[e[3]||(e[3]=t("h2",{class:"section"},"Routing",-1)),e[4]||(e[4]=t("span",{class:"grow"},null,-1)),t("span",me,[r(" TLS: "+l(i.value.challenge==="unknown"?"unknown":i.value.challenge)+" ",1),h(U,{label:"why the TLS mode matters here",align:"end"},{default:m(()=>[...e[2]||(e[2]=[r(" Under HTTP-01 every per-PR router needs ",-1),t("code",null,"tls.certresolver=le",-1),r(", because each hostname resolves its own certificate. Under DNS-01 that inverts — one always-on router holds the wildcard, and a per-PR certresolver makes each PR order its own and burn the weekly limit. Read from the running Traefik's own flags, not configured here. ",-1)])]),_:1})])]),i.value.routes.length?(n(),o("div",he,[t("table",fe,[e[10]||(e[10]=t("colgroup",null,[t("col",{style:{width:"34%"}}),t("col",{style:{width:"26%"}}),t("col",{style:{width:"26%"}}),t("col",{style:{width:"14%"}})],-1)),t("thead",null,[t("tr",null,[e[7]||(e[7]=t("th",null,"URL",-1)),t("th",null,[e[6]||(e[6]=r(" Forwards to ",-1)),h(U,{label:"how a URL reaches a port"},{default:m(()=>[...e[5]||(e[5]=[r(" Traefik's docker provider resolves the container's IP on ",-1),t("code",null,"preview-ingress",-1),r(" and dials it on the port from ",-1),t("code",null,"loadbalancer.server.port",-1),r(" — it does ",-1),t("em",null,"not",-1),r(" use ",-1),t("code",null,"service:port",-1),r(" DNS. So the port here is the one inside the container, and publishing a host port is unnecessary. ",-1)])]),_:1})]),e[8]||(e[8]=t("th",null,"Router",-1)),e[9]||(e[9]=t("th",null,"TLS",-1))])]),t("tbody",ve,[(n(!0),o(y,null,C(i.value.routes,(s,P)=>(n(),o("tr",{key:s.router,style:z({"--i":P})},[t("td",ce,[(n(!0),o(y,null,C(s.hosts,d=>(n(),o("div",{key:d},[d.startsWith("(pattern)")?(n(),o("span",ye,l(d),1)):(n(),o("a",{key:0,href:`https://${d}`,target:"_blank",rel:"noreferrer"},l(d),9,ge))]))),128)),s.hosts.length?u("",!0):(n(),o("span",ke,"no host in the rule"))]),t("td",_e,[h(te,{route:s},null,8,["route"]),t("div",{class:"mute cell-clip",style:{"font-size":"var(--t-sm)"},title:s.container},l(s.container),9,be)]),t("td",we,[t("div",{class:"cell-clip",title:s.router},l(s.router),9,$e),s.priority?(n(),o("div",Re," priority "+l(s.priority),1)):u("",!0)]),t("td",Ce,[s.tls?(n(),o("span",Se,l(s.certresolver||"inherited"),1)):(n(),o("span",Te,"off"))])],4))),128))])])])):(n(),o("div",Ie,[e[16]||(e[16]=t("b",null,"No routes. Traefik has not been told about this deployment.",-1)),t("p",null,[e[12]||(e[12]=r(" Routes come from labels in ",-1)),e[13]||(e[13]=t("em",null,"your",-1)),e[14]||(e[14]=r(" compose file, not from pstack and not from the ",-1)),h(c,{to:"/routing"},{default:m(()=>[...e[11]||(e[11]=[r("Routing",-1)])]),_:1}),e[15]||(e[15]=r(" page (that is Traefik's file provider — middleware and TLS options, not per-PR routers). A reachable service needs four things: ",-1))]),e[17]||(e[17]=t("pre",{class:"code"},"labels:\n - traefik.enable=true # the host runs exposedbydefault=false\n - traefik.docker.network=preview-ingress # which network Traefik should dial\n - traefik.http.routers.<name>-${STACK}.rule=Host(`<name>-${STACK}.${PREVIEW_DOMAIN}`)\n - traefik.http.services.<name>-${STACK}.loadbalancer.server.port=80\nnetworks: [default, preview-ingress] # and preview-ingress: { external: true }",-1)),e[18]||(e[18]=t("p",{class:"mute"},[r(" Put "),t("code",null,"${STACK}"),r(" in the router and service names: Traefik's namespace is global across the host, so two deployments sharing a router name serve each other's containers. ")],-1))]))]),t("section",Ne,[t("div",xe,[e[19]||(e[19]=t("h2",{class:"section"},"Containers",-1)),e[20]||(e[20]=t("span",{class:"grow"},null,-1)),t("span",De,l(I.value)+" of "+l(i.value.containers.length)+" running ",1),h(se,{run:g,busy:_.value},null,8,["busy"])]),i.value.containers.length?(n(),o("div",Pe,[t("table",{class:w(["cards tbl-fixed t-containers",{swarm:$.value}])},[t("colgroup",null,[e[21]||(e[21]=t("col",{style:{width:"22ch"}},null,-1)),$.value?(n(),o("col",Le)):u("",!0),e[22]||(e[22]=t("col",{style:{width:"12ch"}},null,-1)),e[23]||(e[23]=t("col",{style:{width:"13ch"}},null,-1)),e[24]||(e[24]=t("col",{style:{width:"20ch"}},null,-1)),e[25]||(e[25]=t("col",null,null,-1)),e[26]||(e[26]=t("col",{style:{width:"288px"}},null,-1))]),t("thead",null,[t("tr",null,[e[27]||(e[27]=t("th",null,"Service",-1)),$.value?(n(),o("th",Ue,"Node")):u("",!0),e[28]||(e[28]=t("th",null,"State",-1)),e[29]||(e[29]=t("th",null,"Ports",-1)),e[30]||(e[30]=t("th",null,"Networks",-1)),e[31]||(e[31]=t("th",null,"Image",-1)),e[32]||(e[32]=t("th",{"aria-label":"Actions"},null,-1))])]),t("tbody",ze,[(n(!0),o(y,null,C(i.value.containers,(s,P)=>(n(),o("tr",{key:s.id,style:z({"--i":P})},[t("td",Ae,[t("div",{class:"cell-clip",title:s.service??s.name},l(s.service??s.name),9,Ee),t("div",{class:"mute task cell-clip",title:s.name},l(D(s.name)),9,Be)]),$.value?(n(),o("td",Fe,[t("div",{class:"cell-clip",title:s.node??void 0},l(s.node??"—"),9,je),s.remote?(n(),o("span",Me,"remote")):u("",!0)])):u("",!0),t("td",Oe,[t("span",{class:w(s.state==="running"?"s-ok":"s-failed")},l(f(A)(s.state)),3),s.health&&s.state==="running"?(n(),o("div",{key:0,class:w(["mute",s.health==="healthy"?"s-ok":"s-failed"]),style:{"font-size":"var(--t-sm)"}},l(f(A)(s.health)),3)):u("",!0)]),t("td",Ve,[(n(!0),o(y,null,C(s.ports,d=>(n(),o("div",{key:`${d.containerPort}/${d.protocol}`},[t("span",We,l(d.containerPort),1),d.hostPort?(n(),o("span",Ke," ← host "+l(d.hostPort),1)):u("",!0)]))),128)),s.ports.length?u("",!0):(n(),o("span",He,"none exposed"))]),t("td",Ge,[(n(!0),o(y,null,C(s.networks,d=>(n(),o("div",{key:d,class:"cell-clip",title:d},[t("span",{class:w(d==="preview-ingress"?"s-ok":"")},l(d),3)],8,Qe))),128)),s.ingressIp?(n(),o("div",{key:0,class:"mute mono cell-clip",style:{"font-size":"var(--t-sm)"},title:s.ingressIp},l(s.ingressIp),9,qe)):u("",!0)]),t("td",Je,[t("span",{class:"cell-clip",title:s.image},l(s.image),9,Xe)]),t("td",Ye,[s.job?(n(),o("span",Ze,"one-shot")):s.remote?(n(),o("span",et," on "+l(s.node),1)):s.state!=="running"?(n(),b(L,{key:2,class:"sm",variant:"ghost",pending:p.value===`start:${s.name}`,disabled:!!p.value,confirm:"Start it?",onRun:d=>v(s,"start")},{default:m(()=>[...e[33]||(e[33]=[r(" Start ",-1)])]),_:1},8,["pending","disabled","onRun"])):(n(),b(L,{key:3,class:"sm",variant:"ghost",pending:p.value===`stop:${s.name}`,disabled:!!p.value,confirm:"Stop it?",title:"Stops this container only. It stays stopped until something starts it.",onRun:d=>v(s,"stop")},{default:m(()=>[...e[34]||(e[34]=[r(" Stop ",-1)])]),_:1},8,["pending","disabled","onRun"])),!s.remote&&!s.job?(n(),b(L,{key:4,class:"sm",variant:"ghost",pending:p.value===`restart:${s.name}`,disabled:!!p.value,confirm:"Restart it?",onRun:d=>v(s,"restart")},{default:m(()=>[...e[35]||(e[35]=[r(" Restart ",-1)])]),_:1},8,["pending","disabled","onRun"])):u("",!0),h(c,{class:"btn sm ghost",to:`/deployments/${encodeURIComponent(f(S).id)}/logs?container=${encodeURIComponent(s.name)}`},{default:m(()=>[...e[36]||(e[36]=[r(" Logs ",-1)])]),_:1},8,["to"]),s.state==="running"&&!s.remote&&!s.job?(n(),b(c,{key:5,class:"btn sm ghost",to:`/deployments/${encodeURIComponent(f(S).id)}/terminal?container=${encodeURIComponent(s.name)}`},{default:m(()=>[...e[37]||(e[37]=[r(" Shell ",-1)])]),_:1},8,["to"])):u("",!0),s.state==="running"&&R(s)?(n(),o("a",{key:6,class:"btn sm ghost",href:R(s),target:"_blank",rel:"noreferrer"}," Open ",8,tt)):u("",!0)])],4))),128))])],2)])):(n(),o("p",st," No containers for this stack. If you expected some, check that their profile is one the spec selects — a service behind a profile that is not enabled is never started. "))])],64)):(n(),o("div",re,[...e[0]||(e[0]=[t("b",null,"Docker did not answer.",-1),t("p",null," Nothing below could be determined — this is not the same as nothing running. Check the daemon and the socket mount, then refresh. ",-1)])]))],64)):u("",!0)])}}}),vt=O(nt,[["__scopeId","data-v-084c7ea0"]]);export{vt as default};
|
|
2
|
-
//# sourceMappingURL=RuntimeTab-DFxU8OLh.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RuntimeTab-DFxU8OLh.js","sources":["../../src/components/FindingsModal.vue","../../src/views/tabs/RuntimeTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The runtime findings, as one button that opens them rather than a stack of banners.\n *\n * WHAT WAS WRONG. Every finding rendered as its own inline banner, unbounded. A deployment with a\n * dozen of them — which is exactly the deployment worth looking at — pushed the routing table and the\n * container table off the bottom of the screen, so the page that exists to show you what is running\n * showed you paragraphs about it instead.\n *\n * WHAT THE BANNERS DID WELL, AND IS KEPT. A `warn` announced itself: you could not open the tab and\n * miss it. So the trigger carries the count and the highest severity as COLOUR, not just a label —\n * three warnings and none look different from across the room, which a plain \"Findings\" button would\n * not. An empty list renders nothing at all: there is no button to wonder about.\n *\n * Built on `HelpModal`'s idiom rather than a second one — the same Reka Dialog, the same\n * `.help-*` classes, so focus trap, focus restore, scroll lock and Escape behave identically. It is a\n * separate component only because the trigger is the whole point here and `HelpModal`'s is a fixed\n * `?` glyph.\n */\nimport { computed } from 'vue';\nimport { DialogClose, DialogContent, DialogOverlay, DialogPortal, DialogRoot, DialogTitle, DialogTrigger } from 'reka-ui';\nimport type { RuntimeResponse } from '../api/types';\n\nconst props = defineProps<{ findings: RuntimeResponse['findings'] }>();\n\n/** Blocking first, then worth checking, then notes — the order the banners rendered in. */\nconst ORDER = { error: 0, warn: 1, info: 2 } as const;\nconst sorted = computed(() => [...props.findings].sort((a, b) => ORDER[a.level] - ORDER[b.level]));\n/** The highest severity present. Falls out of the sort — there is no second ranking to disagree. */\nconst worst = computed(() => sorted.value[0]?.level ?? 'info');\n\n/** The banners' own words, so the button and the thing it opens say the same thing. */\nconst LABEL = { error: 'Blocking', warn: 'Worth checking', info: 'Notes' } as const;\nconst BADGE = { error: 'failed', warn: 'warn', info: 'info' } as const;\n/** `info` has no banner tint — a note is not a state. */\nconst BANNER = { error: 'failed', warn: 'warn', info: 'plain' } as const;\n</script>\n\n<template>\n <DialogRoot v-if=\"findings.length\">\n <DialogTrigger class=\"btn sm findings-btn\" :class=\"worst\">\n <span class=\"badge\" :class=\"BADGE[worst]\">{{ findings.length }}</span>\n {{ LABEL[worst] }}\n </DialogTrigger>\n\n <DialogPortal>\n <DialogOverlay class=\"scrim help-scrim\" />\n <DialogContent class=\"help-modal\">\n <div class=\"help-head\">\n <DialogTitle class=\"help-title\">What pstack noticed</DialogTitle>\n <DialogClose class=\"ghost sm\" aria-label=\"Close\">Close</DialogClose>\n </div>\n <div class=\"help-body\">\n <div v-for=\"(f, i) in sorted\" :key=\"i\" class=\"banner\" :class=\"BANNER[f.level]\">\n <b>{{ LABEL[f.level] }}</b>\n <p>{{ f.message }}</p>\n </div>\n </div>\n </DialogContent>\n </DialogPortal>\n </DialogRoot>\n</template>\n\n<style scoped>\n/*\n * The trigger sits where the banners did, so it inherits their vertical rhythm (`.banner` is\n * `margin: var(--s3) 0`) rather than butting against the panel below it.\n */\n.findings-btn {\n margin: var(--s3) 0;\n}\n/*\n * `error` borrows `button.danger`'s treatment by name; `warn` has no button variant in the system, so\n * this is the same recipe in `--leak`. Both are the badge's colour repeated at the button's edge —\n * one hue per state, not two.\n */\n.findings-btn.error {\n background: var(--fail-soft);\n border-color: color-mix(in srgb, var(--fail) 45%, transparent);\n color: var(--fail);\n}\n.findings-btn.error:hover:not(:disabled) {\n background: color-mix(in srgb, var(--fail) 26%, transparent);\n border-color: color-mix(in srgb, var(--fail) 62%, transparent);\n}\n.findings-btn.warn {\n background: var(--leak-soft);\n border-color: color-mix(in srgb, var(--leak) 45%, transparent);\n color: var(--leak);\n}\n.findings-btn.warn:hover:not(:disabled) {\n background: color-mix(in srgb, var(--leak) 26%, transparent);\n border-color: color-mix(in srgb, var(--leak) 62%, transparent);\n}\n/*\n * Inside the modal the banners ARE the list, so the body's own padding already spaces the first and\n * last from the edges. `.help-body > * + *` keeps the gap between them.\n */\n.help-body > .banner:first-child {\n margin-top: 0;\n}\n.help-body > .banner:last-child {\n margin-bottom: 0;\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * What is actually running, and what Traefik was actually told about it.\n *\n * THE QUESTION THIS ANSWERS. \"The hostname does not work.\" Nothing in this UI could answer it: the\n * registry shows what was *submitted*, the logs show what the container *says*, and the reason a\n * request 404s is in neither — it is in the container's Traefik labels, which pstack never writes.\n *\n * The routing table is the direct answer to \"which URL maps to which port\". Traefik does **not** dial\n * `service_name:port`: its docker provider resolves the container's IP on the ingress network and\n * dials that, on the port from the `loadbalancer.server.port` label. That is why a service must be\n * attached to `preview-ingress`, why the port is the *container-internal* one, and why publishing a\n * host port is unnecessary. The `target` column shows the address Traefik assembled, so a missing\n * half is visible rather than inferred — and when there is no address, `RouteTarget` says which of\n * three reasons it is. \"Not on the ingress network\" was being printed over swarm services whose\n * network was fine, because the address is simply not knowable from a manager.\n *\n * FINDINGS ARE A BUTTON, NOT BANNERS. They used to lead the tab as a stack of banners: fine at one\n * finding, and at nine they pushed both tables off the screen — on the page whose whole job is those\n * tables. The count and the worst level ride on the trigger so a warning still announces itself\n * unopened (see `FindingsModal`). State that changes what you can do — \"Docker did not answer\",\n * \"nothing looks wrong\" — stays on the page, because it is one line and cannot grow.\n *\n * BOTH TABLES ARE FIXED-LAYOUT, INSIDE A SCROLLER. Under auto layout a single long image or task\n * name took width from every other column on the row, and `.panel > table` splits thead and tbody\n * into two table boxes that size their columns independently — which is why the headers never lined\n * up with the cells under them. The `<colgroup>`s below are those widths, stated once, beside the\n * headers they have to agree with; wrapping the table in `.table-scroll` is what opts it out of the\n * split and lets it scroll instead of squeezing.\n */\nimport { computed, ref, watch } from 'vue';\nimport { sentence } from '../../composables/useFormat';\nimport { api, problem } from '../../api/client';\nimport type { RuntimeContainer, RuntimeResponse } from '../../api/types';\nimport { dep, varsQuery } from '../../composables/useDeployment';\nimport { usePolling } from '../../composables/usePolling';\nimport SkeletonList from '../../components/SkeletonList.vue';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\nimport FindingsModal from '../../components/FindingsModal.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport RouteTarget from '../../components/RouteTarget.vue';\nimport { toast } from '../../composables/useToasts';\nimport RefreshButton from '../../components/RefreshButton.vue';\n\nconst rt = ref<RuntimeResponse | null>(null);\nconst error = ref('');\nconst loading = ref(true);\n\nasync function load(): Promise<void> {\n const r = await api.get<RuntimeResponse>(\n `/api/deployments/${encodeURIComponent(dep.id)}/runtime${varsQuery.value}`,\n );\n loading.value = false;\n if (!r.ok) {\n error.value = problem(r, 'inspect what is running');\n return;\n }\n error.value = '';\n rt.value = r.body;\n}\n\nwatch(() => dep.id, () => { loading.value = true; void load(); }, { immediate: true });\n// Containers change state during a deploy; the poll pauses itself when the tab is hidden.\nusePolling(() => void load(), 8000);\n\nconst running = computed(() => rt.value?.containers.filter((c) => c.state === 'running').length ?? 0);\n\n/**\n * Whether the node column exists at all — compose has no nodes to name.\n *\n * Hoisted rather than asked twice: the header and the cell were computing this separately, which is\n * how a header can end up describing a column the body did not render in the same position.\n */\nconst hasNode = computed(() => rt.value?.containers.some((c) => c.node) ?? false);\n\n/**\n * The part of a container's name worth reading in a table cell.\n *\n * Compose names a container `<stack>-<service>-<n>`. Swarm names a TASK\n * `<stack>_<service>.<slot>.<task id>` — long, and its first half repeats the service already\n * printed on the line above, in a column that under swarm has to share the row with the node and\n * the row actions. The tail is the half that identifies which task this is: the slot and the id\n * `docker service ps` prints. Compose names hold no dots and come back untouched.\n *\n * The full name stays in the cell's `title` rather than in the text. Truncating the text would have\n * cut the id — the one part worth copying — and nothing here needs the whole name by hand anyway:\n * Logs, Shell and the container actions all carry it themselves.\n */\nfunction taskOf(name: string): string {\n const p = name.split('.');\n return p.length === 3 ? `${p[1]}.${p[2]}` : name;\n}\n\n/**\n * One container action in flight, as `action:name`.\n *\n * A single ref rather than a per-row flag: two `docker restart`s racing on the same stack is not\n * something to make easy, and the readiness watch each one starts would fight the other.\n */\nconst busy = ref('');\n\nasync function act(c: RuntimeContainer, action: 'start' | 'stop' | 'restart'): Promise<void> {\n busy.value = `${action}:${c.name}`;\n const r = await api.post<{ note?: string }>(\n `/api/deployments/${encodeURIComponent(dep.id)}/containers/${encodeURIComponent(c.name)}/${action}${varsQuery.value}`,\n );\n busy.value = '';\n if (!r.ok) {\n // Docker's own words. \"Already started\" and \"no such container\" are different problems and it\n // says both better than this layer could.\n toast('error', problem(r, `${action} ${c.name}`));\n return;\n }\n toast('ok', r.body.note ?? `${c.name}: ${action} done.`);\n // Read the table back rather than assuming the new state: a container that exits again immediately\n // is exactly the case worth seeing, and the 8s poll would show it a beat later anyway.\n void load();\n}\n\n/**\n * The hostname Traefik actually routes to this container, or null.\n *\n * Built from the ROUTES rather than guessed from the container: a router's rule is the only thing\n * that decides what URL reaches it, and a link assembled from a service name and a domain would be\n * a plausible-looking 404. Pattern hosts (`HostRegexp`) are skipped for the same reason — there is\n * no single address to send someone to.\n */\nfunction urlFor(c: RuntimeContainer): string | null {\n const host = rt.value?.routes\n // Under swarm the labels live on the service, so a route names `app` where the container is a\n // task called `pr-1_app.1.<id>`. Matching the name alone left every swarm row without a link to\n // a router that does point at it. Both tasks of one service share the URL — Traefik balances.\n .filter((r) => r.container === c.name || r.container === c.service)\n .flatMap((r) => r.hosts)\n .find((h) => !h.startsWith('(pattern)'));\n return host ? `https://${host}` : null;\n}\n</script>\n\n<template>\n <div>\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not inspect this deployment.\" />\n <SkeletonList v-if=\"loading && !rt\" :rows=\"5\" />\n\n <template v-else-if=\"rt\">\n <!--\n `reachable: false` is not \"nothing is running\". The stack may be perfectly healthy while this\n process cannot reach the Docker socket, and reporting that as empty is how a UI tells someone\n their live preview is gone.\n -->\n <div v-if=\"!rt.reachable\" class=\"banner warn\">\n <b>Docker did not answer.</b>\n <p>\n Nothing below could be determined — this is not the same as nothing running. Check the\n daemon and the socket mount, then refresh.\n </p>\n </div>\n\n <template v-else>\n <!--\n Findings first — as one control, not as their own page. The button is absent when there is\n nothing to say, so the row disappears with it rather than leaving an empty gap.\n -->\n <div v-if=\"rt.findings.length\" class=\"row\" style=\"margin: var(--s3) 0\">\n <FindingsModal :findings=\"rt.findings\" />\n </div>\n <div v-if=\"!rt.findings.length && rt.containers.length\" class=\"banner ok\">\n <b>Nothing looks wrong.</b>\n <p>\n Every container is attached to the ingress network and every router has a rule and a port.\n If a hostname still fails, the next suspects are DNS and the certificate.\n </p>\n </div>\n\n <!-- ============================ routing ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Routing</h2>\n <span class=\"grow\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">\n TLS: {{ rt.challenge === 'unknown' ? 'unknown' : rt.challenge }}\n <InfoHint label=\"why the TLS mode matters here\" align=\"end\">\n Under HTTP-01 every per-PR router needs <code>tls.certresolver=le</code>, because each\n hostname resolves its own certificate. Under DNS-01 that inverts — one always-on router\n holds the wildcard, and a per-PR certresolver makes each PR order its own and burn the\n weekly limit. Read from the running Traefik's own flags, not configured here.\n </InfoHint>\n </span>\n </div>\n\n <div v-if=\"rt.routes.length\" class=\"table-scroll\">\n <table class=\"cards tbl-fixed t-routes\">\n <!--\n The widths, as percentages of whatever the panel gives us. URL is the widest because\n it is the value people read, and it WRAPS: a hostname's tail is which PR it is.\n -->\n <colgroup>\n <col style=\"width: 34%\" />\n <col style=\"width: 26%\" />\n <col style=\"width: 26%\" />\n <col style=\"width: 14%\" />\n </colgroup>\n <thead>\n <tr>\n <th>URL</th>\n <th>\n Forwards to\n <InfoHint label=\"how a URL reaches a port\">\n Traefik's docker provider resolves the container's IP on\n <code>preview-ingress</code> and dials it on the port from\n <code>loadbalancer.server.port</code> — it does <em>not</em> use\n <code>service:port</code> DNS. So the port here is the one inside the container,\n and publishing a host port is unnecessary.\n </InfoHint>\n </th>\n <th>Router</th>\n <th>TLS</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(r, i) in rt.routes\" :key=\"r.router\" :style=\"{ '--i': i }\">\n <td class=\"cell-wrap\" data-label=\"url\">\n <div v-for=\"h in r.hosts\" :key=\"h\">\n <a v-if=\"!h.startsWith('(pattern)')\" :href=\"`https://${h}`\" target=\"_blank\" rel=\"noreferrer\">\n {{ h }}\n </a>\n <span v-else class=\"mono mute\">{{ h }}</span>\n </div>\n <span v-if=\"!r.hosts.length\" class=\"mute\">no host in the rule</span>\n </td>\n <td data-label=\"forwards to\">\n <RouteTarget :route=\"r\" />\n <!-- Under swarm this is the SERVICE name; either way it is matched, not read. -->\n <div class=\"mute cell-clip\" style=\"font-size: var(--t-sm)\" :title=\"r.container\">\n {{ r.container }}\n </div>\n </td>\n <td data-label=\"router\">\n <div class=\"cell-clip\" :title=\"r.router\">{{ r.router }}</div>\n <div v-if=\"r.priority\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n priority {{ r.priority }}\n </div>\n </td>\n <td data-label=\"tls\">\n <span v-if=\"r.tls\" class=\"badge ok\">{{ r.certresolver || 'inherited' }}</span>\n <span v-else class=\"badge off\">off</span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n\n <!--\n The reported failure, stated where it will be looked for. pstack does not write these\n labels — the deployment's own compose file does — so the fix is in the user's file.\n -->\n <div v-else class=\"banner warn\">\n <b>No routes. Traefik has not been told about this deployment.</b>\n <p>\n Routes come from labels in <em>your</em> compose file, not from pstack and not from the\n <RouterLink to=\"/routing\">Routing</RouterLink> page (that is Traefik's file provider —\n middleware and TLS options, not per-PR routers). A reachable service needs four things:\n </p>\n <pre class=\"code\">labels:\n - traefik.enable=true # the host runs exposedbydefault=false\n - traefik.docker.network=preview-ingress # which network Traefik should dial\n - traefik.http.routers.<name>-${STACK}.rule=Host(`<name>-${STACK}.${PREVIEW_DOMAIN}`)\n - traefik.http.services.<name>-${STACK}.loadbalancer.server.port=80\nnetworks: [default, preview-ingress] # and preview-ingress: { external: true }</pre>\n <p class=\"mute\">\n Put <code>${STACK}</code> in the router and service names: Traefik's namespace is global\n across the host, so two deployments sharing a router name serve each other's containers.\n </p>\n </div>\n </section>\n\n <!-- ============================ containers ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Containers</h2>\n <span class=\"grow\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ running }} of {{ rt.containers.length }} running\n </span>\n <RefreshButton :run=\"load\" :busy=\"loading\" />\n </div>\n\n <div v-if=\"rt.containers.length\" class=\"table-scroll\">\n <table class=\"cards tbl-fixed t-containers\" :class=\"{ swarm: hasNode }\">\n <!--\n THE NODE `<col>` CARRIES THE SAME `v-if` AS ITS `<th>`, and has to: one without the\n other shifts every column after it by one, which is the header-drift bug rebuilt by\n hand, in the swarm case that is already the worst one.\n\n Image takes no width — under fixed layout the unsized column absorbs what is left,\n so adding Node narrows the image rather than pushing the table wider. Actions is in\n px because it holds buttons, not text: five of them at their widest (Stop, Restart,\n Logs, Shell, Open), which `.row-actions` forbids to wrap, so the column is measured\n from the buttons rather than guessed. The table's floor in `app.css` is this\n colgroup added up; change one and change the other.\n -->\n <colgroup>\n <col style=\"width: 22ch\" />\n <col v-if=\"hasNode\" style=\"width: 14ch\" />\n <col style=\"width: 12ch\" />\n <col style=\"width: 13ch\" />\n <col style=\"width: 20ch\" />\n <col />\n <col style=\"width: 288px\" />\n </colgroup>\n <thead>\n <tr>\n <th>Service</th>\n <!-- Where, then how it is doing — the order the cells are in. They disagreed, so\n under swarm (the only time this column exists) every state read as a node. -->\n <th v-if=\"hasNode\">Node</th>\n <th>State</th>\n <th>Ports</th>\n <th>Networks</th>\n <th>Image</th>\n <th aria-label=\"Actions\" />\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(c, i) in rt.containers\" :key=\"c.id\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"service\">\n <div class=\"cell-clip\" :title=\"c.service ?? c.name\">{{ c.service ?? c.name }}</div>\n <div class=\"mute task cell-clip\" :title=\"c.name\">{{ taskOf(c.name) }}</div>\n </td>\n <td v-if=\"hasNode\" data-label=\"node\">\n <div class=\"cell-clip\" :title=\"c.node ?? undefined\">{{ c.node ?? '—' }}</div>\n <!-- A task on another node: listed from the manager, out of reach of exec/stop. -->\n <span v-if=\"c.remote\" class=\"badge\" title=\"runs on another swarm node — logs reach it through the manager; a shell and stop/start do not\">remote</span>\n </td>\n <td data-label=\"state\">\n <span :class=\"c.state === 'running' ? 's-ok' : 's-failed'\">{{ sentence(c.state) }}</span>\n <!--\n Health is only reported while it is RUNNING. Docker keeps the last probe result on\n a stopped container, so an exited one rendered \"Exited / Healthy\" — a stale reading\n presented beside the fact that contradicts it.\n -->\n <div\n v-if=\"c.health && c.state === 'running'\"\n class=\"mute\"\n style=\"font-size: var(--t-sm)\"\n :class=\"c.health === 'healthy' ? 's-ok' : 's-failed'\"\n >\n {{ sentence(c.health) }}\n </div>\n </td>\n <td data-label=\"ports\">\n <div v-for=\"p in c.ports\" :key=\"`${p.containerPort}/${p.protocol}`\">\n <span class=\"mono\">{{ p.containerPort }}</span>\n <span v-if=\"p.hostPort\" class=\"mute\"> ← host {{ p.hostPort }}</span>\n </div>\n <span v-if=\"!c.ports.length\" class=\"mute\">none exposed</span>\n </td>\n <td data-label=\"networks\">\n <div v-for=\"n in c.networks\" :key=\"n\" class=\"cell-clip\" :title=\"n\">\n <span :class=\"n === 'preview-ingress' ? 's-ok' : ''\">{{ n }}</span>\n </div>\n <div v-if=\"c.ingressIp\" class=\"mute mono cell-clip\" style=\"font-size: var(--t-sm)\" :title=\"c.ingressIp\">\n {{ c.ingressIp }}\n </div>\n </td>\n <!-- Clipped, not wrapped: an image reference is matched against one you know, and\n `registry.example.com/team/app@sha256:…` costs three rows to say nothing new. -->\n <td class=\"dim\" data-label=\"image\">\n <span class=\"cell-clip\" :title=\"c.image\">{{ c.image }}</span>\n </td>\n <!--\n The three things anyone wants from a container row, without hunting for the tab\n that does it. Open goes to the URL Traefik actually assembled for THIS container\n (see `urlFor`), so it is absent rather than wrong when no router points here.\n -->\n <td class=\"row-actions\" data-label=\"\">\n <!--\n One container, not the service and not the stack. Start appears only when it is\n not running and Stop only when it is, so the control on screen is the one that\n would do something. Both destructive ones confirm in place.\n -->\n <!-- None of these reach a task on another node; docker's verbs are node-local. -->\n <!-- And none of them reach a one-shot job's row, which stands for the SERVICE:\n there is no container behind its name, so the verbs could only fail. -->\n <span v-if=\"c.job\" class=\"badge\" title=\"a one-shot job — it runs to completion; there is no long-lived container to start, stop, or open a shell in\">one-shot</span>\n <span v-else-if=\"c.remote\" class=\"mute\" style=\"font-size: var(--t-sm)\" title=\"runs on another swarm node — redeploy the stack, or act on the worker itself\">\n on {{ c.node }}\n </span>\n <ActionButton\n v-else-if=\"c.state !== 'running'\"\n class=\"sm\"\n variant=\"ghost\"\n :pending=\"busy === `start:${c.name}`\"\n :disabled=\"!!busy\"\n confirm=\"Start it?\"\n @run=\"act(c, 'start')\"\n >\n Start\n </ActionButton>\n <ActionButton\n v-else\n class=\"sm\"\n variant=\"ghost\"\n :pending=\"busy === `stop:${c.name}`\"\n :disabled=\"!!busy\"\n confirm=\"Stop it?\"\n title=\"Stops this container only. It stays stopped until something starts it.\"\n @run=\"act(c, 'stop')\"\n >\n Stop\n </ActionButton>\n <ActionButton\n v-if=\"!c.remote && !c.job\"\n class=\"sm\"\n variant=\"ghost\"\n :pending=\"busy === `restart:${c.name}`\"\n :disabled=\"!!busy\"\n confirm=\"Restart it?\"\n @run=\"act(c, 'restart')\"\n >\n Restart\n </ActionButton>\n <RouterLink\n class=\"btn sm ghost\"\n :to=\"`/deployments/${encodeURIComponent(dep.id)}/logs?container=${encodeURIComponent(c.name)}`\"\n >\n Logs\n </RouterLink>\n <RouterLink\n v-if=\"c.state === 'running' && !c.remote && !c.job\"\n class=\"btn sm ghost\"\n :to=\"`/deployments/${encodeURIComponent(dep.id)}/terminal?container=${encodeURIComponent(c.name)}`\"\n >\n Shell\n </RouterLink>\n <!--\n Only while running: the router label survives a stopped container, so the URL\n still exists and answers 502. A link that is certain to fail is worse than no link.\n -->\n <a\n v-if=\"c.state === 'running' && urlFor(c)\"\n class=\"btn sm ghost\"\n :href=\"urlFor(c)!\"\n target=\"_blank\"\n rel=\"noreferrer\"\n >\n Open\n </a>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n <p v-else class=\"mute\">\n No containers for this stack. If you expected some, check that their profile is one the\n spec selects — a service behind a profile that is not enabled is never started.\n </p>\n </section>\n </template>\n </template>\n </div>\n</template>\n\n<style scoped>\n/*\n * The second line of the service cell: the task, under the service it belongs to.\n *\n * The `max-width` cap is GONE. It was a ceiling on what this line could bid for under auto layout —\n * a bid is what auto layout runs on, and there is no bidding any more: the `<colgroup>` sets the\n * column and `.cell-clip` on the line keeps it inside. Two mechanisms for one width is how they\n * drift apart. `taskOf` still shortens what is shown; `title` still holds the whole name.\n */\n.task {\n font-size: var(--t-sm);\n}\n\n/*\n * The floors that make `.table-scroll` a scroller rather than decoration live in `app.css`, beside\n * the `.tbl-fixed` comment that promises them — one place, so a floor and the rule it belongs to\n * cannot be changed apart. They are derived from the `<colgroup>`s above: change a `<col>` and go\n * change the matching `min-width` there.\n */\n</style>\n"],"names":["props","__props","ORDER","sorted","computed","a","b","worst","_a","LABEL","BADGE","BANNER","_createBlock","_unref","DialogRoot","_createVNode","DialogTrigger","_normalizeClass","_createElementVNode","_toDisplayString","DialogPortal","DialogOverlay","DialogContent","_hoisted_1","DialogTitle","_cache","DialogClose","_hoisted_2","_openBlock","_createElementBlock","_Fragment","_renderList","f","i","rt","ref","error","loading","load","r","api","dep","varsQuery","problem","watch","usePolling","running","c","hasNode","taskOf","name","p","busy","act","action","toast","urlFor","host","h","ErrorNote","SkeletonList","FindingsModal","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","InfoHint","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_12","_hoisted_11","_hoisted_13","_hoisted_14","RouteTarget","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_component_RouterLink","_hoisted_23","_hoisted_24","_hoisted_25","RefreshButton","_hoisted_26","_hoisted_27","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","sentence","_hoisted_37","_hoisted_38","_hoisted_39","_hoisted_40","_hoisted_41","n","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_47","_hoisted_48","ActionButton","$event","_hoisted_49","_hoisted_50"],"mappings":"u+BAuBA,MAAMA,EAAQC,EAGRC,E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aAC5F,IAED,CAAA,GAAAtB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,SAED,EAAA,CAAA,oBAEQsB,EAAE,QAAK,WAAA,CAAmBA,EAAE,QAAM,CAAKA,EAAE,SADjDnC,EAMawE,EAAA,OAJX,MAAM,eACL,GAAE,gBAAkB,mBAAmBvE,EAAA4B,CAAA,EAAI,EAAE,CAAA,uBAAwB,mBAAmBM,EAAE,IAAI,CAAA,EAAA,aAChG,IAED,CAAA,GAAAtB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,UAED,EAAA,CAAA,8BAMQsB,EAAE,QAAK,WAAkBS,EAAOT,CAAC,OADzClB,EAQI,IAAA,OANF,MAAM,eACL,KAAM2B,EAAOT,CAAC,EACf,OAAO,SACP,IAAI,YAAA,EACL,SAED,EAAAmE,EAAA,wCAMVrF,EAGI,IAHJsF,GAAuB,2KAGvB,EAAA,UAlTJvF,EAAA,EAAAC,EAMM,MANNN,GAMM,CAAA,GAAAE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CALJP,EAA6B,SAA1B,yBAAsB,EAAA,EACzBA,EAGI,SAHD,sIAGH,EAAA,CAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as se,K as oe,a6 as P,M as ne,c as d,a as s,i as V,v as F,u as a,$ as l,f as n,e as m,w as c,_ as A,ac as ae,t as i,g as p,z as I,F as H,A as v,D as le,j as b,k as f,ae as ie,U as K,p as q,C as z,a7 as re,o as r}from"./index-DB2WhG8N.js";import{_ as $}from"./ActionButton.vue_vue_type_script_setup_true_lang-AGS1FKpY.js";import{_ as ue}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BrBUwK6j.js";import{_ as D}from"./SelectMenu.vue_vue_type_script_setup_true_lang-Bjd8KlYw.js";import"./Teleport-Bg1yDCl9.js";const de={class:"panel settings-form"},ve={class:"field"},he={class:"mute hint"},me={class:"field"},pe=["type"],fe={class:"row",style:{"margin-top":"var(--s2)"}},be={key:2,class:"mute",style:{"font-size":"var(--t-xs)"}},ye={class:"mute hint"},ce={class:"row",style:{gap:"8px","margin-top":"4px"}},ge=["disabled"],ke={key:0,class:"mute"},we={key:1,class:"bad"},Se={class:"panel settings-form"},xe={class:"mute hint"},_e={class:"field"},Ce={class:"row"},Re=["disabled","title"],Ae={class:"mute",style:{"font-size":"var(--t-xs)"}},Te={key:0,class:"mute hint"},Ve={class:"field"},$e={class:"row"},De={key:0,class:"mute hint"},je={key:2,class:"mute hint"},Ee={class:"panel"},Le={class:"field"},Be={class:"field"},Fe=se({__name:"SettingsView",setup(Je){const C=b(!1),R=b(!1),W=f(()=>{const t=l.token;return t.startsWith("pstack_pat_")?"Looks like a personal token.":/^[0-9a-f]{40,}$/i.test(t)?"Looks like a machine token.":`${t.length} characters — this does not look like a pstack token.`}),X=f(()=>{var t;return((t=v.health)==null?void 0:t.authEnforced)??null});async function G(){C.value=!0;try{await ie(),K(v.healthError?"error":"ok",v.healthError||"Control plane reachable")}finally{C.value=!1}}const y=b(null),g=b(""),j=b(!1),k=b(""),x=b("viewer"),w=b(null),E=t=>{var e;return((e=y.value)==null?void 0:e.settings.find(o=>o.key===t))??null},u=f(()=>E("max_jobs")),h=f(()=>E("default_role"));function L(){var t,e;k.value=String(((t=u.value)==null?void 0:t.value)??""),x.value=String(((e=h.value)==null?void 0:e.value)??"viewer")}async function Q(){const t=await q.get("/api/settings");if(j.value=!0,!t.ok){g.value=z(t,"read the host settings");return}g.value="",y.value=t.body,L()}Q(),oe();async function B(t,e){w.value=t;const o=await q.put(`/api/settings/${t}`,{value:e});if(w.value=null,!o.ok){g.value=z(o,`save ${t}`);return}g.value="",y.value&&(y.value.settings=y.value.settings.map(T=>T.key===t?{key:T.key,value:o.body.value,source:o.body.source,minRole:o.body.minRole}:T)),L(),K("ok",o.body.note??"Saved.")}function S(t){return t?re(P.includes(t.minRole)?t.minRole:"admin"):!1}function _(t){return!t||S(t)?"":`Changing this needs the ${t.minRole} role — your account can read it, not set it.`}function J(t){var e;if(t.source==="db")return"Set here and stored on the host — it survives a restart.";if(t.source==="env"){const o=(e=y.value)==null?void 0:e.env.PSTACK_MAX_JOBS;return`From PSTACK_MAX_JOBS${o==null?"":` (${o})`} in the server's environment, which supplies the default and no longer the last word.`}return"The value the binary ships with — nobody has set it, and nothing in the environment supplies one."}const N={db:"Set here",env:"From the environment",default:"The shipped default"},Y=f(()=>v.jobs.filter(t=>t.state==="running").length),Z=f(()=>v.jobs.filter(t=>t.state==="queued").length),U=f(()=>{const t=k.value.trim();if(!t)return"type a number first";const e=Number(t);return!Number.isInteger(e)||e<1?"the limit is a whole number, 1 or more":""}),O=f(()=>{var t;return Number(k.value)!==Number((t=u.value)==null?void 0:t.value)}),M=f(()=>{var t;return x.value!==String(((t=h.value)==null?void 0:t.value)??"")}),ee={viewer:"reads everything",developer:"deploys and tears down",maintainer:"host configuration",admin:"accounts and sign-on"},te=P.map(t=>({value:t,label:ne(t),hint:ee[t]}));return(t,e)=>(r(),d("div",null,[e[35]||(e[35]=s("div",{class:"page-head"},[s("div",null,[s("h1",null,"Settings"),s("div",{class:"sub"},"Some of this is yours alone; some of it is the whole host's. Each panel says which.")])],-1)),s("section",de,[e[18]||(e[18]=s("h2",{class:"phead-title"},"Connection",-1)),e[19]||(e[19]=s("p",{class:"mute hint"}," Stored in this browser, by this browser. Nothing on this panel is sent anywhere, nobody else sees it, and there is nothing to save — every box writes through as you type. ",-1)),s("div",ve,[e[12]||(e[12]=s("label",{for:"apiBase"},"API base URL",-1)),V(s("input",{id:"apiBase","onUpdate:modelValue":e[0]||(e[0]=o=>a(l).apiBase=o),type:"url",spellcheck:"false",placeholder:"(same origin)"},null,512),[[F,a(l).apiBase,void 0,{trim:!0}]]),s("div",he,[e[11]||(e[11]=n(" Leave it empty unless you are pointing this page at another host. ",-1)),m(A,{label:"about the API base URL"},{default:c(()=>[...e[10]||(e[10]=[n(" Empty means same-origin, which is how the control stack serves this page — the browser never makes a cross-origin request, so there is no CORS to configure. Set an absolute URL only for a development session against a remote host. ",-1)])]),_:1})])]),s("div",me,[e[15]||(e[15]=s("label",{for:"token"},"Access token",-1)),V(s("input",{id:"token","onUpdate:modelValue":e[1]||(e[1]=o=>a(l).token=o),type:R.value||!a(l).token?"text":"password",name:"pstack-access-token",autocomplete:"off","data-1p-ignore":"","data-lpignore":"true","data-bwignore":"","data-form-type":"other",spellcheck:"false",placeholder:"paste the token from pstack init"},null,8,pe),[[ae,a(l).token,void 0,{trim:!0}]]),s("div",fe,[a(l).token?(r(),d("button",{key:0,class:"ghost sm",onClick:e[2]||(e[2]=o=>R.value=!R.value)},i(R.value?"Hide":"Show"),1)):p("",!0),a(l).token?(r(),I($,{key:1,variant:"ghost",class:"sm",confirm:"Clear it?",onRun:e[3]||(e[3]=o=>a(l).token="")},{default:c(()=>[...e[13]||(e[13]=[n(" Clear ",-1)])]),_:1})):p("",!0),a(l).token?(r(),d("span",be,i(W.value),1)):p("",!0)]),s("div",ye,[e[14]||(e[14]=n(" Authenticates every request — signing in with an account does the same job, so set this only for token-based access (the machine token, or a personal token from your account). ",-1)),X.value===!1?(r(),d(H,{key:0},[n(" This server is not asking for one — it only accepts connections from this machine, so a token here is harmless but unnecessary. ")],64)):p("",!0)])]),s("div",ce,[s("button",{class:"btn",disabled:C.value,onClick:G},i(C.value?"Checking…":"Test connection"),9,ge),a(v).health?(r(),d("span",ke,[n(" Connected to pstack "+i(a(v).health.version)+" ",1),m(A,{label:"where data is stored"},{default:c(()=>[e[16]||(e[16]=n(" Deployment records and stored specs live in ",-1)),s("code",null,i(a(v).health.dataDir),1),e[17]||(e[17]=n(" on the host. ",-1))]),_:1})])):a(v).healthError?(r(),d("span",we,i(a(v).healthError),1)):p("",!0)])]),s("section",Se,[e[29]||(e[29]=s("h2",{class:"phead-title"},"This host",-1)),s("p",xe,[e[21]||(e[21]=n(" Stored on the server, in force for everybody, and saved on purpose — a box that wrote through on every keystroke would set the limit to 1 on the way to typing 12. ",-1)),m(A,{label:"which value wins"},{default:c(()=>[...e[20]||(e[20]=[n(" Database, then environment, then the value the binary ships with. Something saved here outranks ",-1),s("code",null,"PSTACK_MAX_JOBS",-1),n(" and is not undone by the next restart — and a host where nobody ever saves anything keeps behaving exactly as it did before this panel existed. ",-1)])]),_:1})]),g.value?(r(),I(ue,{key:0,text:g.value,title:"Host settings."},null,8,["text"])):p("",!0),y.value?(r(),d(H,{key:1},[s("div",_e,[e[24]||(e[24]=s("label",{for:"maxJobs"},"Concurrency limit",-1)),s("div",Ce,[V(s("input",{id:"maxJobs","onUpdate:modelValue":e[4]||(e[4]=o=>k.value=o),type:"number",min:"1",step:"1",inputmode:"numeric",disabled:!S(u.value),title:_(u.value)||void 0,style:le(`width: 8rem${S(u.value)?"":"; opacity: 0.45; cursor: not-allowed"}`)},null,12,Re),[[F,k.value]]),m($,{variant:"primary",pending:w.value==="max_jobs",disabled:!S(u.value)||!O.value||!!U.value||w.value!==null,title:_(u.value)||U.value||(O.value?void 0:"this is already the stored value"),onClick:e[5]||(e[5]=o=>B("max_jobs",Number(k.value)))},{default:c(()=>[...e[22]||(e[22]=[n(" Save ",-1)])]),_:1},8,["pending","disabled","title"]),s("span",Ae,[n(i(Y.value)+" running · "+i(Z.value)+" waiting ",1),m(A,{label:"what waiting means"},{default:c(()=>[...e[23]||(e[23]=[n(" A waiting job is not necessarily waiting for a slot: a stack runs one job at a time, so a job can be queued behind another on its own stack while the host is nowhere near this limit. The Jobs page says which, per job. ",-1)])]),_:1})])]),e[25]||(e[25]=s("div",{class:"mute hint"},[n(" The most jobs this host runs at once, across every stack. It applies from the moment you save it — no restart. "),s("b",null,"Lowering it cancels nothing:"),n(" jobs already running run to completion, and the new limit applies to the next job that starts. Raising it starts whatever has been waiting for a slot. ")],-1)),u.value?(r(),d("div",Te,[s("b",null,i(N[u.value.source])+".",1),n(" "+i(J(u.value))+" "+i(_(u.value)),1)])):p("",!0)]),s("div",Ve,[e[27]||(e[27]=s("label",{for:"defaultRole"},"Default role for new accounts",-1)),s("div",$e,[m(D,{id:"defaultRole",modelValue:x.value,"onUpdate:modelValue":e[6]||(e[6]=o=>x.value=o),label:"Default role for new accounts",options:a(te),disabled:!S(h.value)},null,8,["modelValue","options","disabled"]),m($,{variant:"primary",pending:w.value==="default_role",disabled:!S(h.value)||!M.value||w.value!==null,title:_(h.value)||(M.value?void 0:"this is already the stored value"),onClick:e[7]||(e[7]=o=>B("default_role",x.value))},{default:c(()=>[...e[26]||(e[26]=[n(" Save ",-1)])]),_:1},8,["pending","disabled","title"])]),e[28]||(e[28]=s("div",{class:"mute hint"},[n(" What an account gets when it is created without a role being named — the API's "),s("code",null,"POST /api/users"),n(", and any sign-on provider left to inherit the host default. It never widens what anyone may do: creating accounts is admin's either way. Accounts that already exist keep the role they have. ")],-1)),h.value?(r(),d("div",De,[s("b",null,i(N[h.value.source])+".",1),n(" "+i(J(h.value))+" "+i(_(h.value)),1)])):p("",!0)])],64)):j.value?p("",!0):(r(),d("p",je,"Reading the host's settings…"))]),s("section",Ee,[e[33]||(e[33]=s("h2",{class:"phead-title"},"Appearance",-1)),e[34]||(e[34]=s("p",{class:"mute hint"},"This browser's too — and applied the moment you pick it.",-1)),s("div",Le,[e[30]||(e[30]=s("label",{for:"theme"},"Theme",-1)),m(D,{modelValue:a(l).theme,"onUpdate:modelValue":e[8]||(e[8]=o=>a(l).theme=o),id:"theme",label:"Theme",options:[{value:"system",label:"Follow the system"},{value:"dark",label:"Dark"},{value:"light",label:"Light"}]},null,8,["modelValue"])]),s("div",Be,[e[31]||(e[31]=s("label",{for:"motion"},"Motion",-1)),m(D,{modelValue:a(l).motion,"onUpdate:modelValue":e[9]||(e[9]=o=>a(l).motion=o),id:"motion",label:"Motion",options:[{value:"system",label:"Follow the system"},{value:"full",label:"Always animate"},{value:"none",label:"No animation"}]},null,8,["modelValue"]),e[32]||(e[32]=s("div",{class:"mute hint"}," “Follow the system” uses your device's reduce-motion setting. The other two override it, in either direction. ",-1))])])]))}});export{Fe as default};
|
|
2
|
-
//# sourceMappingURL=SettingsView-DwSmnNbU.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsView-DwSmnNbU.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, how the app looks — and the two settings\n * that live on the HOST.\n *\n * ── TWO KINDS OF CONTROL ON ONE PAGE ─────────────────────────────────────────────────────────────\n *\n * Nobody should have to guess which is which, so each panel says so in its own subtitle rather than\n * the page making one claim at the top: \"nothing here is sent to the server\" was true of this page\n * for eight versions, and a sentence like that outlives its truth in people's memory.\n *\n * - THIS BROWSER — Connection and Appearance. `useSettings` writes them straight to localStorage;\n * nothing is sent anywhere, nobody else sees them, and there is nothing to save because the\n * bindings write through immediately. That is why those panels have no Save button.\n * - THIS HOST — the concurrency limit and the default role for new accounts. Stored in the\n * server's database, in force for everybody, and saved EXPLICITLY: a number box that wrote\n * through on every keystroke would set the cap to 1 on the way to typing 12.\n *\n * ── WHERE THE VALUE CAME FROM, ALWAYS ────────────────────────────────────────────────────────────\n *\n * Both host settings render their `source`, because \"I changed it and it did not stick\" is\n * otherwise unanswerable: a box saying 4 cannot tell a refused write from a stale page from an\n * environment variable overriding it. Precedence is database > environment > built-in default — so\n * `PSTACK_MAX_JOBS` is now the DEFAULT rather than the authority, and a value set here is not\n * silently reverted by the next restart. A save flips the row's source to \"db\", so the write's own\n * response is what the page re-renders from; keeping the old row and patching just the number would\n * leave the line still crediting the environment.\n *\n * ── LOWERING THE CAP CANCELS NOTHING ─────────────────────────────────────────────────────────────\n *\n * Said beside the field, not only in the toast afterwards. Jobs already running run to completion;\n * the cap applies to the next dispatch. Someone typing 1 while four jobs run must not read the\n * confirmation as \"three were just killed\" — which is also why the running and waiting counts sit\n * next to the input rather than a page away in Jobs.\n *\n * ── A VIEWER READS BOTH AND WRITES NEITHER ───────────────────────────────────────────────────────\n *\n * Disabled, not hidden, with the reason in text under the control: a page that hides what your tier\n * cannot reach looks broken rather than restricted, and the reason cannot live only in a `title`\n * because a disabled `SelectMenu` has no element of its own to hang one on. The threshold comes\n * from the server's own permission table (`minRole`, per key — maintainer for the cap, admin for\n * the role) and is never re-derived here. An unrecognised name is read as ADMIN: `rank()` scores a\n * role it has never heard of as 0, so passing one through unguarded would enable the control for\n * everyone. Hiding is courtesy either way — the server's 403 is the enforcement, and it lands in\n * `hostError`.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport { ROLES, type HostSettings, type Role, type SettingKey, type SettingRow, type SettingWritten } from '../api/types';\nimport { can } from '../composables/useAuth';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth, loadJobs } from '../composables/useControlPlane';\nimport { sentence } from '../composables/useFormat';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst checking = ref(false);\nconst reveal = ref(false);\n\n/**\n * What is in the token box, described without printing it.\n *\n * The point is to make a WRONG value visible at a glance. A password autofilled into this field is\n * short and matches neither shape, and \"12 characters, not a pstack token\" is the sentence that\n * ends the mystery — before this, the only symptom was every page 401ing.\n */\nconst tokenShape = computed(() => {\n const t = settings.token;\n if (t.startsWith('pstack_pat_')) return 'Looks like a personal token.';\n if (/^[0-9a-f]{40,}$/i.test(t)) return 'Looks like a machine token.';\n return `${t.length} characters — this does not look like a pstack token.`;\n});\n\n/**\n * The server tells us whether it enforces auth. When it does not, it is bound to loopback and a\n * token would be pointless — worth saying, so nobody hunts for one that was never issued.\n */\nconst authEnforced = computed(() => state.health?.authEnforced ?? null);\n\nasync function recheck(): Promise<void> {\n checking.value = true;\n try {\n await loadHealth();\n toast(state.healthError ? 'error' : 'ok', state.healthError || 'Control plane reachable');\n } finally {\n checking.value = false;\n }\n}\n\n// ── the host's settings ──────────────────────────────────────────────────────────────────────────\n\nconst host = ref<HostSettings | null>(null);\nconst hostError = ref('');\nconst hostLoaded = ref(false);\n/** What the boxes hold, kept apart from the server's copy so \"changed\" is a comparison, not a flag. */\nconst maxJobsDraft = ref('');\nconst roleDraft = ref('viewer');\n/** Which key is in flight — one at a time, so a save cannot be racing its own re-read. */\nconst savingKey = ref<SettingKey | null>(null);\n\nconst row = (key: SettingKey): SettingRow | null => host.value?.settings.find((s) => s.key === key) ?? null;\nconst maxJobs = computed(() => row('max_jobs'));\nconst defaultRole = computed(() => row('default_role'));\n\n/** Both drafts back to what the server just said. Called after every read and every write. */\nfunction resetDrafts(): void {\n maxJobsDraft.value = String(maxJobs.value?.value ?? '');\n roleDraft.value = String(defaultRole.value?.value ?? 'viewer');\n}\n\nasync function loadHost(): Promise<void> {\n const r = await api.get<HostSettings>('/api/settings');\n hostLoaded.value = true;\n if (!r.ok) {\n // Includes the honest 404: a server older than these settings has no such route, and `problem`\n // says exactly that rather than inventing a reason.\n hostError.value = problem(r, 'read the host settings');\n return;\n }\n hostError.value = '';\n host.value = r.body;\n resetDrafts();\n}\nvoid loadHost();\n// The shell polls the job list every seven seconds once signed in; this is only so the counts\n// beside the cap are right on arrival rather than up to a poll later.\nvoid loadJobs();\n\nasync function save(key: SettingKey, value: number | string): Promise<void> {\n savingKey.value = key;\n const r = await api.put<SettingWritten>(`/api/settings/${key}`, { value });\n savingKey.value = null;\n if (!r.ok) {\n hostError.value = problem(r, `save ${key}`);\n return;\n }\n hostError.value = '';\n // The WHOLE row from the response, not just the number: a stored value's source is now \"db\", and\n // a line still saying \"from the environment\" is the precise lie this display exists to prevent.\n if (host.value) {\n host.value.settings = host.value.settings.map((s) =>\n s.key === key ? { key: s.key, value: r.body.value, source: r.body.source, minRole: r.body.minRole } : s,\n );\n }\n resetDrafts();\n // The server's own words for what a cap change did and did not do — paraphrasing it here is how\n // the two drift.\n toast('ok', r.body.note ?? 'Saved.');\n}\n\n/**\n * May this account write this key — for rendering only.\n *\n * FAILS CLOSED on a `minRole` this build does not know: `rank()` scores an unfamiliar role 0, so\n * handing one to `can()` unchecked would answer true for every signed-in account, and the least\n * privileged person on the host would be shown a control the server refuses.\n */\nfunction mayWrite(r: SettingRow | null): boolean {\n if (!r) return false;\n return can((ROLES as readonly string[]).includes(r.minRole) ? (r.minRole as Role) : 'admin');\n}\n\n/** Empty when they may write it; otherwise the sentence rendered under the disabled control. */\nfunction whyReadOnly(r: SettingRow | null): string {\n if (!r || mayWrite(r)) return '';\n return `Changing this needs the ${r.minRole} role — your account can read it, not set it.`;\n}\n\n/**\n * Where the value came from. Stated as a FACT about the host, never as an instruction: a viewer\n * reads this line too, and \"save a value here to override it\" is advice for someone else.\n */\nfunction sourceLine(r: SettingRow): string {\n if (r.source === 'db') return 'Set here and stored on the host — it survives a restart.';\n if (r.source === 'env') {\n const n = host.value?.env.PSTACK_MAX_JOBS;\n return `From PSTACK_MAX_JOBS${n === null || n === undefined ? '' : ` (${n})`} in the server's environment, which supplies the default and no longer the last word.`;\n }\n return 'The value the binary ships with — nobody has set it, and nothing in the environment supplies one.';\n}\n// Not \"your choice\": a viewer reads this line too, and whoever set it may not be the person looking.\nconst SOURCE_LABEL: Record<SettingRow['source'], string> = {\n db: 'Set here',\n env: 'From the environment',\n default: 'The shipped default',\n};\n\nconst running = computed(() => state.jobs.filter((j) => j.state === 'running').length);\nconst waiting = computed(() => state.jobs.filter((j) => j.state === 'queued').length);\n\n/** Why the cap cannot be saved as typed — shown as the button's title, per the disabled rule. */\nconst maxJobsProblem = computed(() => {\n const raw = maxJobsDraft.value.trim();\n if (!raw) return 'type a number first';\n const n = Number(raw);\n // The server takes an integer ≥ 1 and refuses everything else; saying so here spares a round trip,\n // and the server still gets the last word.\n if (!Number.isInteger(n) || n < 1) return 'the limit is a whole number, 1 or more';\n return '';\n});\n/** `Number` on both sides: the input hands back a string, so `'4' !== 4` would leave Save lit forever. */\nconst maxJobsDirty = computed(() => Number(maxJobsDraft.value) !== Number(maxJobs.value?.value));\nconst roleDirty = computed(() => roleDraft.value !== String(defaultRole.value?.value ?? ''));\n\n/** One line each, in the picker itself — a role name alone does not say what it costs to grant. */\nconst ROLE_WHAT: Record<Role, string> = {\n viewer: 'reads everything',\n developer: 'deploys and tears down',\n maintainer: 'host configuration',\n admin: 'accounts and sign-on',\n};\nconst roleOptions = ROLES.map((r) => ({ value: r, label: sentence(r), hint: ROLE_WHAT[r] }));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <!-- Panel by panel, because two of the three are this browser's and one is the host's, and\n a page-level \"nothing here is sent to the server\" would now be a lie about the third. -->\n <div class=\"sub\">Some of this is yours alone; some of it is the whole host's. Each panel says which.</div>\n </div>\n </div>\n\n <!-- `settings-form` caps the field widths: a URL input stretched to the panel's full 1500px\n reads as a text editor, not a form — see the rule in app.css. -->\n <section class=\"panel settings-form\">\n <h2 class=\"phead-title\">Connection</h2>\n <p class=\"mute hint\">\n Stored in this browser, by this browser. Nothing on this panel is sent anywhere, nobody else\n sees it, and there is nothing to save — every box writes through as you type.\n </p>\n\n <div class=\"field\">\n <label for=\"apiBase\">API base URL</label>\n <input\n id=\"apiBase\"\n v-model.trim=\"settings.apiBase\"\n type=\"url\"\n spellcheck=\"false\"\n placeholder=\"(same origin)\"\n />\n <div class=\"mute hint\">\n Leave it empty unless you are pointing this page at another host.\n <InfoHint label=\"about the API base URL\">\n Empty means same-origin, which is how the control stack serves this page — the browser\n never makes a cross-origin request, so there is no CORS to configure. Set an absolute\n URL only for a development session against a remote host.\n </InfoHint>\n </div>\n </div>\n\n <div class=\"field\">\n <label for=\"token\">Access token</label>\n <!--\n NOT `type=\"password\"`, and none of these attributes are decorative.\n\n This field is why \"opening Settings signs me out\" was a real bug. A password input is an\n autofill magnet: Chrome and every password manager fill one on sight and ignore\n `autocomplete=\"off\"` while doing it. The filled value went straight through `v-model` into\n localStorage and onto every request as `Authorization: Bearer <someone's password>` — and\n the server used to treat a bad bearer as a hard refusal rather than falling back to the\n session cookie, so a perfectly good login 401'd on every route until site data was cleared.\n\n The server now falls through (that is the real fix), and this field stops inviting the\n fill: a text input that masks itself only while it holds a value, named nothing like a\n password, with the ignore hints the managers respect.\n -->\n <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n :type=\"reveal || !settings.token ? 'text' : 'password'\"\n name=\"pstack-access-token\"\n autocomplete=\"off\"\n data-1p-ignore\n data-lpignore=\"true\"\n data-bwignore\n data-form-type=\"other\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"row\" style=\"margin-top: var(--s2)\">\n <button v-if=\"settings.token\" class=\"ghost sm\" @click=\"reveal = !reveal\">\n {{ reveal ? 'Hide' : 'Show' }}\n </button>\n <ActionButton\n v-if=\"settings.token\"\n variant=\"ghost\"\n class=\"sm\"\n confirm=\"Clear it?\"\n @run=\"settings.token = ''\"\n >\n Clear\n </ActionButton>\n <span v-if=\"settings.token\" class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ tokenShape }}\n </span>\n </div>\n <div class=\"mute hint\">\n Authenticates every request — signing in with an account does the same job, so set this\n only for token-based access (the machine token, or a personal token from your account).\n <template v-if=\"authEnforced === false\">\n This server is not asking for one — it only accepts connections from this machine, so a\n token here is harmless but unnecessary.\n </template>\n </div>\n </div>\n\n <div class=\"row\" style=\"gap: 8px; margin-top: 4px\">\n <button class=\"btn\" :disabled=\"checking\" @click=\"recheck\">\n {{ checking ? 'Checking…' : 'Test connection' }}\n </button>\n <span v-if=\"state.health\" class=\"mute\">\n Connected to pstack {{ state.health.version }}\n <InfoHint label=\"where data is stored\">\n Deployment records and stored specs live in\n <code>{{ state.health.dataDir }}</code> on the host.\n </InfoHint>\n </span>\n <span v-else-if=\"state.healthError\" class=\"bad\">{{ state.healthError }}</span>\n </div>\n </section>\n\n <!-- ===================== the host's own settings — everyone sees these ===================== -->\n <section class=\"panel settings-form\">\n <h2 class=\"phead-title\">This host</h2>\n <p class=\"mute hint\">\n Stored on the server, in force for everybody, and saved on purpose — a box that wrote\n through on every keystroke would set the limit to 1 on the way to typing 12.\n <InfoHint label=\"which value wins\">\n Database, then environment, then the value the binary ships with. Something saved here\n outranks <code>PSTACK_MAX_JOBS</code> and is not undone by the next restart — and a host\n where nobody ever saves anything keeps behaving exactly as it did before this panel\n existed.\n </InfoHint>\n </p>\n\n <ErrorNote v-if=\"hostError\" :text=\"hostError\" title=\"Host settings.\" />\n\n <template v-if=\"host\">\n <div class=\"field\">\n <!-- The dimming is inline because app.css has no `input:disabled` rule — `button:disabled`\n exists (which is what fades the role picker, a real <button> under the hood) and\n checkboxes have one, but this is the app's first disabled TEXT-shaped input, and\n without it a viewer gets a box that looks live, takes no focus and explains nothing.\n It matches the button rule's 0.45; the honest home for it is app.css, which is not\n this agent's to edit. -->\n <label for=\"maxJobs\">Concurrency limit</label>\n <div class=\"row\">\n <input\n id=\"maxJobs\"\n v-model=\"maxJobsDraft\"\n type=\"number\"\n min=\"1\"\n step=\"1\"\n inputmode=\"numeric\"\n :disabled=\"!mayWrite(maxJobs)\"\n :title=\"whyReadOnly(maxJobs) || undefined\"\n :style=\"`width: 8rem${mayWrite(maxJobs) ? '' : '; opacity: 0.45; cursor: not-allowed'}`\"\n />\n <ActionButton\n variant=\"primary\"\n :pending=\"savingKey === 'max_jobs'\"\n :disabled=\"!mayWrite(maxJobs) || !maxJobsDirty || !!maxJobsProblem || savingKey !== null\"\n :title=\"whyReadOnly(maxJobs) || maxJobsProblem || (maxJobsDirty ? undefined : 'this is already the stored value')\"\n @click=\"save('max_jobs', Number(maxJobsDraft))\"\n >\n Save\n </ActionButton>\n <span class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ running }} running · {{ waiting }} waiting\n <InfoHint label=\"what waiting means\">\n A waiting job is not necessarily waiting for a slot: a stack runs one job at a time,\n so a job can be queued behind another on its own stack while the host is nowhere near\n this limit. The Jobs page says which, per job.\n </InfoHint>\n </span>\n </div>\n <div class=\"mute hint\">\n The most jobs this host runs at once, across every stack. It applies from the moment you\n save it — no restart. <b>Lowering it cancels nothing:</b> jobs already running run to\n completion, and the new limit applies to the next job that starts. Raising it starts\n whatever has been waiting for a slot.\n </div>\n <div v-if=\"maxJobs\" class=\"mute hint\">\n <b>{{ SOURCE_LABEL[maxJobs.source] }}.</b> {{ sourceLine(maxJobs) }}\n {{ whyReadOnly(maxJobs) }}\n </div>\n </div>\n\n <div class=\"field\">\n <label for=\"defaultRole\">Default role for new accounts</label>\n <div class=\"row\">\n <SelectMenu\n id=\"defaultRole\"\n v-model=\"roleDraft\"\n label=\"Default role for new accounts\"\n :options=\"roleOptions\"\n :disabled=\"!mayWrite(defaultRole)\"\n />\n <ActionButton\n variant=\"primary\"\n :pending=\"savingKey === 'default_role'\"\n :disabled=\"!mayWrite(defaultRole) || !roleDirty || savingKey !== null\"\n :title=\"whyReadOnly(defaultRole) || (roleDirty ? undefined : 'this is already the stored value')\"\n @click=\"save('default_role', roleDraft)\"\n >\n Save\n </ActionButton>\n </div>\n <div class=\"mute hint\">\n What an account gets when it is created without a role being named — the API's\n <code>POST /api/users</code>, and any sign-on provider left to inherit the host default.\n It never widens what anyone may do: creating accounts is admin's either way. Accounts\n that already exist keep the role they have.\n </div>\n <div v-if=\"defaultRole\" class=\"mute hint\">\n <b>{{ SOURCE_LABEL[defaultRole.source] }}.</b> {{ sourceLine(defaultRole) }}\n {{ whyReadOnly(defaultRole) }}\n </div>\n </div>\n </template>\n <p v-else-if=\"!hostLoaded\" class=\"mute hint\">Reading the host's settings…</p>\n </section>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n <p class=\"mute hint\">This browser's too — and applied the moment you pick it.</p>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <SelectMenu\n v-model=\"settings.theme\" id=\"theme\"\n label=\"Theme\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'dark', label: 'Dark' },\n { value: 'light', label: 'Light' },\n ]\"\n />\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <SelectMenu\n v-model=\"settings.motion\" id=\"motion\"\n label=\"Motion\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'full', label: 'Always animate' },\n { value: 'none', label: 'No animation' },\n ]\"\n />\n <div class=\"mute hint\">\n “Follow the system” uses your device's reduce-motion setting. The other two override it,\n in either direction.\n </div>\n </div>\n </section>\n </div>\n</template>\n"],"names":["checking","ref","reveal","tokenShape","computed","settings","authEnforced","_a","state","recheck","loadHealth","toast","host","hostError","hostLoaded","maxJobsDraft","roleDraft","savingKey","row","key","s","maxJobs","defaultRole","resetDrafts","_b","loadHost","r","api","problem","loadJobs","save","value","mayWrite","can","ROLES","whyReadOnly","sourceLine","n","SOURCE_LABEL","running","j","waiting","maxJobsProblem","raw","maxJobsDirty","roleDirty","ROLE_WHAT","roleOptions","sentence","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_6","_createBlock","ActionButton","_hoisted_7","_toDisplayString","_hoisted_8","_Fragment","_hoisted_9","_hoisted_10","_openBlock","_hoisted_11","_createTextVNode","_hoisted_12","_hoisted_13","_hoisted_14","ErrorNote","_hoisted_15","_hoisted_16","_normalizeStyle","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","SelectMenu","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26"],"mappings":"svCA2DA,MAAMA,EAAWC,EAAI,EAAK,EACpBC,EAASD,EAAI,EAAK,EASlBE,EAAaC,EAAS,IAAM,CAChC,MAAM,EAAIC,EAAS,MACnB,OAAI,EAAE,WAAW,aAAa,EAAU,+BACpC,mBAAmB,KAAK,CAAC,EAAU,8BAChC,GAAG,EAAE,MAAM,uDACpB,CAAC,EAMKC,EAAeF,EAAS,IAAA,OAAM,QAAAG,EAAAC,EAAM,SAAN,YAAAD,EAAc,eAAgB,KAAI,EAEtE,eAAeE,GAAyB,CACtCT,EAAS,MAAQ,GACjB,GAAI,CACF,MAAMU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C,KAAA,CAAnC,MAAM,aAAA,EAAc,aAAU,EAAA,GAClCE,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAiF,IAAA,CAA9E,MAAM,WAAA,EAAY,2DAAwD,EAAA,GAE7EA,EAWM,MAXNqC,GAWM,CAVJnC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAgC,QAAA,CAAzB,IAAI,OAAA,EAAQ,QAAK,EAAA,GACxBO,EAQI0B,EAAA,CAPS,WAAA5B,EAAAlD,CAAA,EAAS,MAAT,sBAAA+C,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAlD,CAAA,EAAS,MAAKiD,GAAE,GAAG,QAC5B,MAAM,QACL,QAAS,sGAIT,2BAIPJ,EAeM,MAfNsC,GAeM,CAdJpC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAkC,QAAA,CAA3B,IAAI,QAAA,EAAS,SAAM,EAAA,GAC1BO,EAQI0B,EAAA,CAPS,WAAA5B,EAAAlD,CAAA,EAAS,OAAT,sBAAA+C,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAlD,CAAA,EAAS,OAAMiD,GAAE,GAAG,SAC7B,MAAM,SACL,QAAS,sHAIT,yBAELF,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGM,MAAA,CAHD,MAAM,aAAY,kHAGvB,EAAA,EAAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
function u(n){return n!=="queued"&&n!=="running"}function c(n,r){const t=r.filter(i=>i.id!==n.id),s=t.find(i=>i.state==="running"&&i.stack===n.stack);if(s)return{kind:"stack",blocker:s};const e=t.filter(i=>i.state==="running").length;return e>0?{kind:"slot",running:e}:{kind:"unknown"}}function d(n,r){const t=r.findIndex(e=>e.id===n.id);return t<0?null:r.slice(0,t).reverse().find(e=>e.stack===n.stack)??null}export{u as i,d as s,c as w};
|
|
2
|
-
//# sourceMappingURL=useJobQueue-D5JkRJNX.js.map
|