@samyx/preview-stacks-ui 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js → ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js.map → ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js.map} +1 -1
- package/dist/assets/AxesTab-BZZXKEC0.js +2 -0
- package/dist/assets/{AxesTab-DkF15gUV.js.map → AxesTab-BZZXKEC0.js.map} +1 -1
- package/dist/assets/ConfigTab-CFbS48D0.js +2 -0
- package/dist/assets/ConfigTab-CFbS48D0.js.map +1 -0
- package/dist/assets/{DangerTab-BOrQMzL3.js → DangerTab-Nyebdr6k.js} +2 -2
- package/dist/assets/{DangerTab-BOrQMzL3.js.map → DangerTab-Nyebdr6k.js.map} +1 -1
- package/dist/assets/DashboardView-CFwb63EX.js +2 -0
- package/dist/assets/DashboardView-CFwb63EX.js.map +1 -0
- package/dist/assets/DeploymentDetailView-DKCUbiGG.js +2 -0
- package/dist/assets/{DeploymentDetailView-D23-qn3Z.js.map → DeploymentDetailView-DKCUbiGG.js.map} +1 -1
- package/dist/assets/DeploymentsView-BX4GOb2A.js +2 -0
- package/dist/assets/DeploymentsView-BX4GOb2A.js.map +1 -0
- package/dist/assets/EquivalentCommand-BFnZRfDg.css +1 -0
- package/dist/assets/EquivalentCommand-w1nGowVi.js +3 -0
- package/dist/assets/EquivalentCommand-w1nGowVi.js.map +1 -0
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js → ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js.map} +1 -1
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-TcgJr2CB.js +2 -0
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-TcgJr2CB.js.map +1 -0
- package/dist/assets/JobDetailView-ow1_d8lc.js +2 -0
- package/dist/assets/{JobDetailView-ByaH2ylY.js.map → JobDetailView-ow1_d8lc.js.map} +1 -1
- package/dist/assets/JobsView-Boi9Cmdc.js +2 -0
- package/dist/assets/JobsView-Boi9Cmdc.js.map +1 -0
- package/dist/assets/LoginView-1ZpxP8a9.js +2 -0
- package/dist/assets/LoginView-1ZpxP8a9.js.map +1 -0
- package/dist/assets/LoginView-BFIG7vGw.css +1 -0
- package/dist/assets/LogsTab-Bgev0F7g.js +4 -0
- package/dist/assets/LogsTab-Bgev0F7g.js.map +1 -0
- package/dist/assets/{NotFoundView-BN-7ZNip.js → NotFoundView-BhCKBrlY.js} +2 -2
- package/dist/assets/{NotFoundView-BN-7ZNip.js.map → NotFoundView-BhCKBrlY.js.map} +1 -1
- package/dist/assets/NotifiersView-DN9UiqDs.js +2 -0
- package/dist/assets/NotifiersView-DN9UiqDs.js.map +1 -0
- package/dist/assets/{OverviewTab-BI1DZZxS.js → OverviewTab-DzZG0moV.js} +2 -2
- package/dist/assets/{OverviewTab-BI1DZZxS.js.map → OverviewTab-DzZG0moV.js.map} +1 -1
- package/dist/assets/RegistriesView-CPyfKKWJ.js +2 -0
- package/dist/assets/RegistriesView-CPyfKKWJ.js.map +1 -0
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js +2 -0
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-lQaz4t05.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js.map} +1 -1
- package/dist/assets/{RequiresTab-B9YauFIz.js → RequiresTab-CjNRorI5.js} +2 -2
- package/dist/assets/{RequiresTab-B9YauFIz.js.map → RequiresTab-CjNRorI5.js.map} +1 -1
- package/dist/assets/RoutingView-Br16pPwF.js +9 -0
- package/dist/assets/RoutingView-Br16pPwF.js.map +1 -0
- package/dist/assets/RuntimeTab-BssqRUYz.js +2 -0
- package/dist/assets/{RuntimeTab-DvrQFekD.js.map → RuntimeTab-BssqRUYz.js.map} +1 -1
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js +2 -0
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js.map +1 -0
- package/dist/assets/SettingsView-Cqsv0chw.js +2 -0
- package/dist/assets/SettingsView-Cqsv0chw.js.map +1 -0
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-SxitAmDb.js → SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-SxitAmDb.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js.map} +1 -1
- package/dist/assets/SpecDetailView-P6Kk7cwx.js +2 -0
- package/dist/assets/{SpecDetailView-CViJ8WG_.js.map → SpecDetailView-P6Kk7cwx.js.map} +1 -1
- package/dist/assets/SpecsView-DogEWlyZ.js +2 -0
- package/dist/assets/SpecsView-DogEWlyZ.js.map +1 -0
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js +2 -0
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CgDXVhMF.js.map → StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js.map} +1 -1
- package/dist/assets/SubmitView-CufYXtWD.js +45 -0
- package/dist/assets/SubmitView-CufYXtWD.js.map +1 -0
- package/dist/assets/Teleport-0BmaJsBF.js +4 -0
- package/dist/assets/Teleport-0BmaJsBF.js.map +1 -0
- package/dist/assets/{TerminalTab-Bqulz6Eb.css → TerminalTab-4vbfGB2S.css} +1 -1
- package/dist/assets/TerminalTab-DndloIiD.js +3 -0
- package/dist/assets/TerminalTab-DndloIiD.js.map +1 -0
- package/dist/assets/UsersView-DZhhpsnX.css +1 -0
- package/dist/assets/UsersView-KHRd16sV.js +2 -0
- package/dist/assets/UsersView-KHRd16sV.js.map +1 -0
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js → VarEditor.vue_vue_type_script_setup_true_lang-FaBOeld_.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-CZcKBdbw.js.map → VarEditor.vue_vue_type_script_setup_true_lang-FaBOeld_.js.map} +1 -1
- package/dist/assets/index-BnwKLRM7.css +1 -0
- package/dist/assets/index-D8OAewba.js +134 -0
- package/dist/assets/index-D8OAewba.js.map +1 -0
- package/dist/assets/{useDeployment-C4MdUG63.js → useDeployment-DplTFu7s.js} +2 -2
- package/dist/assets/{useDeployment-C4MdUG63.js.map → useDeployment-DplTFu7s.js.map} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/AxesTab-DkF15gUV.js +0 -2
- package/dist/assets/ConfigTab-DIfAtFKC.js +0 -2
- package/dist/assets/ConfigTab-DIfAtFKC.js.map +0 -1
- package/dist/assets/DashboardView-Cr6Nnj3O.js +0 -2
- package/dist/assets/DashboardView-Cr6Nnj3O.js.map +0 -1
- package/dist/assets/DeploymentDetailView-D23-qn3Z.js +0 -2
- package/dist/assets/DeploymentsView-BMD-3aeS.js +0 -2
- package/dist/assets/DeploymentsView-BMD-3aeS.js.map +0 -1
- package/dist/assets/JobDetailView-ByaH2ylY.js +0 -2
- package/dist/assets/JobsView-h_BUWgIG.js +0 -2
- package/dist/assets/JobsView-h_BUWgIG.js.map +0 -1
- package/dist/assets/LoginView-BstzTLQc.js +0 -5
- package/dist/assets/LoginView-BstzTLQc.js.map +0 -1
- package/dist/assets/LoginView-CAyD1E0h.css +0 -1
- package/dist/assets/LogsTab-B_NVnnVo.js +0 -4
- package/dist/assets/LogsTab-B_NVnnVo.js.map +0 -1
- package/dist/assets/NotifiersView-CsAmv8wB.js +0 -2
- package/dist/assets/NotifiersView-CsAmv8wB.js.map +0 -1
- package/dist/assets/RegistriesView-CEE730kV.js +0 -2
- package/dist/assets/RegistriesView-CEE730kV.js.map +0 -1
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-lQaz4t05.js +0 -2
- package/dist/assets/RoutingView-DXCaRJek.js +0 -9
- package/dist/assets/RoutingView-DXCaRJek.js.map +0 -1
- package/dist/assets/RuntimeTab-DvrQFekD.js +0 -2
- package/dist/assets/SettingsView-B7_zHjVP.js +0 -2
- package/dist/assets/SettingsView-B7_zHjVP.js.map +0 -1
- package/dist/assets/SpecDetailView-CViJ8WG_.js +0 -2
- package/dist/assets/SpecsView-BpG2OWMm.js +0 -2
- package/dist/assets/SpecsView-BpG2OWMm.js.map +0 -1
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-CgDXVhMF.js +0 -2
- package/dist/assets/SubmitView-CwdWrsVS.js +0 -45
- package/dist/assets/SubmitView-CwdWrsVS.js.map +0 -1
- package/dist/assets/TerminalTab-C6gRXura.js +0 -3
- package/dist/assets/TerminalTab-C6gRXura.js.map +0 -1
- package/dist/assets/index-Bygbts8t.js +0 -129
- package/dist/assets/index-Bygbts8t.js.map +0 -1
- package/dist/assets/index-DOv3m8-x.css +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s,c as t,
|
|
2
|
-
//# sourceMappingURL=ActionButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as s,c as t,E as i,V as o,g as d,o as a}from"./index-D8OAewba.js";const l=["disabled","title","aria-busy"],r={key:0,class:"progress","aria-hidden":"true"},m=s({__name:"ActionButton",props:{pending:{type:Boolean},disabled:{type:Boolean},variant:{},title:{}},setup(e){return(n,c)=>(a(),t("button",{class:i(e.variant),disabled:e.pending||e.disabled,title:e.title,"aria-busy":e.pending?"true":void 0},[o(n.$slots,"default"),e.pending?(a(),t("span",r)):d("",!0)],10,l))}});export{m as _};
|
|
2
|
+
//# sourceMappingURL=ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js","sources":["../../src/components/ActionButton.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A button that disables itself the moment it is pressed and shows inline progress until the\n * request settles.\n *\n * Optimistic only about the DISABLED state, never about the outcome: every action here starts a\n * job that destroys or creates infrastructure, so the button says \"in flight\", not \"done\". The\n * result is reported by the caller once the server has actually answered.\n *\n * The progress bar sits inside the button rather than replacing the label, so the button keeps its\n * width and the page does not reflow under the pointer mid-click.\n */\ndefineProps<{\n pending?: boolean;\n disabled?: boolean;\n variant?: 'primary' | 'danger' | 'ghost';\n /** Shown as a native tooltip; use it to say WHY a disabled control is disabled. */\n title?: string;\n}>();\n</script>\n\n<template>\n <button\n :class=\"variant\"\n :disabled=\"pending || disabled\"\n :title=\"title\"\n :aria-busy=\"pending ? 'true' : undefined\"\n >\n <slot />\n <span v-if=\"pending\" class=\"progress\" aria-hidden=\"true\" />\n </button>\n</template>\n"],"names":["_createElementBlock","__props","_renderSlot","_ctx","_openBlock","_hoisted_2"],"mappings":"qSAsBEA,EAQS,SAAA,CAPN,QAAOC,EAAA,OAAO,EACd,SAAUA,EAAA,SAAWA,EAAA,SACrB,MAAOA,EAAA,MACP,YAAWA,EAAA,QAAO,OAAY,MAAA,GAE/BC,EAAQC,EAAA,OAAA,SAAA,EACIF,EAAA,SAAZG,EAAA,EAAAJ,EAA2D,OAA3DK,CAA2D"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as u,i as x,u as i}from"./useDeployment-DplTFu7s.js";import{d as h,c as o,a as s,f as t,u as l,F as p,e as b,w as m,_ as f,s as k,g,t as r,o as n,D as w,E as _}from"./index-D8OAewba.js";import"./useVars-VN9gYdR6.js";const C={class:"panel"},A={key:0,class:"mute"},N={class:"cards"},S={class:"stagger"},V={class:"name","data-label":"axis"},B={"data-label":"hooks"},T={"data-label":"provable"},z={key:0,class:"badge ok"},D={key:1,class:"badge warn",title:"verify cannot prove this axis was cleaned up — this is not a pass"},E={key:0},F={colspan:"3",class:"mute"},H={key:0},I={key:0,class:"banner warn"},U=h({__name:"AxesTab",setup(L){const v=["up","assert_live","down","assert_gone"];return(O,e)=>(n(),o("section",C,[e[18]||(e[18]=s("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},[t(" Axes "),s("span",{class:"mute"},"(provisioned in order, destroyed in reverse)")],-1)),l(u).detail?(n(),o(p,{key:1},[s("table",N,[s("thead",null,[s("tr",null,[e[2]||(e[2]=s("th",null,"axis",-1)),s("th",null,[e[1]||(e[1]=t(" hooks ",-1)),b(f,{label:"what the four hooks do"},{default:m(()=>[...e[0]||(e[0]=[s("code",null,"up",-1),t(" provisions · ",-1),s("code",null,"assert_live",-1),t(" checks it exists · ",-1),s("code",null,"down",-1),t(" destroys · ",-1),s("code",null,"assert_gone",-1),t(" proves it is gone. Hook ",-1),s("em",null,"bodies",-1),t(" are never sent to this page — a hook is a shell string that routinely carries a token inline. ",-1)])]),_:1})]),e[3]||(e[3]=s("th",null,"teardown provable?",-1))])]),s("tbody",S,[(n(!0),o(p,null,k(l(u).detail.axes,(a,y)=>(n(),o("tr",{key:a.name,style:w({"--i":y})},[s("td",V,r(a.name),1),s("td",B,[(n(),o(p,null,k(v,d=>s("span",{key:d,class:_(["badge",{off:!a.hooks.includes(d)}]),style:{"margin-right":"4px"}},r(d),3)),64))]),s("td",T,[a.verifiable?(n(),o("span",z,"assert_gone")):(n(),o("span",D,"unverifiable"))])],4))),128)),l(u).detail.axes.length?g("",!0):(n(),o("tr",E,[s("td",F,[e[4]||(e[4]=t(" No axes",-1)),l(x)?(n(),o("span",H," — a shared singleton has nothing to isolate and nothing to prove gone")):g("",!0),e[5]||(e[5]=t(". ",-1))])]))])]),l(i).length?(n(),o("div",I,[s("b",null,r(l(i).length===1?"1 axis cannot":`${l(i).length} axes cannot`)+" be verified: "+r(l(i).join(", "))+". ",1),s("p",null,[e[7]||(e[7]=t(" They define no ",-1)),e[8]||(e[8]=s("code",null,"assert_gone",-1)),e[9]||(e[9]=t(", so a green ",-1)),e[10]||(e[10]=s("code",null,"verify",-1)),e[11]||(e[11]=t(" is ",-1)),e[12]||(e[12]=s("em",null,"silence",-1)),e[13]||(e[13]=t(" about them, not proof they are gone. Add an ",-1)),e[14]||(e[14]=s("code",null,"assert_gone",-1)),e[15]||(e[15]=t(" that ",-1)),e[16]||(e[16]=s("b",null,"fails closed",-1)),e[17]||(e[17]=t(". ",-1)),b(f,{label:"how to write an assert_gone that fails closed"},{default:m(()=>[...e[6]||(e[6]=[t(" Check the probe can work, ",-1),s("em",null,"then",-1),t(" assert absence: ",-1),s("code",null,"<probe-is-usable> || exit 1",-1),t(", then ",-1),s("code",null,"! <probe-for-this-resource>",-1),t(". A bare ",-1),s("code",null,"! <probe>",-1),t(" exits 0 whenever the probe itself fails — a missing CLI, an expired token — turning “I could not tell” into “it is gone”. ",-1)])]),_:1})])])):g("",!0)],64)):(n(),o("p",A,"Unavailable until the spec resolves."))]))}});export{U as default};
|
|
2
|
+
//# sourceMappingURL=AxesTab-BZZXKEC0.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxesTab-
|
|
1
|
+
{"version":3,"file":"AxesTab-BZZXKEC0.js","sources":["../../src/views/tabs/AxesTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Axes: the hooks each declares, and whether teardown can be PROVEN.\n *\n * `verifiable: false` means the axis defines no `assert_gone`, so `verify` cannot prove it was\n * cleaned up. That is a THIRD state — neither pass nor fail — and it must never be coloured green:\n * a green verify on an unverifiable axis is exactly the false confidence this tool exists to\n * remove.\n */\nimport { dep, isShared, unverifiableAxes } from '../../composables/useDeployment';\nimport type { HookName } from '../../api/types';\nimport InfoHint from '../../components/InfoHint.vue';\n\n/** In the order `up` and `verify` actually use them. */\nconst HOOKS: HookName[] = ['up', 'assert_live', 'down', 'assert_gone'];\n</script>\n\n<template>\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">\n Axes <span class=\"mute\">(provisioned in order, destroyed in reverse)</span>\n </h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n <template v-else>\n <table class=\"cards\">\n <thead>\n <tr>\n <th>axis</th>\n <th>\n hooks\n <InfoHint label=\"what the four hooks do\">\n <code>up</code> provisions · <code>assert_live</code> checks it exists ·\n <code>down</code> destroys · <code>assert_gone</code> proves it is gone. Hook\n <em>bodies</em> are never sent to this page — a hook is a shell string that routinely\n carries a token inline.\n </InfoHint>\n </th>\n <th>teardown provable?</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(a, i) in dep.detail.axes\" :key=\"a.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"axis\">{{ a.name }}</td>\n <td data-label=\"hooks\">\n <span\n v-for=\"h in HOOKS\"\n :key=\"h\"\n class=\"badge\"\n :class=\"{ off: !a.hooks.includes(h) }\"\n style=\"margin-right: 4px\"\n >{{ h }}</span\n >\n </td>\n <td data-label=\"provable\">\n <span v-if=\"a.verifiable\" class=\"badge ok\">assert_gone</span>\n <span\n v-else\n class=\"badge warn\"\n title=\"verify cannot prove this axis was cleaned up — this is not a pass\"\n >unverifiable</span\n >\n </td>\n </tr>\n <tr v-if=\"!dep.detail.axes.length\">\n <td colspan=\"3\" class=\"mute\">\n No axes<span v-if=\"isShared\">\n — a shared singleton has nothing to isolate and nothing to prove gone</span\n >.\n </td>\n </tr>\n </tbody>\n </table>\n\n <div v-if=\"unverifiableAxes.length\" class=\"banner warn\">\n <b>\n {{ unverifiableAxes.length === 1 ? '1 axis cannot' : `${unverifiableAxes.length} axes cannot` }}\n be verified: {{ unverifiableAxes.join(', ') }}.\n </b>\n <p>\n They define no <code>assert_gone</code>, so a green <code>verify</code> is\n <em>silence</em> about them, not proof they are gone. Add an <code>assert_gone</code> that\n <b>fails closed</b>.\n <InfoHint label=\"how to write an assert_gone that fails closed\">\n Check the probe can work, <em>then</em> assert absence:\n <code><probe-is-usable> || exit 1</code>, then\n <code>! <probe-for-this-resource></code>. A bare <code>! <probe></code> exits\n 0 whenever the probe itself fails — a missing CLI, an expired token — turning “I could not\n tell” into “it is gone”.\n </InfoHint>\n </p>\n </div>\n </template>\n </section>\n</template>\n"],"names":["HOOKS","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_unref","dep","_Fragment","_hoisted_3","_cache","_createVNode","InfoHint","_hoisted_4","_renderList","i","_hoisted_5","_toDisplayString","_hoisted_6","h","_normalizeClass","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","isShared","unverifiableAxes","_hoisted_13","_hoisted_2"],"mappings":"goBAcA,MAAMA,EAAoB,CAAC,KAAM,cAAe,OAAQ,aAAa,gBAInEC,EAAA,EAAAC,EA2EU,UA3EVC,EA2EU,eA1ERC,EAEK,KAAA,CAFD,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,CAAA,KAAiC,QAC9C,EAAAA,EAAsE,OAAA,CAAhE,MAAM,MAAA,EAAO,8CAA4C,CAAA,OAG5DC,EAAAC,CAAA,EAAI,YACdJ,EAoEWK,EAAA,CAAA,IAAA,GAAA,CAnETH,EA+CQ,QA/CRI,EA+CQ,CA9CNJ,EAcQ,QAAA,KAAA,CAbNA,EAYK,KAAA,KAAA,CAXHK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAL,EAAa,UAAT,OAAI,EAAA,GACRA,EAQK,KAAA,KAAA,eARD,UAEF,EAAA,GAAAM,EAKWC,EAAA,CALD,MAAM,0BAAwB,WACtC,IAAe,CAAA,GAAAF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAAfL,EAAe,YAAT,KAAE,EAAA,IAAO,iBAAc,EAAA,EAAAA,EAAwB,YAAlB,cAAW,EAAA,IAAO,uBACr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iBACnFV,EAAGX,EAAAqB,CAAA,EAAiB,YAAa,KAChD,CAAA,EACAtB,EAWI,IAAA,KAAA,eAXD,mBACc,EAAA,GAAAK,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAL,EAAwB,YAAlB,cAAW,EAAA,iBAAO,gBAAa,EAAA,GAAAK,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAmB,YAAb,SAAM,EAAA,mBAAO,OACvE,EAAA,GAAAK,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAgB,UAAZ,UAAO,EAAA,mBAAK,gDAA6C,EAAA,GAAAK,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAwB,YAAlB,cAAW,EAAA,mBAAO,SACrF,EAAA,GAAAK,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAmB,SAAhB,eAAY,EAAA,mBAAI,KACnB,EAAA,GAAAM,EAMWC,EAAA,CAND,MAAM,iDAA+C,WAAC,IACpC,CAAA,GAAAF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GADoC,8BACpC,EAAA,EAAAL,EAAa,UAAT,OAAI,EAAA,IAAK,oBACvC,EAAA,EAAAA,EAA8C,YAAxC,8BAAiC,EAAA,IAAO,UAC9C,EAAA,EAAAA,EAA8C,YAAxC,8BAAiC,EAAA,IAAO,YAAS,EAAA,EAAAA,EAA4B,YAAtB,YAAe,EAAA,IAAO,8HAGrF,EAAA,CAAA,oCAlENF,EAA2E,IAA3E0B,EAAmC,sCAAoC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as C,d as r,a as c,r as V}from"./useDeployment-DplTFu7s.js";import{d as x,c as n,a as e,f as t,e as v,w,u as o,t as i,_ as T,F as p,s as f,g as d,C as u,o as l,E as k}from"./index-D8OAewba.js";import{c as A}from"./useVars-VN9gYdR6.js";import{_ as N}from"./VarEditor.vue_vue_type_script_setup_true_lang-FaBOeld_.js";import{_ as $}from"./HelpModal.vue_vue_type_script_setup_true_lang-TcgJr2CB.js";import"./Teleport-0BmaJsBF.js";const j={class:"panel"},B={class:"hint"},I={class:"row",style:{"margin-top":"var(--s3)"}},z={class:"mute",style:{"font-size":"var(--t-xs)"}},D={class:"hint"},L={key:0,class:"panel"},R={class:"kvlist",style:{"margin-top":"var(--s3)"}},q={class:"k"},E={class:"v mono"},F={key:0,class:"banner warn"},O={class:"panel"},S={key:0,class:"mute"},U={class:"cards"},K={class:"name","data-label":"key"},W={"data-label":"visibility"},Y={class:"dim","data-label":"length"},G={key:0,class:"badge warn",style:{"margin-left":"6px"}},H={key:0},se=x({__name:"ConfigTab",setup(J){const h=u(()=>Object.keys(r.vars??{}).length),y=u(()=>{var m;return(m=V.value)==null?void 0:m.vars}),b=u(()=>Object.entries(y.value??{})),g=u(()=>A(r.vars,y.value));return(m,s)=>(l(),n("div",null,[e("section",j,[s[6]||(s[6]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Request variables",-1)),e("p",B,[s[3]||(s[3]=t(" Remembered in this browser. Another browser, a CI job or the command line supplies its own. ",-1)),v($,{title:"Why the same variables have to be used for both"},{default:w(()=>[...s[2]||(s[2]=[e("p",null,[t(" These variables are part of how this deployment's name is worked out. Deploy with one value and tear down with another and the two commands are pointing at "),e("b",null,"different things"),t(" — the teardown finishes successfully having removed nothing, and the original is still running. ")],-1),e("p",null,[t(" They are kept per deployment in this browser only, which is what keeps them matched "),e("em",null,"here"),t(". Nothing carries them to anywhere else. ")],-1)])]),_:1})]),v(N,{modelValue:o(r).vars,"onUpdate:modelValue":s[0]||(s[0]=a=>o(r).vars=a),onChange:o(C)},null,8,["modelValue","onChange"]),e("div",I,[e("button",{class:"primary",onClick:s[1]||(s[1]=(...a)=>o(c)&&o(c)(...a))},"Apply & reload"),e("span",z,i(h.value?`${h.value} variable${h.value===1?"":"s"}`:"no variables"),1)]),e("p",D,[s[5]||(s[5]=t(" Add any variable you need — the list below is what the spec declares, not everything it uses. ",-1)),v(T,{label:"why the two differ"},{default:w(()=>[...s[4]||(s[4]=[t(" A spec can consume a variable without declaring it, for instance by building its stack name out of one. If a variable is missing, the error you get when the spec fails to resolve names it exactly — that message is the authoritative list. ",-1)])]),_:1})])]),b.value.length?(l(),n("section",L,[s[10]||(s[10]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Stored on the server",-1)),s[11]||(s[11]=e("p",{class:"dim",style:{"font-size":"var(--t-sm)"}}," Kept with the deployment on the server, so deploying and tearing down agree without anyone passing anything. Anything set above overrides these. ",-1)),e("ul",R,[(l(!0),n(p,null,f(b.value,([a,_])=>(l(),n("li",{key:a},[e("span",q,[e("b",null,i(a),1)]),e("span",E,i(_),1)]))),128))]),g.value.length?(l(),n("div",F,[s[7]||(s[7]=e("b",null,"Your request variables disagree with the stored ones:",-1)),e("b",null,i(g.value.join(", ")),1),s[8]||(s[8]=t(". ",-1)),s[9]||(s[9]=e("p",null,[t(" Both resolve, so nothing will error — they simply resolve to "),e("em",null,"different stacks"),t(". That is the dangerous shape: an action sent from this page would target one stack while the CLI, CI, or another browser targets the other. Clear the override above unless you mean it. ")],-1))])):d("",!0)])):d("",!0),e("section",O,[s[15]||(s[15]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},[t(" Declared env "),e("span",{class:"mute"},"(after interpolation)")],-1)),o(r).detail?(l(),n(p,{key:1},[e("table",U,[s[13]||(s[13]=e("thead",null,[e("tr",null,[e("th",null,"key"),e("th",null,"value"),e("th",null,"visibility"),e("th",null,"length")])],-1)),e("tbody",null,[(l(!0),n(p,null,f(o(r).detail.env,a=>(l(),n("tr",{key:a.key},[e("td",K,i(a.key),1),e("td",{class:k(["name",{masked:a.visibility==="masked"}]),"data-label":"value"},i(a.value),3),e("td",W,[e("span",{class:k(["badge",a.visibility==="masked"?"warn":""])},i(a.visibility),3)]),e("td",Y,[t(i(a.length)+" chars ",1),a.length===0?(l(),n("span",G,"never set")):d("",!0)])]))),128)),o(r).detail.env.length?d("",!0):(l(),n("tr",H,[...s[12]||(s[12]=[e("td",{colspan:"4",class:"mute"},[t("This spec declares no "),e("code",null,"env:"),t(" block.")],-1)])]))])]),s[14]||(s[14]=e("p",{class:"hint"},[t(" A "),e("b",null,"masked"),t(" value was redacted on the host because its name reads as a secret. The real value was never sent to this page, so there is "),e("b",null,"nothing to reveal"),t(" — only its length is shown. Read it on the host if you need it. ")],-1))],64)):(l(),n("p",S,"Unavailable until the spec resolves."))])]))}});export{se as default};
|
|
2
|
+
//# sourceMappingURL=ConfigTab-CFbS48D0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfigTab-CFbS48D0.js","sources":["../../src/views/tabs/ConfigTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Variables (what we SEND) and declared env (what the spec DECLARES). Two different things, on\n * purpose, and the tab explains the difference rather than merging them into one table.\n */\nimport { computed } from 'vue';\nimport { applyVars, dep, persistVars, row } from '../../composables/useDeployment';\nimport InfoHint from '../../components/InfoHint.vue';\n\nimport { conflictingVars } from '../../composables/useVars';\nimport VarEditor from '../../components/VarEditor.vue';\nimport HelpModal from '../../components/HelpModal.vue';\n\n/** A count, not the raw query string — `?PR=7®ION=eu` beside a button is machine talk. */\nconst varCount = computed(() => Object.keys(dep.vars ?? {}).length);\n\nconst storedVars = computed(() => row.value?.vars);\nconst storedList = computed(() => Object.entries(storedVars.value ?? {}));\nconst clashes = computed(() => conflictingVars(dep.vars, storedVars.value));\n</script>\n\n<template>\n <div>\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Request variables</h2>\n\n <!--\n THE safety rule on this page. A spec interpolates `${VAR}` exactly once, at resolve time,\n and every route that resolves a deployment layers the request's query parameters over the\n server's environment. So `up` sent with PR=7 and a later `down` sent without it resolve to\n two DIFFERENT stacks, and the teardown quietly misses everything the deploy created.\n\n Keeping the pairs in this browser is what holds them matched here. It is a convenience, not\n a guarantee — a different browser, a CI job or the CLI must pass the same ones itself —\n which is why this warning stays visible rather than being dismissible.\n -->\n <p class=\"hint\">\n Remembered in this browser. Another browser, a CI job or the command line supplies its own.\n <HelpModal title=\"Why the same variables have to be used for both\">\n <p>\n These variables are part of how this deployment's name is worked out. Deploy with one\n value and tear down with another and the two commands are pointing at\n <b>different things</b> — the teardown finishes successfully having removed nothing, and\n the original is still running.\n </p>\n <p>\n They are kept per deployment in this browser only, which is what keeps them matched\n <em>here</em>. Nothing carries them to anywhere else.\n </p>\n </HelpModal>\n </p>\n\n <VarEditor v-model=\"dep.vars\" @change=\"persistVars\" />\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <button class=\"primary\" @click=\"applyVars\">Apply & reload</button>\n <span class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ varCount ? `${varCount} variable${varCount === 1 ? '' : 's'}` : 'no variables' }}\n </span>\n </div>\n\n <p class=\"hint\">\n Add any variable you need — the list below is what the spec declares, not everything it\n uses.\n <InfoHint label=\"why the two differ\">\n A spec can consume a variable without declaring it, for instance by building its stack\n name out of one. If a variable is missing, the error you get when the spec fails to\n resolve names it exactly — that message is the authoritative list.\n </InfoHint>\n </p>\n </section>\n\n <!--\n Newer servers store variables WITH the deployment, which makes `down` self-describing — the\n strictly better arrangement. It does not make the warning above obsolete: a request variable\n still OVERRIDES a stored one, so a different value typed here retargets the stack.\n -->\n <section v-if=\"storedList.length\" class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Stored on the server</h2>\n <p class=\"dim\" style=\"font-size: var(--t-sm)\">\n Kept with the deployment on the server, so deploying and tearing down agree without anyone\n passing anything. Anything set above overrides these.\n </p>\n <ul class=\"kvlist\" style=\"margin-top: var(--s3)\">\n <li v-for=\"[k, v] in storedList\" :key=\"k\">\n <span class=\"k\"><b>{{ k }}</b></span>\n <span class=\"v mono\">{{ v }}</span>\n </li>\n </ul>\n\n <div v-if=\"clashes.length\" class=\"banner warn\">\n <b>Your request variables disagree with the stored ones:</b>\n <b>{{ clashes.join(', ') }}</b\n >.\n <p>\n Both resolve, so nothing will error — they simply resolve to <em>different stacks</em>.\n That is the dangerous shape: an action sent from this page would target one stack while\n the CLI, CI, or another browser targets the other. Clear the override above unless you\n mean it.\n </p>\n </div>\n </section>\n\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">\n Declared env <span class=\"mute\">(after interpolation)</span>\n </h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n <template v-else>\n <table class=\"cards\">\n <thead>\n <tr>\n <th>key</th>\n <th>value</th>\n <th>visibility</th>\n <th>length</th>\n </tr>\n </thead>\n <tbody>\n <tr v-for=\"e in dep.detail.env\" :key=\"e.key\">\n <td class=\"name\" data-label=\"key\">{{ e.key }}</td>\n <td class=\"name\" :class=\"{ masked: e.visibility === 'masked' }\" data-label=\"value\">\n {{ e.value }}\n </td>\n <td data-label=\"visibility\">\n <span class=\"badge\" :class=\"e.visibility === 'masked' ? 'warn' : ''\">\n {{ e.visibility }}\n </span>\n </td>\n <!--\n `length` answers \"did it get set at all?\" without the value. length 0 on a masked\n var is the interesting case: declared, never set — usually a hook about to fail on\n an empty credential.\n -->\n <td class=\"dim\" data-label=\"length\">\n {{ e.length }} chars\n <span v-if=\"e.length === 0\" class=\"badge warn\" style=\"margin-left: 6px\">never set</span>\n </td>\n </tr>\n <tr v-if=\"!dep.detail.env.length\">\n <td colspan=\"4\" class=\"mute\">This spec declares no <code>env:</code> block.</td>\n </tr>\n </tbody>\n </table>\n\n <!--\n Masked is NOT \"hidden pending a click\". The plaintext was never in the response, so there\n is nothing here to reveal — a reveal control would be a lie, and building one would mean\n sending secrets into a browser tab, and from there into screenshots and support tickets.\n Deny-by-default by name, decided on the host.\n -->\n <p class=\"hint\">\n A <b>masked</b> value was redacted on the host because its name reads as a secret. The\n real value was never sent to this page, so there is <b>nothing to reveal</b> — only its\n length is shown. Read it on the host if you need it.\n </p>\n </template>\n </section>\n </div>\n</template>\n"],"names":["varCount","computed","dep","storedVars","_a","row","storedList","clashes","conflictingVars","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","HelpModal","_cache","VarEditor","_unref","$event","persistVars","_hoisted_3","applyVars","args","_hoisted_4","_toDisplayString","_hoisted_5","InfoHint","_openBlock","_hoisted_6","_hoisted_7","_Fragment","_renderList","k","v","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_13","e","_hoisted_14","_normalizeClass","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_12"],"mappings":"o+BAcA,MAAMA,EAAWC,EAAS,IAAM,OAAO,KAAKC,EAAI,MAAQ,EAAE,EAAE,MAAM,EAE5DC,EAAaF,EAAS,IAAA,OAAM,OAAAG,EAAAC,EAAI,QAAJ,YAAAD,EAAW,KAAI,EAC3CE,EAAaL,EAAS,IAAM,OAAO,QAAQE,EAAW,OAAS,CAAA,CAAE,CAAC,EAClEI,EAAUN,EAAS,IAAMO,EAAgBN,EAAI,KAAMC,EAAW,KAAK,CAAC,oBAIxEM,EAyIM,MAAA,KAAA,CAxIJC,EA+CU,UA/CVC,EA+CU,aA9CRD,EAA2E,KAAA,CAAvE,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,CAAA,EAAiC,oBAAiB,EAAA,GAYtEA,EAcI,IAdJE,EAcI,eAdY,gGAEd,EAAA,GAAAC,EAWYC,EAAA,CAXD,MAAM,mDAAiD,WAChE,IAKI,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CALJL,EAKI,IAAA,KAAA,GALD,+JAGD,EAAAA,EAAuB,SAApB,kBAAgB,IAAI,mGAEzB,CAAA,MACAA,EAGI,IAAA,KAAA,GAHD,uFAED,EAAAA,EAAa,UAAT,MAAI,IAAK,2CACf,CAAA,kBAIJG,EAAsDG,EAAA,CAAlC,WAAAC,EAAAf,CAAA,EAAI,KAAJ,sBAAAa,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAG,GAAAD,EAAAf,CAAA,EAA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AG,UACd,CAAA,EAAYA,EAAE,SAAM,OAApB9B,EAAwF,OAAxFmC,EAAwE,WAAS,wBAG1E3B,EAAAf,CAAA,EAAI,OAAO,IAAI,qBAA1BO,EAEK,KAAAoC,EAAA,CAAA,GAAA9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,CADHL,EAAgF,KAAA,CAA5E,QAAQ,IAAI,MAAM,MAAA,KAAO,wBAAsB,EAAAA,EAAiB,YAAX,MAAI,IAAO,SAAO,CAAA,6BAWjFA,EAII,IAAA,CAJD,MAAM,QAAM,GAAC,KACZ,EAAAA,EAAa,SAAV,QAAM,IAAI,8HACqC,EAAAA,EAAwB,SAArB,mBAAiB,IAAI,mEAE9E,CAAA,kBAhDFD,EAA2E,IAA3EqC,EAAmC,sCAAoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as O,c as r,G as Y,a as o,t as y,m as t,h as f,i as v,j as P,o as a,u as d,F as M,f as b,_ as L,g as V,I as z,v as Z,y as Q,r as w,D as j,B as A,P as F,Q as W,C as G,R as _,k as ee,z as te,S as oe}from"./index-Bygbts8t.js";import{d as i,i as $,v as J}from"./useDeployment-C4MdUG63.js";import{a as C}from"./useFormat-CKJxQp_i.js";import{_ as R}from"./ActionButton.vue_vue_type_script_setup_true_lang-DxV7T6dV.js";import{_ as ne}from"./ErrorNote.vue_vue_type_script_setup_true_lang-BlepSrj0.js";import"./useVars-VN9gYdR6.js";const se={class:"raw",style:{color:"var(--fg-dim)","max-height":"200px"}},ie={key:0},ae={key:1},le={key:2},re={key:3},de={key:4},ue=O({__name:"ConflictNote",props:{conflict:{},jobId:{}},setup(m){return(I,s)=>{const p=P("RouterLink");return a(),r("div",{class:Y(["banner",m.conflict.kind==="shared"?"leaked":"info"]),role:"alert"},[s[5]||(s[5]=o("b",null,"Refused — nothing was started.",-1)),o("pre",se,y(m.conflict.text),1),m.conflict.kind==="shared"?(a(),r("p",ie,[...s[0]||(s[0]=[t(" Type the stack name in the confirmation field above and press ",-1),o("code",null,"down",-1),t(" again. ",-1)])])):m.conflict.kind==="containers"?(a(),r("p",ae,[...s[1]||(s[1]=[t(" Run ",-1),o("code",null,"down",-1),t(" first. Forgetting the record now would orphan those containers beyond the control plane's view: nothing left would know their stack name, their axes, or how to tear them down. ",-1)])])):m.conflict.kind==="referenced"?(a(),r("p",le,[s[2]||(s[2]=t(" These deployments still use this spec: ",-1)),o("strong",null,y(m.conflict.deployments.join(", ")),1),s[3]||(s[3]=t(". Deleting it would leave them with no way to be torn down. ",-1))])):m.jobId?(a(),r("p",re,[f(p,{to:`/jobs/${encodeURIComponent(m.jobId)}`},{default:v(()=>[...s[4]||(s[4]=[t("Follow the running job →",-1)])]),_:1},8,["to"])])):(a(),r("p",de,"Nothing was retried. Wait for the current work to finish, then try again."))],2)}}}),fe={class:"panel"},ve={key:0,class:"mute"},me={key:0,class:"banner warn"},pe={class:"row"},ye={key:1,class:"hint"},be={class:"hint"},we={class:"row",style:{"margin-top":"var(--s3)"}},ke={class:"check"},ce={key:2,class:"hint"},he={key:3,class:"banner leaked"},ge={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},$e=["for"],Ce=["id","placeholder"],xe={key:0,class:"s-failed"},Te={class:"panel"},je={key:0,class:"mute"},Re={class:"dim"},Ie={class:"row",style:{"margin-top":"var(--s3)"}},Ue={class:"check"},De=O({__name:"DangerTab",setup(m){const I=ee(),s=w(""),p=w(""),k=w(null),U=w(""),x=w(!0),c=w(""),h=w(!1),H=j(()=>{const n=i.vars.filter(e=>e.k).map(e=>e.k);return n.length?`Sending ${n.join(", ")} with every action.`:"Using the variables saved with this deployment."}),T=j(()=>{var n;return!!((n=i.detail)!=null&&n.stack)&&c.value===i.detail.stack}),K=j(()=>{var n;return((n=te.health)==null?void 0:n.authEnforced)===!0&&!oe.token}),g=j(()=>{var n;return((n=i.detail)==null?void 0:n.busy)===!0});function N(n){if(!i.detail)return"The spec has not resolved — the server cannot compute the stack name.";if(g.value)return`A job is already in flight for ${i.detail.stack}.`;if(n==="down"&&$.value&&!T.value)return`Type the stack name "${i.detail.stack}" below to confirm a shared teardown.`}async function S(n){if(!i.detail)return;s.value=n,p.value="",k.value=null;const e=n==="down"?{verify:x.value,force:$.value&&T.value}:{},u=await A.post(`/api/deployments/${encodeURIComponent(i.id)}/${n}${J.value}`,e);if(s.value="",u.status===202){const l=u.body.job;if(l!=null&&l.id){F("info",`${C(n)} started on ${l.stack}`,{to:`/jobs/${encodeURIComponent(l.id)}`,toLabel:"Follow"}),W(),I.push(`/jobs/${encodeURIComponent(l.id)}`);return}p.value="The action was accepted, but the response carried nothing to follow.";return}if(u.status===409)return D(u.body);p.value=G(u,C(n).toLowerCase()),F("error",`${C(n)} was refused.`)}async function X(){if(!h.value)return;s.value="forget",p.value="",k.value=null;const n=await A.del(`/api/deployments/${encodeURIComponent(i.id)}${J.value}`);if(s.value="",n.ok){F("ok",`Forgot ${i.id}. Nothing was torn down.`),W(),I.push("/deployments");return}if(n.status===409)return D(n.body);p.value=G(n,"forget this deployment")}async function D(n){var E;const e=_(n);k.value=e,U.value="",e.kind==="shared"&&(c.value="");const u=e.stack||((E=i.detail)==null?void 0:E.stack);if(e.kind!=="other"||!u)return;const B=((await A.get("/api/jobs")).body.jobs??[]).find(q=>q.state==="running"&&q.stack===u);B&&(U.value=B.id)}return(n,e)=>{const u=P("RouterLink");return a(),r("div",null,[o("section",fe,[e[30]||(e[30]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Lifecycle",-1)),d(i).detail?(a(),r(M,{key:1},[K.value?(a(),r("div",me,[e[12]||(e[12]=o("b",null,"No access token set.",-1)),o("p",null,[e[10]||(e[10]=t(" Every action below will be refused. Add your token under ",-1)),f(u,{to:"/settings"},{default:v(()=>[...e[9]||(e[9]=[t("Settings",-1)])]),_:1}),e[11]||(e[11]=t(". ",-1))])])):b("",!0),o("div",pe,[f(R,{variant:"primary",pending:s.value==="up",disabled:!!s.value||g.value,title:N("up"),onClick:e[0]||(e[0]=l=>S("up"))},{default:v(()=>[t(y(d(C)("up")),1)]),_:1},8,["pending","disabled","title"]),f(R,{pending:s.value==="verify",disabled:!!s.value||g.value,title:N("verify"),onClick:e[1]||(e[1]=l=>S("verify"))},{default:v(()=>[t(y(d(C)("verify")),1)]),_:1},8,["pending","disabled","title"]),f(R,{variant:"danger",pending:s.value==="down",disabled:!!s.value||g.value||d($)&&!T.value,title:N("down"),onClick:e[2]||(e[2]=l=>S("down"))},{default:v(()=>[t(y(d($)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),e[14]||(e[14]=o("span",{class:"grow"},null,-1)),f(u,{to:`/submit/${encodeURIComponent(d(i).id)}`},{default:v(()=>[...e[13]||(e[13]=[t("Edit spec & compose →",-1)])]),_:1},8,["to"])]),g.value?(a(),r("p",ye,[e[16]||(e[16]=t(" Something is already running on ",-1)),o("b",null,y(d(i).detail.stack),1),e[17]||(e[17]=t(". ",-1)),f(L,{label:"why actions wait"},{default:v(()=>[...e[15]||(e[15]=[t(" One action at a time per stack, and they are not queued. A teardown racing a deploy over the same database would corrupt it, so the second request is refused rather than delayed. ",-1)])]),_:1})])):b("",!0),o("p",be,[t(y(H.value)+" ",1),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[18]||(e[18]=[t("change",-1)])]),_:1},8,["to"])]),o("div",we,[o("label",ke,[V(o("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>x.value=l),type:"checkbox"},null,512),[[z,x.value]]),e[19]||(e[19]=t(" Check for leftovers afterwards ",-1))])]),x.value?b("",!0):(a(),r("p",ce,[...e[20]||(e[20]=[t(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),o("b",null,"Verify",-1),t(" yourself afterwards. ",-1)])])),d($)?(a(),r("div",he,[e[29]||(e[29]=o("b",null,"Shared — read this before tearing down.",-1)),o("p",null,[e[22]||(e[22]=t(" Tearing this down ",-1)),e[23]||(e[23]=o("b",null,"deletes its stored data",-1)),e[24]||(e[24]=t(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[25]||(e[25]=o("b",null,"every preview on this host breaks",-1)),e[26]||(e[26]=t(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),f(L,{label:"what tearing down runs"},{default:v(()=>[...e[21]||(e[21]=[o("code",null,"docker compose down -v",-1),t(" — the ",-1),o("code",null,"-v",-1),t(" is what removes the volumes. ",-1)])]),_:1})]),o("div",ge,[o("label",{for:`confirm-${d(i).id}`},[e[27]||(e[27]=t(" Type the stack name ",-1)),o("b",null,y(d(i).detail.stack),1),e[28]||(e[28]=t(" to confirm ",-1))],8,$e),V(o("input",{id:`confirm-${d(i).id}`,"onUpdate:modelValue":e[4]||(e[4]=l=>c.value=l),type:"text",placeholder:d(i).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Ce),[[Z,c.value,void 0,{trim:!0}]])]),c.value&&!T.value?(a(),r("p",xe," That does not match, so tearing down stays disabled. ")):b("",!0)])):b("",!0),p.value?(a(),Q(ne,{key:4,text:p.value,title:"The action was refused."},null,8,["text"])):b("",!0),k.value?(a(),Q(ue,{key:5,conflict:k.value,"job-id":U.value},null,8,["conflict","job-id"])):b("",!0)],64)):(a(),r("p",ve,[e[7]||(e[7]=t(" Actions are unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[6]||(e[6]=[t(" Config & variables ",-1)])]),_:1},8,["to"]),e[8]||(e[8]=t("first. ",-1))]))]),o("section",Te,[e[39]||(e[39]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),d(i).detail?(a(),r(M,{key:1},[o("p",Re,[e[32]||(e[32]=t(" This removes the ",-1)),e[33]||(e[33]=o("em",null,"record only",-1)),e[34]||(e[34]=t(" — ",-1)),e[35]||(e[35]=o("b",null,"it never tears anything down",-1)),e[36]||(e[36]=t(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),f(L,{label:"when forgetting is refused"},{default:v(()=>[...e[31]||(e[31]=[t(" Refused while any container for this stack still exists — and refused just as firmly when docker cannot be reached, because “cannot confirm” is not evidence of absence. What is deleted is the stored spec, compose file and metadata. ",-1)])]),_:1})]),o("div",Ie,[o("label",Ue,[V(o("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>h.value=l),type:"checkbox"},null,512),[[z,h.value]]),e[37]||(e[37]=t(" I have torn this down and want the record removed ",-1))]),f(R,{variant:"danger",pending:s.value==="forget",disabled:!h.value||!!s.value,title:h.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:v(()=>[...e[38]||(e[38]=[t(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),r("p",je," Unavailable until the variables are filled in: this stack's containers are counted before the record can be forgotten, and that needs its name. "))])])}}});export{De as default};
|
|
2
|
-
//# sourceMappingURL=DangerTab-
|
|
1
|
+
import{d as J,c as r,E as Y,a as o,t as y,f as t,e as f,w as v,j as P,o as a,u as d,F as M,g as w,_ as L,i as S,G as O,v as Z,x as Q,r as b,C as j,A as V,N as F,O as W,B as z,P as _,k as ee,y as te,Q as oe}from"./index-D8OAewba.js";import{d as i,i as $,v as G}from"./useDeployment-DplTFu7s.js";import{a as C}from"./useFormat-CKJxQp_i.js";import{_ as R}from"./ActionButton.vue_vue_type_script_setup_true_lang-DjO5RzbR.js";import{_ as ne}from"./ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js";import"./useVars-VN9gYdR6.js";const se={class:"raw",style:{color:"var(--fg-dim)","max-height":"200px"}},ie={key:0},ae={key:1},le={key:2},re={key:3},de={key:4},ue=J({__name:"ConflictNote",props:{conflict:{},jobId:{}},setup(m){return(I,s)=>{const p=P("RouterLink");return a(),r("div",{class:Y(["banner",m.conflict.kind==="shared"?"leaked":"info"]),role:"alert"},[s[5]||(s[5]=o("b",null,"Refused — nothing was started.",-1)),o("pre",se,y(m.conflict.text),1),m.conflict.kind==="shared"?(a(),r("p",ie,[...s[0]||(s[0]=[t(" Type the stack name in the confirmation field above and press ",-1),o("code",null,"down",-1),t(" again. ",-1)])])):m.conflict.kind==="containers"?(a(),r("p",ae,[...s[1]||(s[1]=[t(" Run ",-1),o("code",null,"down",-1),t(" first. Forgetting the record now would orphan those containers beyond the control plane's view: nothing left would know their stack name, their axes, or how to tear them down. ",-1)])])):m.conflict.kind==="referenced"?(a(),r("p",le,[s[2]||(s[2]=t(" These deployments still use this spec: ",-1)),o("strong",null,y(m.conflict.deployments.join(", ")),1),s[3]||(s[3]=t(". Deleting it would leave them with no way to be torn down. ",-1))])):m.jobId?(a(),r("p",re,[f(p,{to:`/jobs/${encodeURIComponent(m.jobId)}`},{default:v(()=>[...s[4]||(s[4]=[t("Follow the running job →",-1)])]),_:1},8,["to"])])):(a(),r("p",de,"Nothing was retried. Wait for the current work to finish, then try again."))],2)}}}),fe={class:"panel"},ve={key:0,class:"mute"},me={key:0,class:"banner warn"},pe={class:"row"},ye={key:1,class:"hint"},we={class:"hint"},be={class:"row",style:{"margin-top":"var(--s3)"}},ke={class:"check"},ce={key:2,class:"hint"},he={key:3,class:"banner leaked"},ge={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},$e=["for"],Ce=["id","placeholder"],xe={key:0,class:"s-failed"},Te={class:"panel"},je={key:0,class:"mute"},Re={class:"dim"},Ie={class:"row",style:{"margin-top":"var(--s3)"}},Ue={class:"check"},De=J({__name:"DangerTab",setup(m){const I=ee(),s=b(""),p=b(""),k=b(null),U=b(""),x=b(!0),c=b(""),h=b(!1),H=j(()=>{const n=i.vars.filter(e=>e.k).map(e=>e.k);return n.length?`Sending ${n.join(", ")} with every action.`:"Using the variables saved with this deployment."}),T=j(()=>{var n;return!!((n=i.detail)!=null&&n.stack)&&c.value===i.detail.stack}),K=j(()=>{var n;return((n=te.health)==null?void 0:n.authEnforced)===!0&&!oe.token}),g=j(()=>{var n;return((n=i.detail)==null?void 0:n.busy)===!0});function N(n){if(!i.detail)return"The spec has not resolved — the server cannot compute the stack name.";if(g.value)return`A job is already in flight for ${i.detail.stack}.`;if(n==="down"&&$.value&&!T.value)return`Type the stack name "${i.detail.stack}" below to confirm a shared teardown.`}async function A(n){if(!i.detail)return;s.value=n,p.value="",k.value=null;const e=n==="down"?{verify:x.value,force:$.value&&T.value}:{},u=await V.post(`/api/deployments/${encodeURIComponent(i.id)}/${n}${G.value}`,e);if(s.value="",u.status===202){const l=u.body.job;if(l!=null&&l.id){F("info",`${C(n)} started on ${l.stack}`,{to:`/jobs/${encodeURIComponent(l.id)}`,toLabel:"Follow"}),W(),I.push(`/jobs/${encodeURIComponent(l.id)}`);return}p.value="The action was accepted, but the response carried nothing to follow.";return}if(u.status===409)return D(u.body);p.value=z(u,C(n).toLowerCase()),F("error",`${C(n)} was refused.`)}async function X(){if(!h.value)return;s.value="forget",p.value="",k.value=null;const n=await V.del(`/api/deployments/${encodeURIComponent(i.id)}${G.value}`);if(s.value="",n.ok){F("ok",`Forgot ${i.id}. Nothing was torn down.`),W(),I.push("/deployments");return}if(n.status===409)return D(n.body);p.value=z(n,"forget this deployment")}async function D(n){var B;const e=_(n);k.value=e,U.value="",e.kind==="shared"&&(c.value="");const u=e.stack||((B=i.detail)==null?void 0:B.stack);if(e.kind!=="other"||!u)return;const E=((await V.get("/api/jobs")).body.jobs??[]).find(q=>q.state==="running"&&q.stack===u);E&&(U.value=E.id)}return(n,e)=>{const u=P("RouterLink");return a(),r("div",null,[o("section",fe,[e[30]||(e[30]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Lifecycle",-1)),d(i).detail?(a(),r(M,{key:1},[K.value?(a(),r("div",me,[e[12]||(e[12]=o("b",null,"No access token set.",-1)),o("p",null,[e[10]||(e[10]=t(" Every action below will be refused. Add your token under ",-1)),f(u,{to:"/settings"},{default:v(()=>[...e[9]||(e[9]=[t("Settings",-1)])]),_:1}),e[11]||(e[11]=t(". ",-1))])])):w("",!0),o("div",pe,[f(R,{variant:"primary",pending:s.value==="up",disabled:!!s.value||g.value,title:N("up"),onClick:e[0]||(e[0]=l=>A("up"))},{default:v(()=>[t(y(d(C)("up")),1)]),_:1},8,["pending","disabled","title"]),f(R,{pending:s.value==="verify",disabled:!!s.value||g.value,title:N("verify"),onClick:e[1]||(e[1]=l=>A("verify"))},{default:v(()=>[t(y(d(C)("verify")),1)]),_:1},8,["pending","disabled","title"]),f(R,{variant:"danger",pending:s.value==="down",disabled:!!s.value||g.value||d($)&&!T.value,title:N("down"),onClick:e[2]||(e[2]=l=>A("down"))},{default:v(()=>[t(y(d($)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),e[14]||(e[14]=o("span",{class:"grow"},null,-1)),f(u,{to:`/submit/${encodeURIComponent(d(i).id)}`},{default:v(()=>[...e[13]||(e[13]=[t("Edit spec & compose →",-1)])]),_:1},8,["to"])]),g.value?(a(),r("p",ye,[e[16]||(e[16]=t(" Something is already running on ",-1)),o("b",null,y(d(i).detail.stack),1),e[17]||(e[17]=t(". ",-1)),f(L,{label:"why actions wait"},{default:v(()=>[...e[15]||(e[15]=[t(" One action at a time per stack, and they are not queued. A teardown racing a deploy over the same database would corrupt it, so the second request is refused rather than delayed. ",-1)])]),_:1})])):w("",!0),o("p",we,[t(y(H.value)+" ",1),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[18]||(e[18]=[t("change",-1)])]),_:1},8,["to"])]),o("div",be,[o("label",ke,[S(o("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>x.value=l),type:"checkbox"},null,512),[[O,x.value]]),e[19]||(e[19]=t(" Check for leftovers afterwards ",-1))])]),x.value?w("",!0):(a(),r("p",ce,[...e[20]||(e[20]=[t(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),o("b",null,"Verify",-1),t(" yourself afterwards. ",-1)])])),d($)?(a(),r("div",he,[e[29]||(e[29]=o("b",null,"Shared — read this before tearing down.",-1)),o("p",null,[e[22]||(e[22]=t(" Tearing this down ",-1)),e[23]||(e[23]=o("b",null,"deletes its stored data",-1)),e[24]||(e[24]=t(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[25]||(e[25]=o("b",null,"every preview on this host breaks",-1)),e[26]||(e[26]=t(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),f(L,{label:"what tearing down runs"},{default:v(()=>[...e[21]||(e[21]=[o("code",null,"docker compose down -v",-1),t(" — the ",-1),o("code",null,"-v",-1),t(" is what removes the volumes. ",-1)])]),_:1})]),o("div",ge,[o("label",{for:`confirm-${d(i).id}`},[e[27]||(e[27]=t(" Type the stack name ",-1)),o("b",null,y(d(i).detail.stack),1),e[28]||(e[28]=t(" to confirm ",-1))],8,$e),S(o("input",{id:`confirm-${d(i).id}`,"onUpdate:modelValue":e[4]||(e[4]=l=>c.value=l),type:"text",placeholder:d(i).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Ce),[[Z,c.value,void 0,{trim:!0}]])]),c.value&&!T.value?(a(),r("p",xe," That does not match, so tearing down stays disabled. ")):w("",!0)])):w("",!0),p.value?(a(),Q(ne,{key:4,text:p.value,title:"The action was refused."},null,8,["text"])):w("",!0),k.value?(a(),Q(ue,{key:5,conflict:k.value,"job-id":U.value},null,8,["conflict","job-id"])):w("",!0)],64)):(a(),r("p",ve,[e[7]||(e[7]=t(" Actions are unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),f(u,{to:`/deployments/${encodeURIComponent(d(i).id)}/config`},{default:v(()=>[...e[6]||(e[6]=[t(" Config & variables ",-1)])]),_:1},8,["to"]),e[8]||(e[8]=t("first. ",-1))]))]),o("section",Te,[e[39]||(e[39]=o("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),d(i).detail?(a(),r(M,{key:1},[o("p",Re,[e[32]||(e[32]=t(" This removes the ",-1)),e[33]||(e[33]=o("em",null,"record only",-1)),e[34]||(e[34]=t(" — ",-1)),e[35]||(e[35]=o("b",null,"it never tears anything down",-1)),e[36]||(e[36]=t(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),f(L,{label:"when forgetting is refused"},{default:v(()=>[...e[31]||(e[31]=[t(" Refused while any container for this stack still exists — and refused just as firmly when docker cannot be reached, because “cannot confirm” is not evidence of absence. What is deleted is the stored spec, compose file and metadata. ",-1)])]),_:1})]),o("div",Ie,[o("label",Ue,[S(o("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>h.value=l),type:"checkbox"},null,512),[[O,h.value]]),e[37]||(e[37]=t(" I have torn this down and want the record removed ",-1))]),f(R,{variant:"danger",pending:s.value==="forget",disabled:!h.value||!!s.value,title:h.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:v(()=>[...e[38]||(e[38]=[t(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),r("p",je," Unavailable until the variables are filled in: this stack's containers are counted before the record can be forgotten, and that needs its name. "))])])}}});export{De as default};
|
|
2
|
+
//# sourceMappingURL=DangerTab-Nyebdr6k.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DangerTab-BOrQMzL3.js","sources":["../../src/components/ConflictNote.vue","../../src/views/tabs/DangerTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A 409, explained.\n *\n * \"409\" on this API always means the same thing about consequences — **refused, and nothing was\n * started** — but four different things about the cause, and guessing wrong sends the operator\n * down the wrong path. The classification is done on payload SHAPE in `client.ts`, never on the\n * message text, and the server's own message is always printed verbatim underneath.\n *\n * Note what is deliberately NOT distinguished: \"a job is in flight\" and \"docker did not answer\"\n * are shape-identical, so this renders neither claim — it prints the message and offers a link to\n * a running job only when one demonstrably exists.\n */\nimport type { Conflict } from '../api/client';\n\ndefineProps<{ conflict: Conflict; jobId?: string }>();\n</script>\n\n<template>\n <div class=\"banner\" :class=\"conflict.kind === 'shared' ? 'leaked' : 'info'\" role=\"alert\">\n <b>Refused — nothing was started.</b>\n <pre class=\"raw\" style=\"color: var(--fg-dim); max-height: 200px\">{{ conflict.text }}</pre>\n\n <p v-if=\"conflict.kind === 'shared'\">\n Type the stack name in the confirmation field above and press <code>down</code> again.\n </p>\n <p v-else-if=\"conflict.kind === 'containers'\">\n Run <code>down</code> first. Forgetting the record now would orphan those containers beyond\n the control plane's view: nothing left would know their stack name, their axes, or how to\n tear them down.\n </p>\n <p v-else-if=\"conflict.kind === 'referenced'\">\n These deployments still use this spec: <strong>{{ conflict.deployments.join(', ') }}</strong>.\n Deleting it would leave them with no way to be torn down.\n </p>\n <p v-else-if=\"jobId\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(jobId)}`\">Follow the running job →</RouterLink>\n </p>\n <p v-else>Nothing was retried. Wait for the current work to finish, then try again.</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Lifecycle actions, and forgetting the record. Everything on this page destroys something.\n *\n * The two guards that matter:\n *\n * 1. TYPED CONFIRMATION FOR A SHARED `down`. A checkbox is one stray click; typing a name is a\n * decision. The typed string is the resolved STACK NAME — not the deployment id — because the\n * stack is the actual blast target, it is what the server's own 409 refusal names, and it is\n * what `compose down -v` will be pointed at. The server holds the authoritative guard\n * (`down()` refuses without `force`, and the API answers 409 before starting a job), so this\n * is defence in depth, not the only barrier.\n *\n * 2. FORGETTING IS NOT TEARING DOWN. `DELETE` removes the record and never touches a container.\n * The server refuses with 409 while any container exists — and refuses just as firmly when\n * docker did not answer, because \"cannot confirm\" is not evidence of absence.\n */\nimport { computed, ref } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { api, classifyConflict, problem, type Conflict } from '../../api/client';\nimport type { ActionResponse, ConflictBody, JobsResponse } from '../../api/types';\nimport { dep, isShared, varsQuery } from '../../composables/useDeployment';\nimport { loadDeployments, state } from '../../composables/useControlPlane';\nimport { settings } from '../../composables/useSettings';\nimport { toast } from '../../composables/useToasts';\nimport { actionLabel } from '../../composables/useFormat';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ConflictNote from '../../components/ConflictNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\n\nconst router = useRouter();\n\nconst pending = ref<'' | 'up' | 'verify' | 'down' | 'forget'>('');\nconst actionError = ref('');\nconst conflict = ref<Conflict | null>(null);\nconst conflictJobId = ref('');\nconst downVerify = ref(true);\nconst forceTyped = ref('');\nconst forgetArmed = ref(false);\n\n/**\n * The variables these actions will send, as prose. Which variables are set decides which stack is\n * touched, so the NAMES are worth stating — the URL-encoded query string they become is not.\n */\nconst varsSummary = computed(() => {\n const names = dep.vars.filter((v) => v.k).map((v) => v.k);\n // NOT \"no variables\": with none set here the server resolves the ones stored with the deployment,\n // and claiming otherwise would have an operator hunting for variables that are already in place.\n return names.length\n ? `Sending ${names.join(', ')} with every action.`\n : 'Using the variables saved with this deployment.';\n});\n\n/** Exact match against the resolved stack name. Nothing looser — no trim-insensitive, no prefix. */\nconst forceArmed = computed(\n () => !!dep.detail?.stack && forceTyped.value === dep.detail.stack,\n);\n\nconst tokenMissing = computed(() => state.health?.authEnforced === true && !settings.token);\nconst busy = computed(() => dep.detail?.busy === true);\n\n/** A disabled control must say why. This is the text that answers it. */\nfunction whyDisabled(action: 'up' | 'verify' | 'down'): string | undefined {\n if (!dep.detail) return 'The spec has not resolved — the server cannot compute the stack name.';\n if (busy.value) return `A job is already in flight for ${dep.detail.stack}.`;\n if (action === 'down' && isShared.value && !forceArmed.value) {\n return `Type the stack name \"${dep.detail.stack}\" below to confirm a shared teardown.`;\n }\n return undefined;\n}\n\nasync function act(action: 'up' | 'verify' | 'down'): Promise<void> {\n if (!dep.detail) return;\n pending.value = action;\n actionError.value = '';\n conflict.value = null;\n\n const body =\n action === 'down'\n ? // `force` is only ever true for a shared deployment whose stack name was typed out in full.\n { verify: downVerify.value, force: isShared.value && forceArmed.value }\n : {};\n\n const r = await api.post<ActionResponse & ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}/${action}${varsQuery.value}`,\n body,\n );\n pending.value = '';\n\n if (r.status === 202) {\n const job = r.body.job;\n if (job?.id) {\n toast('info', `${actionLabel(action)} started on ${job.stack}`, {\n to: `/jobs/${encodeURIComponent(job.id)}`,\n toLabel: 'Follow',\n });\n void loadDeployments();\n void router.push(`/jobs/${encodeURIComponent(job.id)}`);\n return;\n }\n actionError.value = 'The action was accepted, but the response carried nothing to follow.';\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n\n actionError.value = problem(r, actionLabel(action).toLowerCase());\n toast('error', `${actionLabel(action)} was refused.`);\n}\n\nasync function forget(): Promise<void> {\n if (!forgetArmed.value) return;\n pending.value = 'forget';\n actionError.value = '';\n conflict.value = null;\n\n const r = await api.del<ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}${varsQuery.value}`,\n );\n pending.value = '';\n\n if (r.ok) {\n toast('ok', `Forgot ${dep.id}. Nothing was torn down.`);\n void loadDeployments();\n void router.push('/deployments');\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n actionError.value = problem(r, 'forget this deployment');\n}\n\n/**\n * Classify on payload SHAPE (in `client.ts`), never on message text — then look for a running job\n * ONLY to offer a link. \"A job is in flight\" and \"docker did not answer\" are shape-identical, so\n * neither is claimed; the server's message is printed verbatim either way. Never retry.\n */\nasync function onConflict(body: ConflictBody): Promise<void> {\n const c = classifyConflict(body);\n conflict.value = c;\n conflictJobId.value = '';\n if (c.kind === 'shared') forceTyped.value = '';\n\n const stack = c.stack || dep.detail?.stack;\n if (c.kind !== 'other' || !stack) return;\n const jl = await api.get<JobsResponse>('/api/jobs');\n const live = (jl.body.jobs ?? []).find((j) => j.state === 'running' && j.stack === stack);\n if (live) conflictJobId.value = live.id;\n}\n</script>\n\n<template>\n <div>\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Lifecycle</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Actions are unavailable until this deployment's variables are filled in — without them its\n stack has no name to act on. Set them under\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">\n Config & variables </RouterLink\n >first.\n </p>\n\n <template v-else>\n <div v-if=\"tokenMissing\" class=\"banner warn\">\n <b>No access token set.</b>\n <p>\n Every action below will be refused. Add your token under\n <RouterLink to=\"/settings\">Settings</RouterLink>.\n </p>\n </div>\n\n <div class=\"row\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending === 'up'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('up')\"\n @click=\"act('up')\"\n >\n {{ actionLabel('up') }}\n </ActionButton>\n <ActionButton\n :pending=\"pending === 'verify'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('verify')\"\n @click=\"act('verify')\"\n >\n {{ actionLabel('verify') }}\n </ActionButton>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'down'\"\n :disabled=\"!!pending || busy || (isShared && !forceArmed)\"\n :title=\"whyDisabled('down')\"\n @click=\"act('down')\"\n >\n {{ isShared ? 'Tear down (force)' : 'Tear down' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink :to=\"`/submit/${encodeURIComponent(dep.id)}`\">Edit spec & compose →</RouterLink>\n </div>\n\n <p v-if=\"busy\" class=\"hint\">\n Something is already running on <b>{{ dep.detail.stack }}</b>.\n <InfoHint label=\"why actions wait\">\n One action at a time per stack, and they are not queued. A teardown racing a deploy over\n the same database would corrupt it, so the second request is refused rather than delayed.\n </InfoHint>\n </p>\n <p class=\"hint\">\n {{ varsSummary }}\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">change</RouterLink>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"downVerify\" type=\"checkbox\" />\n Check for leftovers afterwards\n </label>\n </div>\n <p v-if=\"!downVerify\" class=\"hint\">\n Nothing will check that teardown actually finished. A teardown that silently half-worked is\n the exact failure this tool exists to catch — run <b>Verify</b> yourself afterwards.\n </p>\n\n <!--\n Gate 1 of 2. The typed name is the point: a checkbox is one stray click, typing the stack\n name is a decision.\n -->\n <div v-if=\"isShared\" class=\"banner leaked\">\n <b>Shared — read this before tearing down.</b>\n <p>\n Tearing this down <b>deletes its stored data</b>: the TLS certificates, the shared\n database or queue, admin credentials. Nothing here recreates them, so\n <b>every preview on this host breaks</b> until someone rebuilds it by hand. The button is\n the same one that is routine on a single preview.\n <InfoHint label=\"what tearing down runs\">\n <code>docker compose down -v</code> — the <code>-v</code> is what removes the volumes.\n </InfoHint>\n </p>\n <div class=\"field\" style=\"margin-top: var(--s3); max-width: 380px\">\n <label :for=\"`confirm-${dep.id}`\">\n Type the stack name <b>{{ dep.detail.stack }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${dep.id}`\"\n v-model.trim=\"forceTyped\"\n type=\"text\"\n :placeholder=\"dep.detail.stack\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <p v-if=\"forceTyped && !forceArmed\" class=\"s-failed\">\n That does not match, so tearing down stays disabled.\n </p>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote v-if=\"conflict\" :conflict=\"conflict\" :job-id=\"conflictJobId\" />\n </template>\n </section>\n\n <!-- ============================ forget ============================ -->\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Forget this deployment</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until the variables are filled in: this stack's containers are counted before the\n record can be forgotten, and that needs its name.\n </p>\n <template v-else>\n <p class=\"dim\">\n This removes the <em>record only</em> — <b>it never tears anything down</b>. Afterwards\n nothing here knows how to remove whatever this deployment created.\n <InfoHint label=\"when forgetting is refused\">\n Refused while any container for this stack still exists — and refused just as firmly when\n docker cannot be reached, because “cannot confirm” is not evidence of absence. What is\n deleted is the stored spec, compose file and metadata.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"forgetArmed\" type=\"checkbox\" />\n I have torn this down and want the record removed\n </label>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'forget'\"\n :disabled=\"!forgetArmed || !!pending\"\n :title=\"forgetArmed ? undefined : 'Confirm you have torn this down first.'\"\n @click=\"forget\"\n >\n Forget\n </ActionButton>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_cache","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","_component_RouterLink","_openBlock","router","useRouter","pending","ref","actionError","conflict","conflictJobId","downVerify","forceTyped","forgetArmed","varsSummary","computed","names","dep","v","forceArmed","_a","tokenMissing","state","settings","busy","whyDisabled","action","isShared","act","body","r","api","varsQuery","job","toast","actionLabel","loadDeployments","onConflict","problem","forget","c","classifyConflict","stack","live","j","_unref","_Fragment","ActionButton","InfoHint","_hoisted_6","_createTextVNode","_hoisted_7","_hoisted_8","$event","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_14","_createBlock","ErrorNote","ConflictNote","_hoisted_15","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_16"],"mappings":"wwBAmBEA,EAoBM,MAAA,CApBD,MAAKC,EAAA,CAAC,SAAiBC,EAAA,SAAS,OAAI,SAAA,SAAA,MAAA,CAAA,EAAmC,KAAK,OAAA,GAC/EC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,EAAqC,SAAlC,iCAA8B,EAAA,GACjCA,EAA0F,MAA1FC,GAA0FC,EAAtBJ,EAAA,SAAS,IAAI,EAAA,CAAA,EAExEA,EAAA,SAAS,OAAI,cAAtBF,EAEI,IAAAO,GAAA,CAAA,GAAAJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAFiC,kEAC2B,EAAA,EAAAC,EAAiB,YAAX,OAAI,EAAA,IAAO,WACjF,EAAA,CAAA,MACcF,EAAA,SAAS,OAAI,kB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MAwGFC,EAiCU,UAjCVmE,GAiCU,eAhCRnE,EAAgF,KAAA,CAA5E,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,CAAA,EAAiC,yBAAsB,EAAA,GAEjEmD,EAAA5B,CAAA,EAAI,YAId3B,EAyBWwD,EAAA,CAAA,IAAA,GAAA,CAxBTpD,EAQI,IARJoE,GAQI,iBARW,qBACI,EAAA,GAAArE,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAoB,UAAhB,cAAW,EAAA,mBAAK,MAAG,EAAA,GAAAD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAmC,SAAhC,+BAA4B,EAAA,mBAAI,mFAE3E,EAAA,GAAAO,EAIW+C,EAAA,CAJD,MAAM,8BAA4B,WAAC,IAI7C,CAAA,GAAAvD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ6C,4OAI7C,EAAA,CAAA,aAEFC,EAcM,MAdNqE,GAcM,CAbJrE,EAGQ,QAHRsE,GAGQ,GAFNtE,EAA+C,QAAA,sCAA/BmB,EAAW,MAAAwC,GAAE,KAAK,UAAA,gBAAlBxC,EAAA,KAAW,CAAA,mBAAoB,sDAEjD,EAAA,EAAA,GACAZ,EAQe8C,EAAA,CAPb,QAAQ,SACP,QAASzC,EAAA,QAAO,SAChB,SAAQ,CAAGO,EAAA,OAAW,CAAA,CAAMP,EAAA,MAC5B,MAAOO,EAAA,MAAc,OAAS,yCAC9B,QAAO0B,CAAA,aACT,IAED,CAAA,GAAA9C,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA,yDA3BJH,EAGI,IAHJ2E,GAAmC,mJAGnC"}
|
|
1
|
+
{"version":3,"file":"DangerTab-Nyebdr6k.js","sources":["../../src/components/ConflictNote.vue","../../src/views/tabs/DangerTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A 409, explained.\n *\n * \"409\" on this API always means the same thing about consequences — **refused, and nothing was\n * started** — but four different things about the cause, and guessing wrong sends the operator\n * down the wrong path. The classification is done on payload SHAPE in `client.ts`, never on the\n * message text, and the server's own message is always printed verbatim underneath.\n *\n * Note what is deliberately NOT distinguished: \"a job is in flight\" and \"docker did not answer\"\n * are shape-identical, so this renders neither claim — it prints the message and offers a link to\n * a running job only when one demonstrably exists.\n */\nimport type { Conflict } from '../api/client';\n\ndefineProps<{ conflict: Conflict; jobId?: string }>();\n</script>\n\n<template>\n <div class=\"banner\" :class=\"conflict.kind === 'shared' ? 'leaked' : 'info'\" role=\"alert\">\n <b>Refused — nothing was started.</b>\n <pre class=\"raw\" style=\"color: var(--fg-dim); max-height: 200px\">{{ conflict.text }}</pre>\n\n <p v-if=\"conflict.kind === 'shared'\">\n Type the stack name in the confirmation field above and press <code>down</code> again.\n </p>\n <p v-else-if=\"conflict.kind === 'containers'\">\n Run <code>down</code> first. Forgetting the record now would orphan those containers beyond\n the control plane's view: nothing left would know their stack name, their axes, or how to\n tear them down.\n </p>\n <p v-else-if=\"conflict.kind === 'referenced'\">\n These deployments still use this spec: <strong>{{ conflict.deployments.join(', ') }}</strong>.\n Deleting it would leave them with no way to be torn down.\n </p>\n <p v-else-if=\"jobId\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(jobId)}`\">Follow the running job →</RouterLink>\n </p>\n <p v-else>Nothing was retried. Wait for the current work to finish, then try again.</p>\n </div>\n</template>\n","<script setup lang=\"ts\">\n/**\n * Lifecycle actions, and forgetting the record. Everything on this page destroys something.\n *\n * The two guards that matter:\n *\n * 1. TYPED CONFIRMATION FOR A SHARED `down`. A checkbox is one stray click; typing a name is a\n * decision. The typed string is the resolved STACK NAME — not the deployment id — because the\n * stack is the actual blast target, it is what the server's own 409 refusal names, and it is\n * what `compose down -v` will be pointed at. The server holds the authoritative guard\n * (`down()` refuses without `force`, and the API answers 409 before starting a job), so this\n * is defence in depth, not the only barrier.\n *\n * 2. FORGETTING IS NOT TEARING DOWN. `DELETE` removes the record and never touches a container.\n * The server refuses with 409 while any container exists — and refuses just as firmly when\n * docker did not answer, because \"cannot confirm\" is not evidence of absence.\n */\nimport { computed, ref } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { api, classifyConflict, problem, type Conflict } from '../../api/client';\nimport type { ActionResponse, ConflictBody, JobsResponse } from '../../api/types';\nimport { dep, isShared, varsQuery } from '../../composables/useDeployment';\nimport { loadDeployments, state } from '../../composables/useControlPlane';\nimport { settings } from '../../composables/useSettings';\nimport { toast } from '../../composables/useToasts';\nimport { actionLabel } from '../../composables/useFormat';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ConflictNote from '../../components/ConflictNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\n\nconst router = useRouter();\n\nconst pending = ref<'' | 'up' | 'verify' | 'down' | 'forget'>('');\nconst actionError = ref('');\nconst conflict = ref<Conflict | null>(null);\nconst conflictJobId = ref('');\nconst downVerify = ref(true);\nconst forceTyped = ref('');\nconst forgetArmed = ref(false);\n\n/**\n * The variables these actions will send, as prose. Which variables are set decides which stack is\n * touched, so the NAMES are worth stating — the URL-encoded query string they become is not.\n */\nconst varsSummary = computed(() => {\n const names = dep.vars.filter((v) => v.k).map((v) => v.k);\n // NOT \"no variables\": with none set here the server resolves the ones stored with the deployment,\n // and claiming otherwise would have an operator hunting for variables that are already in place.\n return names.length\n ? `Sending ${names.join(', ')} with every action.`\n : 'Using the variables saved with this deployment.';\n});\n\n/** Exact match against the resolved stack name. Nothing looser — no trim-insensitive, no prefix. */\nconst forceArmed = computed(\n () => !!dep.detail?.stack && forceTyped.value === dep.detail.stack,\n);\n\nconst tokenMissing = computed(() => state.health?.authEnforced === true && !settings.token);\nconst busy = computed(() => dep.detail?.busy === true);\n\n/** A disabled control must say why. This is the text that answers it. */\nfunction whyDisabled(action: 'up' | 'verify' | 'down'): string | undefined {\n if (!dep.detail) return 'The spec has not resolved — the server cannot compute the stack name.';\n if (busy.value) return `A job is already in flight for ${dep.detail.stack}.`;\n if (action === 'down' && isShared.value && !forceArmed.value) {\n return `Type the stack name \"${dep.detail.stack}\" below to confirm a shared teardown.`;\n }\n return undefined;\n}\n\nasync function act(action: 'up' | 'verify' | 'down'): Promise<void> {\n if (!dep.detail) return;\n pending.value = action;\n actionError.value = '';\n conflict.value = null;\n\n const body =\n action === 'down'\n ? // `force` is only ever true for a shared deployment whose stack name was typed out in full.\n { verify: downVerify.value, force: isShared.value && forceArmed.value }\n : {};\n\n const r = await api.post<ActionResponse & ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}/${action}${varsQuery.value}`,\n body,\n );\n pending.value = '';\n\n if (r.status === 202) {\n const job = r.body.job;\n if (job?.id) {\n toast('info', `${actionLabel(action)} started on ${job.stack}`, {\n to: `/jobs/${encodeURIComponent(job.id)}`,\n toLabel: 'Follow',\n });\n void loadDeployments();\n void router.push(`/jobs/${encodeURIComponent(job.id)}`);\n return;\n }\n actionError.value = 'The action was accepted, but the response carried nothing to follow.';\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n\n actionError.value = problem(r, actionLabel(action).toLowerCase());\n toast('error', `${actionLabel(action)} was refused.`);\n}\n\nasync function forget(): Promise<void> {\n if (!forgetArmed.value) return;\n pending.value = 'forget';\n actionError.value = '';\n conflict.value = null;\n\n const r = await api.del<ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}${varsQuery.value}`,\n );\n pending.value = '';\n\n if (r.ok) {\n toast('ok', `Forgot ${dep.id}. Nothing was torn down.`);\n void loadDeployments();\n void router.push('/deployments');\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n actionError.value = problem(r, 'forget this deployment');\n}\n\n/**\n * Classify on payload SHAPE (in `client.ts`), never on message text — then look for a running job\n * ONLY to offer a link. \"A job is in flight\" and \"docker did not answer\" are shape-identical, so\n * neither is claimed; the server's message is printed verbatim either way. Never retry.\n */\nasync function onConflict(body: ConflictBody): Promise<void> {\n const c = classifyConflict(body);\n conflict.value = c;\n conflictJobId.value = '';\n if (c.kind === 'shared') forceTyped.value = '';\n\n const stack = c.stack || dep.detail?.stack;\n if (c.kind !== 'other' || !stack) return;\n const jl = await api.get<JobsResponse>('/api/jobs');\n const live = (jl.body.jobs ?? []).find((j) => j.state === 'running' && j.stack === stack);\n if (live) conflictJobId.value = live.id;\n}\n</script>\n\n<template>\n <div>\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Lifecycle</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Actions are unavailable until this deployment's variables are filled in — without them its\n stack has no name to act on. Set them under\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">\n Config & variables </RouterLink\n >first.\n </p>\n\n <template v-else>\n <div v-if=\"tokenMissing\" class=\"banner warn\">\n <b>No access token set.</b>\n <p>\n Every action below will be refused. Add your token under\n <RouterLink to=\"/settings\">Settings</RouterLink>.\n </p>\n </div>\n\n <div class=\"row\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending === 'up'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('up')\"\n @click=\"act('up')\"\n >\n {{ actionLabel('up') }}\n </ActionButton>\n <ActionButton\n :pending=\"pending === 'verify'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('verify')\"\n @click=\"act('verify')\"\n >\n {{ actionLabel('verify') }}\n </ActionButton>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'down'\"\n :disabled=\"!!pending || busy || (isShared && !forceArmed)\"\n :title=\"whyDisabled('down')\"\n @click=\"act('down')\"\n >\n {{ isShared ? 'Tear down (force)' : 'Tear down' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink :to=\"`/submit/${encodeURIComponent(dep.id)}`\">Edit spec & compose →</RouterLink>\n </div>\n\n <p v-if=\"busy\" class=\"hint\">\n Something is already running on <b>{{ dep.detail.stack }}</b>.\n <InfoHint label=\"why actions wait\">\n One action at a time per stack, and they are not queued. A teardown racing a deploy over\n the same database would corrupt it, so the second request is refused rather than delayed.\n </InfoHint>\n </p>\n <p class=\"hint\">\n {{ varsSummary }}\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">change</RouterLink>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"downVerify\" type=\"checkbox\" />\n Check for leftovers afterwards\n </label>\n </div>\n <p v-if=\"!downVerify\" class=\"hint\">\n Nothing will check that teardown actually finished. A teardown that silently half-worked is\n the exact failure this tool exists to catch — run <b>Verify</b> yourself afterwards.\n </p>\n\n <!--\n Gate 1 of 2. The typed name is the point: a checkbox is one stray click, typing the stack\n name is a decision.\n -->\n <div v-if=\"isShared\" class=\"banner leaked\">\n <b>Shared — read this before tearing down.</b>\n <p>\n Tearing this down <b>deletes its stored data</b>: the TLS certificates, the shared\n database or queue, admin credentials. Nothing here recreates them, so\n <b>every preview on this host breaks</b> until someone rebuilds it by hand. The button is\n the same one that is routine on a single preview.\n <InfoHint label=\"what tearing down runs\">\n <code>docker compose down -v</code> — the <code>-v</code> is what removes the volumes.\n </InfoHint>\n </p>\n <div class=\"field\" style=\"margin-top: var(--s3); max-width: 380px\">\n <label :for=\"`confirm-${dep.id}`\">\n Type the stack name <b>{{ dep.detail.stack }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${dep.id}`\"\n v-model.trim=\"forceTyped\"\n type=\"text\"\n :placeholder=\"dep.detail.stack\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <p v-if=\"forceTyped && !forceArmed\" class=\"s-failed\">\n That does not match, so tearing down stays disabled.\n </p>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote v-if=\"conflict\" :conflict=\"conflict\" :job-id=\"conflictJobId\" />\n </template>\n </section>\n\n <!-- ============================ forget ============================ -->\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Forget this deployment</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until the variables are filled in: this stack's containers are counted before the\n record can be forgotten, and that needs its name.\n </p>\n <template v-else>\n <p class=\"dim\">\n This removes the <em>record only</em> — <b>it never tears anything down</b>. Afterwards\n nothing here knows how to remove whatever this deployment created.\n <InfoHint label=\"when forgetting is refused\">\n Refused while any container for this stack still exists — and refused just as firmly when\n docker cannot be reached, because “cannot confirm” is not evidence of absence. What is\n deleted is the stored spec, compose file and metadata.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"forgetArmed\" type=\"checkbox\" />\n I have torn this down and want the record removed\n </label>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'forget'\"\n :disabled=\"!forgetArmed || !!pending\"\n :title=\"forgetArmed ? undefined : 'Confirm you have torn this down first.'\"\n @click=\"forget\"\n >\n Forget\n </ActionButton>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["_createElementBlock","_normalizeClass","__props","_cache","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","_component_RouterLink","_openBlock","router","useRouter","pending","ref","actionError","conflict","conflictJobId","downVerify","forceTyped","forgetArmed","varsSummary","computed","names","dep","v","forceArmed","_a","tokenMissing","state","settings","busy","whyDisabled","action","isShared","act","body","r","api","varsQuery","job","toast","actionLabel","loadDeployments","onConflict","problem","forget","c","classifyConflict","stack","live","j","_unref","_Fragment","ActionButton","InfoHint","_hoisted_6","_createTextVNode","_hoisted_7","_hoisted_8","$event","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_14","_createBlock","ErrorNote","ConflictNote","_hoisted_15","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_16"],"mappings":"wwBAmBEA,EAoBM,MAAA,CApBD,MAAKC,EAAA,CAAC,SAAiBC,EAAA,SAAS,OAAI,SAAA,SAAA,MAAA,CAAA,EAAmC,KAAK,OAAA,GAC/EC,EAAA,CAAA,IAAAA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QAAO0B,CAAA,aACT,IAED,CAAA,GAAA9C,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA,yDA3BJH,EAGI,IAHJ2E,GAAmC,mJAGnC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as L,p as N,c as a,a as e,u as t,q as _,t as l,f as r,e as u,w as c,_ as k,F as m,s as w,g as h,x as g,y as v,z as i,r as z,A as R,B as V,C as $,j as S,o,D as x,E as A}from"./index-D8OAewba.js";import{a as I,b as U,t as q}from"./useFormat-CKJxQp_i.js";import{_ as F}from"./StateBadge.vue_vue_type_script_setup_true_lang-B5C48Wlo.js";import{_ as C}from"./SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js";const J={key:0,class:"banner leaked land"},T={class:"grid-2"},H={class:"panel"},M={class:"phead"},O={key:0,class:"badge"},P={key:0,class:"s-failed"},Y={key:0,class:"banner warn"},G={key:1,class:"banner warn"},K={key:2,class:"banner failed"},Q={key:3,class:"cards"},W={class:"stagger"},X={class:"name","data-label":"service"},Z={class:"name dim","data-label":"image"},ss={class:"panel"},es={class:"phead"},ts={key:0,class:"s-failed"},os={class:"stats"},ns=["data-zero"],as={class:"v"},ls=["data-zero"],rs={class:"v"},is=["data-zero"],ds={class:"v"},us=["data-zero"],cs={class:"v"},hs=["data-zero"],vs={class:"v"},ms={key:0,class:"stat unknown"},ps={class:"v"},ks={key:0,class:"hint"},ys={key:1,class:"hint"},bs={class:"panel"},gs={class:"phead"},fs={key:0,class:"s-failed"},_s={key:2,class:"kvlist stagger"},ws={class:"k"},zs={class:"v"},Cs={class:"mute",style:{"font-size":"var(--t-xs)"}},Es={key:0,class:"mute"},Ls=L({__name:"DashboardView",setup(Ds){const d=z(null),y=z(""),E=z(!1);async function D(){const b=await R.get("/api/control");if(E.value=!0,!b.ok){y.value=V(b,"load the control stack");return}y.value="";const s=b.body;d.value={project:s.project??"",reachable:s.reachable!==!1,parseError:!!s.parseError,services:Array.isArray(s.services)?s.services:[],managedBy:s.managedBy??"",actionable:s.actionable===!0,note:s.note??""}}N(()=>void D(),1e4);const B=$(()=>v.jobs.slice(0,8));return(b,s)=>{var j;const p=S("RouterLink");return o(),a("div",null,[s[28]||(s[28]=e("div",{class:"page-head"},[e("div",null,[e("h1",null,"Dashboard"),e("div",{class:"sub"},"Everything running on this host.")])],-1)),t(_).length?(o(),a("div",J,[e("b",null,l(t(_).length)+" teardown(s) left something behind.",1),e("p",null,[s[1]||(s[1]=r(" Something survived being torn down, and nothing else is going to remove it. ",-1)),u(k,{label:"what was already cleaned up"},{default:c(()=>[...s[0]||(s[0]=[e("code",null,"compose down -v",-1),r(" removed the containers, volumes and networks — whatever is left is outside compose's reach. ",-1)])]),_:1}),(o(!0),a(m,null,w(t(_).slice(0,3),n=>(o(),g(p,{key:n.id,to:`/jobs/${encodeURIComponent(n.id)}`,style:{"margin-left":"8px"}},{default:c(()=>[r(l(n.stack)+" →",1)]),_:2},1032,["to"]))),128))])])):h("",!0),e("div",T,[e("section",H,[e("div",M,[s[3]||(s[3]=e("h2",{class:"section"},"Control stack",-1)),u(k,{label:"why there are no actions here"},{default:c(()=>{var n;return[s[2]||(s[2]=r(" pstack itself runs in this stack, so starting or stopping it here would kill the process handling the request — and a failed self-upgrade would leave the host with no control plane and no way back in. It is managed from the host instead. ",-1)),(n=d.value)!=null&&n.managedBy?(o(),a(m,{key:0},[r("Managed by "+l(d.value.managedBy)+".",1)],64)):h("",!0)]}),_:1}),(j=d.value)!=null&&j.project?(o(),a("span",O,l(d.value.project),1)):h("",!0),s[4]||(s[4]=e("span",{class:"grow"},null,-1)),e("button",{class:"sm ghost",onClick:D},"Refresh")]),y.value?(o(),a("p",P,l(y.value),1)):E.value?d.value?(o(),a(m,{key:2},[d.value.reachable?d.value.parseError?(o(),a("div",G,[...s[8]||(s[8]=[e("b",null,"Docker's answer could not be read.",-1),e("p",null,"Service state is unknown for this refresh; the stack itself may be fine.",-1)])])):d.value.services.length?h("",!0):(o(),a("div",K,[...s[9]||(s[9]=[e("b",null,"Nothing is running in this project.",-1),e("p",null," Docker answered clearly, so the control stack really is down — yet you are reading a page it serves. You are most likely reaching it by some other route. ",-1)])])):(o(),a("div",Y,[s[7]||(s[7]=e("b",null,"Docker did not answer.",-1)),e("p",null,[s[6]||(s[6]=r(" Check Docker is running, then refresh. ",-1)),u(k,{label:"why this is not the same as nothing running"},{default:c(()=>[...s[5]||(s[5]=[r(" This is ",-1),e("em",null,"not",-1),r(" the same as “nothing is running”: the control stack may be perfectly healthy while this process cannot reach the Docker socket. ",-1)])]),_:1})])])),d.value.services.length?(o(),a("table",Q,[s[10]||(s[10]=e("thead",null,[e("tr",null,[e("th",null,"service"),e("th",null,"state"),e("th",null,"health"),e("th",null,"image")])],-1)),e("tbody",W,[(o(!0),a(m,null,w(d.value.services,(n,f)=>(o(),a("tr",{key:n.name,style:x({"--i":f})},[e("td",X,l(n.name),1),e("td",{"data-label":"state",class:A(n.state==="running"?"s-ok":"s-failed")},l(n.state||"—"),3),e("td",{"data-label":"health",class:A(n.health==="healthy"?"s-ok":n.health?"s-failed":"")},l(n.health||"—"),3),e("td",Z,l(n.image||"—"),1)],4))),128))])])):h("",!0)],64)):h("",!0):(o(),g(C,{key:1,rows:3}))]),e("div",null,[e("section",ss,[e("div",es,[s[12]||(s[12]=e("h2",{class:"section"},"Deployments",-1)),s[13]||(s[13]=e("span",{class:"grow"},null,-1)),u(p,{to:"/deployments"},{default:c(()=>[...s[11]||(s[11]=[r("all →",-1)])]),_:1})]),t(v).deploymentsError?(o(),a("p",ts,l(t(v).deploymentsError),1)):t(v).deploymentsLoaded?(o(),a(m,{key:2},[e("div",os,[e("div",{class:"stat","data-zero":t(i).total===0},[e("div",as,l(t(i).total),1),s[14]||(s[14]=e("div",{class:"k"},"total",-1))],8,ns),e("div",{class:"stat","data-zero":t(i).isolated===0},[e("div",rs,l(t(i).isolated),1),s[15]||(s[15]=e("div",{class:"k"},"isolated",-1))],8,ls),e("div",{class:"stat","data-zero":t(i).shared===0},[e("div",ds,l(t(i).shared),1),s[16]||(s[16]=e("div",{class:"k"},"shared",-1))],8,is),e("div",{class:"stat","data-zero":t(i).running===0},[e("div",cs,l(t(i).running),1),s[17]||(s[17]=e("div",{class:"k"},"running",-1))],8,us),e("div",{class:"stat busy","data-zero":t(i).busy===0},[e("div",vs,l(t(i).busy),1),s[18]||(s[18]=e("div",{class:"k"},"busy",-1))],8,hs),t(i).unknown?(o(),a("div",ms,[e("div",ps,l(t(i).unknown),1),s[19]||(s[19]=e("div",{class:"k"},"unknown",-1))])):h("",!0)]),t(i).unresolved?(o(),a("p",ks,[r(l(t(i).unresolved)+" deployment(s) are missing variables. ",1),u(p,{to:"/deployments"},{default:c(()=>[...s[20]||(s[20]=[r("Open one and set them.",-1)])]),_:1})])):t(i).unknown?(o(),a("p",ys,[s[22]||(s[22]=r(" “Unknown” means it could not be determined ",-1)),u(k,{label:"what unknown means"},{default:c(()=>[...s[21]||(s[21]=[r(" — ",-1),e("em",null,"not",-1),r(" that the deployment is idle. An unknown is never counted as a zero, which is how a live stack gets reported as torn down. ",-1)])]),_:1})])):h("",!0)],64)):(o(),g(C,{key:1,rows:2,tall:""}))]),e("section",bs,[e("div",gs,[s[24]||(s[24]=e("h2",{class:"section"},"Recent jobs",-1)),s[25]||(s[25]=e("span",{class:"grow"},null,-1)),u(p,{to:"/jobs"},{default:c(()=>[...s[23]||(s[23]=[r("all →",-1)])]),_:1})]),t(v).jobsError?(o(),a("p",fs,l(t(v).jobsError),1)):t(v).jobsLoaded?(o(),a("ul",_s,[(o(!0),a(m,null,w(B.value,(n,f)=>(o(),a("li",{key:n.id,style:x({"--i":f})},[e("span",ws,[u(F,{state:n.state},null,8,["state"])]),e("span",zs,[u(p,{to:`/jobs/${encodeURIComponent(n.id)}`},{default:c(()=>[r(l(t(I)(n.action))+" "+l(n.stack),1)]),_:2},1032,["to"]),e("span",Cs," · "+l(t(U)(n.startedAt))+" · "+l(t(q)(n.startedAt,n.endedAt)),1)])],4))),128)),B.value.length?h("",!0):(o(),a("li",Es,[s[27]||(s[27]=r(" No jobs yet. ",-1)),u(k,{label:"how long job history is kept"},{default:c(()=>[...s[26]||(s[26]=[r(" History is held in memory, so restarting the server clears it. A job record is the transcript of an attempt, not the truth about what exists now. ",-1)])]),_:1})]))])):(o(),g(C,{key:1,rows:4}))])])])])}}});export{Ls as default};
|
|
2
|
+
//# sourceMappingURL=DashboardView-CFwb63EX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DashboardView-CFwb63EX.js","sources":["../../src/views/DashboardView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Dashboard: control-stack health, deployment counts, recent jobs, activity.\n *\n * The deployment and job lists are already polled by the shell, so this view only fetches the one\n * thing nobody else needs — the control stack.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Control } from '../api/types';\nimport { leakedJobs, state, summary } from '../composables/useControlPlane';\nimport { usePolling } from '../composables/usePolling';\nimport { actionLabel, ago, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst control = ref<Control | null>(null);\nconst controlError = ref('');\nconst controlLoaded = ref(false);\n\nasync function loadControl(): Promise<void> {\n const r = await api.get<Control>('/api/control');\n controlLoaded.value = true;\n if (!r.ok) {\n controlError.value = problem(r, 'load the control stack');\n return;\n }\n controlError.value = '';\n const b = r.body;\n control.value = {\n project: b.project ?? '',\n // `reachable !== false`, not `!!reachable`: an older build that omits the field should not be\n // reported as \"docker did not answer\".\n reachable: b.reachable !== false,\n parseError: !!b.parseError,\n services: Array.isArray(b.services) ? b.services : [],\n managedBy: b.managedBy ?? '',\n actionable: b.actionable === true,\n note: b.note ?? '',\n };\n}\n\nusePolling(() => void loadControl(), 10000);\n\nconst recentJobs = computed(() => state.jobs.slice(0, 8));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Dashboard</h1>\n <div class=\"sub\">Everything running on this host.</div>\n </div>\n </div>\n\n <!--\n A leak is the single thing this whole tool exists to catch, so it outranks every other panel\n on the page. Nothing else will clean up what survived a teardown.\n -->\n <div v-if=\"leakedJobs.length\" class=\"banner leaked land\">\n <b>{{ leakedJobs.length }} teardown(s) left something behind.</b>\n <p>\n Something survived being torn down, and nothing else is going to remove it.\n <InfoHint label=\"what was already cleaned up\">\n <code>compose down -v</code> removed the containers, volumes and networks — whatever is\n left is outside compose's reach.\n </InfoHint>\n <RouterLink\n v-for=\"j in leakedJobs.slice(0, 3)\"\n :key=\"j.id\"\n :to=\"`/jobs/${encodeURIComponent(j.id)}`\"\n style=\"margin-left: 8px\"\n >{{ j.stack }} →</RouterLink\n >\n </p>\n </div>\n\n <div class=\"grid-2\">\n <!-- ============================ control stack ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Control stack</h2>\n <InfoHint label=\"why there are no actions here\">\n pstack itself runs in this stack, so starting or stopping it here would kill the process\n handling the request — and a failed self-upgrade would leave the host with no control\n plane and no way back in. It is managed from the host instead.\n <template v-if=\"control?.managedBy\">Managed by {{ control.managedBy }}.</template>\n </InfoHint>\n <span v-if=\"control?.project\" class=\"badge\">{{ control.project }}</span>\n <span class=\"grow\" />\n <button class=\"sm ghost\" @click=\"loadControl\">Refresh</button>\n </div>\n\n <p v-if=\"controlError\" class=\"s-failed\">{{ controlError }}</p>\n <SkeletonList v-else-if=\"!controlLoaded\" :rows=\"3\" />\n\n <template v-else-if=\"control\">\n <!--\n Three distinct failure shapes. Collapsing any of them into \"nothing is running\" would be\n a lie an operator acts on.\n -->\n <div v-if=\"!control.reachable\" class=\"banner warn\">\n <b>Docker did not answer.</b>\n <p>\n Check Docker is running, then refresh.\n <InfoHint label=\"why this is not the same as nothing running\">\n This is <em>not</em> the same as “nothing is running”: the control stack may be\n perfectly healthy while this process cannot reach the Docker socket.\n </InfoHint>\n </p>\n </div>\n <div v-else-if=\"control.parseError\" class=\"banner warn\">\n <b>Docker's answer could not be read.</b>\n <p>Service state is unknown for this refresh; the stack itself may be fine.</p>\n </div>\n <div v-else-if=\"!control.services.length\" class=\"banner failed\">\n <b>Nothing is running in this project.</b>\n <p>\n Docker answered clearly, so the control stack really is down — yet you are reading a\n page it serves. You are most likely reaching it by some other route.\n </p>\n </div>\n\n <table v-if=\"control.services.length\" class=\"cards\">\n <thead>\n <tr>\n <th>service</th>\n <th>state</th>\n <th>health</th>\n <th>image</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in control.services\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"service\">{{ s.name }}</td>\n <td data-label=\"state\" :class=\"s.state === 'running' ? 's-ok' : 's-failed'\">\n {{ s.state || '—' }}\n </td>\n <td\n data-label=\"health\"\n :class=\"s.health === 'healthy' ? 's-ok' : s.health ? 's-failed' : ''\"\n >\n {{ s.health || '—' }}\n </td>\n <td class=\"name dim\" data-label=\"image\">{{ s.image || '—' }}</td>\n </tr>\n </tbody>\n </table>\n\n <!--\n NEVER ADD AN ACTION HERE, not even a safe one. The API serving this page runs INSIDE this\n stack: `up` would kill the process performing it, and a failed self-upgrade leaves the\n host with no control plane and no remote way in. The server says `actionable: false` for\n exactly this reason.\n\n This used to be a banner reading \"Read-only — there are no actions here\", which spent a\n block of the page announcing the ABSENCE of something. Nobody looks at a panel with no\n buttons and wonders why; the handful who do get the reason from the hint in the header.\n -->\n </template>\n </section>\n\n <!-- ============================ deployments + jobs ============================ -->\n <div>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Deployments</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/deployments\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.deploymentsError\" class=\"s-failed\">{{ state.deploymentsError }}</p>\n <SkeletonList v-else-if=\"!state.deploymentsLoaded\" :rows=\"2\" tall />\n <template v-else>\n <!-- `data-zero` dims a nought so it stops competing with the counts that moved. -->\n <div class=\"stats\">\n <div class=\"stat\" :data-zero=\"summary.total === 0\"><div class=\"v\">{{ summary.total }}</div><div class=\"k\">total</div></div>\n <div class=\"stat\" :data-zero=\"summary.isolated === 0\"><div class=\"v\">{{ summary.isolated }}</div><div class=\"k\">isolated</div></div>\n <div class=\"stat\" :data-zero=\"summary.shared === 0\"><div class=\"v\">{{ summary.shared }}</div><div class=\"k\">shared</div></div>\n <div class=\"stat\" :data-zero=\"summary.running === 0\"><div class=\"v\">{{ summary.running }}</div><div class=\"k\">running</div></div>\n <div class=\"stat busy\" :data-zero=\"summary.busy === 0\"><div class=\"v\">{{ summary.busy }}</div><div class=\"k\">busy</div></div>\n <!--\n The server sends `null`, never `false`, when it could not determine busy/running.\n An unknown must never be counted as a zero — that is how a live stack gets reported\n as torn down. It gets its own tile.\n -->\n <div v-if=\"summary.unknown\" class=\"stat unknown\">\n <div class=\"v\">{{ summary.unknown }}</div>\n <div class=\"k\">unknown</div>\n </div>\n </div>\n\n <p v-if=\"summary.unresolved\" class=\"hint\">\n {{ summary.unresolved }} deployment(s) are missing variables.\n <RouterLink to=\"/deployments\">Open one and set them.</RouterLink>\n </p>\n <p v-else-if=\"summary.unknown\" class=\"hint\">\n “Unknown” means it could not be determined\n <InfoHint label=\"what unknown means\">\n — <em>not</em> that the deployment is idle. An unknown is never counted as a zero,\n which is how a live stack gets reported as torn down.\n </InfoHint>\n </p>\n </template>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Recent jobs</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/jobs\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"4\" />\n <ul v-else class=\"kvlist stagger\">\n <li v-for=\"(j, i) in recentJobs\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <span class=\"k\"><StateBadge :state=\"j.state\" /></span>\n <span class=\"v\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n {{ actionLabel(j.action) }} {{ j.stack }}\n </RouterLink>\n <span class=\"mute\" style=\"font-size: var(--t-xs)\">\n · {{ ago(j.startedAt) }} · {{ took(j.startedAt, j.endedAt) }}\n </span>\n </span>\n </li>\n <li v-if=\"!recentJobs.length\" class=\"mute\">\n No jobs yet.\n <InfoHint label=\"how long job history is kept\">\n History is held in memory, so restarting the server clears it. A job record is the\n transcript of an attempt, not the truth about what exists now.\n </InfoHint>\n </li>\n </ul>\n </section>\n </div>\n </div>\n </div>\n</template>\n"],"names":["control","ref","controlError","controlLoaded","loadControl","r","api","problem","b","usePolling","recentJobs","computed","state","_createElementBlock","_createElementVNode","_unref","leakedJobs","_openBlock","_hoisted_1","_toDisplayString","_createVNode","InfoHint","_cache","_Fragment","_renderList","j","_createBlock","_component_RouterLink","_hoisted_2","_hoisted_3","_hoisted_4","_a","_createTextVNode","_hoisted_5","_hoisted_6","_hoisted_8","_hoisted_9","_hoisted_7","_hoisted_10","_hoisted_11","s","i","_hoisted_12","_normalizeClass","_hoisted_13","SkeletonList","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","summary","_hoisted_19","_hoisted_21","_hoisted_23","_hoisted_25","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","StateBadge","_hoisted_37","actionLabel","_hoisted_38","ago","_hoisted_39"],"mappings":"i2CAiBA,MAAMA,EAAUC,EAAoB,IAAI,EAClCC,EAAeD,EAAI,EAAE,EACrBE,EAAgBF,EAAI,EAAK,EAE/B,eAAeG,GAA6B,CAC1C,MAAMC,EAAI,MAAMC,EAAI,IAAa,cAAc,EAE/C,GADAH,EAAc,MAAQ,GAClB,CAACE,EAAE,GAAI,CACTH,EAAa,MAAQK,EAAQF,EAAG,wBAAwB,EACxD,MACF,CACAH,EAAa,MAAQ,GAC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K,EAAA,CAAA,CAAA,qBAExCX,EAEO,OAFPsD,GAAkD,QAC3CrD,EAAAsD,CAAA,EAAI5C,EAAE,SAAS,GAAI,MAAGN,EAAGJ,KAAKU,EAAE,UAAWA,EAAE,OAAO,CAAA,EAAA,CAAA,CAAA,eAIpDf,EAAA,MAAW,iBAAtBO,IAAAJ,EAMK,KANLyD,GAMK,iBANsC,iBAEzC,EAAA,GAAAlD,EAGWC,EAAA,CAHD,MAAM,gCAA8B,WAAC,IAG/C,CAAA,GAAAC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAH+C,sJAG/C,EAAA,CAAA,sBAlBJI,EAAwDmB,EAAA,OAAX,KAAM,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as C,H as k,c as l,a as t,e as r,w as i,t as p,u as s,f as a,E as R,g as u,F as D,s as V,x as w,_,j as c,o,T as B,k as I,I as T}from"./index-D8OAewba.js";import{d as n,i as $,o as A}from"./useDeployment-DplTFu7s.js";import{_ as L}from"./ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js";import"./useVars-VN9gYdR6.js";const N={class:"page-head"},S={class:"mute",style:{"font-size":"var(--t-sm)"}},q={style:{"font-size":"var(--t-xl)"}},z={class:"sub"},U={key:0},E={key:1},F={key:2},j={key:1,class:"badge busy"},H={class:"tabs","aria-label":"Deployment sections"},O={key:1,class:"hint"},G={key:2,class:"hint",style:{"margin-bottom":"var(--s4)"}},Q=C({__name:"DeploymentDetailView",props:{id:{}},setup(y){const v=y,b=I(),h=[{to:"overview",label:"Overview"},{to:"runtime",label:"Containers & routes"},{to:"config",label:"Config & variables"},{to:"axes",label:"Axes"},{to:"requires",label:"Requires"},{to:"logs",label:"Logs"},{to:"terminal",label:"Terminal"},{to:"danger",label:"Danger"}];return k(()=>v.id,m=>A(m),{immediate:!0}),k(()=>n.error,m=>{m&&b.currentRoute.value.name==="d.overview"&&b.replace(`/deployments/${encodeURIComponent(v.id)}/config`)}),(m,e)=>{var g;const f=c("RouterLink"),x=c("RouterView");return o(),l("div",null,[t("div",N,[t("div",null,[t("div",S,[r(f,{to:"/deployments"},{default:i(()=>[...e[0]||(e[0]=[a("← deployments",-1)])]),_:1})]),t("h1",q,p(y.id),1),t("div",z,[s(n).detail?(o(),l("span",U,[e[1]||(e[1]=a(" stack ",-1)),t("b",null,p(s(n).detail.stack),1)])):s(n).error?(o(),l("span",E,"unresolved")):(o(),l("span",F,"loading…"))])]),e[3]||(e[3]=t("span",{class:"grow"},null,-1)),s(n).detail?(o(),l("span",{key:0,class:R(["badge",s(n).detail.kind])},p(s(n).detail.kind),3)):u("",!0),((g=s(n).detail)==null?void 0:g.busy)===!0?(o(),l("span",j,[...e[2]||(e[2]=[t("span",{class:"dot pulse"},null,-1),a("busy",-1)])])):u("",!0)]),t("nav",H,[(o(),l(D,null,V(h,d=>r(f,{key:d.to,to:`/deployments/${encodeURIComponent(y.id)}/${d.to}`},{default:i(()=>[a(p(d.label),1)]),_:2},1032,["to"])),64))]),s(n).error?(o(),w(L,{key:0,text:s(n).error,title:"Could not resolve this deployment."},null,8,["text"])):u("",!0),s(n).error?(o(),l("p",O,[e[5]||(e[5]=a(" If that message names a variable, add it under ",-1)),e[6]||(e[6]=t("b",null,"Config & variables",-1)),e[7]||(e[7]=a(" and press ",-1)),e[8]||(e[8]=t("b",null,"Apply & reload",-1)),e[9]||(e[9]=a(". ",-1)),r(_,{label:"why the rest of the page is unavailable"},{default:i(()=>[...e[4]||(e[4]=[a(" Until the spec resolves there is no stack name, and every action on this deployment needs one. ",-1)])]),_:1})])):u("",!0),s($)?(o(),l("p",G,[e[11]||(e[11]=a(" Shared with every preview on this host. ",-1)),r(_,{label:"what a shared deployment is"},{default:i(()=>[...e[10]||(e[10]=[a(" A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no axes, and tearing it down needs an explicit confirmation, because doing so destroys state every other deployment depends on. ",-1)])]),_:1})])):u("",!0),r(x,null,{default:i(({Component:d})=>[r(B,{name:"view",mode:"out-in"},{default:i(()=>[(o(),w(T(d)))]),_:2},1024)]),_:1})])}}});export{Q as default};
|
|
2
|
+
//# sourceMappingURL=DeploymentDetailView-DKCUbiGG.js.map
|
package/dist/assets/{DeploymentDetailView-D23-qn3Z.js.map → DeploymentDetailView-DKCUbiGG.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeploymentDetailView-
|
|
1
|
+
{"version":3,"file":"DeploymentDetailView-DKCUbiGG.js","sources":["../../src/views/DeploymentDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The detail shell: breadcrumb, tabs, and the resolve-failure banner that gates the rest.\n *\n * A deployment whose spec will not resolve is not a dead end — the fix (its variables) lives on\n * the Config tab, so this sends the operator there rather than leaving them in front of an error\n * with no control in reach. Everything else stays unavailable until it resolves, because the\n * server cannot name the stack without the variables, and every action needs the stack name.\n */\nimport { watch } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { dep, isShared, openDeployment } from '../composables/useDeployment';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ id: string }>();\nconst router = useRouter();\n\nconst TABS = [\n { to: 'overview', label: 'Overview' },\n // Second, not buried: \"the hostname does not work\" is the most common question, and this is the\n // only tab that can answer it.\n { to: 'runtime', label: 'Containers & routes' },\n { to: 'config', label: 'Config & variables' },\n { to: 'axes', label: 'Axes' },\n { to: 'requires', label: 'Requires' },\n { to: 'logs', label: 'Logs' },\n // After Logs: a shell is what you reach for when the logs did not answer it.\n { to: 'terminal', label: 'Terminal' },\n { to: 'danger', label: 'Danger' },\n] as const;\n\nwatch(() => props.id, (id) => openDeployment(id), { immediate: true });\n\n// Land the operator on the editor when the spec will not resolve — but only from the tab that has\n// nothing to show. Sending them away from Logs or Danger mid-read would be its own annoyance.\nwatch(\n () => dep.error,\n (err) => {\n if (err && router.currentRoute.value.name === 'd.overview') {\n void router.replace(`/deployments/${encodeURIComponent(props.id)}/config`);\n }\n },\n);\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=\"/deployments\">← deployments</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ id }}</h1>\n <div class=\"sub\">\n <span v-if=\"dep.detail\">\n stack <b>{{ dep.detail.stack }}</b>\n </span>\n <span v-else-if=\"dep.error\">unresolved</span>\n <span v-else>loading…</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"dep.detail\" class=\"badge\" :class=\"dep.detail.kind\">{{ dep.detail.kind }}</span>\n <span v-if=\"dep.detail?.busy === true\" class=\"badge busy\"><span class=\"dot pulse\" />busy</span>\n </div>\n\n <nav class=\"tabs\" aria-label=\"Deployment sections\">\n <RouterLink\n v-for=\"t in TABS\"\n :key=\"t.to\"\n :to=\"`/deployments/${encodeURIComponent(id)}/${t.to}`\"\n >{{ t.label }}</RouterLink\n >\n </nav>\n\n <ErrorNote v-if=\"dep.error\" :text=\"dep.error\" title=\"Could not resolve this deployment.\">\n </ErrorNote>\n <p v-if=\"dep.error\" class=\"hint\">\n If that message names a variable, add it under <b>Config & variables</b> and press\n <b>Apply & reload</b>.\n <InfoHint label=\"why the rest of the page is unavailable\">\n Until the spec resolves there is no stack name, and every action on this deployment needs one.\n </InfoHint>\n </p>\n\n <p v-if=\"isShared\" class=\"hint\" style=\"margin-bottom: var(--s4)\">\n Shared with every preview on this host.\n <InfoHint label=\"what a shared deployment is\">\n A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no\n axes, and tearing it down needs an explicit confirmation, because doing so destroys state\n every other deployment depends on.\n </InfoHint>\n </p>\n\n <RouterView v-slot=\"{ Component }\">\n <Transition name=\"view\" mode=\"out-in\">\n <component :is=\"Component\" />\n </Transition>\n </RouterView>\n </div>\n</template>\n"],"names":["props","__props","router","useRouter","TABS","watch","id","openDeployment","dep","err","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_unref","_hoisted_5","_openBlock","_hoisted_8","_hoisted_9","_Fragment","_renderList","t","_createTextVNode","_createBlock","ErrorNote","_hoisted_10","InfoHint","isShared","_hoisted_11","_component_RouterView","_withCtx","Component","_Transition","_resolveDynamicComponent"],"mappings":"+sBAeA,MAAMA,EAAQC,EACRC,EAASC,EAAA,EAETC,EAAO,CACX,CAAE,GAAI,WAAY,MAAO,UAAA,EAGzB,CAAE,GAAI,UAAW,MAAO,qBAAA,EACxB,CAAE,GAAI,SAAU,MAAO,oBAAA,EACvB,CAAE,GAAI,OAAQ,MAAO,MAAA,EACrB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GAAI,OAAQ,MAAO,MAAA,EAErB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GAAI,SAAU,MAAO,QAAA,CAAS,EAGlC,OAAAC,EAAM,IAAML,EAAM,GAAKM,GAAOC,EAAeD,CAAE,EAAG,CAAE,UAAW,GAAM,EAIrED,EACE,IAAMG,EAAI,MACTC,GAAQ,CACHA,GAAOP,EAAO,aAAa,MAAM,OAAS,cACvCA,EAAO,QAAQ,gBAAgB,mBAAmBF,EAAM,EAAE,CAAC,SAAS,CAE7E,CAAA,qEAKAU,EAqDM,MAAA,KAAA,CApDJC,EAiBM,MAjBNC,EAiBM,CAhBJD,EAYM,MAAA,KAAA,CAXJA,EAEM,MAFNE,EAEM,CADJC,EAAwDC,EAAA,CAA5C,GAAG,gBAAc,WAAC,IAAa,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAb,gBAAa,EAAA,CAAA,aAE7CL,EAAgD,KAAhDM,EAAgDC,EAAVjB,EAAA,EAAE,EAAA,CAAA,EACxCU,EAMM,MANNQ,EAMM,CALQC,EAAAZ,CAAA,EAAI,YAAhBE,EAEO,OAAAW,EAAA,eAFiB,UAChB,EAAA,GAAAV,EAA6B,IAAA,K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GAAAG,EAEWkB,EAAA,CAFD,MAAM,2CAAyC,WAAC,IAE1D,CAAA,GAAAhB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAF0D,mGAE1D,EAAA,CAAA,uBAGOI,EAAAa,CAAA,GAATX,IAAAZ,EAOI,IAPJwB,EAOI,iBAP6D,4CAE/D,EAAA,GAAApB,EAIWkB,EAAA,CAJD,MAAM,+BAA6B,WAAC,IAI9C,CAAA,GAAAhB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ8C,gOAI9C,EAAA,CAAA,uBAGFF,EAIaqB,EAAA,KAAA,CAHX,QAAAC,EAAA,CAEa,CAHO,UAAAC,KAAS,CAC7BvB,EAEawB,EAAA,CAFD,KAAK,OAAO,KAAK,QAAA,aAC3B,IAA6B,EAA7BhB,IAAAO,EAA6BU,EAAbF,CAAS,CAAA,EAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as $,o as l,c as n,a as t,f as o,t as a,u as d,z as g,e as u,w as k,i as w,v as N,g as h,G as B,y as p,x as R,F as b,s as C,r as f,C as x,j as S,D,E as U}from"./index-D8OAewba.js";import{_ as z}from"./SkeletonList.vue_vue_type_script_setup_true_lang-CIiWzcE5.js";import{_ as E}from"./RelativeTime.vue_vue_type_script_setup_true_lang-mzHGsi43.js";import{_ as q}from"./SelectMenu.vue_vue_type_script_setup_true_lang-CLqZAezG.js";import"./useFormat-CKJxQp_i.js";import"./Teleport-0BmaJsBF.js";const A={key:0,class:"badge busy"},F={key:1,class:"badge ok"},I={key:2,class:"badge unknown",title:"the server could not determine this — it is not the same as idle"},M={key:3,class:"badge"},T=$({__name:"RunStateBadge",props:{busy:{type:[Boolean,null]},running:{type:[Boolean,null]}},setup(m){return(y,i)=>m.busy===!0?(l(),n("span",A,[...i[0]||(i[0]=[t("span",{class:"dot pulse"},null,-1),o("busy",-1)])])):m.running===!0?(l(),n("span",F,[...i[1]||(i[1]=[t("span",{class:"dot"},null,-1),o("running",-1)])])):m.busy===null||m.running===null?(l(),n("span",I,"unknown")):(l(),n("span",M,"idle"))}}),j={class:"page-head"},G={class:"sub"},H={class:"panel"},J={class:"phead"},K={class:"searchbox"},O={key:0},P={class:"check"},Q={key:0,class:"s-failed"},W={class:"cards"},X={class:"stagger"},Y={"data-label":"id"},Z={key:0,class:"mute",style:{"font-size":"var(--t-xs)"}},ee={"data-label":"kind"},te={class:"name dim","data-label":"stack"},se={key:0},le={key:1,class:"badge warn",title:"the spec could not be resolved without variables"},ne={"data-label":"state"},oe={class:"dim nowrap","data-label":"updated"},ae={key:0},ie={colspan:"5",class:"mute"},re={class:"mono"},ve=$({__name:"DeploymentsView",setup(m){const y=f(""),i=f("all"),c=f(!1),_=x(()=>{const r=y.value.trim().toLowerCase();return p.deployments.filter(e=>i.value!=="all"&&e.kind!==i.value||c.value&&!(e.running===!0||e.busy===!0)?!1:r?e.id.toLowerCase().includes(r)||(e.stack??"").toLowerCase().includes(r)||(e.specName??"").toLowerCase().includes(r):!0)}),V=x(()=>p.deployments.filter(r=>r.unresolved));return(r,e)=>{const v=S("RouterLink");return l(),n("div",null,[t("div",j,[t("div",null,[e[3]||(e[3]=t("h1",null,"Deployments",-1)),t("div",G,a(d(g).total)+" submitted · "+a(d(g).running)+" running · "+a(d(g).busy)+" busy ",1)]),e[5]||(e[5]=t("span",{class:"grow"},null,-1)),u(v,{to:"/submit",class:"btn"},{default:k(()=>[...e[4]||(e[4]=[o("+ Submit",-1)])]),_:1})]),t("section",H,[t("div",J,[t("div",K,[e[6]||(e[6]=t("svg",{viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},[t("circle",{cx:"11",cy:"11",r:"7",fill:"none",stroke:"currentColor","stroke-width":"2"}),t("path",{d:"M16.5 16.5 21 21",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),w(t("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=s=>y.value=s),"data-search":"",type:"search","aria-label":"Search deployments",placeholder:"Search by id, stack or spec",spellcheck:"false"},null,512),[[N,y.value]]),y.value?h("",!0):(l(),n("kbd",O,"/"))]),u(q,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=s=>i.value=s),label:"Filter by kind",options:[{value:"all",label:"All kinds"},{value:"isolated",label:"Isolated"},{value:"shared",label:"Shared"}]},null,8,["modelValue"]),t("label",P,[w(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>c.value=s),type:"checkbox"},null,512),[[B,c.value]]),e[7]||(e[7]=o(" Running or busy only ",-1))])]),d(p).deploymentsError?(l(),n("p",Q,a(d(p).deploymentsError),1)):d(p).deploymentsLoaded?(l(),n(b,{key:2},[t("table",W,[e[11]||(e[11]=t("thead",null,[t("tr",null,[t("th",null,"id"),t("th",null,"kind"),t("th",null,"stack"),t("th",null,"state"),t("th",null,"updated")])],-1)),t("tbody",X,[(l(!0),n(b,null,C(_.value,(s,L)=>(l(),n("tr",{key:s.id,style:D({"--i":L})},[t("td",Y,[u(v,{to:`/deployments/${encodeURIComponent(s.id)}`},{default:k(()=>[o(a(s.id),1)]),_:2},1032,["to"]),s.specName?(l(),n("div",Z," spec: "+a(s.specName),1)):h("",!0)]),t("td",ee,[t("span",{class:U(["badge",s.kind])},a(s.kind),3)]),t("td",te,[s.stack?(l(),n("span",se,a(s.stack),1)):(l(),n("span",le," needs variables "))]),t("td",ne,[u(T,{busy:s.busy,running:s.running},null,8,["busy","running"])]),t("td",oe,[u(E,{at:s.updatedAt},null,8,["at"])])],4))),128)),_.value.length?h("",!0):(l(),n("tr",ae,[t("td",ie,[d(p).deployments.length?(l(),n(b,{key:0},[o(" Nothing matches this filter. ")],64)):(l(),n(b,{key:1},[e[9]||(e[9]=o(" Nothing submitted yet — ",-1)),u(v,{to:"/submit"},{default:k(()=>[...e[8]||(e[8]=[o("submit a spec",-1)])]),_:1}),e[10]||(e[10]=o(" to put a deployment in the registry. ",-1))],64))])]))])]),(l(!0),n(b,null,C(V.value,s=>(l(),n("div",{key:`u-${s.id}`,class:"banner warn"},[t("b",null,a(s.id),1),e[19]||(e[19]=o(" could not be resolved: ",-1)),t("span",re,a(s.unresolved),1),t("p",null,[e[13]||(e[13]=o(" This listing resolves every spec with the ",-1)),e[14]||(e[14]=t("em",null,"same",-1)),e[15]||(e[15]=o(" (empty) request variables, so a spec with a ",-1)),e[16]||(e[16]=t("code",null,"${VAR}",-1)),e[17]||(e[17]=o(" the server does not already hold will always appear here. ",-1)),u(v,{to:`/deployments/${encodeURIComponent(s.id)}/config`},{default:k(()=>[...e[12]||(e[12]=[o(" Set its variables ",-1)])]),_:1},8,["to"]),e[18]||(e[18]=o(" and the detail view will resolve. ",-1))])]))),128))],64)):(l(),R(z,{key:1,rows:4,tall:""}))])])}}});export{ve as default};
|
|
2
|
+
//# sourceMappingURL=DeploymentsView-BX4GOb2A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DeploymentsView-BX4GOb2A.js","sources":["../../src/components/RunStateBadge.vue","../../src/views/DeploymentsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A deployment's live state, from the two TRI-STATE fields the server sends.\n *\n * `busy` and `running` are `boolean | null`, and `null` means \"the server could not determine\n * this\": an unresolved spec has no stack name to look up, and a docker that did not answer is not\n * the same fact as \"nothing is running\". Rendering either as \"idle\" would be a guess presented as\n * a fact — that is how a live stack gets reported as torn down and someone forgets it.\n *\n * So unknown says unknown, and it gets its own colour.\n */\ndefineProps<{ busy: boolean | null; running: boolean | null }>();\n</script>\n\n<template>\n <span v-if=\"busy === true\" class=\"badge busy\"><span class=\"dot pulse\" />busy</span>\n <span v-else-if=\"running === true\" class=\"badge ok\"><span class=\"dot\" />running</span>\n <span\n v-else-if=\"busy === null || running === null\"\n class=\"badge unknown\"\n title=\"the server could not determine this — it is not the same as idle\"\n >unknown</span\n >\n <span v-else class=\"badge\">idle</span>\n</template>\n","<script setup lang=\"ts\">\n/**\n * The deployment list: searchable, filterable, and honest about what could not be resolved.\n *\n * Filtering is client-side because the API has no query parameters for it and the list is one\n * host's worth of previews — a few dozen rows, already in memory from the shell's poll.\n */\nimport { computed, ref } from 'vue';\nimport { state, summary } from '../composables/useControlPlane';\n\nimport RunStateBadge from '../components/RunStateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst q = ref('');\nconst kind = ref<'all' | 'isolated' | 'shared'>('all');\nconst onlyLive = ref(false);\n\nconst rows = computed(() => {\n const needle = q.value.trim().toLowerCase();\n return state.deployments.filter((d) => {\n if (kind.value !== 'all' && d.kind !== kind.value) return false;\n // \"Live\" means DEMONSTRABLY live. An unknown is not evidence of either state, so it is not\n // silently included here — the filter says what it filters.\n if (onlyLive.value && !(d.running === true || d.busy === true)) return false;\n if (!needle) return true;\n return (\n d.id.toLowerCase().includes(needle) ||\n (d.stack ?? '').toLowerCase().includes(needle) ||\n (d.specName ?? '').toLowerCase().includes(needle)\n );\n });\n});\n\nconst unresolvedRows = computed(() => state.deployments.filter((d) => d.unresolved));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Deployments</h1>\n <div class=\"sub\">\n {{ summary.total }} submitted · {{ summary.running }} running · {{ summary.busy }} busy\n </div>\n </div>\n <span class=\"grow\" />\n <RouterLink to=\"/submit\" class=\"btn\">+ Submit</RouterLink>\n </div>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <!--\n One row of equal-height controls. Each used to sit under its own stacked label, which cost\n a line of vertical space per control, put \"Search — press /\" on screen as a permanent\n instruction, and left the two fields 8px out of vertical alignment because a `select` and\n an `input` do not have the same intrinsic height. A placeholder says the same thing in the\n place you are already looking, and the select's own options say what it filters.\n -->\n <div class=\"searchbox\">\n <svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n <path d=\"M16.5 16.5 21 21\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n <input\n id=\"q\"\n v-model=\"q\"\n data-search\n type=\"search\"\n aria-label=\"Search deployments\"\n placeholder=\"Search by id, stack or spec\"\n spellcheck=\"false\"\n />\n <kbd v-if=\"!q\">/</kbd>\n </div>\n <SelectMenu\n v-model=\"kind\"\n label=\"Filter by kind\"\n :options=\"[\n { value: 'all', label: 'All kinds' },\n { value: 'isolated', label: 'Isolated' },\n { value: 'shared', label: 'Shared' },\n ]\"\n />\n <label class=\"check\">\n <input v-model=\"onlyLive\" type=\"checkbox\" />\n Running or busy only\n </label>\n </div>\n\n <p v-if=\"state.deploymentsError\" class=\"s-failed\">{{ state.deploymentsError }}</p>\n <SkeletonList v-else-if=\"!state.deploymentsLoaded\" :rows=\"4\" tall />\n\n <template v-else>\n <table class=\"cards\">\n <thead>\n <tr>\n <th>id</th>\n <th>kind</th>\n <th>stack</th>\n <th>state</th>\n <th>updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(d, i) in rows\" :key=\"d.id\" :style=\"{ '--i': i }\">\n <td data-label=\"id\">\n <RouterLink :to=\"`/deployments/${encodeURIComponent(d.id)}`\">\n {{ d.id }}\n </RouterLink>\n <div v-if=\"d.specName\" class=\"mute\" style=\"font-size: var(--t-xs)\">\n spec: {{ d.specName }}\n </div>\n </td>\n <td data-label=\"kind\"><span class=\"badge\" :class=\"d.kind\">{{ d.kind }}</span></td>\n <td class=\"name dim\" data-label=\"stack\">\n <span v-if=\"d.stack\">{{ d.stack }}</span>\n <!--\n No stack name means the spec could not be resolved with the variables this\n listing had. It is not an error state for the deployment — it is a missing input.\n -->\n <span v-else class=\"badge warn\" title=\"the spec could not be resolved without variables\">\n needs variables\n </span>\n </td>\n <td data-label=\"state\"><RunStateBadge :busy=\"d.busy\" :running=\"d.running\" /></td>\n <td class=\"dim nowrap\" data-label=\"updated\"><RelativeTime :at=\"d.updatedAt\" /></td>\n </tr>\n <tr v-if=\"!rows.length\">\n <td colspan=\"5\" class=\"mute\">\n <template v-if=\"state.deployments.length\">\n Nothing matches this filter.\n </template>\n <template v-else>\n Nothing submitted yet — <RouterLink to=\"/submit\">submit a spec</RouterLink> to\n put a deployment in the registry.\n </template>\n </td>\n </tr>\n </tbody>\n </table>\n\n <!-- One message per unresolved row, verbatim: it names the missing variable. -->\n <div v-for=\"d in unresolvedRows\" :key=\"`u-${d.id}`\" class=\"banner warn\">\n <b>{{ d.id }}</b> could not be resolved:\n <span class=\"mono\">{{ d.unresolved }}</span>\n <p>\n This listing resolves every spec with the <em>same</em> (empty) request variables, so a\n spec with a <code>${VAR}</code> the server does not already hold will always appear\n here.\n <RouterLink :to=\"`/deployments/${encodeURIComponent(d.id)}/config`\">\n Set its variables\n </RouterLink>\n and the detail view will resolve.\n </p>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["__props","_openBlock","_createElementBlock","_hoisted_1","_cache","_createElementVNode","_hoisted_2","_hoisted_3","_hoisted_4","q","ref","kind","onlyLive","rows","computed","needle","state","d","unresolvedRows","_toDisplayString","_unref","_createVNode","_component_RouterLink","_hoisted_5","$event","SelectMenu","_hoisted_7","_hoisted_8","_Fragment","_hoisted_9","_hoisted_10","_renderList","i","_hoisted_11","_createTextVNode","_hoisted_12","_hoisted_13","_normalizeClass","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","RunStateBadge","_hoisted_18","RelativeTime","_hoisted_19","_hoisted_20","_hoisted_21","_createBlock","SkeletonList"],"mappings":"qyBAecA,EAAA,OAAI,IAAhBC,EAAA,EAAAC,EAAmF,OAAnFC,EAAmF,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CAArCC,EAA0B,OAAA,CAApB,MAAM,WAAA,EAAW,KAAA,EAAA,IAAG,OAAI,EAAA,CAAA,MAC3DL,EAAA,UAAO,IAAxBC,IAAAC,EAAsF,OAAtFI,EAAsF,CAAA,GAAAF,EAA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IAAa,CAAA,GAAAlB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAb,gBAAa,EAAA,CAAA,2BAAa,yCAE7E,EAAA,EAAA,uBAORF,EAYM0B,EAAA,KAAAG,EAZWb,EAAA,MAALD,QAAZf,EAYM,MAAA,CAZ4B,IAAG,KAAOe,EAAE,EAAE,GAAI,MAAM,aAAA,GACxDZ,EAAiB,IAAA,KAAAc,EAAXF,EAAE,EAAE,EAAA,CAAA,kBAAO,2BACjB,EAAA,GAAAZ,EAA4C,OAA5C0C,GAA4C5B,EAAtBF,EAAE,UAAU,EAAA,CAAA,EAClCZ,EAQI,IAAA,KAAA,iBARD,8CACyC,EAAA,GAAAD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAa,UAAT,OAAI,EAAA,mBAAK,gDAC3C,EAAA,GAAAD,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAC,EAAmB,YAAb,SAAM,EAAA,mBAAO,8DAE/B,EAAA,GAAAgB,EAEaC,EAAA,CAFA,GAAE,gBAAkB,mBAAmBL,EAAE,EAAE,CAAA,SAAA,aAAY,IAEpE,CAAA,GAAAb,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFoE,sBAEpE,EAAA,CAAA,oCAAa,sCAEf,EAAA,EAAA,wBA/DJ4C,EAAoEC,EAAA,OAAhB,KAAM,EAAG,KAAA,EAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.eqc[data-v-0e7a9878]{min-width:0}.eqc-panel[data-v-0e7a9878]{margin-top:var(--s3);border:1px solid var(--line);border-radius:var(--r2);background:var(--sunk);overflow:hidden}.eqc-tabs[data-v-0e7a9878]{display:flex;align-items:center;gap:var(--s1);padding:var(--s2);border-bottom:1px solid var(--line-soft)}.eqc-tabs [data-on=true][data-v-0e7a9878]{background:var(--accent-soft);color:var(--accent)}.eqc-code[data-v-0e7a9878]{margin:0;padding:var(--s3);font:var(--t-sm) / 1.6 var(--mono);white-space:pre;overflow-x:auto;color:var(--fg-dim)}.eqc-note[data-v-0e7a9878]{padding:0 var(--s3) var(--s3);font-size:var(--t-xs);color:var(--fg-mute)}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as f,c as i,a as e,f as r,t as c,e as w,T as _,w as g,r as h,o as d,g as m,C as u,N as b}from"./index-D8OAewba.js";import{_ as $}from"./_plugin-vue_export-helper-DlAUqK2U.js";const x={class:"eqc"},T=["aria-expanded"],N={key:0,class:"eqc-panel"},q={class:"eqc-tabs",role:"tablist"},E=["aria-selected","data-on"],B=["aria-selected","data-on"],K={class:"eqc-code"},S={class:"eqc-note"},j=f({__name:"EquivalentCommand",props:{what:{},method:{},path:{},body:{},cli:{}},setup(l){const s=l,n=h(!1),o=h("curl"),C=u(()=>`${location.protocol}//${location.host}`),k=u(()=>{const a=[`curl -X ${s.method} ${C.value}${s.path} \\`];if(a.push(" -H 'Authorization: Bearer $PSTACK_TOKEN' \\"),s.body!==void 0){a.push(" -H 'Content-Type: application/json' \\");const t=JSON.stringify(s.body,null,2).split("'").join("'\\''");a.push(` -d '${t}'`)}else a[a.length-1]=" -H 'Authorization: Bearer $PSTACK_TOKEN'";return a.join(`
|
|
2
|
+
`)}),p=u(()=>o.value==="curl"?k.value:s.cli??"");async function y(){try{await navigator.clipboard.writeText(p.value),b("ok","Copied.")}catch{b("error","Could not copy — your browser blocked clipboard access.")}}return(a,t)=>(d(),i("div",x,[e("button",{class:"ghost sm","aria-expanded":n.value,onClick:t[0]||(t[0]=v=>n.value=!n.value)},[t[3]||(t[3]=e("svg",{viewBox:"0 0 24 24",width:"14",height:"14","aria-hidden":"true",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[e("path",{d:"m7 8-4 4 4 4"}),e("path",{d:"m17 8 4 4-4 4"}),e("path",{d:"M14 4 10 20"})],-1)),r(" "+c(n.value?"Hide":"Show")+" equivalent command ",1)],8,T),w(_,{name:"fade"},{default:g(()=>[n.value?(d(),i("div",N,[e("div",q,[e("button",{class:"ghost sm",role:"tab","aria-selected":o.value==="curl","data-on":o.value==="curl",onClick:t[1]||(t[1]=v=>o.value="curl")}," curl ",8,E),l.cli?(d(),i("button",{key:0,class:"ghost sm",role:"tab","aria-selected":o.value==="cli","data-on":o.value==="cli",onClick:t[2]||(t[2]=v=>o.value="cli")}," pstack ",8,B)):m("",!0),t[4]||(t[4]=e("span",{class:"grow"},null,-1)),e("button",{class:"ghost sm",onClick:y},"Copy")]),e("pre",K,c(p.value),1),e("p",S,[r(" Runs "+c(l.what)+" exactly as the button above does. ",1),t[5]||(t[5]=e("b",null,"$PSTACK_TOKEN",-1)),t[6]||(t[6]=r(" is left as a shell variable on purpose — a real token in a screenshot or a shell history is the whole host. ",-1))])])):m("",!0)]),_:1})]))}}),O=$(j,[["__scopeId","data-v-0e7a9878"]]);export{O as E};
|
|
3
|
+
//# sourceMappingURL=EquivalentCommand-w1nGowVi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EquivalentCommand-w1nGowVi.js","sources":["../../src/components/EquivalentCommand.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * \"Show equivalent command\" — the GCP pattern.\n *\n * WHY THIS EXISTS RATHER THAN A SNIPPET ON THE PAGE. A `curl` line printed next to a form is read by\n * everyone and needed by almost nobody: it is permanent clutter charged to every operator so that\n * the occasional scripter does not have to look something up. Behind a button it costs one click\n * when you want it and nothing when you do not — and, unlike a static snippet in the docs, it is\n * generated from what is actually in the form right now, so it cannot drift from the request the\n * button next to it would send.\n *\n * IT IS NOT A SECOND SOURCE OF TRUTH. The caller passes the same values it is about to POST. If the\n * form changes, this changes with it, because there is nothing here to keep in sync by hand.\n *\n * THE TOKEN IS NEVER INTERPOLATED. `$PSTACK_TOKEN` stays a shell variable: a rendered command lands\n * in screenshots, pasted messages and shell history, and a control-plane token in any of those is\n * the whole host. The panel says so rather than silently omitting it.\n */\nimport { computed, ref } from 'vue';\nimport { toast } from '../composables/useToasts';\n\nconst props = defineProps<{\n /** Shown as the button label's object, e.g. \"this registration\". */\n what: string;\n /** The HTTP request the adjacent action performs. */\n method: string;\n /** Path only — the host is filled in from where the UI is served. */\n path: string;\n body?: unknown;\n /** The `pstack` invocation that does the same thing, when one exists. */\n cli?: string;\n}>();\n\nconst open = ref(false);\nconst tab = ref<'curl' | 'cli'>('curl');\n\nconst base = computed(() => `${location.protocol}//${location.host}`);\n\nconst curl = computed(() => {\n const lines = [`curl -X ${props.method} ${base.value}${props.path} \\\\`];\n lines.push(` -H 'Authorization: Bearer $PSTACK_TOKEN' \\\\`);\n if (props.body !== undefined) {\n lines.push(` -H 'Content-Type: application/json' \\\\`);\n // Single-quoted so nothing in a value is expanded by the shell; embedded quotes are escaped\n // the only way that works inside single quotes.\n const json = JSON.stringify(props.body, null, 2).split(\"'\").join(`'\\\\''`);\n lines.push(` -d '${json}'`);\n } else {\n lines[lines.length - 1] = ` -H 'Authorization: Bearer $PSTACK_TOKEN'`;\n }\n return lines.join('\\n');\n});\n\nconst text = computed(() => (tab.value === 'curl' ? curl.value : (props.cli ?? '')));\n\nasync function copy(): Promise<void> {\n try {\n await navigator.clipboard.writeText(text.value);\n toast('ok', 'Copied.');\n } catch {\n toast('error', 'Could not copy — your browser blocked clipboard access.');\n }\n}\n</script>\n\n<template>\n <div class=\"eqc\">\n <button class=\"ghost sm\" :aria-expanded=\"open\" @click=\"open = !open\">\n <svg viewBox=\"0 0 24 24\" width=\"14\" height=\"14\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n <path d=\"m7 8-4 4 4 4\" /><path d=\"m17 8 4 4-4 4\" /><path d=\"M14 4 10 20\" />\n </svg>\n {{ open ? 'Hide' : 'Show' }} equivalent command\n </button>\n\n <Transition name=\"fade\">\n <div v-if=\"open\" class=\"eqc-panel\">\n <div class=\"eqc-tabs\" role=\"tablist\">\n <button\n class=\"ghost sm\"\n role=\"tab\"\n :aria-selected=\"tab === 'curl'\"\n :data-on=\"tab === 'curl'\"\n @click=\"tab = 'curl'\"\n >\n curl\n </button>\n <button\n v-if=\"cli\"\n class=\"ghost sm\"\n role=\"tab\"\n :aria-selected=\"tab === 'cli'\"\n :data-on=\"tab === 'cli'\"\n @click=\"tab = 'cli'\"\n >\n pstack\n </button>\n <span class=\"grow\" />\n <button class=\"ghost sm\" @click=\"copy\">Copy</button>\n </div>\n\n <pre class=\"eqc-code\">{{ text }}</pre>\n\n <p class=\"eqc-note\">\n Runs {{ what }} exactly as the button above does.\n <b>$PSTACK_TOKEN</b> is left as a shell variable on purpose — a real token in a screenshot\n or a shell history is the whole host.\n </p>\n </div>\n </Transition>\n </div>\n</template>\n\n<style scoped>\n.eqc {\n min-width: 0;\n}\n.eqc-panel {\n margin-top: var(--s3);\n border: 1px solid var(--line);\n border-radius: var(--r2);\n background: var(--sunk);\n overflow: hidden;\n}\n.eqc-tabs {\n display: flex;\n align-items: center;\n gap: var(--s1);\n padding: var(--s2);\n border-bottom: 1px solid var(--line-soft);\n}\n.eqc-tabs [data-on='true'] {\n background: var(--accent-soft);\n color: var(--accent);\n}\n.eqc-code {\n margin: 0;\n padding: var(--s3);\n font: var(--t-sm) / 1.6 var(--mono);\n white-space: pre;\n overflow-x: auto;\n color: var(--fg-dim);\n}\n.eqc-note {\n padding: 0 var(--s3) var(--s3);\n font-size: var(--t-xs);\n color: var(--fg-mute);\n}\n</style>\n"],"names":["props","__props","open","ref","tab","base","computed","curl","lines","json","text","copy","toast","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_cache","$event","_toDisplayString","_createVNode","_Transition","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8"],"mappings":"keAqBA,MAAMA,EAAQC,EAYRC,EAAOC,EAAI,EAAK,EAChBC,EAAMD,EAAoB,MAAM,EAEhCE,EAAOC,EAAS,IAAM,GAAG,SAAS,QAAQ,KAAK,SAAS,IAAI,EAAE,E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,WACrB,IAgCM,CAhCKnB,EAAA,OAAXW,EAAA,EAAAC,EAgCM,MAhCNQ,EAgCM,CA/BJN,EAsBM,MAtBNO,EAsBM,CArBJP,EAQS,SAAA,CAPP,MAAM,WACN,KAAK,MACJ,gBAAeZ,EAAA,QAAG,OAClB,UAASA,EAAA,QAAG,OACZ,uBAAOA,EAAA,MAAG,OAAA,EACZ,SAED,EAAAoB,CAAA,EAEQvB,EAAA,SADRa,EASS,SAAA,OAPP,MAAM,WACN,KAAK,MACJ,gBAAeV,EAAA,QAAG,MAClB,UAASA,EAAA,QAAG,MACZ,uBAAOA,EAAA,MAAG,MAAA,EACZ,WAED,EAAAqB,CAAA,wBACAT,EAAqB,OAAA,CAAf,MAAM,MAAA,EAAM,KAAA,EAAA,GAClBA,EAAoD,SAAA,CAA5C,MAAM,WAAY,QAAOL,CAAA,EAAM,MAAI,CAAA,GAG7CK,EAAsC,MAAtCU,EAAsCP,EAAbT,EAAA,KAAI,EAAA,CAAA,EAE7BM,EAII,IAJJW,EAII,GAJgB,SACbR,EAAGlB,EAAA,IAAI,EAAG,sCACf,CAAA,EAAAgB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAD,EAAoB,SAAjB,gBAAa,EAAA,iBAAI,gHAEtB,EAAA,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as r,c as a,a as t,t as s,o}from"./index-
|
|
2
|
-
//# sourceMappingURL=ErrorNote.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as r,c as a,a as t,t as s,o}from"./index-D8OAewba.js";const n={class:"banner failed",role:"alert"},c={class:"raw"},d=r({__name:"ErrorNote",props:{text:{},title:{}},setup(e){return(l,i)=>(o(),a("div",n,[t("b",null,s(e.title??"The server refused this."),1),t("pre",c,s(e.text),1)]))}});export{d as _};
|
|
2
|
+
//# sourceMappingURL=ErrorNote.vue_vue_type_script_setup_true_lang-D28UQmNR.js.map
|