@samyx/preview-stacks-ui 0.4.0 → 0.8.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.
Files changed (65) hide show
  1. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-zTFy3C1L.js → ActionButton.vue_vue_type_script_setup_true_lang-B1iO-Hbs.js} +2 -2
  2. package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-zTFy3C1L.js.map → ActionButton.vue_vue_type_script_setup_true_lang-B1iO-Hbs.js.map} +1 -1
  3. package/dist/assets/{AxesTab-ulz5gFHt.js → AxesTab-Cxy76M1f.js} +2 -2
  4. package/dist/assets/{AxesTab-ulz5gFHt.js.map → AxesTab-Cxy76M1f.js.map} +1 -1
  5. package/dist/assets/{ConfigTab-BQBwybc7.js → ConfigTab-ezI-u-MN.js} +2 -2
  6. package/dist/assets/{ConfigTab-BQBwybc7.js.map → ConfigTab-ezI-u-MN.js.map} +1 -1
  7. package/dist/assets/{DangerTab-DJw6jFIi.js → DangerTab-Cnr_8-Ba.js} +2 -2
  8. package/dist/assets/{DangerTab-DJw6jFIi.js.map → DangerTab-Cnr_8-Ba.js.map} +1 -1
  9. package/dist/assets/{DashboardView-z0IrTMvv.js → DashboardView-Dgqzqr0u.js} +2 -2
  10. package/dist/assets/{DashboardView-z0IrTMvv.js.map → DashboardView-Dgqzqr0u.js.map} +1 -1
  11. package/dist/assets/DeploymentDetailView-CzNOnaAb.js +2 -0
  12. package/dist/assets/DeploymentDetailView-CzNOnaAb.js.map +1 -0
  13. package/dist/assets/{DeploymentsView-vzkuxfYA.js → DeploymentsView-CDNBJ7JQ.js} +2 -2
  14. package/dist/assets/{DeploymentsView-vzkuxfYA.js.map → DeploymentsView-CDNBJ7JQ.js.map} +1 -1
  15. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-pc4tgtPS.js → ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js} +2 -2
  16. package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-pc4tgtPS.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js.map} +1 -1
  17. package/dist/assets/{JobDetailView-CWmRMQCy.js → JobDetailView-DB6cP2ka.js} +2 -2
  18. package/dist/assets/{JobDetailView-CWmRMQCy.js.map → JobDetailView-DB6cP2ka.js.map} +1 -1
  19. package/dist/assets/{JobsView-B7w8_fns.js → JobsView-DeAdOUVq.js} +2 -2
  20. package/dist/assets/{JobsView-B7w8_fns.js.map → JobsView-DeAdOUVq.js.map} +1 -1
  21. package/dist/assets/LogsTab-BHYDWsWb.js +4 -0
  22. package/dist/assets/LogsTab-BHYDWsWb.js.map +1 -0
  23. package/dist/assets/{NotFoundView-CodRC_TG.js → NotFoundView-ROlvmBTU.js} +2 -2
  24. package/dist/assets/{NotFoundView-CodRC_TG.js.map → NotFoundView-ROlvmBTU.js.map} +1 -1
  25. package/dist/assets/OverviewTab-LKcYN5mk.js +2 -0
  26. package/dist/assets/OverviewTab-LKcYN5mk.js.map +1 -0
  27. package/dist/assets/RegistriesView-Bvnq_VSn.js +2 -0
  28. package/dist/assets/RegistriesView-Bvnq_VSn.js.map +1 -0
  29. package/dist/assets/{RequiresTab-BngG8IrC.js → RequiresTab-BeZeFQdv.js} +2 -2
  30. package/dist/assets/{RequiresTab-BngG8IrC.js.map → RequiresTab-BeZeFQdv.js.map} +1 -1
  31. package/dist/assets/RoutingView-BjBTNG-z.js +9 -0
  32. package/dist/assets/RoutingView-BjBTNG-z.js.map +1 -0
  33. package/dist/assets/RuntimeTab-CWjyUEnD.js +2 -0
  34. package/dist/assets/RuntimeTab-CWjyUEnD.js.map +1 -0
  35. package/dist/assets/{SettingsView-Xfi1eGZO.js → SettingsView-D_roVhhz.js} +2 -2
  36. package/dist/assets/{SettingsView-Xfi1eGZO.js.map → SettingsView-D_roVhhz.js.map} +1 -1
  37. package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js → SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js} +2 -2
  38. package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js.map} +1 -1
  39. package/dist/assets/{SpecDetailView-bw4Xzo2x.js → SpecDetailView-CDXuYT7k.js} +2 -2
  40. package/dist/assets/{SpecDetailView-bw4Xzo2x.js.map → SpecDetailView-CDXuYT7k.js.map} +1 -1
  41. package/dist/assets/{SpecsView-DZWFViN5.js → SpecsView-Bib418qu.js} +2 -2
  42. package/dist/assets/{SpecsView-DZWFViN5.js.map → SpecsView-Bib418qu.js.map} +1 -1
  43. package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-FqyOZ8sk.js → StateBadge.vue_vue_type_script_setup_true_lang-BBoSnS4z.js} +2 -2
  44. package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-FqyOZ8sk.js.map → StateBadge.vue_vue_type_script_setup_true_lang-BBoSnS4z.js.map} +1 -1
  45. package/dist/assets/SubmitView-DoVltkUx.js +45 -0
  46. package/dist/assets/SubmitView-DoVltkUx.js.map +1 -0
  47. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BNRC1yg9.js → VarEditor.vue_vue_type_script_setup_true_lang-CjFu7uoM.js} +2 -2
  48. package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BNRC1yg9.js.map → VarEditor.vue_vue_type_script_setup_true_lang-CjFu7uoM.js.map} +1 -1
  49. package/dist/assets/{index-CrxqzmXu.js → index-B4C7uKN0.js} +27 -22
  50. package/dist/assets/index-B4C7uKN0.js.map +1 -0
  51. package/dist/assets/{useDeployment-BB9Fq2IS.js → useDeployment-DKKVYXcr.js} +2 -2
  52. package/dist/assets/{useDeployment-BB9Fq2IS.js.map → useDeployment-DKKVYXcr.js.map} +1 -1
  53. package/dist/index.html +1 -1
  54. package/package.json +1 -1
  55. package/dist/assets/DeploymentDetailView-B6dRosS8.js +0 -2
  56. package/dist/assets/DeploymentDetailView-B6dRosS8.js.map +0 -1
  57. package/dist/assets/LogsTab-BR9QaUgo.js +0 -4
  58. package/dist/assets/LogsTab-BR9QaUgo.js.map +0 -1
  59. package/dist/assets/OverviewTab-Bcc1S9BV.js +0 -2
  60. package/dist/assets/OverviewTab-Bcc1S9BV.js.map +0 -1
  61. package/dist/assets/RoutingView-CTPhqDby.js +0 -9
  62. package/dist/assets/RoutingView-CTPhqDby.js.map +0 -1
  63. package/dist/assets/SubmitView-Cod9su4V.js +0 -45
  64. package/dist/assets/SubmitView-Cod9su4V.js.map +0 -1
  65. package/dist/assets/index-CrxqzmXu.js.map +0 -1
@@ -0,0 +1,9 @@
1
+ import{d as oe,c as o,a as t,e as n,f as m,w as f,_ as E,g as v,h as g,t as u,F as w,r as j,b as x,K as $,x as z,y as B,j as r,m as G,k as _,p as A,n as le,H as K,o as s,q as ne}from"./index-B4C7uKN0.js";import{s as ae}from"./useFormat-CKJxQp_i.js";import{_ as J}from"./ActionButton.vue_vue_type_script_setup_true_lang-B1iO-Hbs.js";import{_ as O}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js";import{_ as Q}from"./SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js";const ie={class:"page-head"},re={class:"sub"},ue={key:1,class:"banner info"},de={class:"panel"},ve={class:"phead"},pe={class:"mute",style:{"font-size":"var(--t-sm)"}},fe={key:0,class:"banner warn"},me={key:1,class:"cards"},ce={class:"stagger"},he={"data-label":"url"},ye=["href"],ke={key:1,class:"mono mute"},be={key:0,class:"mute"},ge={"data-label":"forwards to"},we={key:0,class:"mono"},_e={key:1,class:"s-failed"},Te={"data-label":"deployment"},Ce={key:1,class:"mute"},Re={class:"dim","data-label":"router"},xe={key:2,class:"mute"},$e={class:"panel"},Ae={class:"phead"},Ne={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},Le={class:"banner warn"},Se={key:0,class:"banner failed"},Ie={key:1,class:"banner info"},Pe={key:3,class:"kvlist"},Ue={class:"k"},Ve=["onClick"],De={class:"v mute",style:{"font-size":"var(--t-sm)"}},Ee={key:4,class:"mute"},je={key:2,class:"panel"},ze={class:"phead"},Be={class:"section"},Fe={key:0,class:"badge warn"},Me={key:0,class:"field",style:{"max-width":"340px"}},We={key:2,class:"banner plain"},He={class:"field"},qe={class:"row",style:{"margin-top":"var(--s4)"}},Ge={key:0,class:"mute"},Ke={class:"field",style:{"max-width":"340px"}},Je=["for"],Oe=["id","placeholder"],Qe={class:"row"},Xe=`http:
2
+ middlewares:
3
+ # An example — replace it. Middlewares go UNDER http; at the top level Traefik ignores them.
4
+ ip-allow:
5
+ ipAllowList:
6
+ sourceRange:
7
+ - 203.0.113.0/24
8
+ `,lt=oe({__name:"RoutingView",setup(Ye){const N=r([]),L=r(null),S=r([]),I=r(""),P=r(null),F=r(!1),T=r(""),i=r(null),d=r(""),c=r(""),C=r(!1),U=r(!1),k=r(!1),p=r(""),R=r(""),h=r(null),y=r(""),M=G(()=>i.value!==null&&d.value!==c.value),X=G(()=>!!$.token&&!k.value&&d.value.trim().length>0&&(M.value||i.value===""));async function V(){const l=await _.get("/api/routing");if(F.value=!0,!l.ok){T.value=A(l,"load the routing files");return}T.value="",S.value=l.body.files??[],I.value=l.body.dir??"",P.value=l.body.writable??!1}async function Y(){const l=await _.get("/api/routing/live");if(!l.ok){L.value=!1;return}L.value=l.body.reachable,N.value=l.body.routes??[]}V(),Y();async function Z(l){i.value=l,U.value=!0,p.value="",C.value=!1,y.value="";const e=await _.getAuthed(`/api/routing/${encodeURIComponent(l)}`);if(U.value=!1,!e.ok){p.value=A(e,"open this file");return}if(e.body.sourceWithheld){C.value=!0,d.value="",c.value="";return}d.value=e.body.content??"",c.value=d.value}function ee(){i.value="",R.value="",d.value=Xe,c.value="",C.value=!1,p.value=""}function W(){i.value=null,d.value="",c.value="",p.value=""}async function H(){const l=i.value===""?R.value.trim():i.value;if(!l){p.value="Give the file a name, ending in .yml";return}k.value=!0,p.value="";const e=await _.put(`/api/routing/${encodeURIComponent(l)}`,{content:d.value});if(k.value=!1,!e.ok){p.value=A(e,"save this file");return}e.body.previous&&(h.value={name:l,content:e.body.previous}),c.value=d.value,i.value=l,K("ok",`Saved ${l}. Traefik reloads within a second or two.`),V()}async function te(){const l=h.value;l&&(d.value=l.content,i.value=l.name,await H(),h.value=null)}async function se(){const l=i.value;if(!l||y.value!==l)return;const e=await _.del(`/api/routing/${encodeURIComponent(l)}`);if(!e.ok){p.value=A(e,"delete this file");return}e.body.previous&&(h.value={name:l,content:e.body.previous}),K("ok",`Deleted ${l}.`),W(),V()}return(l,e)=>{const D=le("RouterLink");return s(),o("div",null,[t("div",ie,[t("div",null,[e[5]||(e[5]=t("h1",null,"Routing",-1)),t("div",re,[e[4]||(e[4]=n(" Every route on this host, and the config files behind them ",-1)),m(E,{label:"what belongs in these files"},{default:f(()=>[...e[3]||(e[3]=[n(" Middleware (basic auth, rate limits, IP allow-lists), TLS options, the catch-all fallback router, and routes to anything running outside compose. Per-PR routers are not here — those are labels in each deployment's own compose file. ",-1)])]),_:1})])]),e[6]||(e[6]=t("span",{class:"grow"},null,-1)),P.value?(s(),o("button",{key:0,class:"btn primary",onClick:ee},"New file")):v("",!0)]),T.value?(s(),g(O,{key:0,text:T.value,title:"Could not load the routing files."},null,8,["text"])):v("",!0),h.value?(s(),o("div",ue,[t("b",null,"Replaced "+u(h.value.name)+".",1),t("p",null,[e[7]||(e[7]=n(" The previous contents are still here for this session. ",-1)),t("button",{class:"btn sm",onClick:te},"Put it back")])])):v("",!0),t("section",de,[t("div",ve,[e[10]||(e[10]=t("h2",{class:"section"},"Live routes",-1)),e[11]||(e[11]=t("span",{class:"grow"},null,-1)),t("span",pe,[e[9]||(e[9]=n(" from container labels ",-1)),m(E,{label:"why routes are not in the files below",align:"end"},{default:f(()=>[...e[8]||(e[8]=[n(" Traefik reads two providers. Per-PR routers are ",-1),t("b",null,"labels on containers",-1),n(", written by each deployment's own compose file — so deploying a stack changes this list and never the files. The files are the other provider: middleware, TLS options, the fallback router. ",-1)])]),_:1})])]),L.value===!1?(s(),o("div",fe,[...e[12]||(e[12]=[t("b",null,"Docker did not answer.",-1),t("p",null,"Routes could not be listed — which is not the same as there being none.",-1)])])):N.value.length?(s(),o("table",me,[e[13]||(e[13]=t("thead",null,[t("tr",null,[t("th",null,"url"),t("th",null,"forwards to"),t("th",null,"deployment"),t("th",null,"router")])],-1)),t("tbody",ce,[(s(!0),o(w,null,j(N.value,(a,q)=>(s(),o("tr",{key:`${a.container}-${a.router}`,style:ne({"--i":q})},[t("td",he,[(s(!0),o(w,null,j(a.hosts,b=>(s(),o("div",{key:b},[b.startsWith("(pattern)")?(s(),o("span",ke,u(b),1)):(s(),o("a",{key:0,href:`https://${b}`,target:"_blank",rel:"noreferrer"},u(b),9,ye))]))),128)),a.hosts.length?v("",!0):(s(),o("span",be,"no host in the rule"))]),t("td",ge,[a.target?(s(),o("span",we,u(a.target),1)):(s(),o("span",_e,u(a.port===null?"no port declared":"not on the ingress network"),1))]),t("td",Te,[a.project?(s(),g(D,{key:0,to:`/deployments/${encodeURIComponent(a.project)}/runtime`},{default:f(()=>[n(u(a.project),1)]),_:2},1032,["to"])):(s(),o("span",Ce,"—"))]),t("td",Re,u(a.router),1)],4))),128))])])):(s(),o("p",xe,[...e[14]||(e[14]=[n(" No container on this host declares a Traefik router. A deployment's routes come from labels in its own compose file — open a deployment's ",-1),t("b",null,"Containers & routes",-1),n(" tab to see what is missing. ",-1)])]))]),t("section",$e,[t("div",Ae,[e[15]||(e[15]=t("h2",{class:"section"},"Config files",-1)),e[16]||(e[16]=t("span",{class:"grow"},null,-1)),I.value?(s(),o("span",Ne,[t("code",null,u(I.value),1)])):v("",!0)]),t("div",Le,[e[21]||(e[21]=t("b",null,"A bad file here affects every preview on this host.",-1)),t("p",null,[e[18]||(e[18]=n(" Traefik reads this directory as a whole: one unparseable file and it logs a parse error for the ",-1)),e[19]||(e[19]=t("em",null,"directory",-1)),e[20]||(e[20]=n(", so the symptom is other routes disappearing. Saves are checked before they are written and land atomically, so a rejected file never reaches Traefik. ",-1)),m(E,{label:"what this page cannot break"},{default:f(()=>[...e[17]||(e[17]=[n(" This page and the API are routed by container labels, not by these files — so no save here can lock you out of the page you would use to undo it. ",-1)])]),_:1})])]),P.value===!1?(s(),o("div",Se,[...e[22]||(e[22]=[t("b",null,"Read-only: the API cannot write to this directory.",-1),t("p",null,[n(" The control stack mounts it into the API from 0.4.0 onward. Re-run "),t("code",null,"pstack init"),n(" on the host to pick up the mount — it is idempotent, and it recreates the control containers. ")],-1)])])):x($).token?v("",!0):(s(),o("div",Ie,[e[26]||(e[26]=t("b",null,"Viewing needs a token too.",-1)),t("p",null,[e[24]||(e[24]=n(" These files hold basic-auth hashes and forward-auth URLs, so their contents are not served unauthenticated. ",-1)),m(D,{to:"/settings"},{default:f(()=>[...e[23]||(e[23]=[n("Add your token",-1)])]),_:1}),e[25]||(e[25]=n(". ",-1))])])),F.value?S.value.length?(s(),o("ul",Pe,[(s(!0),o(w,null,j(S.value,a=>(s(),o("li",{key:a.name},[t("span",Ue,[t("button",{class:"ghost sm",onClick:q=>Z(a.name)},u(a.name),9,Ve)]),t("span",De,u(a.size)+" bytes · "+u(x(ae)(a.updatedAt)),1)]))),128))])):(s(),o("p",Ee," No files yet. Everything is routed by container labels, which is a perfectly good place to be. ")):(s(),g(Q,{key:2,rows:3}))]),i.value!==null?(s(),o("section",je,[t("div",ze,[t("h2",Be,u(i.value===""?"New file":i.value),1),M.value?(s(),o("span",Fe,"unsaved")):v("",!0),e[27]||(e[27]=t("span",{class:"grow"},null,-1)),t("button",{class:"ghost sm",onClick:W},"Close")]),i.value===""?(s(),o("div",Me,[e[28]||(e[28]=t("label",{for:"fname"},"File name",-1)),z(t("input",{id:"fname","onUpdate:modelValue":e[0]||(e[0]=a=>R.value=a),type:"text",placeholder:"middleware.yml",spellcheck:"false",autocomplete:"off"},null,512),[[B,R.value,void 0,{trim:!0}]]),e[29]||(e[29]=t("div",{class:"mute hint"},[n("Lower case, ending in "),t("code",null,".yml"),n(".")],-1))])):v("",!0),U.value?(s(),g(Q,{key:1,rows:4})):C.value?(s(),o("div",We,[e[32]||(e[32]=t("b",null,"Hidden without an access token.",-1)),t("p",null,[m(D,{to:"/settings"},{default:f(()=>[...e[30]||(e[30]=[n("Add your token",-1)])]),_:1}),e[31]||(e[31]=n(" to read and edit this file. ",-1))])])):(s(),o(w,{key:3},[t("div",He,[e[33]||(e[33]=t("label",{for:"content"},"Contents",-1)),z(t("textarea",{id:"content","onUpdate:modelValue":e[1]||(e[1]=a=>d.value=a),rows:"18",spellcheck:"false"},null,512),[[B,d.value]])]),p.value?(s(),g(O,{key:0,text:p.value,title:"Traefik would not accept this."},null,8,["text"])):v("",!0),t("div",qe,[m(J,{variant:"primary",pending:k.value,disabled:!X.value,onClick:H},{default:f(()=>[n(u(k.value?"Saving…":"Save"),1)]),_:1},8,["pending","disabled"]),x($).token?v("",!0):(s(),o("span",Ge,"Saving needs a token."))]),i.value?(s(),o(w,{key:1},[e[37]||(e[37]=t("h2",{class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},"Delete this file",-1)),e[38]||(e[38]=t("p",{class:"dim"}," Whatever it configures stops applying as soon as Traefik reloads. If it holds a router, those hostnames stop resolving to anything. ",-1)),t("div",Ke,[t("label",{for:`confirm-${i.value}`},[e[34]||(e[34]=n(" Type ",-1)),t("b",null,u(i.value),1),e[35]||(e[35]=n(" to confirm ",-1))],8,Je),z(t("input",{id:`confirm-${i.value}`,"onUpdate:modelValue":e[2]||(e[2]=a=>y.value=a),type:"text",placeholder:i.value,spellcheck:"false",autocomplete:"off"},null,8,Oe),[[B,y.value,void 0,{trim:!0}]])]),t("div",Qe,[m(J,{variant:"danger",disabled:y.value!==i.value||!x($).token,title:y.value!==i.value?"Type the file name to confirm.":void 0,onClick:se},{default:f(()=>[...e[36]||(e[36]=[n(" Delete ",-1)])]),_:1},8,["disabled","title"])])],64)):v("",!0)],64))])):v("",!0)])}}});export{lt as default};
9
+ //# sourceMappingURL=RoutingView-BjBTNG-z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RoutingView-BjBTNG-z.js","sources":["../../src/views/RoutingView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Traefik's dynamic configuration — the file list, and an editor.\n *\n * WHAT LIVES HERE. Traefik reads config from two providers: labels on containers (every per-PR router)\n * and a watched *directory* of files. This page is the directory: middleware (basic auth, rate limits,\n * IP allow-lists), TLS options, the catch-all fallback router, routes to something running outside\n * compose. Several files rather than one is the point of a watched directory — one file per concern.\n *\n * THE WARNING IS NOT DECORATION. Traefik's documented behaviour is that an unparseable file produces\n * a parse error for the whole DIRECTORY, and the rest can be discarded with it — so a careless save\n * here breaks *other people's* routes, not the file being edited. The server validates before writing\n * and renames into place so the watcher never sees a partial file, and every rejection is rendered\n * verbatim because it names the actual problem.\n *\n * What it cannot break: `control.<domain>` and `api.<domain>` are docker labels on the pstack\n * container, not file config. This page cannot lock you out of the page you would use to undo a bad\n * save. That is stated in the UI, because an operator hesitating over a save deserves to know it.\n *\n * `previous` from a save is an in-session undo. There is deliberately no history on disk: the obvious\n * place to keep it is the one directory that must contain nothing but dynamic config.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type {\n LiveRoutesResponse,\n RoutingFile,\n RoutingListResponse,\n RoutingReadResponse,\n RoutingWriteResponse,\n RuntimeRoute,\n} from '../api/types';\nimport { settings } from '../composables/useSettings';\nimport { stamp } 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 SkeletonList from '../components/SkeletonList.vue';\n\n/**\n * The live routes, from container labels.\n *\n * This page used to show only the file provider, and the reported confusion was exactly right: a\n * deployment goes up, its hostname appears, and nothing here changes — because per-PR routers are\n * DOCKER labels and the files below are Traefik's *other* provider. Showing both is what makes the\n * page match what \"routing\" means to whoever opened it.\n */\nconst live = ref<RuntimeRoute[]>([]);\nconst liveReachable = ref<boolean | null>(null);\n\nconst files = ref<RoutingFile[]>([]);\nconst dir = ref('');\nconst writable = ref<boolean | null>(null);\nconst loaded = ref(false);\nconst listError = ref('');\n\n/** The open file. `null` name means a new one. */\nconst openName = ref<string | null>(null);\nconst draft = ref('');\nconst original = ref('');\nconst withheld = ref(false);\nconst loadingFile = ref(false);\nconst saving = ref(false);\nconst fileError = ref('');\nconst newName = ref('');\n/** Last replaced content, offered as an undo for the rest of the session. */\nconst undo = ref<{ name: string; content: string } | null>(null);\nconst confirmDelete = ref('');\n\nconst dirty = computed(() => openName.value !== null && draft.value !== original.value);\nconst canSave = computed(\n () => !!settings.token && !saving.value && draft.value.trim().length > 0 && (dirty.value || openName.value === ''),\n);\n\nconst STARTER = `http:\n middlewares:\n # An example — replace it. Middlewares go UNDER http; at the top level Traefik ignores them.\n ip-allow:\n ipAllowList:\n sourceRange:\n - 203.0.113.0/24\n`;\n\nasync function loadList(): Promise<void> {\n const r = await api.get<RoutingListResponse>('/api/routing');\n loaded.value = true;\n if (!r.ok) {\n listError.value = problem(r, 'load the routing files');\n return;\n }\n listError.value = '';\n files.value = r.body.files ?? [];\n dir.value = r.body.dir ?? '';\n writable.value = r.body.writable ?? false;\n}\n\nasync function loadLive(): Promise<void> {\n const r = await api.get<LiveRoutesResponse>('/api/routing/live');\n if (!r.ok) {\n liveReachable.value = false;\n return;\n }\n liveReachable.value = r.body.reachable;\n live.value = r.body.routes ?? [];\n}\n\nvoid loadList();\nvoid loadLive();\n\nasync function open(name: string): Promise<void> {\n openName.value = name;\n loadingFile.value = true;\n fileError.value = '';\n withheld.value = false;\n confirmDelete.value = '';\n // Authenticated: dynamic config holds basic-auth hashes and forward-auth URLs.\n const r = await api.getAuthed<RoutingReadResponse>(`/api/routing/${encodeURIComponent(name)}`);\n loadingFile.value = false;\n if (!r.ok) {\n fileError.value = problem(r, 'open this file');\n return;\n }\n if (r.body.sourceWithheld) {\n withheld.value = true;\n draft.value = '';\n original.value = '';\n return;\n }\n draft.value = r.body.content ?? '';\n original.value = draft.value;\n}\n\nfunction startNew(): void {\n openName.value = '';\n newName.value = '';\n draft.value = STARTER;\n original.value = '';\n withheld.value = false;\n fileError.value = '';\n}\n\nfunction close(): void {\n openName.value = null;\n draft.value = '';\n original.value = '';\n fileError.value = '';\n}\n\nasync function save(): Promise<void> {\n const name = openName.value === '' ? newName.value.trim() : openName.value;\n if (!name) {\n fileError.value = 'Give the file a name, ending in .yml';\n return;\n }\n saving.value = true;\n fileError.value = '';\n const r = await api.put<RoutingWriteResponse>(`/api/routing/${encodeURIComponent(name)}`, {\n content: draft.value,\n });\n saving.value = false;\n if (!r.ok) {\n // Rendered verbatim: the server's message names the unknown section or the YAML error, which is\n // the whole diagnosis.\n fileError.value = problem(r, 'save this file');\n return;\n }\n if (r.body.previous) undo.value = { name, content: r.body.previous };\n original.value = draft.value;\n openName.value = name;\n toast('ok', `Saved ${name}. Traefik reloads within a second or two.`);\n void loadList();\n}\n\nasync function revert(): Promise<void> {\n const u = undo.value;\n if (!u) return;\n draft.value = u.content;\n openName.value = u.name;\n await save();\n undo.value = null;\n}\n\nasync function remove(): Promise<void> {\n const name = openName.value;\n if (!name || confirmDelete.value !== name) return;\n const r = await api.del<RoutingWriteResponse>(`/api/routing/${encodeURIComponent(name)}`);\n if (!r.ok) {\n fileError.value = problem(r, 'delete this file');\n return;\n }\n if (r.body.previous) undo.value = { name, content: r.body.previous };\n toast('ok', `Deleted ${name}.`);\n close();\n void loadList();\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Routing</h1>\n <div class=\"sub\">\n Every route on this host, and the config files behind them\n <InfoHint label=\"what belongs in these files\">\n Middleware (basic auth, rate limits, IP allow-lists), TLS options, the catch-all fallback\n router, and routes to anything running outside compose. Per-PR routers are not here —\n those are labels in each deployment's own compose file.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <button v-if=\"writable\" class=\"btn primary\" @click=\"startNew\">New file</button>\n </div>\n\n <ErrorNote v-if=\"listError\" :text=\"listError\" title=\"Could not load the routing files.\" />\n\n <div v-if=\"undo\" class=\"banner info\">\n <b>Replaced {{ undo.name }}.</b>\n <p>\n The previous contents are still here for this session.\n <button class=\"btn sm\" @click=\"revert\">Put it back</button>\n </p>\n </div>\n\n <!-- ============================ live routes ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Live routes</h2>\n <span class=\"grow\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">\n from container labels\n <InfoHint label=\"why routes are not in the files below\" align=\"end\">\n Traefik reads two providers. Per-PR routers are <b>labels on containers</b>, written by each\n deployment's own compose file — so deploying a stack changes this list and never the files.\n The files are the other provider: middleware, TLS options, the fallback router.\n </InfoHint>\n </span>\n </div>\n\n <div v-if=\"liveReachable === false\" class=\"banner warn\">\n <b>Docker did not answer.</b>\n <p>Routes could not be listed — which is not the same as there being none.</p>\n </div>\n\n <table v-else-if=\"live.length\" class=\"cards\">\n <thead>\n <tr>\n <th>url</th>\n <th>forwards to</th>\n <th>deployment</th>\n <th>router</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(r, i) in live\" :key=\"`${r.container}-${r.router}`\" :style=\"{ '--i': i }\">\n <td 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 <span v-if=\"r.target\" class=\"mono\">{{ r.target }}</span>\n <span v-else class=\"s-failed\">\n {{ r.port === null ? 'no port declared' : 'not on the ingress network' }}\n </span>\n </td>\n <td data-label=\"deployment\">\n <RouterLink v-if=\"r.project\" :to=\"`/deployments/${encodeURIComponent(r.project)}/runtime`\">\n {{ r.project }}\n </RouterLink>\n <span v-else class=\"mute\">—</span>\n </td>\n <td class=\"dim\" data-label=\"router\">{{ r.router }}</td>\n </tr>\n </tbody>\n </table>\n\n <p v-else class=\"mute\">\n No container on this host declares a Traefik router. A deployment's routes come from labels in\n its own compose file — open a deployment's <b>Containers &amp; routes</b> tab to see what is\n missing.\n </p>\n </section>\n\n <!-- ============================ config files ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Config files</h2>\n <span class=\"grow\" />\n <span v-if=\"dir\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n <code>{{ dir }}</code>\n </span>\n </div>\n\n <!--\n The blast radius, stated once and up front — and the reassurance alongside it, because \"this can\n break everything\" without \"you will still be able to fix it\" just makes people avoid the page.\n -->\n <div class=\"banner warn\">\n <b>A bad file here affects every preview on this host.</b>\n <p>\n Traefik reads this directory as a whole: one unparseable file and it logs a parse error for the\n <em>directory</em>, so the symptom is other routes disappearing. Saves are checked before they\n are written and land atomically, so a rejected file never reaches Traefik.\n <InfoHint label=\"what this page cannot break\">\n This page and the API are routed by container labels, not by these files — so no save here\n can lock you out of the page you would use to undo it.\n </InfoHint>\n </p>\n </div>\n\n <div v-if=\"writable === false\" class=\"banner failed\">\n <b>Read-only: the API cannot write to this directory.</b>\n <p>\n The control stack mounts it into the API from 0.4.0 onward. Re-run\n <code>pstack init</code> on the host to pick up the mount — it is idempotent, and it recreates\n the control containers.\n </p>\n </div>\n\n <div v-else-if=\"!settings.token\" class=\"banner info\">\n <b>Viewing needs a token too.</b>\n <p>\n These files hold basic-auth hashes and forward-auth URLs, so their contents are not served\n unauthenticated. <RouterLink to=\"/settings\">Add your token</RouterLink>.\n </p>\n </div>\n\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n <ul v-else-if=\"files.length\" class=\"kvlist\">\n <li v-for=\"f in files\" :key=\"f.name\">\n <span class=\"k\">\n <button class=\"ghost sm\" @click=\"open(f.name)\">{{ f.name }}</button>\n </span>\n <span class=\"v mute\" style=\"font-size: var(--t-sm)\">\n {{ f.size }} bytes · {{ stamp(f.updatedAt) }}\n </span>\n </li>\n </ul>\n <p v-else class=\"mute\">\n No files yet. Everything is routed by container labels, which is a perfectly good place to be.\n </p>\n </section>\n\n <section v-if=\"openName !== null\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">{{ openName === '' ? 'New file' : openName }}</h2>\n <span v-if=\"dirty\" class=\"badge warn\">unsaved</span>\n <span class=\"grow\" />\n <button class=\"ghost sm\" @click=\"close\">Close</button>\n </div>\n\n <div v-if=\"openName === ''\" class=\"field\" style=\"max-width: 340px\">\n <label for=\"fname\">File name</label>\n <input\n id=\"fname\"\n v-model.trim=\"newName\"\n type=\"text\"\n placeholder=\"middleware.yml\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n <div class=\"mute hint\">Lower case, ending in <code>.yml</code>.</div>\n </div>\n\n <SkeletonList v-if=\"loadingFile\" :rows=\"4\" />\n\n <div v-else-if=\"withheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n <RouterLink to=\"/settings\">Add your token</RouterLink> to read and edit this file.\n </p>\n </div>\n\n <template v-else>\n <div class=\"field\">\n <label for=\"content\">Contents</label>\n <textarea id=\"content\" v-model=\"draft\" rows=\"18\" spellcheck=\"false\" />\n </div>\n\n <ErrorNote v-if=\"fileError\" :text=\"fileError\" title=\"Traefik would not accept this.\" />\n\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton variant=\"primary\" :pending=\"saving\" :disabled=\"!canSave\" @click=\"save\">\n {{ saving ? 'Saving…' : 'Save' }}\n </ActionButton>\n <span v-if=\"!settings.token\" class=\"mute\">Saving needs a token.</span>\n </div>\n\n <template v-if=\"openName\">\n <h2 class=\"section\" style=\"margin: var(--s5) 0 var(--s3)\">Delete this file</h2>\n <p class=\"dim\">\n Whatever it configures stops applying as soon as Traefik reloads. If it holds a router,\n those hostnames stop resolving to anything.\n </p>\n <div class=\"field\" style=\"max-width: 340px\">\n <label :for=\"`confirm-${openName}`\">\n Type <b>{{ openName }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${openName}`\"\n v-model.trim=\"confirmDelete\"\n type=\"text\"\n :placeholder=\"openName\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <div class=\"row\">\n <ActionButton\n variant=\"danger\"\n :disabled=\"confirmDelete !== openName || !settings.token\"\n :title=\"confirmDelete !== openName ? 'Type the file name to confirm.' : undefined\"\n @click=\"remove\"\n >\n Delete\n </ActionButton>\n </div>\n </template>\n </template>\n </section>\n </div>\n</template>\n"],"names":["STARTER","live","ref","liveReachable","files","dir","writable","loaded","listError","openName","draft","original","withheld","loadingFile","saving","fileError","newName","undo","confirmDelete","dirty","computed","canSave","settings","loadList","r","api","problem","loadLive","open","name","startNew","close","save","toast","revert","u","remove","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","_createBlock","ErrorNote","_openBlock","_hoisted_3","_toDisplayString","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_Fragment","_renderList","i","_hoisted_10","h","_hoisted_12","_hoisted_11","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_component_RouterLink","_createTextVNode","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_unref","_hoisted_26","_hoisted_27","f","_hoisted_28","$event","_hoisted_29","_hoisted_30","stamp","_hoisted_31","SkeletonList","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","ActionButton","_hoisted_40","_hoisted_41","_hoisted_44"],"mappings":"yrDA2EMA,GAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wCA3BhB,MAAMC,EAAOC,EAAoB,EAAE,EAC7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AAA,GAC1EE,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGI,IAAA,CAHD,MAAM,KAAA,EAAM,wIAGf,EAAA,GACAA,EAYM,MAZN4D,GAYM,CAXJ5D,EAEQ,QAAA,CAFA,eAAgB7B,EAAA,KAAQ,EAAA,mBAAI,SAC7B,EAAA,GAAA6B,EAAqB,WAAf7B,EAAA,KAAQ,EAAA,CAAA,kBAAO,eAC5B,EAAA,EAAA,UACA6B,EAOE,QAAA,CANC,cAAe7B,EAAA,KAAQ,wCACVS,EAAa,MAAAgE,GAC3B,KAAK,OACJ,YAAazE,EAAA,MACd,WAAW,QACX,aAAa,KAAA,iBAJCS,EAAA,aAAN,CAAA,KAAR,EAAA,CAA4B,MAOhCoB,EASM,MATN6D,GASM,CARJzD,EAOesD,EAAA,CANb,QAAQ,SACP,SAAU9E,EAAA,QAAkBT,SAAQ,CAAKoE,EAAAvD,CAAA,EAAS,MAClD,MAAOJ,EAAA,QAAkBT,EAAA,uCAA8C,OACvE,QAAO2B,EAAA,aACT,IAED,CAAA,GAAAI,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ import{d as z,B as I,u as L,c as n,h as w,g as p,F as d,a as e,r as m,e as a,t as r,f as k,w as g,_ as T,j as y,m as c,n as A,o as s,q as $,v as _,k as B,p as D}from"./index-B4C7uKN0.js";import{v as V,d as R}from"./useDeployment-DKKVYXcr.js";import{_ as E}from"./SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js";import{_ as K}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js";import"./useVars-VN9gYdR6.js";const U={key:0,class:"banner warn"},W={key:0,class:"banner ok"},F={class:"panel"},H={class:"phead"},j={class:"mute",style:{"font-size":"var(--t-sm)"}},q={key:0,class:"cards"},M={class:"stagger"},O={"data-label":"url"},Q=["href"],G={key:1,class:"mono mute"},J={key:0,class:"mute"},X={"data-label":"forwards to"},Y={key:0,class:"mono"},Z={key:1,class:"s-failed"},ee={class:"mute",style:{"font-size":"var(--t-sm)"}},te={"data-label":"router"},se={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},ne={"data-label":"tls"},oe={key:0,class:"badge ok"},re={key:1,class:"badge off"},le={key:1,class:"banner warn"},ae={class:"panel"},ie={class:"phead"},ue={class:"mute",style:{"font-size":"var(--t-sm)"}},de={key:0,class:"cards"},he={class:"stagger"},pe={class:"name","data-label":"service"},me={class:"mute",style:{"font-size":"var(--t-sm)"}},ve={"data-label":"state"},ce={"data-label":"ports"},fe={class:"mono"},ke={key:0,class:"mute"},ge={key:0,class:"mute"},ye={"data-label":"networks"},_e={key:0,class:"mute mono",style:{"font-size":"var(--t-sm)"}},be={class:"dim","data-label":"image"},we={key:1,class:"mute"},Ne=z({__name:"RuntimeTab",setup(Te){const l=y(null),v=y(""),f=y(!0);async function b(){const i=await B.get(`/api/deployments/${encodeURIComponent(R.id)}/runtime${V.value}`);if(f.value=!1,!i.ok){v.value=D(i,"inspect what is running");return}v.value="",l.value=i.body}I(()=>R.id,()=>{f.value=!0,b()},{immediate:!0}),L(()=>void b(),8e3);const C=c(()=>{var i;return((i=l.value)==null?void 0:i.findings.filter(t=>t.level==="error"))??[]}),P=c(()=>{var i;return((i=l.value)==null?void 0:i.findings.filter(t=>t.level==="warn"))??[]}),S=c(()=>{var i;return((i=l.value)==null?void 0:i.findings.filter(t=>t.level==="info"))??[]}),N=c(()=>{var i;return((i=l.value)==null?void 0:i.containers.filter(t=>t.state==="running").length)??0});return(i,t)=>{const x=A("RouterLink");return s(),n("div",null,[v.value?(s(),w(K,{key:0,text:v.value,title:"Could not inspect this deployment."},null,8,["text"])):p("",!0),f.value&&!l.value?(s(),w(E,{key:1,rows:5})):l.value?(s(),n(d,{key:2},[l.value.reachable?(s(),n(d,{key:1},[(s(!0),n(d,null,m(C.value,(o,h)=>(s(),n("div",{key:`e${h}`,class:"banner failed"},[t[1]||(t[1]=e("b",null,"Blocking",-1)),e("p",null,r(o.message),1)]))),128)),(s(!0),n(d,null,m(P.value,(o,h)=>(s(),n("div",{key:`w${h}`,class:"banner warn"},[t[2]||(t[2]=e("b",null,"Worth checking",-1)),e("p",null,r(o.message),1)]))),128)),(s(!0),n(d,null,m(S.value,(o,h)=>(s(),n("div",{key:`i${h}`,class:"banner plain"},[e("p",null,r(o.message),1)]))),128)),!l.value.findings.length&&l.value.containers.length?(s(),n("div",W,[...t[3]||(t[3]=[e("b",null,"Nothing looks wrong.",-1),e("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)])])):p("",!0),e("section",F,[e("div",H,[t[5]||(t[5]=e("h2",{class:"section"},"Routing",-1)),t[6]||(t[6]=e("span",{class:"grow"},null,-1)),e("span",j,[a(" TLS: "+r(l.value.challenge==="unknown"?"unknown":l.value.challenge)+" ",1),k(T,{label:"why the TLS mode matters here",align:"end"},{default:g(()=>[...t[4]||(t[4]=[a(" Under HTTP-01 every per-PR router needs ",-1),e("code",null,"tls.certresolver=le",-1),a(", 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})])]),l.value.routes.length?(s(),n("table",q,[e("thead",null,[e("tr",null,[t[9]||(t[9]=e("th",null,"url",-1)),e("th",null,[t[8]||(t[8]=a(" forwards to ",-1)),k(T,{label:"how a URL reaches a port"},{default:g(()=>[...t[7]||(t[7]=[a(" Traefik's docker provider resolves the container's IP on ",-1),e("code",null,"preview-ingress",-1),a(" and dials it on the port from ",-1),e("code",null,"loadbalancer.server.port",-1),a(" — it does ",-1),e("em",null,"not",-1),a(" use ",-1),e("code",null,"service:port",-1),a(" DNS. So the port here is the one inside the container, and publishing a host port is unnecessary. ",-1)])]),_:1})]),t[10]||(t[10]=e("th",null,"router",-1)),t[11]||(t[11]=e("th",null,"tls",-1))])]),e("tbody",M,[(s(!0),n(d,null,m(l.value.routes,(o,h)=>(s(),n("tr",{key:o.router,style:$({"--i":h})},[e("td",O,[(s(!0),n(d,null,m(o.hosts,u=>(s(),n("div",{key:u},[u.startsWith("(pattern)")?(s(),n("span",G,r(u),1)):(s(),n("a",{key:0,href:`https://${u}`,target:"_blank",rel:"noreferrer"},r(u),9,Q))]))),128)),o.hosts.length?p("",!0):(s(),n("span",J,"no host in the rule"))]),e("td",X,[o.target?(s(),n("span",Y,r(o.target),1)):(s(),n("span",Z,r(o.port===null?"no port declared":"not on the ingress network"),1)),e("div",ee,r(o.container),1)]),e("td",te,[a(r(o.router)+" ",1),o.priority?(s(),n("div",se," priority "+r(o.priority),1)):p("",!0)]),e("td",ne,[o.tls?(s(),n("span",oe,r(o.certresolver||"inherited"),1)):(s(),n("span",re,"off"))])],4))),128))])])):(s(),n("div",le,[t[17]||(t[17]=e("b",null,"No routes. Traefik has not been told about this deployment.",-1)),e("p",null,[t[13]||(t[13]=a(" Routes come from labels in ",-1)),t[14]||(t[14]=e("em",null,"your",-1)),t[15]||(t[15]=a(" compose file, not from pstack and not from the ",-1)),k(x,{to:"/routing"},{default:g(()=>[...t[12]||(t[12]=[a("Routing",-1)])]),_:1}),t[16]||(t[16]=a(" page (that is Traefik's file provider — middleware and TLS options, not per-PR routers). A reachable service needs four things: ",-1))]),t[18]||(t[18]=e("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)),t[19]||(t[19]=e("p",{class:"mute"},[a(" Put "),e("code",null,"${STACK}"),a(" 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))]))]),e("section",ae,[e("div",ie,[t[20]||(t[20]=e("h2",{class:"section"},"Containers",-1)),t[21]||(t[21]=e("span",{class:"grow"},null,-1)),e("span",ue,r(N.value)+" of "+r(l.value.containers.length)+" running ",1)]),l.value.containers.length?(s(),n("table",de,[t[22]||(t[22]=e("thead",null,[e("tr",null,[e("th",null,"service"),e("th",null,"state"),e("th",null,"ports"),e("th",null,"networks"),e("th",null,"image")])],-1)),e("tbody",he,[(s(!0),n(d,null,m(l.value.containers,(o,h)=>(s(),n("tr",{key:o.id,style:$({"--i":h})},[e("td",pe,[a(r(o.service??o.name)+" ",1),e("div",me,r(o.name),1)]),e("td",ve,[e("span",{class:_(o.state==="running"?"s-ok":"s-failed")},r(o.state),3),o.health?(s(),n("div",{key:0,class:_(["mute",o.health==="healthy"?"s-ok":"s-failed"]),style:{"font-size":"var(--t-sm)"}},r(o.health),3)):p("",!0)]),e("td",ce,[(s(!0),n(d,null,m(o.ports,u=>(s(),n("div",{key:`${u.containerPort}/${u.protocol}`},[e("span",fe,r(u.containerPort),1),u.hostPort?(s(),n("span",ke," ← host "+r(u.hostPort),1)):p("",!0)]))),128)),o.ports.length?p("",!0):(s(),n("span",ge,"none exposed"))]),e("td",ye,[(s(!0),n(d,null,m(o.networks,u=>(s(),n("div",{key:u},[e("span",{class:_(u==="preview-ingress"?"s-ok":"")},r(u),3)]))),128)),o.ingressIp?(s(),n("div",_e,r(o.ingressIp),1)):p("",!0)]),e("td",be,r(o.image),1)],4))),128))])])):(s(),n("p",we," 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)):(s(),n("div",U,[...t[0]||(t[0]=[e("b",null,"Docker did not answer.",-1),e("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)):p("",!0)])}}});export{Ne as default};
2
+ //# sourceMappingURL=RuntimeTab-CWjyUEnD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RuntimeTab-CWjyUEnD.js","sources":["../../src/views/tabs/RuntimeTab.vue"],"sourcesContent":["<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.\n *\n * Findings come first because they are the reason anyone opened this tab.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../../api/client';\nimport type { RuntimeResponse } from '../../api/types';\nimport { dep, varsQuery } from '../../composables/useDeployment';\nimport { usePolling } from '../../composables/usePolling';\nimport SkeletonList from '../../components/SkeletonList.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\nimport InfoHint from '../../components/InfoHint.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 errors = computed(() => rt.value?.findings.filter((f) => f.level === 'error') ?? []);\nconst warns = computed(() => rt.value?.findings.filter((f) => f.level === 'warn') ?? []);\nconst infos = computed(() => rt.value?.findings.filter((f) => f.level === 'info') ?? []);\nconst running = computed(() => rt.value?.containers.filter((c) => c.state === 'running').length ?? 0);\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 <!-- Findings first: this tab exists because something is not working. -->\n <div v-for=\"(f, i) in errors\" :key=\"`e${i}`\" class=\"banner failed\">\n <b>Blocking</b>\n <p>{{ f.message }}</p>\n </div>\n <div v-for=\"(f, i) in warns\" :key=\"`w${i}`\" class=\"banner warn\">\n <b>Worth checking</b>\n <p>{{ f.message }}</p>\n </div>\n <div v-for=\"(f, i) in infos\" :key=\"`i${i}`\" class=\"banner plain\">\n <p>{{ f.message }}</p>\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 <table v-if=\"rt.routes.length\" class=\"cards\">\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 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 <span v-if=\"r.target\" class=\"mono\">{{ r.target }}</span>\n <span v-else class=\"s-failed\">\n {{ r.port === null ? 'no port declared' : 'not on the ingress network' }}\n </span>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">{{ r.container }}</div>\n </td>\n <td data-label=\"router\">\n {{ r.router }}\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\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.&lt;name&gt;-${STACK}.rule=Host(`&lt;name&gt;-${STACK}.${PREVIEW_DOMAIN}`)\n - traefik.http.services.&lt;name&gt;-${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 </div>\n\n <table v-if=\"rt.containers.length\" class=\"cards\">\n <thead>\n <tr>\n <th>service</th>\n <th>state</th>\n <th>ports</th>\n <th>networks</th>\n <th>image</th>\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 {{ c.service ?? c.name }}\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">{{ c.name }}</div>\n </td>\n <td data-label=\"state\">\n <span :class=\"c.state === 'running' ? 's-ok' : 's-failed'\">{{ c.state }}</span>\n <div\n v-if=\"c.health\"\n class=\"mute\"\n style=\"font-size: var(--t-sm)\"\n :class=\"c.health === 'healthy' ? 's-ok' : 's-failed'\"\n >\n {{ 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\">\n <span :class=\"n === 'preview-ingress' ? 's-ok' : ''\">{{ n }}</span>\n </div>\n <div v-if=\"c.ingressIp\" class=\"mute mono\" style=\"font-size: var(--t-sm)\">\n {{ c.ingressIp }}\n </div>\n </td>\n <td class=\"dim\" data-label=\"image\">{{ c.image }}</td>\n </tr>\n </tbody>\n </table>\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"],"names":["rt","ref","error","loading","load","r","api","dep","varsQuery","problem","watch","usePolling","errors","computed","_a","f","warns","infos","running","c","_createElementBlock","_createBlock","ErrorNote","SkeletonList","_Fragment","_openBlock","_renderList","i","_cache","_createElementVNode","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","InfoHint","_hoisted_6","_hoisted_7","_hoisted_8","h","_hoisted_10","_hoisted_9","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_component_RouterLink","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_createTextVNode","_hoisted_28","_hoisted_29","_normalizeClass","_hoisted_30","p","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","n","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_1"],"mappings":"8iDA0BA,MAAMA,EAAKC,EAA4B,IAAI,EACrCC,EAAQD,EAAI,EAAE,EACdE,EAAUF,EAAI,EAAI,EAExB,eAAeG,GAAsB,CACnC,MAAMC,EAAI,MAAMC,EAAI,IAClB,oBAAoB,mBAAmBC,EAAI,EAAE,CAAC,WAAWC,EAAU,KAAK,EAAA,EAG1E,GADAL,EAAQ,MAAQ,GACZ,CAACE,EAAE,GAAI,CACTH,EAAM,MAAQO,EAAQJ,EAAG,yBAAyB,EAClD,MACF,CACAH,EAAM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,z as g,j as C,m as x,Q as E,H as B,o as p}from"./index-CrxqzmXu.js";const S={class:"panel"},U={class:"field"},F={class:"mute hint"},N={class:"field"},T={class:"mute hint"},D={class:"row",style:{gap:"8px","margin-top":"4px"}},L=["disabled"],R={key:0,class:"mute"},A={key:1,class:"bad"},M={class:"panel"},H={class:"field"},I={class:"field"},q=w({__name:"SettingsView",setup(P){const a=C(!1),b=x(()=>{var m;return((m=n.health)==null?void 0:m.authEnforced)??null});async function c(){a.value=!0;try{await E(),B(n.healthError?"error":"ok",n.healthError||"Control plane reachable")}finally{a.value=!1}}return(m,e)=>(p(),r("div",null,[e[18]||(e[18]=t("div",{class:"page-head"},[t("div",null,[t("h1",null,"Settings"),t("div",{class:"sub"},"Stored in this browser only. Nothing here is sent to the server.")])],-1)),t("section",S,[e[11]||(e[11]=t("h2",{class:"phead-title"},"Connection",-1)),t("div",U,[e[6]||(e[6]=t("label",{for:"apiBase"},"API base URL",-1)),d(t("input",{id:"apiBase","onUpdate:modelValue":e[0]||(e[0]=l=>s(o).apiBase=l),type:"url",spellcheck:"false",placeholder:"(same origin)"},null,512),[[h,s(o).apiBase,void 0,{trim:!0}]]),t("div",F,[e[5]||(e[5]=i(" Leave it empty unless you are pointing this page at another host. ",-1)),v(k,{label:"about the API base URL"},{default:f(()=>[...e[4]||(e[4]=[i(" 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})])]),t("div",N,[e[8]||(e[8]=t("label",{for:"token"},"Access token",-1)),d(t("input",{id:"token","onUpdate:modelValue":e[1]||(e[1]=l=>s(o).token=l),type:"password",autocomplete:"off",spellcheck:"false",placeholder:"paste the token from pstack init"},null,512),[[h,s(o).token,void 0,{trim:!0}]]),t("div",T,[e[7]||(e[7]=i(" Needed to deploy, tear down or delete. Viewing works without one. ",-1)),b.value===!1?(p(),r(V,{key:0},[i(" This server is not asking for one — it only accepts connections from this machine, so a token here is harmless but unnecessary. ")],64)):y("",!0)])]),t("div",D,[t("button",{class:"btn",disabled:a.value,onClick:c},u(a.value?"Checking…":"Test connection"),9,L),s(n).health?(p(),r("span",R,[i(" Connected to pstack "+u(s(n).health.version)+" ",1),v(k,{label:"where data is stored"},{default:f(()=>[e[9]||(e[9]=i(" Deployment records and stored specs live in ",-1)),t("code",null,u(s(n).health.dataDir),1),e[10]||(e[10]=i(" on the host. ",-1))]),_:1})])):s(n).healthError?(p(),r("span",A,u(s(n).healthError),1)):y("",!0)])]),t("section",M,[e[17]||(e[17]=t("h2",{class:"phead-title"},"Appearance",-1)),t("div",H,[e[13]||(e[13]=t("label",{for:"theme"},"Theme",-1)),d(t("select",{id:"theme","onUpdate:modelValue":e[2]||(e[2]=l=>s(o).theme=l)},[...e[12]||(e[12]=[t("option",{value:"system"},"Follow the system",-1),t("option",{value:"dark"},"Dark",-1),t("option",{value:"light"},"Light",-1)])],512),[[g,s(o).theme]])]),t("div",I,[e[15]||(e[15]=t("label",{for:"motion"},"Motion",-1)),d(t("select",{id:"motion","onUpdate:modelValue":e[3]||(e[3]=l=>s(o).motion=l)},[...e[14]||(e[14]=[t("option",{value:"system"},"Follow the system",-1),t("option",{value:"full"},"Full animation",-1),t("option",{value:"none"},"Reduce motion",-1)])],512),[[g,s(o).motion]]),e[16]||(e[16]=t("div",{class:"mute hint"}," “Follow the system” uses your device's reduce-motion setting. The other two override it, in either direction. ",-1))])])]))}});export{q as default};
2
- //# sourceMappingURL=SettingsView-Xfi1eGZO.js.map
1
+ import{d as w,c as r,a as t,x as d,y as h,b as s,K as o,e as i,f as v,w as f,_ as k,F as V,g as y,t as u,s as n,z as g,j as C,m as x,R as E,H as B,o as p}from"./index-B4C7uKN0.js";const S={class:"panel"},U={class:"field"},F={class:"mute hint"},N={class:"field"},R={class:"mute hint"},T={class:"row",style:{gap:"8px","margin-top":"4px"}},D=["disabled"],L={key:0,class:"mute"},A={key:1,class:"bad"},M={class:"panel"},H={class:"field"},I={class:"field"},q=w({__name:"SettingsView",setup(P){const a=C(!1),b=x(()=>{var m;return((m=n.health)==null?void 0:m.authEnforced)??null});async function c(){a.value=!0;try{await E(),B(n.healthError?"error":"ok",n.healthError||"Control plane reachable")}finally{a.value=!1}}return(m,e)=>(p(),r("div",null,[e[18]||(e[18]=t("div",{class:"page-head"},[t("div",null,[t("h1",null,"Settings"),t("div",{class:"sub"},"Stored in this browser only. Nothing here is sent to the server.")])],-1)),t("section",S,[e[11]||(e[11]=t("h2",{class:"phead-title"},"Connection",-1)),t("div",U,[e[6]||(e[6]=t("label",{for:"apiBase"},"API base URL",-1)),d(t("input",{id:"apiBase","onUpdate:modelValue":e[0]||(e[0]=l=>s(o).apiBase=l),type:"url",spellcheck:"false",placeholder:"(same origin)"},null,512),[[h,s(o).apiBase,void 0,{trim:!0}]]),t("div",F,[e[5]||(e[5]=i(" Leave it empty unless you are pointing this page at another host. ",-1)),v(k,{label:"about the API base URL"},{default:f(()=>[...e[4]||(e[4]=[i(" 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})])]),t("div",N,[e[8]||(e[8]=t("label",{for:"token"},"Access token",-1)),d(t("input",{id:"token","onUpdate:modelValue":e[1]||(e[1]=l=>s(o).token=l),type:"password",autocomplete:"off",spellcheck:"false",placeholder:"paste the token from pstack init"},null,512),[[h,s(o).token,void 0,{trim:!0}]]),t("div",R,[e[7]||(e[7]=i(" Needed to deploy, tear down or delete. Viewing works without one. ",-1)),b.value===!1?(p(),r(V,{key:0},[i(" This server is not asking for one — it only accepts connections from this machine, so a token here is harmless but unnecessary. ")],64)):y("",!0)])]),t("div",T,[t("button",{class:"btn",disabled:a.value,onClick:c},u(a.value?"Checking…":"Test connection"),9,D),s(n).health?(p(),r("span",L,[i(" Connected to pstack "+u(s(n).health.version)+" ",1),v(k,{label:"where data is stored"},{default:f(()=>[e[9]||(e[9]=i(" Deployment records and stored specs live in ",-1)),t("code",null,u(s(n).health.dataDir),1),e[10]||(e[10]=i(" on the host. ",-1))]),_:1})])):s(n).healthError?(p(),r("span",A,u(s(n).healthError),1)):y("",!0)])]),t("section",M,[e[17]||(e[17]=t("h2",{class:"phead-title"},"Appearance",-1)),t("div",H,[e[13]||(e[13]=t("label",{for:"theme"},"Theme",-1)),d(t("select",{id:"theme","onUpdate:modelValue":e[2]||(e[2]=l=>s(o).theme=l)},[...e[12]||(e[12]=[t("option",{value:"system"},"Follow the system",-1),t("option",{value:"dark"},"Dark",-1),t("option",{value:"light"},"Light",-1)])],512),[[g,s(o).theme]])]),t("div",I,[e[15]||(e[15]=t("label",{for:"motion"},"Motion",-1)),d(t("select",{id:"motion","onUpdate:modelValue":e[3]||(e[3]=l=>s(o).motion=l)},[...e[14]||(e[14]=[t("option",{value:"system"},"Follow the system",-1),t("option",{value:"full"},"Full animation",-1),t("option",{value:"none"},"Reduce motion",-1)])],512),[[g,s(o).motion]]),e[16]||(e[16]=t("div",{class:"mute hint"}," “Follow the system” uses your device's reduce-motion setting. The other two override it, in either direction. ",-1))])])]))}});export{q as default};
2
+ //# sourceMappingURL=SettingsView-D_roVhhz.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SettingsView-Xfi1eGZO.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, and how the app looks.\n *\n * Everything here is client-side and persisted to localStorage by `useSettings` — nothing is sent\n * to the server, and there is nothing to save. Bindings write through immediately.\n */\nimport { computed, ref } from 'vue';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth } from '../composables/useControlPlane';\nimport { toast } from '../composables/useToasts';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst checking = ref(false);\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</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <div class=\"sub\">Stored in this browser only. Nothing here is sent to the server.</div>\n </div>\n </div>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Connection</h2>\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 <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n type=\"password\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"mute hint\">\n Needed to deploy, tear down or delete. Viewing works without one.\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 <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <select id=\"theme\" v-model=\"settings.theme\">\n <option value=\"system\">Follow the system</option>\n <option value=\"dark\">Dark</option>\n <option value=\"light\">Light</option>\n </select>\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <select id=\"motion\" v-model=\"settings.motion\">\n <option value=\"system\">Follow the system</option>\n <option value=\"full\">Full animation</option>\n <option value=\"none\">Reduce motion</option>\n </select>\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","authEnforced","computed","_a","state","recheck","loadHealth","toast","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","settings","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_5","_Fragment","_hoisted_6","_hoisted_7","_openBlock","_hoisted_8","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_hoisted_11","_vModelSelect","_hoisted_12"],"mappings":"ueAaA,MAAMA,EAAWC,EAAI,EAAK,EAMpBC,EAAeC,EAAS,IAAA,OAAM,QAAAC,EAAAC,EAAM,SAAN,YAAAD,EAAc,eAAgB,KAAI,EAEtE,eAAeE,GAAyB,CACtCN,EAAS,MAAQ,GACjB,GAAI,CACF,MAAMO,EAAA,EACNC,EAAMH,EAAM,YAAc,QAAU,KAAMA,EAAM,aAAe,yBAAyB,CAC1F,QAAA,CACEL,EAAS,MAAQ,EACnB,CACF,mBAIES,EAyFM,MAAA,KAAA,eAxFJC,EAKM,MAAA,CALD,MAAM,aAAW,CACpBA,EAGM,MAAA,KAAA,CAFJA,EAAiB,UAAb,UAAQ,EACZA,EAAuF,MAAA,CAAlF,MAAM,KAAA,EAAM,kEAAgE,CAAA,SAIrFA,EAsDU,UAtDVC,EAsDU,CArDRC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAuC,KAAA,CAAnC,MAAM,aAAA,EAAc,aAAU,EAAA,GAElCA,EAiBM,MAjBNG,EAiBM,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SAAA,CAAzC,MAAM,QAAA,EAAS,oBAAiB,EAAA,EACxCA,EAA4C,SAAA,CAApC,MAAM,MAAA,EAAO,iBAAc,EAAA,EACnCA,EAA2C,SAAA,CAAnC,MAAM,MAAA,EAAO,gBAAa,EAAA,CAAA,UAHP,CAAAsB,EAAAjB,EAAAC,CAAA,EAAS,MAAM,CAAA,GAK5CJ,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGM,MAAA,CAHD,MAAM,aAAY,kHAGvB,EAAA,EAAA"}
1
+ {"version":3,"file":"SettingsView-D_roVhhz.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, and how the app looks.\n *\n * Everything here is client-side and persisted to localStorage by `useSettings` — nothing is sent\n * to the server, and there is nothing to save. Bindings write through immediately.\n */\nimport { computed, ref } from 'vue';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth } from '../composables/useControlPlane';\nimport { toast } from '../composables/useToasts';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst checking = ref(false);\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</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <div class=\"sub\">Stored in this browser only. Nothing here is sent to the server.</div>\n </div>\n </div>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Connection</h2>\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 <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n type=\"password\"\n autocomplete=\"off\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"mute hint\">\n Needed to deploy, tear down or delete. Viewing works without one.\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 <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <select id=\"theme\" v-model=\"settings.theme\">\n <option value=\"system\">Follow the system</option>\n <option value=\"dark\">Dark</option>\n <option value=\"light\">Light</option>\n </select>\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <select id=\"motion\" v-model=\"settings.motion\">\n <option value=\"system\">Follow the system</option>\n <option value=\"full\">Full animation</option>\n <option value=\"none\">Reduce motion</option>\n </select>\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","authEnforced","computed","_a","state","recheck","loadHealth","toast","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","settings","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_5","_Fragment","_hoisted_6","_hoisted_7","_openBlock","_hoisted_8","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_hoisted_11","_vModelSelect","_hoisted_12"],"mappings":"ueAaA,MAAMA,EAAWC,EAAI,EAAK,EAMpBC,EAAeC,EAAS,IAAA,OAAM,QAAAC,EAAAC,EAAM,SAAN,YAAAD,EAAc,eAAgB,KAAI,EAEtE,eAAeE,GAAyB,CACtCN,EAAS,MAAQ,GACjB,GAAI,CACF,MAAMO,EAAA,EACNC,EAAMH,EAAM,YAAc,QAAU,KAAMA,EAAM,aAAe,yBAAyB,CAC1F,QAAA,CACEL,EAAS,MAAQ,EACnB,CACF,mBAIES,EAyFM,MAAA,KAAA,eAxFJC,EAKM,MAAA,CALD,MAAM,aAAW,CACpBA,EAGM,MAAA,KAAA,CAFJA,EAAiB,UAAb,UAAQ,EACZA,EAAuF,MAAA,CAAlF,MAAM,KAAA,EAAM,kEAAgE,CAAA,SAIrFA,EAsDU,UAtDVC,EAsDU,CArDRC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAuC,KAAA,CAAnC,MAAM,aAAA,EAAc,aAAU,EAAA,GAElCA,EAiBM,MAjBNG,EAiBM,CAhBJD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAAyC,QAAA,CAAlC,IAAI,SAAA,EAAU,eAAY,EAAA,KACjCA,EAME,QAAA,CALA,GAAG,UACW,sBAAAE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAC,CAAA,EAAS,QAAOF,GAC9B,KAAK,MACL,WAAW,QACX,YAAY,eAAA,gBAHEC,EAAAC,CAAA,EAAS,eAAf,CAAA,KAAR,EAAA,CAA+B,IAKjCN,EAOM,MAPNO,EAOM,eAPiB,sEAErB,EAAA,GAAAC,EAIWC,EAAA,CAJD,MAAM,0BAAwB,WAAC,IA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aria-live":"polite","aria-label":"loading"},p=s({__name:"SkeletonList",props:{rows:{default:3},tall:{type:Boolean,default:!1}},setup(l){return(d,u)=>(e(),a("div",c,[(e(!0),a(o,null,r(l.rows,t=>(e(),a("div",{key:t,class:i(["skel",{tall:l.tall}]),style:n({width:`${100-t*7}%`})},null,6))),128))]))}});export{p as _};
2
- //# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js.map
1
+ import{d as s,o as e,c as a,F as o,r,q as n,v as i}from"./index-B4C7uKN0.js";const c={role:"status","aria-live":"polite","aria-label":"loading"},p=s({__name:"SkeletonList",props:{rows:{default:3},tall:{type:Boolean,default:!1}},setup(l){return(d,u)=>(e(),a("div",c,[(e(!0),a(o,null,r(l.rows,t=>(e(),a("div",{key:t,class:i(["skel",{tall:l.tall}]),style:n({width:`${100-t*7}%`})},null,6))),128))]))}});export{p as _};
2
+ //# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js","sources":["../../src/components/SkeletonList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A loading placeholder shaped like the thing that is coming.\n *\n * Deliberately not a spinner on an empty page: a spinner says \"wait\" and nothing else, while a\n * skeleton says what will be there and stops the layout jumping when it arrives. It also makes an\n * empty result visibly different from a slow one, which on this page is the difference between\n * \"nothing is deployed\" and \"the API is not answering\".\n */\nwithDefaults(defineProps<{ rows?: number; tall?: boolean }>(), { rows: 3, tall: false });\n</script>\n\n<template>\n <div role=\"status\" aria-live=\"polite\" aria-label=\"loading\">\n <div v-for=\"n in rows\" :key=\"n\" class=\"skel\" :class=\"{ tall }\" :style=\"{ width: `${100 - n * 7}%` }\" />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","__props","n","_normalizeClass"],"mappings":"2PAaEA,EAAA,EAAAC,EAEM,MAFNC,EAEM,QADJD,EAAuGE,EAAA,KAAAC,EAAtFC,EAAA,KAALC,QAAZL,EAAuG,MAAA,CAA/E,IAAKK,EAAG,MAAKC,EAAA,CAAC,OAAM,CAAA,KAAWF,EAAA,IAAA,CAAI,CAAA,EAAK,sBAAyBC,EAAC,CAAA,GAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js","sources":["../../src/components/SkeletonList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A loading placeholder shaped like the thing that is coming.\n *\n * Deliberately not a spinner on an empty page: a spinner says \"wait\" and nothing else, while a\n * skeleton says what will be there and stops the layout jumping when it arrives. It also makes an\n * empty result visibly different from a slow one, which on this page is the difference between\n * \"nothing is deployed\" and \"the API is not answering\".\n */\nwithDefaults(defineProps<{ rows?: number; tall?: boolean }>(), { rows: 3, tall: false });\n</script>\n\n<template>\n <div role=\"status\" aria-live=\"polite\" aria-label=\"loading\">\n <div v-for=\"n in rows\" :key=\"n\" class=\"skel\" :class=\"{ tall }\" :style=\"{ width: `${100 - n * 7}%` }\" />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","__props","n","_normalizeClass"],"mappings":"2PAaEA,EAAA,EAAAC,EAEM,MAFNC,EAEM,QADJD,EAAuGE,EAAA,KAAAC,EAAtFC,EAAA,KAALC,QAAZL,EAAuG,MAAA,CAA/E,IAAKK,EAAG,MAAKC,EAAA,CAAC,OAAM,CAAA,KAAWF,EAAA,IAAA,CAAI,CAAA,EAAK,sBAAyBC,EAAC,CAAA,GAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{d as I,B as C,s as V,I as $,c as n,a as s,f as c,w as d,t as o,v as D,g as m,h as _,F as b,e as l,_ as A,r as L,b as N,j as v,m as R,n as z,o as t,K as S,k as j,p as q}from"./index-CrxqzmXu.js";import{s as B}from"./useFormat-CKJxQp_i.js";import{_ as E}from"./SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-pc4tgtPS.js";const T={class:"page-head"},U={class:"mute",style:{"font-size":"var(--t-sm)"}},H={style:{"font-size":"var(--t-xl)"}},K={class:"sub"},P={key:0},W={key:1},G={key:2},J={key:3,class:"mute"},M={key:1,class:"panel"},O={class:"banner failed"},Q={class:"panel"},X={key:1,class:"kvlist"},Y={class:"k"},Z={class:"v"},ee={key:0},se={key:1,class:"mute"},te={class:"v"},ne={key:1,class:"mute"},ae={class:"v"},oe={class:"v"},le={key:0,class:"panel"},ie={key:0,class:"banner plain"},de={key:1,class:"code"},re={key:2,class:"mute"},ve=I({__name:"SpecDetailView",props:{name:{}},setup(y){const k=y,a=v(null),r=v(!0),u=v(""),p=v(!1);async function g(){r.value=!0,p.value=!1;const i=await j.getAuthed(`/api/specs/${encodeURIComponent(k.name)}`);if(r.value=!1,i.status===404){p.value=!0;return}if(!i.ok){u.value=q(i,"load this spec");return}u.value="",a.value=i.body}C(()=>k.name,g,{immediate:!0}),C(()=>S.token,g),V.deploymentsLoaded||$();const w=R(()=>V.deployments.filter(i=>i.specName===k.name));return(i,e)=>{var x;const f=z("RouterLink");return t(),n("div",null,[s("div",T,[s("div",null,[s("div",U,[c(f,{to:"/specs"},{default:d(()=>[...e[0]||(e[0]=[l("← specs",-1)])]),_:1})]),s("h1",H,o(y.name),1),s("div",K,[(x=a.value)!=null&&x.description?(t(),n("span",P,o(a.value.description),1)):p.value?(t(),n("span",W,"not found")):r.value?(t(),n("span",G,"loading…")):(t(),n("span",J,"no description"))])]),e[1]||(e[1]=s("span",{class:"grow"},null,-1)),a.value?(t(),n("span",{key:0,class:D(["badge",a.value.kind])},o(a.value.kind),3)):m("",!0)]),u.value?(t(),_(F,{key:0,text:u.value,title:"Could not load this spec."},null,8,["text"])):m("",!0),p.value?(t(),n("section",M,[s("div",O,[s("b",null,"No spec named “"+o(y.name)+"”.",1),e[2]||(e[2]=s("p",null,"It may have been deleted, or this is an older link.",-1))])])):(t(),n(b,{key:2},[s("section",Q,[r.value?(t(),_(E,{key:0,rows:4})):a.value?(t(),n("ul",X,[s("li",null,[s("span",Y,[e[4]||(e[4]=l(" needs ",-1)),c(A,{label:"what needs means"},{default:d(()=>[...e[3]||(e[3]=[l(" Variables the spec uses but does not set. Every deployment referencing it supplies these, which is how one spec serves many stacks — and a missing one is refused by name rather than filled in blank. ",-1)])]),_:1})]),s("span",Z,[a.value.requiredVars.length?(t(),n("b",ee,o(a.value.requiredVars.join(", ")),1)):(t(),n("span",se,"nothing — every value is fixed by the spec"))])]),s("li",null,[e[6]||(e[6]=s("span",{class:"k"},"used by",-1)),s("span",te,[w.value.length?(t(),n(b,{key:0},[(t(!0),n(b,null,L(w.value,h=>(t(),_(f,{key:h.id,to:`/deployments/${encodeURIComponent(h.id)}`,style:{"margin-right":"10px"}},{default:d(()=>[l(o(h.id),1)]),_:2},1032,["to"]))),128)),c(A,{label:"why this matters"},{default:d(()=>[...e[5]||(e[5]=[l(" Deleting a spec while a deployment still references it is refused: that deployment could no longer be resolved, and one that cannot be resolved can never be torn down. ",-1)])]),_:1})],64)):(t(),n("span",ne,"no deployments reference it"))])]),s("li",null,[e[7]||(e[7]=s("span",{class:"k"},"created",-1)),s("span",ae,o(N(B)(a.value.createdAt)),1)]),s("li",null,[e[8]||(e[8]=s("span",{class:"k"},"updated",-1)),s("span",oe,o(N(B)(a.value.updatedAt)),1)])])):m("",!0)]),a.value?(t(),n("section",le,[e[13]||(e[13]=s("div",{class:"phead"},[s("h2",{class:"section"},"Source")],-1)),a.value.sourceWithheld?(t(),n("div",ie,[e[12]||(e[12]=s("b",null,"Hidden without an access token.",-1)),s("p",null,[e[10]||(e[10]=l(" A spec's hooks are shell commands, and they often carry a password or an API token inline — so the server does not send the file to an unauthenticated reader. ",-1)),c(f,{to:"/settings"},{default:d(()=>[...e[9]||(e[9]=[l("Add your token",-1)])]),_:1}),e[11]||(e[11]=l(" to see it. ",-1))])])):a.value.source?(t(),n("pre",de,o(a.value.source),1)):(t(),n("p",re,"The server returned no source for this spec."))])):m("",!0)],64))])}}});export{ve as default};
2
- //# sourceMappingURL=SpecDetailView-bw4Xzo2x.js.map
1
+ import{d as I,B as C,s as V,I as $,c as n,a as s,f as c,w as d,t as o,v as D,g as m,h as _,F as b,e as l,_ as A,r as L,b as N,j as v,m as R,n as z,o as t,K as S,k as j,p as q}from"./index-B4C7uKN0.js";import{s as B}from"./useFormat-CKJxQp_i.js";import{_ as E}from"./SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js";const T={class:"page-head"},U={class:"mute",style:{"font-size":"var(--t-sm)"}},H={style:{"font-size":"var(--t-xl)"}},K={class:"sub"},P={key:0},W={key:1},G={key:2},J={key:3,class:"mute"},M={key:1,class:"panel"},O={class:"banner failed"},Q={class:"panel"},X={key:1,class:"kvlist"},Y={class:"k"},Z={class:"v"},ee={key:0},se={key:1,class:"mute"},te={class:"v"},ne={key:1,class:"mute"},ae={class:"v"},oe={class:"v"},le={key:0,class:"panel"},ie={key:0,class:"banner plain"},de={key:1,class:"code"},re={key:2,class:"mute"},ve=I({__name:"SpecDetailView",props:{name:{}},setup(y){const k=y,a=v(null),r=v(!0),u=v(""),p=v(!1);async function g(){r.value=!0,p.value=!1;const i=await j.getAuthed(`/api/specs/${encodeURIComponent(k.name)}`);if(r.value=!1,i.status===404){p.value=!0;return}if(!i.ok){u.value=q(i,"load this spec");return}u.value="",a.value=i.body}C(()=>k.name,g,{immediate:!0}),C(()=>S.token,g),V.deploymentsLoaded||$();const w=R(()=>V.deployments.filter(i=>i.specName===k.name));return(i,e)=>{var x;const f=z("RouterLink");return t(),n("div",null,[s("div",T,[s("div",null,[s("div",U,[c(f,{to:"/specs"},{default:d(()=>[...e[0]||(e[0]=[l("← specs",-1)])]),_:1})]),s("h1",H,o(y.name),1),s("div",K,[(x=a.value)!=null&&x.description?(t(),n("span",P,o(a.value.description),1)):p.value?(t(),n("span",W,"not found")):r.value?(t(),n("span",G,"loading…")):(t(),n("span",J,"no description"))])]),e[1]||(e[1]=s("span",{class:"grow"},null,-1)),a.value?(t(),n("span",{key:0,class:D(["badge",a.value.kind])},o(a.value.kind),3)):m("",!0)]),u.value?(t(),_(F,{key:0,text:u.value,title:"Could not load this spec."},null,8,["text"])):m("",!0),p.value?(t(),n("section",M,[s("div",O,[s("b",null,"No spec named “"+o(y.name)+"”.",1),e[2]||(e[2]=s("p",null,"It may have been deleted, or this is an older link.",-1))])])):(t(),n(b,{key:2},[s("section",Q,[r.value?(t(),_(E,{key:0,rows:4})):a.value?(t(),n("ul",X,[s("li",null,[s("span",Y,[e[4]||(e[4]=l(" needs ",-1)),c(A,{label:"what needs means"},{default:d(()=>[...e[3]||(e[3]=[l(" Variables the spec uses but does not set. Every deployment referencing it supplies these, which is how one spec serves many stacks — and a missing one is refused by name rather than filled in blank. ",-1)])]),_:1})]),s("span",Z,[a.value.requiredVars.length?(t(),n("b",ee,o(a.value.requiredVars.join(", ")),1)):(t(),n("span",se,"nothing — every value is fixed by the spec"))])]),s("li",null,[e[6]||(e[6]=s("span",{class:"k"},"used by",-1)),s("span",te,[w.value.length?(t(),n(b,{key:0},[(t(!0),n(b,null,L(w.value,h=>(t(),_(f,{key:h.id,to:`/deployments/${encodeURIComponent(h.id)}`,style:{"margin-right":"10px"}},{default:d(()=>[l(o(h.id),1)]),_:2},1032,["to"]))),128)),c(A,{label:"why this matters"},{default:d(()=>[...e[5]||(e[5]=[l(" Deleting a spec while a deployment still references it is refused: that deployment could no longer be resolved, and one that cannot be resolved can never be torn down. ",-1)])]),_:1})],64)):(t(),n("span",ne,"no deployments reference it"))])]),s("li",null,[e[7]||(e[7]=s("span",{class:"k"},"created",-1)),s("span",ae,o(N(B)(a.value.createdAt)),1)]),s("li",null,[e[8]||(e[8]=s("span",{class:"k"},"updated",-1)),s("span",oe,o(N(B)(a.value.updatedAt)),1)])])):m("",!0)]),a.value?(t(),n("section",le,[e[13]||(e[13]=s("div",{class:"phead"},[s("h2",{class:"section"},"Source")],-1)),a.value.sourceWithheld?(t(),n("div",ie,[e[12]||(e[12]=s("b",null,"Hidden without an access token.",-1)),s("p",null,[e[10]||(e[10]=l(" A spec's hooks are shell commands, and they often carry a password or an API token inline — so the server does not send the file to an unauthenticated reader. ",-1)),c(f,{to:"/settings"},{default:d(()=>[...e[9]||(e[9]=[l("Add your token",-1)])]),_:1}),e[11]||(e[11]=l(" to see it. ",-1))])])):a.value.source?(t(),n("pre",de,o(a.value.source),1)):(t(),n("p",re,"The server returned no source for this spec."))])):m("",!0)],64))])}}});export{ve as default};
2
+ //# sourceMappingURL=SpecDetailView-CDXuYT7k.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpecDetailView-bw4Xzo2x.js","sources":["../../src/views/SpecDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One stored spec: what it needs, who uses it, and its source.\n *\n * THE SOURCE IS A RESTRICTED READ. Everything else on this API can be read without a token, but a\n * spec's hook bodies are shell strings that routinely carry a credential inline, so the server sends\n * `source` only to an authenticated request and sets `sourceWithheld` otherwise. That is why this\n * one view uses `getAuthed`, and why \"no token\" renders an explanation rather than an empty editor —\n * a blank box would read as an empty spec, which is a different and much more alarming fact.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecDetail } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { settings } from '../composables/useSettings';\nimport { stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ name: string }>();\n\nconst spec = ref<SpecDetail | null>(null);\nconst loading = ref(true);\nconst error = ref('');\nconst missing = ref(false);\n\nasync function load(): Promise<void> {\n loading.value = true;\n missing.value = false;\n const r = await api.getAuthed<SpecDetail>(`/api/specs/${encodeURIComponent(props.name)}`);\n loading.value = false;\n if (r.status === 404) {\n missing.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load this spec');\n return;\n }\n error.value = '';\n spec.value = r.body;\n}\n\nwatch(() => props.name, load, { immediate: true });\n// Re-fetch when a token is pasted: the same URL returns strictly more with one.\nwatch(() => settings.token, load);\n\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployments that would become unresolvable if this spec were deleted. */\nconst users = computed(() => state.deployments.filter((d) => d.specName === props.name));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/specs\">← specs</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ name }}</h1>\n <div class=\"sub\">\n <span v-if=\"spec?.description\">{{ spec.description }}</span>\n <span v-else-if=\"missing\">not found</span>\n <span v-else-if=\"loading\">loading…</span>\n <span v-else class=\"mute\">no description</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"spec\" class=\"badge\" :class=\"spec.kind\">{{ spec.kind }}</span>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load this spec.\" />\n\n <section v-if=\"missing\" class=\"panel\">\n <div class=\"banner failed\">\n <b>No spec named “{{ name }}”.</b>\n <p>It may have been deleted, or this is an older link.</p>\n </div>\n </section>\n\n <template v-else>\n <section class=\"panel\">\n <SkeletonList v-if=\"loading\" :rows=\"4\" />\n <ul v-else-if=\"spec\" class=\"kvlist\">\n <li>\n <span class=\"k\">\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it supplies\n these, which is how one spec serves many stacks — and a missing one is refused by\n name rather than filled in blank.\n </InfoHint>\n </span>\n <span class=\"v\">\n <b v-if=\"spec.requiredVars.length\">{{ spec.requiredVars.join(', ') }}</b>\n <span v-else class=\"mute\">nothing — every value is fixed by the spec</span>\n </span>\n </li>\n <li>\n <span class=\"k\">used by</span>\n <span class=\"v\">\n <template v-if=\"users.length\">\n <RouterLink\n v-for=\"d in users\"\n :key=\"d.id\"\n :to=\"`/deployments/${encodeURIComponent(d.id)}`\"\n style=\"margin-right: 10px\"\n >{{ d.id }}</RouterLink\n >\n <InfoHint label=\"why this matters\">\n Deleting a spec while a deployment still references it is refused: that deployment\n could no longer be resolved, and one that cannot be resolved can never be torn\n down.\n </InfoHint>\n </template>\n <span v-else class=\"mute\">no deployments reference it</span>\n </span>\n </li>\n <li><span class=\"k\">created</span><span class=\"v\">{{ stamp(spec.createdAt) }}</span></li>\n <li><span class=\"k\">updated</span><span class=\"v\">{{ stamp(spec.updatedAt) }}</span></li>\n </ul>\n </section>\n\n <section v-if=\"spec\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Source</h2>\n </div>\n\n <!--\n Withheld, not empty. The server never sent the source, so there is nothing here to reveal —\n the same reasoning as the masked variables: an affordance that promises plaintext the page\n does not have would be a lie.\n -->\n <div v-if=\"spec.sourceWithheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n A spec's hooks are shell commands, and they often carry a password or an API token\n inline — so the server does not send the file to an unauthenticated reader.\n <RouterLink to=\"/settings\">Add your token</RouterLink> to see it.\n </p>\n </div>\n <pre v-else-if=\"spec.source\" class=\"code\">{{ spec.source }}</pre>\n <p v-else class=\"mute\">The server returned no source for this spec.</p>\n </section>\n </template>\n </div>\n</template>\n"],"names":["props","__props","spec","ref","loading","error","missing","load","r","api","problem","watch","settings","state","loadDeployments","users","computed","d","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_a","_hoisted_5","_openBlock","_hoisted_8","_normalizeClass","_createBlock","ErrorNote","_hoisted_9","_hoisted_10","_Fragment","_hoisted_11","SkeletonList","_hoisted_12","_hoisted_13","InfoHint","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_createTextVNode","_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A,EAA+B,KAAA,CAA3B,MAAM,SAAA,EAAU,QAAM,CAAA,OAQjBjB,EAAA,MAAK,gBAAhB4B,IAAAZ,EAOM,MAPNoC,GAOM,CANJ9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAsC,SAAnC,kCAA+B,EAAA,GAClCA,EAII,IAAA,KAAA,iBAJD,mKAGD,EAAA,GAAAG,EAAsDC,EAAA,CAA1C,GAAG,aAAW,WAAC,IAAc,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAd,iBAAc,EAAA,CAAA,2BAAa,eACxD,EAAA,EAAA,MAEctB,EAAA,MAAK,QAArB4B,EAAA,EAAAZ,EAAiE,MAAjEqC,GAAiE7B,EAApBxB,EAAA,MAAK,MAAM,EAAA,CAAA,QACxDgB,EAAuE,IAAvEsC,GAAuB,8CAA4C,EAAA"}
1
+ {"version":3,"file":"SpecDetailView-CDXuYT7k.js","sources":["../../src/views/SpecDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One stored spec: what it needs, who uses it, and its source.\n *\n * THE SOURCE IS A RESTRICTED READ. Everything else on this API can be read without a token, but a\n * spec's hook bodies are shell strings that routinely carry a credential inline, so the server sends\n * `source` only to an authenticated request and sets `sourceWithheld` otherwise. That is why this\n * one view uses `getAuthed`, and why \"no token\" renders an explanation rather than an empty editor —\n * a blank box would read as an empty spec, which is a different and much more alarming fact.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecDetail } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { settings } from '../composables/useSettings';\nimport { stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ name: string }>();\n\nconst spec = ref<SpecDetail | null>(null);\nconst loading = ref(true);\nconst error = ref('');\nconst missing = ref(false);\n\nasync function load(): Promise<void> {\n loading.value = true;\n missing.value = false;\n const r = await api.getAuthed<SpecDetail>(`/api/specs/${encodeURIComponent(props.name)}`);\n loading.value = false;\n if (r.status === 404) {\n missing.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load this spec');\n return;\n }\n error.value = '';\n spec.value = r.body;\n}\n\nwatch(() => props.name, load, { immediate: true });\n// Re-fetch when a token is pasted: the same URL returns strictly more with one.\nwatch(() => settings.token, load);\n\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployments that would become unresolvable if this spec were deleted. */\nconst users = computed(() => state.deployments.filter((d) => d.specName === props.name));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/specs\">← specs</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ name }}</h1>\n <div class=\"sub\">\n <span v-if=\"spec?.description\">{{ spec.description }}</span>\n <span v-else-if=\"missing\">not found</span>\n <span v-else-if=\"loading\">loading…</span>\n <span v-else class=\"mute\">no description</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"spec\" class=\"badge\" :class=\"spec.kind\">{{ spec.kind }}</span>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load this spec.\" />\n\n <section v-if=\"missing\" class=\"panel\">\n <div class=\"banner failed\">\n <b>No spec named “{{ name }}”.</b>\n <p>It may have been deleted, or this is an older link.</p>\n </div>\n </section>\n\n <template v-else>\n <section class=\"panel\">\n <SkeletonList v-if=\"loading\" :rows=\"4\" />\n <ul v-else-if=\"spec\" class=\"kvlist\">\n <li>\n <span class=\"k\">\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it supplies\n these, which is how one spec serves many stacks — and a missing one is refused by\n name rather than filled in blank.\n </InfoHint>\n </span>\n <span class=\"v\">\n <b v-if=\"spec.requiredVars.length\">{{ spec.requiredVars.join(', ') }}</b>\n <span v-else class=\"mute\">nothing — every value is fixed by the spec</span>\n </span>\n </li>\n <li>\n <span class=\"k\">used by</span>\n <span class=\"v\">\n <template v-if=\"users.length\">\n <RouterLink\n v-for=\"d in users\"\n :key=\"d.id\"\n :to=\"`/deployments/${encodeURIComponent(d.id)}`\"\n style=\"margin-right: 10px\"\n >{{ d.id }}</RouterLink\n >\n <InfoHint label=\"why this matters\">\n Deleting a spec while a deployment still references it is refused: that deployment\n could no longer be resolved, and one that cannot be resolved can never be torn\n down.\n </InfoHint>\n </template>\n <span v-else class=\"mute\">no deployments reference it</span>\n </span>\n </li>\n <li><span class=\"k\">created</span><span class=\"v\">{{ stamp(spec.createdAt) }}</span></li>\n <li><span class=\"k\">updated</span><span class=\"v\">{{ stamp(spec.updatedAt) }}</span></li>\n </ul>\n </section>\n\n <section v-if=\"spec\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Source</h2>\n </div>\n\n <!--\n Withheld, not empty. The server never sent the source, so there is nothing here to reveal —\n the same reasoning as the masked variables: an affordance that promises plaintext the page\n does not have would be a lie.\n -->\n <div v-if=\"spec.sourceWithheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n A spec's hooks are shell commands, and they often carry a password or an API token\n inline — so the server does not send the file to an unauthenticated reader.\n <RouterLink to=\"/settings\">Add your token</RouterLink> to see it.\n </p>\n </div>\n <pre v-else-if=\"spec.source\" class=\"code\">{{ spec.source }}</pre>\n <p v-else class=\"mute\">The server returned no source for this spec.</p>\n </section>\n </template>\n </div>\n</template>\n"],"names":["props","__props","spec","ref","loading","error","missing","load","r","api","problem","watch","settings","state","loadDeployments","users","computed","d","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_a","_hoisted_5","_openBlock","_hoisted_8","_normalizeClass","_createBlock","ErrorNote","_hoisted_9","_hoisted_10","_Fragment","_hoisted_11","SkeletonList","_hoisted_12","_hoisted_13","InfoHint","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_createTextVNode","_hoisted_18","_hoisted_19","_unref","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"m9BAoBA,MAAMA,EAAQC,EAERC,EAAOC,EAAuB,IAAI,EAClCC,EAAUD,EAAI,EAAI,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAUH,EAAI,EAAK,EAEzB,eAAeI,GAAsB,CACnCH,EAAQ,MAAQ,GAChBE,EAAQ,MAAQ,GAChB,MAAME,EAAI,MAAMC,EAAI,UAAsB,cAAc,mBAAmBT,EAAM,IAAI,CAAC,EAAE,EAExF,GADAI,EAAQ,MAAQ,GACZI,EAAE,SAAW,IAAK,CACpBF,EAAQ,MAAQ,GAChB,MACF,CACA,GAAI,CAACE,EAAE,GAAI,CACTH,EAAM,MAAQK,EAAQF,EAAG,gBAAgB,EACzC,MACF,CACAH,EAAM,MAAQ,GACdH,EAAK,MAAQM,EAAE,IACjB,CAEAG,EAAM,IAAMX,EAAM,KAAMO,EAAM,CAAE,UAAW,GAAM,EAEjDI,EAAM,IAAMC,EAAS,MAAOL,CAAI,EAE3BM,EAAM,mBAAwBC,EAAA,EAGnC,MAAMC,EAAQC,EAAS,IAAMH,EAAM,YAAY,OAAQI,GAAMA,EAAE,WAAajB,EAAM,IAAI,CAAC,yDAIrFkB,EA4FM,MAAA,KAAA,CA3FJC,EAeM,MAfNC,EAeM,CAdJD,EAWM,MAAA,KAAA,CAVJA,EAEM,MAFNE,EAEM,CADJC,EAA4CC,EAAA,CAAhC,GAAG,UAAQ,WAAC,IAAO,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAP,UAAO,EAAA,CAAA,aAEjCL,EAAkD,KAAlDM,EAAkDC,EAAZzB,EAAA,IAAI,EAAA,CAAA,EAC1CkB,EAKM,MALNQ,EAKM,EAJQC,EAAA1B,EAAA,QAAA,MAAA0B,EAAM,iBAAlBV,EAA4D,OAA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GAoBU,eAnBRlC,EAEM,MAAA,CAFD,MAAM,SAAO,CAChBA,EAA+B,KAAA,CAA3B,MAAM,SAAA,EAAU,QAAM,CAAA,OAQjBjB,EAAA,MAAK,gBAAhB4B,IAAAZ,EAOM,MAPNoC,GAOM,CANJ9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAsC,SAAnC,kCAA+B,EAAA,GAClCA,EAII,IAAA,KAAA,iBAJD,mKAGD,EAAA,GAAAG,EAAsDC,EAAA,CAA1C,GAAG,aAAW,WAAC,IAAc,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAd,iBAAc,EAAA,CAAA,2BAAa,eACxD,EAAA,EAAA,MAEctB,EAAA,MAAK,QAArB4B,EAAA,EAAAZ,EAAiE,MAAjEqC,GAAiE7B,EAApBxB,EAAA,MAAK,MAAM,EAAA,CAAA,QACxDgB,EAAuE,IAAvEsC,GAAuB,8CAA4C,EAAA"}
@@ -1,2 +1,2 @@
1
- import{d as q,s as g,I as L,c as a,a as s,e as l,f as c,w as y,_ as w,h as x,g as f,F as C,x as B,y as T,r as U,t as i,j as r,k as $,p as z,m as N,n as D,o as t,q as I,v as R,b as j}from"./index-CrxqzmXu.js";import{s as A}from"./useFormat-CKJxQp_i.js";import{_ as E}from"./SkeletonList.vue_vue_type_script_setup_true_lang-nMOrcNBi.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-pc4tgtPS.js";const M={class:"page-head"},P={class:"sub"},W={key:1,class:"panel"},G={key:2,class:"panel"},H={class:"field",style:{"max-width":"320px","margin-bottom":"var(--s4)"}},J={class:"cards","data-testid":"specs.list"},K={class:"stagger"},O={class:"name","data-label":"name"},Q={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},X={"data-label":"kind"},Y={"data-label":"needs"},Z={key:0},ee={key:1,class:"mute"},se={"data-label":"used by"},te={key:0},ne={key:1,class:"mute"},oe={class:"dim nowrap","data-label":"updated"},ae={key:0},le={colspan:"5",class:"mute"},ie={key:2,class:"banner plain"},ce=q({__name:"SpecsView",setup(de){const u=r([]),v=r(!1),p=r(""),h=r(!1),m=r("");async function S(){const o=await $.get("/api/specs");if(v.value=!0,o.status===404){h.value=!0;return}if(!o.ok){p.value=z(o,"load specs");return}p.value="",u.value=o.body.specs??[]}S(),g.deploymentsLoaded||L();const b=N(()=>{const o=new Map;for(const e of g.deployments){if(!e.specName)continue;const d=o.get(e.specName)??[];d.push(e.id),o.set(e.specName,d)}return o}),_=N(()=>{const o=m.value.trim().toLowerCase();return o?u.value.filter(e=>e.name.toLowerCase().includes(o)||(e.description??"").toLowerCase().includes(o)):u.value});return(o,e)=>{const d=D("RouterLink");return t(),a("div",null,[s("div",M,[s("div",null,[e[3]||(e[3]=s("h1",null,"Specs",-1)),s("div",P,[e[2]||(e[2]=l(" Stored once, used by any number of deployments ",-1)),c(w,{label:"why store a spec"},{default:y(()=>[...e[1]||(e[1]=[l(" Without this, every deployment carries its own copy — 50 open pull requests meant 50 identical files, and fixing a teardown step meant re-submitting it 50 times. ",-1)])]),_:1})])])]),p.value?(t(),x(F,{key:0,text:p.value,title:"Could not load the specs."},null,8,["text"])):f("",!0),h.value?(t(),a("section",W,[...e[4]||(e[4]=[s("div",{class:"banner plain"},[s("b",null,"This server has no stored specs."),s("p",null," It is an older build of pstack — every deployment carries its own copy of its spec, which still works. Upgrade the host to store specs and reference them by name. ")],-1)])])):(t(),a("section",G,[v.value?u.value.length?(t(),a(C,{key:1},[s("div",H,[e[5]||(e[5]=s("label",{for:"q"},"Search",-1)),B(s("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=n=>m.value=n),type:"search",placeholder:"name or description"},null,512),[[T,m.value]])]),s("table",J,[s("thead",null,[s("tr",null,[e[8]||(e[8]=s("th",null,"name",-1)),e[9]||(e[9]=s("th",null,"kind",-1)),s("th",null,[e[7]||(e[7]=l(" needs ",-1)),c(w,{label:"what needs means"},{default:y(()=>[...e[6]||(e[6]=[l(" Variables the spec uses but does not set. Every deployment referencing it must supply these, which is how one spec serves many stacks. ",-1)])]),_:1})]),e[10]||(e[10]=s("th",null,"used by",-1)),e[11]||(e[11]=s("th",null,"updated",-1))])]),s("tbody",K,[(t(!0),a(C,null,U(_.value,(n,V)=>{var k;return t(),a("tr",{key:n.name,style:I({"--i":V})},[s("td",O,[c(d,{to:`/specs/${encodeURIComponent(n.name)}`},{default:y(()=>[l(i(n.name),1)]),_:2},1032,["to"]),n.description?(t(),a("div",Q,i(n.description),1)):f("",!0)]),s("td",X,[s("span",{class:R(["badge",n.kind])},i(n.kind),3)]),s("td",Y,[n.requiredVars.length?(t(),a("span",Z,i(n.requiredVars.join(", ")),1)):(t(),a("span",ee,"nothing"))]),s("td",se,[(k=b.value.get(n.name))!=null&&k.length?(t(),a("span",te,i(b.value.get(n.name).length)+" deployment(s) ",1)):(t(),a("span",ne,"nothing yet"))]),s("td",oe,i(j(A)(n.updatedAt)),1)],4)}),128)),_.value.length?f("",!0):(t(),a("tr",ae,[s("td",le,"No spec matches “"+i(m.value)+"”.",1)]))])])],64)):(t(),a("div",ie,[e[15]||(e[15]=s("b",null,"No specs stored yet.",-1)),s("p",null,[e[13]||(e[13]=l(" A deployment can carry its own spec inline — see ",-1)),c(d,{to:"/submit"},{default:y(()=>[...e[12]||(e[12]=[l("Submit",-1)])]),_:1}),e[14]||(e[14]=l(" — and that is all you need for a one-off. Storing one here pays off when several deployments share it. ",-1))]),e[16]||(e[16]=s("p",{class:"mute"},[l(" Storing is not yet possible from this page; send the spec to "),s("code",null,"PUT /api/specs/<name>"),l(" with your token. ")],-1))])):(t(),x(E,{key:0,rows:3}))]))])}}});export{ce as default};
2
- //# sourceMappingURL=SpecsView-DZWFViN5.js.map
1
+ import{d as q,s as g,I as L,c as a,a as s,e as l,f as c,w as y,_ as w,h as x,g as f,F as C,x as B,y as T,r as U,t as i,j as r,k as $,p as z,m as N,n as D,o as t,q as I,v as R,b as j}from"./index-B4C7uKN0.js";import{s as A}from"./useFormat-CKJxQp_i.js";import{_ as E}from"./SkeletonList.vue_vue_type_script_setup_true_lang-B4p28Paq.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js";const M={class:"page-head"},P={class:"sub"},W={key:1,class:"panel"},G={key:2,class:"panel"},H={class:"field",style:{"max-width":"320px","margin-bottom":"var(--s4)"}},J={class:"cards","data-testid":"specs.list"},K={class:"stagger"},O={class:"name","data-label":"name"},Q={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},X={"data-label":"kind"},Y={"data-label":"needs"},Z={key:0},ee={key:1,class:"mute"},se={"data-label":"used by"},te={key:0},ne={key:1,class:"mute"},oe={class:"dim nowrap","data-label":"updated"},ae={key:0},le={colspan:"5",class:"mute"},ie={key:2,class:"banner plain"},ce=q({__name:"SpecsView",setup(de){const u=r([]),v=r(!1),p=r(""),h=r(!1),m=r("");async function S(){const o=await $.get("/api/specs");if(v.value=!0,o.status===404){h.value=!0;return}if(!o.ok){p.value=z(o,"load specs");return}p.value="",u.value=o.body.specs??[]}S(),g.deploymentsLoaded||L();const b=N(()=>{const o=new Map;for(const e of g.deployments){if(!e.specName)continue;const d=o.get(e.specName)??[];d.push(e.id),o.set(e.specName,d)}return o}),_=N(()=>{const o=m.value.trim().toLowerCase();return o?u.value.filter(e=>e.name.toLowerCase().includes(o)||(e.description??"").toLowerCase().includes(o)):u.value});return(o,e)=>{const d=D("RouterLink");return t(),a("div",null,[s("div",M,[s("div",null,[e[3]||(e[3]=s("h1",null,"Specs",-1)),s("div",P,[e[2]||(e[2]=l(" Stored once, used by any number of deployments ",-1)),c(w,{label:"why store a spec"},{default:y(()=>[...e[1]||(e[1]=[l(" Without this, every deployment carries its own copy — 50 open pull requests meant 50 identical files, and fixing a teardown step meant re-submitting it 50 times. ",-1)])]),_:1})])])]),p.value?(t(),x(F,{key:0,text:p.value,title:"Could not load the specs."},null,8,["text"])):f("",!0),h.value?(t(),a("section",W,[...e[4]||(e[4]=[s("div",{class:"banner plain"},[s("b",null,"This server has no stored specs."),s("p",null," It is an older build of pstack — every deployment carries its own copy of its spec, which still works. Upgrade the host to store specs and reference them by name. ")],-1)])])):(t(),a("section",G,[v.value?u.value.length?(t(),a(C,{key:1},[s("div",H,[e[5]||(e[5]=s("label",{for:"q"},"Search",-1)),B(s("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=n=>m.value=n),type:"search",placeholder:"name or description"},null,512),[[T,m.value]])]),s("table",J,[s("thead",null,[s("tr",null,[e[8]||(e[8]=s("th",null,"name",-1)),e[9]||(e[9]=s("th",null,"kind",-1)),s("th",null,[e[7]||(e[7]=l(" needs ",-1)),c(w,{label:"what needs means"},{default:y(()=>[...e[6]||(e[6]=[l(" Variables the spec uses but does not set. Every deployment referencing it must supply these, which is how one spec serves many stacks. ",-1)])]),_:1})]),e[10]||(e[10]=s("th",null,"used by",-1)),e[11]||(e[11]=s("th",null,"updated",-1))])]),s("tbody",K,[(t(!0),a(C,null,U(_.value,(n,V)=>{var k;return t(),a("tr",{key:n.name,style:I({"--i":V})},[s("td",O,[c(d,{to:`/specs/${encodeURIComponent(n.name)}`},{default:y(()=>[l(i(n.name),1)]),_:2},1032,["to"]),n.description?(t(),a("div",Q,i(n.description),1)):f("",!0)]),s("td",X,[s("span",{class:R(["badge",n.kind])},i(n.kind),3)]),s("td",Y,[n.requiredVars.length?(t(),a("span",Z,i(n.requiredVars.join(", ")),1)):(t(),a("span",ee,"nothing"))]),s("td",se,[(k=b.value.get(n.name))!=null&&k.length?(t(),a("span",te,i(b.value.get(n.name).length)+" deployment(s) ",1)):(t(),a("span",ne,"nothing yet"))]),s("td",oe,i(j(A)(n.updatedAt)),1)],4)}),128)),_.value.length?f("",!0):(t(),a("tr",ae,[s("td",le,"No spec matches “"+i(m.value)+"”.",1)]))])])],64)):(t(),a("div",ie,[e[15]||(e[15]=s("b",null,"No specs stored yet.",-1)),s("p",null,[e[13]||(e[13]=l(" A deployment can carry its own spec inline — see ",-1)),c(d,{to:"/submit"},{default:y(()=>[...e[12]||(e[12]=[l("Submit",-1)])]),_:1}),e[14]||(e[14]=l(" — and that is all you need for a one-off. Storing one here pays off when several deployments share it. ",-1))]),e[16]||(e[16]=s("p",{class:"mute"},[l(" Storing is not yet possible from this page; send the spec to "),s("code",null,"PUT /api/specs/<name>"),l(" with your token. ")],-1))])):(t(),x(E,{key:0,rows:3}))]))])}}});export{ce as default};
2
+ //# sourceMappingURL=SpecsView-Bib418qu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpecsView-DZWFViN5.js","sources":["../../src/views/SpecsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Stored specs: what is on this host, and who is using each one.\n *\n * The \"used by\" count is computed from the deployments already in shared state rather than asked\n * for: every row carries `specName`, so the join is free. It matters because deleting a spec that\n * deployments still reference is refused — a deployment that cannot resolve its spec can never be\n * torn down — so knowing the count before you try is the difference between a plan and a 409.\n *\n * A server built before named specs answers 404 here. That is a capability difference, not an\n * error, so it gets its own explanation instead of a red banner.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecMeta, SpecsResponse } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst specs = ref<SpecMeta[]>([]);\nconst loaded = ref(false);\nconst error = ref('');\nconst unsupported = ref(false);\nconst needle = ref('');\n\nasync function load(): Promise<void> {\n const r = await api.get<SpecsResponse>('/api/specs');\n loaded.value = true;\n if (r.status === 404) {\n unsupported.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load specs');\n return;\n }\n error.value = '';\n specs.value = r.body.specs ?? [];\n}\n\nvoid load();\n// The deployment list is what the \"used by\" column joins against; a deep link straight here may\n// arrive before the shell's poll has filled it.\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployment ids referencing each spec, by spec name. */\nconst users = computed(() => {\n const m = new Map<string, string[]>();\n for (const d of state.deployments) {\n if (!d.specName) continue;\n const list = m.get(d.specName) ?? [];\n list.push(d.id);\n m.set(d.specName, list);\n }\n return m;\n});\n\nconst shown = computed(() => {\n const q = needle.value.trim().toLowerCase();\n if (!q) return specs.value;\n return specs.value.filter(\n (s) => s.name.toLowerCase().includes(q) || (s.description ?? '').toLowerCase().includes(q),\n );\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Specs</h1>\n <div class=\"sub\">\n Stored once, used by any number of deployments\n <InfoHint label=\"why store a spec\">\n Without this, every deployment carries its own copy — 50 open pull requests meant 50\n identical files, and fixing a teardown step meant re-submitting it 50 times.\n </InfoHint>\n </div>\n </div>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load the specs.\" />\n\n <section v-if=\"unsupported\" class=\"panel\">\n <div class=\"banner plain\">\n <b>This server has no stored specs.</b>\n <p>\n It is an older build of pstack — every deployment carries its own copy of its spec, which\n still works. Upgrade the host to store specs and reference them by name.\n </p>\n </div>\n </section>\n\n <section v-else class=\"panel\">\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n\n <template v-else-if=\"specs.length\">\n <div class=\"field\" style=\"max-width: 320px; margin-bottom: var(--s4)\">\n <label for=\"q\">Search</label>\n <input id=\"q\" v-model=\"needle\" type=\"search\" placeholder=\"name or description\" />\n </div>\n\n <table class=\"cards\" data-testid=\"specs.list\">\n <thead>\n <tr>\n <th>name</th>\n <th>kind</th>\n <th>\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it must\n supply these, which is how one spec serves many stacks.\n </InfoHint>\n </th>\n <th>used by</th>\n <th>updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in shown\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"name\">\n <RouterLink :to=\"`/specs/${encodeURIComponent(s.name)}`\">{{ s.name }}</RouterLink>\n <div v-if=\"s.description\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ s.description }}\n </div>\n </td>\n <td data-label=\"kind\">\n <span class=\"badge\" :class=\"s.kind\">{{ s.kind }}</span>\n </td>\n <td data-label=\"needs\">\n <span v-if=\"s.requiredVars.length\">{{ s.requiredVars.join(', ') }}</span>\n <span v-else class=\"mute\">nothing</span>\n </td>\n <td data-label=\"used by\">\n <span v-if=\"users.get(s.name)?.length\">\n {{ users.get(s.name)!.length }} deployment(s)\n </span>\n <span v-else class=\"mute\">nothing yet</span>\n </td>\n <td class=\"dim nowrap\" data-label=\"updated\">{{ stamp(s.updatedAt) }}</td>\n </tr>\n <tr v-if=\"!shown.length\">\n <td colspan=\"5\" class=\"mute\">No spec matches “{{ needle }}”.</td>\n </tr>\n </tbody>\n </table>\n </template>\n\n <!--\n Honest empty state. This page cannot create a spec yet, so pointing at \"New spec\" would be a\n dead end — it names the way that does work instead.\n -->\n <div v-else class=\"banner plain\">\n <b>No specs stored yet.</b>\n <p>\n A deployment can carry its own spec inline — see\n <RouterLink to=\"/submit\">Submit</RouterLink> — and that is all you need for a one-off.\n Storing one here pays off when several deployments share it.\n </p>\n <p class=\"mute\">\n Storing is not yet possible from this page; send the spec to\n <code>PUT /api/specs/&lt;name&gt;</code> with your token.\n </p>\n </div>\n </section>\n </div>\n</template>\n"],"names":["specs","ref","loaded","error","unsupported","needle","load","r","api","problem","state","loadDeployments","users","computed","m","d","list","shown","q","s","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","_createBlock","ErrorNote","_openBlock","_hoisted_3","_hoisted_4","_Fragment","_hoisted_5","$event","_hoisted_6","_hoisted_7","_renderList","i","_hoisted_8","_component_RouterLink","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_normalizeClass","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_a","_hoisted_15","_hoisted_16","_hoisted_17","_unref","_hoisted_18","_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BG,EAEK,KAAAmC,GAAA,CADHlC,EAAiE,KAAjEmC,GAA6B,oBAAiBd,EAAGrC,EAAA,KAAM,EAAG,KAAE,CAAA,CAAA,eAUpEwB,IAAAT,EAWM,MAXNqC,GAWM,CAVJlC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA2B,SAAxB,uBAAoB,EAAA,GACvBA,EAII,IAAA,KAAA,iBAJD,qDAED,EAAA,GAAAI,EAA4Ce,EAAA,CAAhC,GAAG,WAAS,WAAC,IAAM,CAAA,GAAAjB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAAN,SAAM,EAAA,CAAA,2BAAa,2GAE9C,EAAA,EAAA,iBACAF,EAGI,IAAA,CAHD,MAAM,QAAM,GAAC,gEAEd,EAAAA,EAAwC,YAAlC,uBAA2B,IAAO,oBAC1C,CAAA,eApEFM,EAAyC+B,EAAA,OAAX,KAAM,CAAA"}
1
+ {"version":3,"file":"SpecsView-Bib418qu.js","sources":["../../src/views/SpecsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Stored specs: what is on this host, and who is using each one.\n *\n * The \"used by\" count is computed from the deployments already in shared state rather than asked\n * for: every row carries `specName`, so the join is free. It matters because deleting a spec that\n * deployments still reference is refused — a deployment that cannot resolve its spec can never be\n * torn down — so knowing the count before you try is the difference between a plan and a 409.\n *\n * A server built before named specs answers 404 here. That is a capability difference, not an\n * error, so it gets its own explanation instead of a red banner.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecMeta, SpecsResponse } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst specs = ref<SpecMeta[]>([]);\nconst loaded = ref(false);\nconst error = ref('');\nconst unsupported = ref(false);\nconst needle = ref('');\n\nasync function load(): Promise<void> {\n const r = await api.get<SpecsResponse>('/api/specs');\n loaded.value = true;\n if (r.status === 404) {\n unsupported.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load specs');\n return;\n }\n error.value = '';\n specs.value = r.body.specs ?? [];\n}\n\nvoid load();\n// The deployment list is what the \"used by\" column joins against; a deep link straight here may\n// arrive before the shell's poll has filled it.\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployment ids referencing each spec, by spec name. */\nconst users = computed(() => {\n const m = new Map<string, string[]>();\n for (const d of state.deployments) {\n if (!d.specName) continue;\n const list = m.get(d.specName) ?? [];\n list.push(d.id);\n m.set(d.specName, list);\n }\n return m;\n});\n\nconst shown = computed(() => {\n const q = needle.value.trim().toLowerCase();\n if (!q) return specs.value;\n return specs.value.filter(\n (s) => s.name.toLowerCase().includes(q) || (s.description ?? '').toLowerCase().includes(q),\n );\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Specs</h1>\n <div class=\"sub\">\n Stored once, used by any number of deployments\n <InfoHint label=\"why store a spec\">\n Without this, every deployment carries its own copy — 50 open pull requests meant 50\n identical files, and fixing a teardown step meant re-submitting it 50 times.\n </InfoHint>\n </div>\n </div>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load the specs.\" />\n\n <section v-if=\"unsupported\" class=\"panel\">\n <div class=\"banner plain\">\n <b>This server has no stored specs.</b>\n <p>\n It is an older build of pstack — every deployment carries its own copy of its spec, which\n still works. Upgrade the host to store specs and reference them by name.\n </p>\n </div>\n </section>\n\n <section v-else class=\"panel\">\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n\n <template v-else-if=\"specs.length\">\n <div class=\"field\" style=\"max-width: 320px; margin-bottom: var(--s4)\">\n <label for=\"q\">Search</label>\n <input id=\"q\" v-model=\"needle\" type=\"search\" placeholder=\"name or description\" />\n </div>\n\n <table class=\"cards\" data-testid=\"specs.list\">\n <thead>\n <tr>\n <th>name</th>\n <th>kind</th>\n <th>\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it must\n supply these, which is how one spec serves many stacks.\n </InfoHint>\n </th>\n <th>used by</th>\n <th>updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in shown\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"name\">\n <RouterLink :to=\"`/specs/${encodeURIComponent(s.name)}`\">{{ s.name }}</RouterLink>\n <div v-if=\"s.description\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ s.description }}\n </div>\n </td>\n <td data-label=\"kind\">\n <span class=\"badge\" :class=\"s.kind\">{{ s.kind }}</span>\n </td>\n <td data-label=\"needs\">\n <span v-if=\"s.requiredVars.length\">{{ s.requiredVars.join(', ') }}</span>\n <span v-else class=\"mute\">nothing</span>\n </td>\n <td data-label=\"used by\">\n <span v-if=\"users.get(s.name)?.length\">\n {{ users.get(s.name)!.length }} deployment(s)\n </span>\n <span v-else class=\"mute\">nothing yet</span>\n </td>\n <td class=\"dim nowrap\" data-label=\"updated\">{{ stamp(s.updatedAt) }}</td>\n </tr>\n <tr v-if=\"!shown.length\">\n <td colspan=\"5\" class=\"mute\">No spec matches “{{ needle }}”.</td>\n </tr>\n </tbody>\n </table>\n </template>\n\n <!--\n Honest empty state. This page cannot create a spec yet, so pointing at \"New spec\" would be a\n dead end — it names the way that does work instead.\n -->\n <div v-else class=\"banner plain\">\n <b>No specs stored yet.</b>\n <p>\n A deployment can carry its own spec inline — see\n <RouterLink to=\"/submit\">Submit</RouterLink> — and that is all you need for a one-off.\n Storing one here pays off when several deployments share it.\n </p>\n <p class=\"mute\">\n Storing is not yet possible from this page; send the spec to\n <code>PUT /api/specs/&lt;name&gt;</code> with your token.\n </p>\n </div>\n </section>\n </div>\n</template>\n"],"names":["specs","ref","loaded","error","unsupported","needle","load","r","api","problem","state","loadDeployments","users","computed","m","d","list","shown","q","s","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","_createBlock","ErrorNote","_openBlock","_hoisted_3","_hoisted_4","_Fragment","_hoisted_5","$event","_hoisted_6","_hoisted_7","_renderList","i","_hoisted_8","_component_RouterLink","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_normalizeClass","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_a","_hoisted_15","_hoisted_16","_hoisted_17","_unref","_hoisted_18","_hoisted_19","_hoisted_20","SkeletonList"],"mappings":"ihCAqBA,MAAMA,EAAQC,EAAgB,EAAE,EAC1BC,EAASD,EAAI,EAAK,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAcH,EAAI,EAAK,EACvBI,EAASJ,EAAI,EAAE,EAErB,eAAeK,GAAsB,CACnC,MAAMC,EAAI,MAAMC,EAAI,IAAmB,YAAY,EAEnD,GADAN,EAAO,MAAQ,GACXK,EAAE,SAAW,IAAK,CACpBH,EAAY,MAAQ,GACpB,MACF,CACA,GAAI,CAACG,EAAE,GAAI,CACTJ,EAAM,MAAQM,EAAQF,EAAG,YAAY,EACrC,MACF,CACAJ,EAAM,MAAQ,GACdH,EAAM,MAAQO,EAAE,KAAK,OAAS,CAAA,CAChC,CAEKD,EAAA,EAGAI,EAAM,mBAAwBC,EAAA,EAGnC,MAAMC,EAAQC,EAAS,IAAM,CAC3B,MAAMC,MAAQ,IACd,UAAWC,KAAKL,EAAM,YAAa,CACjC,GAAI,CAACK,EAAE,SAAU,SACjB,MAAMC,EAAOF,EAAE,IAAIC,EAAE,QAAQ,GAAK,CAAA,EAClCC,EAAK,KAAKD,EAAE,EAAE,EACdD,EAAE,IAAIC,EAAE,SAAUC,CAAI,CACxB,CACA,OAAOF,CACT,CAAC,EAEKG,EAAQJ,EAAS,IAAM,CAC3B,MAAMK,EAAIb,EAAO,MAAM,KAAA,EAAO,YAAA,EAC9B,OAAKa,EACElB,EAAM,MAAM,OAChBmB,GAAMA,EAAE,KAAK,cAAc,SAASD,CAAC,IAAMC,EAA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AAA+B,EAAmB,YAA/B9B,EAEO,OAAA+B,GAAAT,EADF9B,EAAA,MAAM,IAAIO,EAAE,IAAI,EAAG,MAAM,EAAG,kBACjC,CAAA,QACAC,EAA4C,OAA5CgC,GAA0B,aAAW,EAAA,GAEvC/B,EAAyE,KAAzEgC,GAAyEX,EAA1BY,KAAMnC,EAAE,SAAS,CAAA,EAAA,CAAA,CAAA,aAEvDF,EAAA,MAAM,qBAAjBG,EAEK,KAAAmC,GAAA,CADHlC,EAAiE,KAAjEmC,GAA6B,oBAAiBd,EAAGrC,EAAA,KAAM,EAAG,KAAE,CAAA,CAAA,eAUpEwB,IAAAT,EAWM,MAXNqC,GAWM,CAVJlC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA2B,SAAxB,uBAAoB,EAAA,GACvBA,EAII,IAAA,KAAA,iBAJD,qDAED,EAAA,GAAAI,EAA4Ce,EAAA,CAAhC,GAAG,WAAS,WAAC,IAAM,CAAA,GAAAjB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAAN,SAAM,EAAA,CAAA,2BAAa,2GAE9C,EAAA,EAAA,iBACAF,EAGI,IAAA,CAHD,MAAM,QAAM,GAAC,gEAEd,EAAAA,EAAwC,YAAlC,uBAA2B,IAAO,oBAC1C,CAAA,eApEFM,EAAyC+B,EAAA,OAAX,KAAM,CAAA"}
@@ -1,2 +1,2 @@
1
- import{d as t,c as s,v as n,a as o,e as r,t as l,o as c}from"./index-CrxqzmXu.js";const m=t({__name:"StateBadge",props:{state:{}},setup(e){return(p,a)=>(c(),s("span",{class:n(["badge",e.state])},[a[0]||(a[0]=o("span",{class:"dot"},null,-1)),r(" "+l(e.state),1)],2))}});export{m as _};
2
- //# sourceMappingURL=StateBadge.vue_vue_type_script_setup_true_lang-FqyOZ8sk.js.map
1
+ import{d as t,c as s,v as n,a as o,e as r,t as l,o as c}from"./index-B4C7uKN0.js";const m=t({__name:"StateBadge",props:{state:{}},setup(e){return(p,a)=>(c(),s("span",{class:n(["badge",e.state])},[a[0]||(a[0]=o("span",{class:"dot"},null,-1)),r(" "+l(e.state),1)],2))}});export{m as _};
2
+ //# sourceMappingURL=StateBadge.vue_vue_type_script_setup_true_lang-BBoSnS4z.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"StateBadge.vue_vue_type_script_setup_true_lang-FqyOZ8sk.js","sources":["../../src/components/StateBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The four job states, and only the four. Kept in one component so the colour of `leaked` can\n * never drift from the colour of `failed` in one view and not another:\n *\n * ok green · failed red · leaked AMBER · running blue, pulsing\n *\n * `leaked` must be unmistakably distinct from `failed`. They are different problems with different\n * owners — \"teardown errored\" versus \"teardown ran and something survived\" — which is why the CLI\n * gives leaked its own exit code, and why this app never renders them in the same colour.\n */\nimport type { JobState } from '../api/types';\n\ndefineProps<{ state: JobState }>();\n</script>\n\n<template>\n <span class=\"badge\" :class=\"state\">\n <span class=\"dot\" />\n {{ state }}\n </span>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_createElementVNode","_createTextVNode"],"mappings":"6JAiBEA,EAGO,OAAA,CAHD,MAAKC,EAAA,CAAC,QAAgBC,EAAA,KAAK,CAAA,CAAA,eAC/BC,EAAoB,OAAA,CAAd,MAAM,KAAA,EAAK,KAAA,EAAA,GAAGC,EAAA,MACjBF,EAAA,KAAK,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"StateBadge.vue_vue_type_script_setup_true_lang-BBoSnS4z.js","sources":["../../src/components/StateBadge.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The four job states, and only the four. Kept in one component so the colour of `leaked` can\n * never drift from the colour of `failed` in one view and not another:\n *\n * ok green · failed red · leaked AMBER · running blue, pulsing\n *\n * `leaked` must be unmistakably distinct from `failed`. They are different problems with different\n * owners — \"teardown errored\" versus \"teardown ran and something survived\" — which is why the CLI\n * gives leaked its own exit code, and why this app never renders them in the same colour.\n */\nimport type { JobState } from '../api/types';\n\ndefineProps<{ state: JobState }>();\n</script>\n\n<template>\n <span class=\"badge\" :class=\"state\">\n <span class=\"dot\" />\n {{ state }}\n </span>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_createElementVNode","_createTextVNode"],"mappings":"6JAiBEA,EAGO,OAAA,CAHD,MAAKC,EAAA,CAAC,QAAgBC,EAAA,KAAK,CAAA,CAAA,eAC/BC,EAAoB,OAAA,CAAd,MAAM,KAAA,EAAK,KAAA,EAAA,GAAGC,EAAA,MACjBF,EAAA,KAAK,EAAA,CAAA,CAAA"}
@@ -0,0 +1,45 @@
1
+ import{d as X,j as c,k as E,B as j,c as n,a as t,t as p,e as s,f as v,w as m,_ as A,F as w,g as y,v as G,x as S,y as N,N as M,z as J,r as D,h as Q,m as U,n as Y,o as a,O as Z,I as _,H as ee,p as te,M as F}from"./index-B4C7uKN0.js";import{a as se,w as oe,p as O,r as le}from"./useVars-VN9gYdR6.js";import{_ as ae}from"./ActionButton.vue_vue_type_script_setup_true_lang-B1iO-Hbs.js";import{_ as ne}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BJpi4S3s.js";import{_ as ie}from"./VarEditor.vue_vue_type_script_setup_true_lang-CjFu7uoM.js";const re={class:"page-head"},de={class:"sub"},ue={class:"panel"},pe={class:"dim"},ve={key:0,class:"banner warn"},me={key:0},ye={key:1},fe={key:2},ce={key:3},he={key:2,class:"banner warn"},ke={class:"row",style:{"margin-bottom":"var(--s4)"}},be={class:"field",style:{"max-width":"280px"}},ge={class:"mute",style:{"align-self":"end","padding-bottom":"10px"}},we={key:3,class:"row",style:{"margin-bottom":"var(--s4)"}},Se={class:"check"},xe={class:"check"},Ce={class:"field",style:{"max-width":"340px"}},$e=["value"],Re={key:0,class:"hint"},Ve={key:0},Ae={key:1},Te={key:2},Le={class:"field"},Ie={class:"field",style:{"margin-top":"var(--s3)"}},Ue={class:"hint"},Ee={class:"hint"},Ne={class:"row",style:{"margin-top":"var(--s5)"}},Pe={key:0,class:"s-ok"},We={key:6,class:"banner warn"},je={key:0},Me=`version: 1
2
+ kind: isolated
3
+
4
+ # The stack identity: the compose project name, and $STACK inside every hook.
5
+ # \${PR} is interpolated ONCE, at resolve time, from the variables sent with the request.
6
+ stack: pr-\${PR}
7
+
8
+ env:
9
+ PREVIEW_DOMAIN: preview.example.com
10
+
11
+ compose:
12
+ file: compose.yml
13
+ # Every service sits behind a profile so a bare \`up\` starts nothing.
14
+ # \`down\` always enables ALL of them — otherwise the unselected profiles' network leaks.
15
+ profiles: [app]
16
+
17
+ requires:
18
+ - name: traefik-network
19
+ assert: docker network inspect traefik >/dev/null 2>&1
20
+ hint: run \`pstack init\` on the host first
21
+
22
+ axes:
23
+ # Hooks run from the deployment directory, which holds only spec.yml and compose.yml —
24
+ # so use inline shell or absolute paths, never ./hooks/foo.sh.
25
+ - name: scratch
26
+ up: mkdir -p /tmp/$STACK
27
+ assert_live: test -d /tmp/$STACK
28
+ down: rm -rf /tmp/$STACK
29
+ # assert_gone MUST FAIL CLOSED. A bare \`! <probe>\` reports "gone" whenever the probe fails
30
+ # for any reason — a missing CLI, an expired token — turning "I could not tell" into
31
+ # "it is gone", a false negative on the one thing this tool exists to catch.
32
+ assert_gone: |
33
+ test -d /tmp || exit 1
34
+ ! test -d /tmp/$STACK
35
+ `,De=`services:
36
+ app:
37
+ image: nginx:alpine
38
+ profiles: [app]
39
+ labels:
40
+ - traefik.enable=true
41
+ `,ze=X({__name:"SubmitView",props:{id:{}},setup(P){const T=P,l=c({id:T.id??"",spec:"",compose:""}),h=c([{k:"",v:""}]),k=c("inline"),x=c(""),C=c(!1),g=c(""),u=c(null),$=c([]);E.get("/api/specs").then(o=>{o.ok&&Array.isArray(o.body.specs)&&($.value=o.body.specs)});const R=U(()=>$.value.find(o=>o.name===x.value)),L=U(()=>!!T.id),q=Z(),V=U(()=>{const o=q.query.from;return typeof o=="string"&&o?o:null}),f=c("idle"),b=c(null);async function W(o){f.value="loading",b.value=null;const e=await E.getAuthed(`/api/deployments/${encodeURIComponent(o)}/source`);if(e.status===404||!e.ok){f.value="failed";return}if(e.body.sourceWithheld){f.value="withheld",e.body.specName&&(b.value=e.body.specName);return}l.value.spec||(l.value.spec=e.body.spec??""),l.value.compose||(l.value.compose=e.body.compose??""),e.body.specName&&(b.value=e.body.specName),f.value="loaded"}j(V,async o=>{var r;if(!o||T.id)return;g.value="",u.value=null,l.value.spec="",l.value.compose="";const e=(r=F(o))==null?void 0:r.vars;e&&(h.value=O(e)),await W(o),l.value.id=""},{immediate:!0}),j(()=>T.id,o=>{var d;if(g.value="",u.value=null,f.value="idle",b.value=null,!o)return;o!==l.value.id&&(l.value.spec="",l.value.compose=""),l.value.id=o;const e=(d=F(o))==null?void 0:d.vars,r=e?O(e):le(o);r.some(I=>I.k)&&(h.value=r),W(o)},{immediate:!0});const B=U(()=>!!l.value.id&&(k.value==="stored"?!!x.value:!!l.value.spec.trim())&&!C.value);async function K(){C.value=!0,g.value="",u.value=null;const o=l.value.id,e=se(h.value),r={vars:e,env:e};k.value==="stored"?r.specName=x.value:(r.spec=l.value.spec,l.value.compose.trim()&&(r.compose=l.value.compose));const d=await E.put(`/api/deployments/${encodeURIComponent(o)}`,r);if(C.value=!1,d.status===200||d.status===201){u.value={id:d.body.id??o,stack:d.body.stack??"?",created:d.status===201,stackSharedWith:d.body.stackSharedWith},oe(o,h.value),_(),ee("ok",`${d.status===201?"Created":"Replaced"} ${o} → ${u.value.stack}`,{to:`/deployments/${encodeURIComponent(o)}`,toLabel:"Open"});return}g.value=te(d,"save this deployment")}function z(){k.value="inline",l.value.spec=Me,l.value.compose.trim()||(l.value.compose=De),l.value.id||(l.value.id="pr-123"),h.value.some(o=>o.k)||(h.value=[{k:"PR",v:"123"}])}return(o,e)=>{var d,I;const r=Y("RouterLink");return a(),n("div",null,[t("div",re,[t("div",null,[t("h1",null,p(L.value?"Edit a deployment":V.value?"Duplicate a deployment":"Submit a deployment"),1),t("div",de,p(L.value?"Loaded from what is stored; saving replaces the record":V.value?`Copied from ${V.value} — give it a new id, then edit`:"Stores a spec so it can be deployed"),1)]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),t("button",{class:"ghost",onClick:z},"Load example spec")]),t("section",ue,[t("p",pe,[e[9]||(e[9]=s(" Nothing is saved until the spec is valid. ",-1)),v(A,{label:"what happens on a rejected submission"},{default:m(()=>[...e[8]||(e[8]=[s(" The spec is checked before anything is written, so a rejected submission leaves nothing behind — and a replace never destroys a good record over a typo. Whether the deployment is shared or isolated comes from the spec, not from this form. ",-1)])]),_:1})]),V.value&&!L.value?(a(),n("div",ve,[e[22]||(e[22]=t("b",null,"Change the stack, not just the id.",-1)),t("p",null,[e[13]||(e[13]=s(" Two deployments that resolve to the same ",-1)),e[14]||(e[14]=t("code",null,"stack",-1)),e[15]||(e[15]=s(" drive the same compose project — ",-1)),e[16]||(e[16]=t("code",null,"down",-1)),e[17]||(e[17]=s(" on either stops the other's containers. If the stack interpolates a variable (",-1)),e[18]||(e[18]=t("code",null,"pr-${PR}",-1)),e[19]||(e[19]=s(") give it a different value below; if it is a literal, edit the ",-1)),e[20]||(e[20]=t("code",null,"stack:",-1)),e[21]||(e[21]=s(" line. ",-1)),f.value==="withheld"?(a(),n(w,{key:0},[e[11]||(e[11]=s(" The spec could not be copied without an access token — ",-1)),v(r,{to:"/settings"},{default:m(()=>[...e[10]||(e[10]=[s("add yours",-1)])]),_:1}),e[12]||(e[12]=s(". ",-1))],64)):y("",!0)])])):y("",!0),L.value?(a(),n("div",{key:1,class:G(["banner",f.value==="loaded"?"info":"warn"])},[t("b",null,"Replacing "+p(P.id)+".",1),f.value==="loading"?(a(),n("p",me,"Loading what is stored…")):f.value==="loaded"?(a(),n("p",ye," Loaded from the stored record — edit it and save. Saving replaces the record outright, so anything you delete here stops being tracked while whatever it created keeps running. ")):f.value==="withheld"?(a(),n("p",fe,[e[24]||(e[24]=s(" The stored spec was not loaded: reading it needs an access token, because hooks routinely carry a credential inline. ",-1)),v(r,{to:"/settings"},{default:m(()=>[...e[23]||(e[23]=[s("Add your token",-1)])]),_:1}),e[25]||(e[25]=s(" to edit in place — otherwise paste the ",-1)),e[26]||(e[26]=t("b",null,"complete",-1)),e[27]||(e[27]=s(" spec, since anything you leave out stops being tracked. ",-1))])):(a(),n("p",ce,[...e[28]||(e[28]=[s(" The stored spec could not be loaded, so this form is empty. Paste the ",-1),t("b",null,"complete",-1),s(" spec you want stored — anything you leave out stops being tracked while whatever it created keeps running. ",-1)])]))],2)):y("",!0),b.value?(a(),n("div",he,[t("b",null,"This deployment tracks the stored spec “"+p(b.value)+"”.",1),t("p",null,[e[30]||(e[30]=s(" Saving here writes a private copy and stops it following that spec. To change every deployment using it, edit ",-1)),v(r,{to:`/specs/${encodeURIComponent(b.value)}`},{default:m(()=>[...e[29]||(e[29]=[s("the spec",-1)])]),_:1},8,["to"]),e[31]||(e[31]=s(" instead. ",-1))])])):y("",!0),t("div",ke,[t("div",be,[e[32]||(e[32]=t("label",{for:"did"},"Deployment id",-1)),S(t("input",{id:"did","onUpdate:modelValue":e[0]||(e[0]=i=>l.value.id=i),type:"text",placeholder:"pr-123",spellcheck:"false",autocomplete:"off"},null,512),[[N,l.value.id,void 0,{trim:!0}]])]),t("span",ge,[e[34]||(e[34]=s(" Lower case ",-1)),v(A,{label:"allowed characters in a deployment id"},{default:m(()=>[...e[33]||(e[33]=[s(" Starts with a letter or digit, then letters, digits, dot, dash or underscore. Up to 64 characters — ",-1),t("code",null,"[a-z0-9][a-z0-9._-]{0,63}",-1),s(". ",-1)])]),_:1})])]),$.value.length?(a(),n("div",we,[t("label",Se,[S(t("input",{"onUpdate:modelValue":e[1]||(e[1]=i=>k.value=i),type:"radio",value:"inline"},null,512),[[M,k.value]]),e[35]||(e[35]=s(" inline spec ",-1))]),t("label",xe,[S(t("input",{"onUpdate:modelValue":e[2]||(e[2]=i=>k.value=i),type:"radio",value:"stored"},null,512),[[M,k.value]]),e[36]||(e[36]=s(" reference a stored spec ",-1))])])):y("",!0),k.value==="stored"&&$.value.length?(a(),n(w,{key:4},[t("div",Ce,[e[38]||(e[38]=t("label",{for:"sn"},"Stored spec",-1)),S(t("select",{id:"sn","onUpdate:modelValue":e[3]||(e[3]=i=>x.value=i)},[e[37]||(e[37]=t("option",{value:""},"— choose —",-1)),(a(!0),n(w,null,D($.value,i=>(a(),n("option",{key:i.name,value:i.name},p(i.name)+" ("+p(i.kind)+") ",9,$e))),128))],512),[[J,x.value]])]),R.value?(a(),n("p",Re,[R.value.description?(a(),n("span",Ve,p(R.value.description)+" — ",1)):y("",!0),e[40]||(e[40]=s(" needs ",-1)),R.value.requiredVars.length?(a(),n("b",Ae,p(R.value.requiredVars.join(", ")),1)):(a(),n("span",Te,"no variables")),e[41]||(e[41]=s(". ",-1)),v(A,{label:"why variables are required"},{default:m(()=>[...e[39]||(e[39]=[s(" A missing variable is refused by name. It is never filled in with a blank, which would silently give every deployment the same stack name. ",-1)])]),_:1})])):y("",!0)],64)):(a(),n(w,{key:5},[t("div",Le,[e[42]||(e[42]=t("label",{for:"spec"},"spec.yml",-1)),S(t("textarea",{id:"spec","onUpdate:modelValue":e[4]||(e[4]=i=>l.value.spec=i),rows:"18",spellcheck:"false",placeholder:`version: 1
42
+ kind: isolated
43
+ stack: pr-\${PR}
44
+ axes: []`},null,512),[[N,l.value.spec]])]),t("div",Ie,[e[43]||(e[43]=t("label",{for:"compose"},[s("compose.yml "),t("span",{class:"mute"},"(optional)")],-1)),S(t("textarea",{id:"compose","onUpdate:modelValue":e[5]||(e[5]=i=>l.value.compose=i),rows:"8",spellcheck:"false",placeholder:"Written next to spec.yml, so a compose file named compose.yml resolves"},null,512),[[N,l.value.compose]])]),t("p",Ue,[e[45]||(e[45]=s(" Hooks must be inline shell or an absolute path. ",-1)),v(A,{label:"why a relative script path does not work"},{default:m(()=>[...e[44]||(e[44]=[s(" A deployment directory only ever holds ",-1),t("code",null,"spec.yml",-1),s(" and ",-1),t("code",null,"compose.yml",-1),s(", and hooks run from there — so ",-1),t("code",null,"up: ./hooks/db.sh",-1),s(" has nothing to find. ",-1)])]),_:1})])],64)),e[56]||(e[56]=t("h2",{class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},"Variables",-1)),v(ie,{modelValue:h.value,"onUpdate:modelValue":e[6]||(e[6]=i=>h.value=i)},null,8,["modelValue"]),t("p",Ee,[e[47]||(e[47]=s(" Saved with the deployment, so tearing it down later targets the same stack. ",-1)),v(A,{label:"how variables are remembered"},{default:m(()=>[...e[46]||(e[46]=[s(" They are stored on the server where it supports that, and in this browser either way — so the actions on the deployment page send exactly these values. ",-1)])]),_:1})]),t("div",Ne,[v(ae,{variant:"primary",pending:C.value,disabled:!B.value,onClick:K},{default:m(()=>[s(p(C.value?"submitting…":"Submit"),1)]),_:1},8,["pending","disabled"]),u.value?(a(),n("span",Pe,[s(p(u.value.created?"Created":"Replaced")+" — stack ",1),t("b",null,p(u.value.stack),1),v(r,{to:`/deployments/${encodeURIComponent(u.value.id)}`,style:{"margin-left":"8px"}},{default:m(()=>[...e[48]||(e[48]=[s(" open → ",-1)])]),_:1},8,["to"])])):y("",!0)]),(I=(d=u.value)==null?void 0:d.stackSharedWith)!=null&&I.length?(a(),n("div",We,[t("b",null,"Another deployment already resolves to stack “"+p(u.value.stack)+"”.",1),t("p",null,[(a(!0),n(w,null,D(u.value.stackSharedWith,(i,H)=>(a(),n(w,{key:i},[v(r,{to:`/deployments/${encodeURIComponent(i)}`},{default:m(()=>[s(p(i),1)]),_:2},1032,["to"]),H<u.value.stackSharedWith.length-1?(a(),n("span",je,", ")):y("",!0)],64))),128)),e[49]||(e[49]=s("— both records now drive the same compose project, so ",-1)),e[50]||(e[50]=t("code",null,"down",-1)),e[51]||(e[51]=s(" on either stops the other's containers and ",-1)),e[52]||(e[52]=t("code",null,"verify",-1)),e[53]||(e[53]=s(" on either reports the other's leaks. If that was not intended, change this one's ",-1)),e[54]||(e[54]=t("code",null,"stack",-1)),e[55]||(e[55]=s(" and save again. ",-1))])])):y("",!0),g.value?(a(),Q(ne,{key:7,text:g.value,title:"The server rejected this submission."},null,8,["text"])):y("",!0)])])}}});export{ze as default};
45
+ //# sourceMappingURL=SubmitView-DoVltkUx.js.map