@samyx/preview-stacks-ui 0.33.0 → 0.33.1
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-Boeac0US.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-Boeac0US.js.map} +1 -1
- package/dist/assets/{AxesTab-DlGjhnwi.js → AxesTab-DYWU3-0U.js} +2 -2
- package/dist/assets/{AxesTab-DlGjhnwi.js.map → AxesTab-DYWU3-0U.js.map} +1 -1
- package/dist/assets/{ConfigTab-BiqFZrvm.js → ConfigTab-GNv5OcAW.js} +2 -2
- package/dist/assets/{ConfigTab-BiqFZrvm.js.map → ConfigTab-GNv5OcAW.js.map} +1 -1
- package/dist/assets/{ConfigView-CsQJIt52.js → ConfigView-lP6-ppec.js} +2 -2
- package/dist/assets/{ConfigView-CsQJIt52.js.map → ConfigView-lP6-ppec.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-DxO9agCS.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-DxO9agCS.js.map} +1 -1
- package/dist/assets/{DangerTab-COq-R4Dz.js → DangerTab-BlfddI-Y.js} +2 -2
- package/dist/assets/{DangerTab-COq-R4Dz.js.map → DangerTab-BlfddI-Y.js.map} +1 -1
- package/dist/assets/{DashboardView-DTI9n2-Z.js → DashboardView-Vx-RzO7C.js} +2 -2
- package/dist/assets/{DashboardView-DTI9n2-Z.js.map → DashboardView-Vx-RzO7C.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-BBMtQ9vE.js → DeploymentDetailView-6n1gPVwl.js} +2 -2
- package/dist/assets/{DeploymentDetailView-BBMtQ9vE.js.map → DeploymentDetailView-6n1gPVwl.js.map} +1 -1
- package/dist/assets/{DeploymentsView-BCXfIFud.js → DeploymentsView-BwIXMxDj.js} +2 -2
- package/dist/assets/{DeploymentsView-BCXfIFud.js.map → DeploymentsView-BwIXMxDj.js.map} +1 -1
- package/dist/assets/{DialogTrigger-D4yBGqUf.js → DialogTrigger-ChSYKui7.js} +2 -2
- package/dist/assets/{DialogTrigger-D4yBGqUf.js.map → DialogTrigger-ChSYKui7.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-D0dyw0Wd.js → EquivalentCommand-BO7XtMvC.js} +2 -2
- package/dist/assets/{EquivalentCommand-D0dyw0Wd.js.map → EquivalentCommand-BO7XtMvC.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-TuSS3q8x.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-TuSS3q8x.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-B5yD7e56.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-B5yD7e56.js.map} +1 -1
- package/dist/assets/{JobDetailView-DIEijrhl.js → JobDetailView-CkwAvKII.js} +2 -2
- package/dist/assets/{JobDetailView-DIEijrhl.js.map → JobDetailView-CkwAvKII.js.map} +1 -1
- package/dist/assets/{JobsView-Dw4-yNCj.js → JobsView-CStaz_Yv.js} +2 -2
- package/dist/assets/{JobsView-Dw4-yNCj.js.map → JobsView-CStaz_Yv.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-D32B2YEy.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-D32B2YEy.js.map} +1 -1
- package/dist/assets/{LoginView-NgcWC4N0.js → LoginView-H9eKfpjn.js} +2 -2
- package/dist/assets/{LoginView-NgcWC4N0.js.map → LoginView-H9eKfpjn.js.map} +1 -1
- package/dist/assets/{LogsTab-oWjSPx9O.js → LogsTab-fz8NPH4z.js} +2 -2
- package/dist/assets/{LogsTab-oWjSPx9O.js.map → LogsTab-fz8NPH4z.js.map} +1 -1
- package/dist/assets/{NotFoundView-DnQQJSu_.js → NotFoundView-CfLkt1Lk.js} +2 -2
- package/dist/assets/{NotFoundView-DnQQJSu_.js.map → NotFoundView-CfLkt1Lk.js.map} +1 -1
- package/dist/assets/{NotifiersView-CvP3L81J.js → NotifiersView-BsJr7pg6.js} +2 -2
- package/dist/assets/{NotifiersView-CvP3L81J.js.map → NotifiersView-BsJr7pg6.js.map} +1 -1
- package/dist/assets/{OverviewTab-C10J0ywh.js → OverviewTab-BvR-YA7C.js} +2 -2
- package/dist/assets/{OverviewTab-C10J0ywh.js.map → OverviewTab-BvR-YA7C.js.map} +1 -1
- package/dist/assets/{PublicLogsView-DqMmMbtf.js → PublicLogsView-bT9b1HgF.js} +2 -2
- package/dist/assets/{PublicLogsView-DqMmMbtf.js.map → PublicLogsView-bT9b1HgF.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-C72sUBV5.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-C72sUBV5.js.map} +1 -1
- package/dist/assets/{RegistriesView-DIa3mCyc.js → RegistriesView-C1UKUBoo.js} +2 -2
- package/dist/assets/{RegistriesView-DIa3mCyc.js.map → RegistriesView-C1UKUBoo.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-CWsMYm1n.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-CWsMYm1n.js.map} +1 -1
- package/dist/assets/{RequiresTab-Dde68lOF.js → RequiresTab-UWXA1T0D.js} +2 -2
- package/dist/assets/{RequiresTab-Dde68lOF.js.map → RequiresTab-UWXA1T0D.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-Dxo20XO4.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-Dxo20XO4.js.map} +1 -1
- package/dist/assets/{RoutingView-oXXCIL07.js → RoutingView-DheAKdtP.js} +2 -2
- package/dist/assets/{RoutingView-oXXCIL07.js.map → RoutingView-DheAKdtP.js.map} +1 -1
- package/dist/assets/{RuntimeTab-DFxU8OLh.js → RuntimeTab-CsFdEJft.js} +2 -2
- package/dist/assets/{RuntimeTab-DFxU8OLh.js.map → RuntimeTab-CsFdEJft.js.map} +1 -1
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-Bjd8KlYw.js → SelectMenu.vue_vue_type_script_setup_true_lang-CPpw5Oci.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-CPpw5Oci.js.map} +1 -1
- package/dist/assets/SettingsView-rAcphtRK.js +2 -0
- package/dist/assets/SettingsView-rAcphtRK.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-Chk2I7Hn.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-Chk2I7Hn.js.map} +1 -1
- package/dist/assets/{SpecDetailView-D10gsC8W.js → SpecDetailView-BsKNDau7.js} +2 -2
- package/dist/assets/{SpecDetailView-D10gsC8W.js.map → SpecDetailView-BsKNDau7.js.map} +1 -1
- package/dist/assets/{SpecsView-BU962Blv.js → SpecsView-Dj0In_jz.js} +2 -2
- package/dist/assets/{SpecsView-BU962Blv.js.map → SpecsView-Dj0In_jz.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-CTwtqjCb.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-CTwtqjCb.js.map} +1 -1
- package/dist/assets/{SsoView-BJO4vMED.js → SsoView-BLYI9Ut9.js} +2 -2
- package/dist/assets/{SsoView-BJO4vMED.js.map → SsoView-BLYI9Ut9.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-DkYgZEmJ.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-DkYgZEmJ.js.map} +1 -1
- package/dist/assets/{SubmitView-CChPoIvR.js → SubmitView-BfK82VY5.js} +2 -2
- package/dist/assets/{SubmitView-CChPoIvR.js.map → SubmitView-BfK82VY5.js.map} +1 -1
- package/dist/assets/{SwarmView-xPA-5INc.js → SwarmView-p5aN4B52.js} +2 -2
- package/dist/assets/{SwarmView-xPA-5INc.js.map → SwarmView-p5aN4B52.js.map} +1 -1
- package/dist/assets/{Teleport-Bg1yDCl9.js → Teleport-CNXlGDC9.js} +2 -2
- package/dist/assets/{Teleport-Bg1yDCl9.js.map → Teleport-CNXlGDC9.js.map} +1 -1
- package/dist/assets/{TerminalTab-jUQlwJpM.js → TerminalTab-D_zK5L5R.js} +2 -2
- package/dist/assets/{TerminalTab-jUQlwJpM.js.map → TerminalTab-D_zK5L5R.js.map} +1 -1
- package/dist/assets/{UsersView-DcjfdY6Q.js → UsersView-MuCb17Lb.js} +2 -2
- package/dist/assets/{UsersView-DcjfdY6Q.js.map → UsersView-MuCb17Lb.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-BDoSMa0L.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-BDoSMa0L.js.map} +1 -1
- package/dist/assets/{VarIO-gtGLr9Br.js → VarIO-C_uMaK0d.js} +2 -2
- package/dist/assets/{VarIO-gtGLr9Br.js.map → VarIO-C_uMaK0d.js.map} +1 -1
- package/dist/assets/{VariablesView-DSXnmTTH.js → VariablesView-CJg76tKu.js} +2 -2
- package/dist/assets/{VariablesView-DSXnmTTH.js.map → VariablesView-CJg76tKu.js.map} +1 -1
- package/dist/assets/{index-DB2WhG8N.js → index-Cllpaxdb.js} +3 -3
- package/dist/assets/{index-DB2WhG8N.js.map → index-Cllpaxdb.js.map} +1 -1
- package/dist/assets/{useDeployment-B7wpJY-X.js → useDeployment-DsuhE4uh.js} +2 -2
- package/dist/assets/{useDeployment-B7wpJY-X.js.map → useDeployment-DsuhE4uh.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/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-Cllpaxdb.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-DsuhE4uh.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDeployment-
|
|
1
|
+
{"version":3,"file":"useDeployment-DsuhE4uh.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,SAAAK,EAAAR,EAAI,SAAJ,YAAAQ,EAAY,OAAQ,CAAA,GAAI,OAAQE,GAAM,CAACA,EAAE,UAAU,EAAE,IAAKA,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,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-Cllpaxdb.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 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,GAAA,EACNC,EAAMH,EAAM,YAAc,QAAU,KAAMA,EAAM,aAAe,yBAAyB,CAC1F,QAAA,CACER,EAAS,MAAQ,EACnB,CACF,CAIA,MAAMY,EAAOX,EAAyB,IAAI,EACpCY,EAAYZ,EAAI,EAAE,EA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,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
|