@samyx/preview-stacks-ui 0.33.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-Boeac0US.js → ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-Boeac0US.js.map → ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js.map} +1 -1
- package/dist/assets/{AxesTab-DYWU3-0U.js → AxesTab-Bzm6UBFL.js} +2 -2
- package/dist/assets/{AxesTab-DYWU3-0U.js.map → AxesTab-Bzm6UBFL.js.map} +1 -1
- package/dist/assets/{ConfigTab-GNv5OcAW.js → ConfigTab-B5Mkn_Xr.js} +2 -2
- package/dist/assets/{ConfigTab-GNv5OcAW.js.map → ConfigTab-B5Mkn_Xr.js.map} +1 -1
- package/dist/assets/{ConfigView-lP6-ppec.js → ConfigView-BMINdC1p.js} +2 -2
- package/dist/assets/{ConfigView-lP6-ppec.js.map → ConfigView-BMINdC1p.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DxO9agCS.js → ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DxO9agCS.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js.map} +1 -1
- package/dist/assets/{DangerTab-BlfddI-Y.js → DangerTab-CLAU7ElD.js} +2 -2
- package/dist/assets/{DangerTab-BlfddI-Y.js.map → DangerTab-CLAU7ElD.js.map} +1 -1
- package/dist/assets/{DashboardView-Vx-RzO7C.js → DashboardView-C7Ofmm_R.js} +2 -2
- package/dist/assets/{DashboardView-Vx-RzO7C.js.map → DashboardView-C7Ofmm_R.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-6n1gPVwl.js → DeploymentDetailView-BnEVV3jQ.js} +2 -2
- package/dist/assets/{DeploymentDetailView-6n1gPVwl.js.map → DeploymentDetailView-BnEVV3jQ.js.map} +1 -1
- package/dist/assets/{DeploymentsView-BwIXMxDj.js → DeploymentsView-BQUywd2O.js} +2 -2
- package/dist/assets/{DeploymentsView-BwIXMxDj.js.map → DeploymentsView-BQUywd2O.js.map} +1 -1
- package/dist/assets/{DialogTrigger-ChSYKui7.js → DialogTrigger-K-5IAbpM.js} +2 -2
- package/dist/assets/{DialogTrigger-ChSYKui7.js.map → DialogTrigger-K-5IAbpM.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-BO7XtMvC.js → EquivalentCommand-Bs9vCxV-.js} +2 -2
- package/dist/assets/{EquivalentCommand-BO7XtMvC.js.map → EquivalentCommand-Bs9vCxV-.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-TuSS3q8x.js → ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-TuSS3q8x.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-B5yD7e56.js → HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-B5yD7e56.js.map → HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js.map} +1 -1
- package/dist/assets/{JobDetailView-CkwAvKII.js → JobDetailView-ClTF4h1t.js} +2 -2
- package/dist/assets/{JobDetailView-CkwAvKII.js.map → JobDetailView-ClTF4h1t.js.map} +1 -1
- package/dist/assets/{JobsView-CStaz_Yv.js → JobsView-WFqrBzR6.js} +2 -2
- package/dist/assets/{JobsView-CStaz_Yv.js.map → JobsView-WFqrBzR6.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-D32B2YEy.js → LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js} +2 -2
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-D32B2YEy.js.map → LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js.map} +1 -1
- package/dist/assets/{LoginView-H9eKfpjn.js → LoginView-B3SRuKRK.js} +2 -2
- package/dist/assets/{LoginView-H9eKfpjn.js.map → LoginView-B3SRuKRK.js.map} +1 -1
- package/dist/assets/{LogsTab-fz8NPH4z.js → LogsTab-DtcfNtY8.js} +2 -2
- package/dist/assets/{LogsTab-fz8NPH4z.js.map → LogsTab-DtcfNtY8.js.map} +1 -1
- package/dist/assets/{NotFoundView-CfLkt1Lk.js → NotFoundView-1RdXOkoy.js} +2 -2
- package/dist/assets/{NotFoundView-CfLkt1Lk.js.map → NotFoundView-1RdXOkoy.js.map} +1 -1
- package/dist/assets/{NotifiersView-BsJr7pg6.js → NotifiersView-diZ_EMYq.js} +2 -2
- package/dist/assets/{NotifiersView-BsJr7pg6.js.map → NotifiersView-diZ_EMYq.js.map} +1 -1
- package/dist/assets/{OverviewTab-BvR-YA7C.js → OverviewTab--YuThIvA.js} +2 -2
- package/dist/assets/{OverviewTab-BvR-YA7C.js.map → OverviewTab--YuThIvA.js.map} +1 -1
- package/dist/assets/{PublicLogsView-bT9b1HgF.js → PublicLogsView-gChlTDrp.js} +2 -2
- package/dist/assets/{PublicLogsView-bT9b1HgF.js.map → PublicLogsView-gChlTDrp.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-C72sUBV5.js → RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-C72sUBV5.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js.map} +1 -1
- package/dist/assets/{RegistriesView-C1UKUBoo.js → RegistriesView-Cich0dgu.js} +2 -2
- package/dist/assets/{RegistriesView-C1UKUBoo.js.map → RegistriesView-Cich0dgu.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-CWsMYm1n.js → RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-CWsMYm1n.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js.map} +1 -1
- package/dist/assets/{RequiresTab-UWXA1T0D.js → RequiresTab-CxGBOMkm.js} +2 -2
- package/dist/assets/{RequiresTab-UWXA1T0D.js.map → RequiresTab-CxGBOMkm.js.map} +1 -1
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-Dxo20XO4.js → RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js} +2 -2
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-Dxo20XO4.js.map → RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js.map} +1 -1
- package/dist/assets/{RoutingView-DheAKdtP.js → RoutingView-BXOGdZU4.js} +2 -2
- package/dist/assets/{RoutingView-DheAKdtP.js.map → RoutingView-BXOGdZU4.js.map} +1 -1
- package/dist/assets/{RuntimeTab-By55qdsQ.css → RuntimeTab-CXX0BGYC.css} +1 -1
- package/dist/assets/RuntimeTab-_QvQc5F2.js +3 -0
- package/dist/assets/RuntimeTab-_QvQc5F2.js.map +1 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CPpw5Oci.js → SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CPpw5Oci.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js.map} +1 -1
- package/dist/assets/{SettingsView-rAcphtRK.js → SettingsView-BvscpTdq.js} +2 -2
- package/dist/assets/{SettingsView-rAcphtRK.js.map → SettingsView-BvscpTdq.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Chk2I7Hn.js → SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Chk2I7Hn.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js.map} +1 -1
- package/dist/assets/{SpecDetailView-BsKNDau7.js → SpecDetailView-CAPlEmSg.js} +2 -2
- package/dist/assets/{SpecDetailView-BsKNDau7.js.map → SpecDetailView-CAPlEmSg.js.map} +1 -1
- package/dist/assets/{SpecsView-Dj0In_jz.js → SpecsView-BO0QMGrI.js} +2 -2
- package/dist/assets/{SpecsView-Dj0In_jz.js.map → SpecsView-BO0QMGrI.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-CTwtqjCb.js → SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-CTwtqjCb.js.map → SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js.map} +1 -1
- package/dist/assets/{SsoView-BLYI9Ut9.js → SsoView-2q_nGP-Q.js} +2 -2
- package/dist/assets/{SsoView-BLYI9Ut9.js.map → SsoView-2q_nGP-Q.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DkYgZEmJ.js → StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-DkYgZEmJ.js.map → StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js.map} +1 -1
- package/dist/assets/{SubmitView-BfK82VY5.js → SubmitView-Dxre5OJU.js} +2 -2
- package/dist/assets/{SubmitView-BfK82VY5.js.map → SubmitView-Dxre5OJU.js.map} +1 -1
- package/dist/assets/{SwarmView-p5aN4B52.js → SwarmView-DtwrF08A.js} +2 -2
- package/dist/assets/{SwarmView-p5aN4B52.js.map → SwarmView-DtwrF08A.js.map} +1 -1
- package/dist/assets/{Teleport-CNXlGDC9.js → Teleport-bdITH--T.js} +2 -2
- package/dist/assets/{Teleport-CNXlGDC9.js.map → Teleport-bdITH--T.js.map} +1 -1
- package/dist/assets/{TerminalTab-D_zK5L5R.js → TerminalTab-CfcGPa8t.js} +2 -2
- package/dist/assets/{TerminalTab-D_zK5L5R.js.map → TerminalTab-CfcGPa8t.js.map} +1 -1
- package/dist/assets/{UsersView-MuCb17Lb.js → UsersView-nIlVItsK.js} +2 -2
- package/dist/assets/{UsersView-MuCb17Lb.js.map → UsersView-nIlVItsK.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BDoSMa0L.js → VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BDoSMa0L.js.map → VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js.map} +1 -1
- package/dist/assets/{VarIO-C_uMaK0d.js → VarIO-BcNlaWXO.js} +2 -2
- package/dist/assets/{VarIO-C_uMaK0d.js.map → VarIO-BcNlaWXO.js.map} +1 -1
- package/dist/assets/{VariablesView-CJg76tKu.js → VariablesView-CzeCc-0m.js} +2 -2
- package/dist/assets/{VariablesView-CJg76tKu.js.map → VariablesView-CzeCc-0m.js.map} +1 -1
- package/dist/assets/{index-Cllpaxdb.js → index-IvJmpI3b.js} +3 -3
- package/dist/assets/{index-Cllpaxdb.js.map → index-IvJmpI3b.js.map} +1 -1
- package/dist/assets/{useDeployment-DsuhE4uh.js → useDeployment-rA-pgUHZ.js} +2 -2
- package/dist/assets/{useDeployment-DsuhE4uh.js.map → useDeployment-rA-pgUHZ.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/RuntimeTab-CsFdEJft.js +0 -2
- package/dist/assets/RuntimeTab-CsFdEJft.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as c,Q as m,c as i,aF as f,E as v,t as y,a4 as b,g,j as B,o}from"./index-
|
|
2
|
-
//# sourceMappingURL=ActionButton.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as c,Q as m,c as i,aF as f,E as v,t as y,a4 as b,g,j as B,o}from"./index-IvJmpI3b.js";const h=["disabled","title","aria-busy"],k={key:0},p={key:2,class:"progress","aria-hidden":"true"},E=c({__name:"ActionButton",props:{pending:{type:Boolean},disabled:{type:Boolean},variant:{},title:{},confirm:{}},emits:["run"],setup(e,{emit:s}){const l=e,r=s,t=B(!1);let a=null;function n(){t.value=!1,a&&clearTimeout(a),a=null}function d(){if(l.confirm){if(t.value){n(),r("run");return}t.value=!0,a=setTimeout(n,5e3)}}return m(n),(u,C)=>(o(),i("button",{class:v([e.variant,t.value&&"armed"]),disabled:e.pending||e.disabled,title:e.title,"aria-busy":e.pending?"true":void 0,onClick:d,onBlur:n,onKeydown:f(n,["esc"])},[t.value?(o(),i("span",k,y(e.confirm),1)):b(u.$slots,"default",{},void 0,void 0,1),e.pending?(o(),i("span",p)):g("",!0)],42,h))}});export{E as _};
|
|
2
|
+
//# sourceMappingURL=ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.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-DBfqkgMV.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 *\n * ── `confirm` ────────────────────────────────────────────────────────────────────────────────────\n *\n * Pass `confirm=\"…\"` and the first click ARMS the button instead of acting: the label becomes the\n * confirmation question, and only a second click within a few seconds emits `run`. Anything else —\n * moving away, pressing Escape, waiting — disarms it.\n *\n * Two clicks in place rather than a modal, because a dialog for \"delete this row\" blocks the page\n * for a decision that is already visible; and rather than `window.confirm`, which is a native OS\n * panel this app deliberately avoids everywhere else.\n *\n * THIS PROP USED TO NOT EXIST. Four call sites (Delete on each Variables/Secrets row, Delete and\n * Revoke in Users) already passed `:confirm` and `@run` — so `confirm` fell through as a stray DOM\n * attribute and `run` was emitted by nothing. Those buttons rendered, took the click, and did\n * nothing at all. Implementing the contract they were written against is the fix.\n */\nimport { onBeforeUnmount, ref } from 'vue';\n\nconst props = defineProps<{\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 /** When set, the click is two-stage and this is the question asked in between. */\n confirm?: string;\n}>();\n\nconst emit = defineEmits<{ (e: 'run'): void }>();\n\nconst armed = ref(false);\nlet timer: ReturnType<typeof setTimeout> | null = null;\n\nfunction disarm(): void {\n armed.value = false;\n if (timer) clearTimeout(timer);\n timer = null;\n}\n\nfunction onClick(): void {\n if (!props.confirm) return; // plain button: the parent's own @click handles it\n if (armed.value) {\n disarm();\n emit('run');\n return;\n }\n armed.value = true;\n // Auto-disarm: an armed destructive button left on screen is a trap for the next click, and the\n // next click is often someone scrolling back to a row they had already decided against.\n timer = setTimeout(disarm, 5_000);\n}\n\nonBeforeUnmount(disarm);\n</script>\n\n<template>\n <button\n :class=\"[variant, armed && 'armed']\"\n :disabled=\"pending || disabled\"\n :title=\"title\"\n :aria-busy=\"pending ? 'true' : undefined\"\n @click=\"onClick\"\n @blur=\"disarm\"\n @keydown.esc=\"disarm\"\n >\n <span v-if=\"armed\">{{ confirm }}</span>\n <slot v-else />\n <span v-if=\"pending\" class=\"progress\" aria-hidden=\"true\" />\n </button>\n</template>\n"],"names":["props","__props","emit","__emit","armed","ref","timer","disarm","onClick","onBeforeUnmount","_createElementBlock","_normalizeClass","_openBlock","_renderSlot","_ctx","_hoisted_3"],"mappings":"mVA6BA,MAAMA,EAAQC,EAURC,EAAOC,EAEPC,EAAQC,EAAI,EAAK,EACvB,IAAIC,EAA8C,KAElD,SAASC,GAAe,CACtBH,EAAM,MAAQ,GACVE,gBAAoBA,CAAK,EAC7BA,EAAQ,IACV,CAEA,SAASE,GAAgB,CACvB,GAAKR,EAAM,QACX,IAAII,EAAM,MAAO,CACfG,EAAA,EACAL,EAAK,KAAK,EACV,MACF,CACAE,EAAM,MAAQ,GAGdE,EAAQ,WAAWC,EAAQ,GAAK,EAClC,CAEA,OAAAE,EAAgBF,CAAM,cAIpBG,EAYS,SAAA,CAXN,MAAKC,EAAA,CAAGV,EAAA,QAASG,EAAA,OAAK,OAAA,CAAA,EACtB,SAAUH,EAAA,SAAWA,EAAA,SACrB,MAAOA,EAAA,MACP,YAAWA,EAAA,QAAO,OAAY,OAC9B,QAAAO,EACA,OAAMD,EACN,YAAaA,EAAM,CAAA,KAAA,CAAA,CAAA,GAERH,EAAA,OAAZQ,IAAAF,EAAuC,WAAjBT,EAAA,OAAO,EAAA,CAAA,GAC7BY,EAAeC,EAAA,OAAA,UAAA,GAAA,OAAA,OAAA,CAAA,EACHb,EAAA,SAAZW,EAAA,EAAAF,EAA2D,OAA3DK,CAA2D"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as u,i as x,u as i}from"./useDeployment-
|
|
2
|
-
//# sourceMappingURL=AxesTab-
|
|
1
|
+
import{d as u,i as x,u as i}from"./useDeployment-rA-pgUHZ.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,r as k,g,t as r,o as n,D as w,E as _}from"./index-IvJmpI3b.js";import"./useVars-VN9gYdR6.js";const A={class:"panel"},C={key:0,class:"mute"},N={class:"cards"},S={class:"stagger"},T={class:"name","data-label":"axis"},V={"data-label":"hooks"},B={"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",A,[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",T,r(a.name),1),s("td",V,[(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",B,[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",C,"Unavailable until the spec resolves."))]))}});export{U as default};
|
|
2
|
+
//# sourceMappingURL=AxesTab-Bzm6UBFL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxesTab-
|
|
1
|
+
{"version":3,"file":"AxesTab-Bzm6UBFL.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,uBACrD,EAAA,EAAAA,EAAiB,YAAX,OAAI,EAAA,IAAO,eAAY,EAAA,EAAAA,EAAwB,YAAlB,cAAW,EAAA,IAAO,4BAC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AK,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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as C,c as n,a as e,f as s,e as p,w as c,u as l,t as i,_ as V,F as v,r as w,g as d,k as u,o,E as f,M as x}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConfigTab-
|
|
1
|
+
import{d as C,c as n,a as e,f as s,e as p,w as c,u as l,t as i,_ as V,F as v,r as w,g as d,k as u,o,E as f,M as x}from"./index-IvJmpI3b.js";import{p as T,d as r,a as k,r as A}from"./useDeployment-rA-pgUHZ.js";import{c as N}from"./useVars-VN9gYdR6.js";import{_ as $}from"./VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js";import{_ as j}from"./HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js";import"./VarIO-BcNlaWXO.js";import"./SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js";import"./Teleport-bdITH--T.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DialogTrigger-K-5IAbpM.js";const B={class:"panel"},I={class:"hint"},L={class:"row",style:{"margin-top":"var(--s3)"}},z={class:"mute",style:{"font-size":"var(--t-xs)"}},D={class:"hint"},R={key:0,class:"panel"},q={class:"kvlist",style:{"margin-top":"var(--s3)"}},E={class:"k"},F={class:"v mono"},K={key:0,class:"banner warn"},O={class:"panel"},S={key:0,class:"mute"},U={class:"cards"},M={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},le=C({__name:"ConfigTab",setup(J){const h=u(()=>Object.keys(r.vars??{}).length),y=u(()=>{var m;return(m=A.value)==null?void 0:m.vars}),b=u(()=>Object.entries(y.value??{})),g=u(()=>N(r.vars,y.value));return(m,t)=>(o(),n("div",null,[e("section",B,[t[6]||(t[6]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Request variables",-1)),e("p",I,[t[3]||(t[3]=s(" Remembered in this browser. Another browser, a CI job or the command line supplies its own. ",-1)),p(j,{title:"Why the same variables have to be used for both"},{default:c(()=>[...t[2]||(t[2]=[e("p",null,[s(" 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"),s(" — the teardown finishes successfully having removed nothing, and the original is still running. ")],-1),e("p",null,[s(" They are kept per deployment in this browser only, which is what keeps them matched "),e("em",null,"here"),s(". Nothing carries them to anywhere else. ")],-1)])]),_:1})]),p($,{modelValue:l(r).vars,"onUpdate:modelValue":t[0]||(t[0]=a=>l(r).vars=a),onChange:l(T)},null,8,["modelValue","onChange"]),e("div",L,[e("button",{class:"primary",onClick:t[1]||(t[1]=(...a)=>l(k)&&l(k)(...a))},"Apply & reload"),e("span",z,i(h.value?`${h.value} variable${h.value===1?"":"s"}`:"no variables"),1)]),e("p",D,[t[5]||(t[5]=s(" Add any variable you need — the list below is what the spec declares, not everything it uses. ",-1)),p(V,{label:"why the two differ"},{default:c(()=>[...t[4]||(t[4]=[s(" 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?(o(),n("section",R,[t[10]||(t[10]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Stored on the server",-1)),t[11]||(t[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",q,[(o(!0),n(v,null,w(b.value,([a,_])=>(o(),n("li",{key:a},[e("span",E,[e("b",null,i(a),1)]),e("span",F,i(_),1)]))),128))]),g.value.length?(o(),n("div",K,[t[7]||(t[7]=e("b",null,"Your request variables disagree with the stored ones:",-1)),e("b",null,i(g.value.join(", ")),1),t[8]||(t[8]=s(". ",-1)),t[9]||(t[9]=e("p",null,[s(" Both resolve, so nothing will error — they simply resolve to "),e("em",null,"different stacks"),s(". 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,[t[15]||(t[15]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},[s(" Declared env "),e("span",{class:"mute"},"(after interpolation)")],-1)),l(r).detail?(o(),n(v,{key:1},[e("table",U,[t[13]||(t[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,[(o(!0),n(v,null,w(l(r).detail.env,a=>(o(),n("tr",{key:a.key},[e("td",M,i(a.key),1),e("td",{class:f(["name",{masked:a.visibility==="masked"}]),"data-label":"value"},i(a.value),3),e("td",W,[e("span",{class:f(["badge",a.visibility==="masked"?"warn":""])},i(l(x)(a.visibility)),3)]),e("td",Y,[s(i(a.length)+" chars ",1),a.length===0?(o(),n("span",G,"never set")):d("",!0)])]))),128)),l(r).detail.env.length?d("",!0):(o(),n("tr",H,[...t[12]||(t[12]=[e("td",{colspan:"4",class:"mute"},[s("This spec declares no "),e("code",null,"env:"),s(" block.")],-1)])]))])]),t[14]||(t[14]=e("p",{class:"hint"},[s(" A "),e("b",null,"masked"),s(" 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"),s(" — only its length is shown. Read it on the host if you need it. ")],-1))],64)):(o(),n("p",S,"Unavailable until the spec resolves."))])]))}});export{le as default};
|
|
2
|
+
//# sourceMappingURL=ConfigTab-B5Mkn_Xr.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigTab-GNv5OcAW.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 { sentence } from '../../composables/useFormat';\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 {{ sentence(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","sentence","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_12"],"mappings":"gqCAeA,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,mGAE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AEZ7B,EAIK,KAJLgC,EAIK,CAHHhC,EAEO,OAAA,CAFD,MAAK+B,EAAA,CAAC,QAAgBF,EAAE,aAAU,SAAA,OAAA,EAAA,CAAA,CAAA,IACnCtB,EAAA0B,CAAA,EAASJ,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA,GAQ5B7B,EAGK,KAHLkC,EAGK,KAFAL,EAAE,MAAM,EAAG,UACd,CAAA,EAAYA,EAAE,SAAM,OAApB9B,EAAwF,OAAxFoC,EAAwE,WAAS,wBAG1E5B,EAAAf,CAAA,EAAI,OAAO,IAAI,qBAA1BO,EAEK,KAAAqC,EAAA,CAAA,GAAA/B,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,IAA3EsC,EAAmC,sCAAoC"}
|
|
1
|
+
{"version":3,"file":"ConfigTab-B5Mkn_Xr.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 { sentence } from '../../composables/useFormat';\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 {{ sentence(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","sentence","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_12"],"mappings":"gqCAeA,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,IAdJ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AAlD8B,EAAkDhB,EAAbe,EAAE,GAAG,EAAA,CAAA,EAC1C7B,EAEK,KAAA,CAFD,MAAK+B,EAAA,CAAC,OAAM,CAAA,OAAmBF,EAAE,aAAU,QAAA,CAAA,CAAA,EAAiB,aAAW,OAAA,EACtEf,EAAAe,EAAE,KAAK,EAAA,CAAA,EAEZ7B,EAIK,KAJLgC,EAIK,CAHHhC,EAEO,OAAA,CAFD,MAAK+B,EAAA,CAAC,QAAgBF,EAAE,aAAU,SAAA,OAAA,EAAA,CAAA,CAAA,IACnCtB,EAAA0B,CAAA,EAASJ,EAAE,UAAU,CAAA,EAAA,CAAA,CAAA,GAQ5B7B,EAGK,KAHLkC,EAGK,KAFAL,EAAE,MAAM,EAAG,UACd,CAAA,EAAYA,EAAE,SAAM,OAApB9B,EAAwF,OAAxFoC,EAAwE,WAAS,wBAG1E5B,EAAAf,CAAA,EAAI,OAAO,IAAI,qBAA1BO,EAEK,KAAAqC,EAAA,CAAA,GAAA/B,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,IAA3EsC,EAAmC,sCAAoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as A,c as n,a as s,f as r,t as i,g as u,i as C,v as T,e as k,F as y,r as m,z as N,j as p,p as P,C as V,U as $,o as a}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConfigView-
|
|
1
|
+
import{d as A,c as n,a as s,f as r,t as i,g as u,i as C,v as T,e as k,F as y,r as m,z as N,j as p,p as P,C as V,U as $,o as a}from"./index-IvJmpI3b.js";import{_ as b}from"./ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js";import{_ as I}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js";const B={class:"page"},S={class:"card"},j={class:"field"},D={key:0,class:"dim"},E={class:"field"},F={class:"row"},K={key:0,class:"dim"},U={key:0,class:"card banner warn"},z={key:0,class:"dim"},L={class:"dim"},M={key:1,class:"card"},O={key:0,class:"dim"},q={key:1,class:"dim"},R=A({__name:"ConfigView",setup(G){const c=p(""),h=p(""),g=p(""),v=p(""),f=p(""),l=p(null),o=p(null);async function _(d){var t;const e=(t=d.target.files)==null?void 0:t[0];if(l.value=null,o.value=null,f.value="",!e){c.value="",h.value="";return}h.value=e.name,c.value=await e.text()}function x(){l.value=null,o.value=null}async function w(d){f.value="",v.value=d;const e=await P.post("/api/config/sealed",{sealed:c.value,passphrase:g.value,preview:d==="preview"});if(v.value="",!e.ok){f.value=V(e,d==="preview"?"preview this config":"apply this config");return}if(d==="preview"){l.value=e.body;return}const t=e.body;o.value=t,l.value=null,$("ok",`Applied: ${t.created.length} created, ${t.skipped.length} already here.`)}return(d,e)=>(a(),n("div",B,[e[9]||(e[9]=s("header",{class:"page-head"},[s("h1",null,"Apply a configuration"),s("p",{class:"dim"},[r(" A sealed "),s("code",null,"pstack pull config"),r(" export from another host: accounts, API tokens, variables and secrets, notifiers, sign-on, registry logins, routing files and named specs. It "),s("b",null,"creates what is missing and never overwrites"),r(", so applying one twice changes nothing the second time. ")])],-1)),s("section",S,[s("label",j,[e[3]||(e[3]=s("span",null,"Sealed export",-1)),s("input",{type:"file",accept:".sealed,.yaml,.yml,.json,application/json",onChange:_},null,32),h.value?(a(),n("small",D,i(h.value)+" — "+i(c.value.length)+" bytes",1)):u("",!0)]),s("label",E,[e[4]||(e[4]=s("span",null,"Passphrase",-1)),C(s("input",{"onUpdate:modelValue":e[0]||(e[0]=t=>g.value=t),type:"password",autocomplete:"off",placeholder:"the passphrase this file was sealed with",onInput:x},null,544),[[T,g.value]]),e[5]||(e[5]=s("small",{class:"dim"}," Sent to this host so it can open the file. That is safe in a way exporting would not be: everything inside is about to be stored here in plain text regardless. ",-1))]),s("div",F,[k(b,{label:"Preview",pending:v.value==="preview",disabled:!c.value||!g.value||!!v.value,onClick:e[1]||(e[1]=t=>w("preview"))},null,8,["pending","disabled"]),k(b,{label:"Apply",variant:"danger",pending:v.value==="apply",disabled:!l.value||!!v.value,onClick:e[2]||(e[2]=t=>w("apply"))},null,8,["pending","disabled"]),!l.value&&!o.value?(a(),n("small",K,"Preview first — Apply stays disabled until you have seen what this file does.")):u("",!0)])]),l.value?(a(),n("section",U,[e[6]||(e[6]=s("b",null,"This file will make this host trust:",-1)),s("ul",null,[(a(!0),n(y,null,m(l.value.trusts,t=>(a(),n("li",{key:t},i(t),1))),128)),l.value.trusts.length?u("",!0):(a(),n("li",z,"nothing it does not already trust."))]),s("p",L,[r(i(l.value.users)+" accounts · "+i(l.value.tokens)+" API tokens · "+i(l.value.vars)+" variables · "+i(l.value.notifiers)+" notifiers · "+i(l.value.registries)+" registries · "+i(l.value.routing)+" routing files · "+i(l.value.specs)+" specs",1),l.value.sso?(a(),n(y,{key:0},[r(" · sign-on ("+i(typeof l.value.sso=="number"?l.value.sso:1)+" provider"+i(typeof l.value.sso=="number"&&l.value.sso>1?"s":"")+")",1)],64)):u("",!0)]),e[7]||(e[7]=s("p",null,"Nothing has been written yet.",-1))])):u("",!0),o.value?(a(),n("section",M,[e[8]||(e[8]=s("b",null,"Applied.",-1)),o.value.created.length?(a(),n("p",O,"Created:")):u("",!0),s("ul",null,[(a(!0),n(y,null,m(o.value.created,t=>(a(),n("li",{key:t},i(t),1))),128))]),o.value.skipped.length?(a(),n("p",q,"Already here, left alone:")):u("",!0),s("ul",null,[(a(!0),n(y,null,m(o.value.skipped,t=>(a(),n("li",{key:t,class:"dim"},i(t),1))),128))])])):u("",!0),f.value?(a(),N(I,{key:2,text:f.value,title:"This configuration was not applied."},null,8,["text"])):u("",!0),e[10]||(e[10]=s("p",{class:"dim"},[r(" To "),s("em",null,"take"),r(" an export, run "),s("code",null,"pstack pull config -o host.sealed"),r(" on a machine that holds this host's "),s("code",null,"PSTACK_TOKEN"),r(". It is deliberately not possible from a browser session: one click would otherwise hand over every credential on the host. ")],-1))]))}});export{R as default};
|
|
2
|
+
//# sourceMappingURL=ConfigView-BMINdC1p.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigView-lP6-ppec.js","sources":["../../src/views/ConfigView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Apply a host configuration: a `pstack pull config` export, sealed, from another host.\n *\n * ── WHY THERE IS NO DOWNLOAD BUTTON ──────────────────────────────────────────────────────────────\n *\n * This page applies a config and cannot produce one. That is deliberate and it is not an oversight\n * to be tidied up later.\n *\n * Export is exfiltration: one request and every credential on the host — account hashes, API\n * tokens, host secrets, registry logins, notifier URLs — is in the caller's hands. If a browser\n * session could do that, then an XSS, a borrowed laptop or a stolen cookie could do it too, in one\n * click. So `GET /api/config` refuses a session and answers only to the PSTACK_TOKEN bearer, and\n * the way to take an export is `pstack pull config` on a machine that already holds that token.\n *\n * Import runs the other way. The caller must ALREADY possess the sealed file and its passphrase —\n * so this page reveals nothing its user could not read for themselves — and every secret in it is\n * about to be plaintext on this host anyway. That is also why the passphrase is sent to the server\n * here while `pull` keeps it local: there is nothing left for it to protect from this host.\n *\n * It is still the widest-reaching write in the API. It can create an administrator and choose where\n * this host pulls its images from. Hence Preview: nothing is written until the operator has seen,\n * in words, what the file will make this host trust.\n */\nimport { ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\n\ntype Preview = {\n preview: true;\n trusts: string[];\n users: number;\n tokens: number;\n vars: number;\n notifiers: number;\n registries: number;\n routing: number;\n specs: number;\n /** Count since multi-provider SSO; older servers sent a boolean, and truthiness reads both. */\n sso: number | boolean;\n};\ntype Applied = { trusts: string[]; created: string[]; skipped: string[] };\n\nconst sealed = ref('');\nconst fileName = ref('');\nconst passphrase = ref('');\nconst busy = ref('');\nconst error = ref('');\nconst preview = ref<Preview | null>(null);\nconst applied = ref<Applied | null>(null);\n\n/**\n * Reading the file in the BROWSER, never uploading it as a form part.\n *\n * It is one small JSON envelope, and this keeps the whole thing on one request whose body we can\n * describe exactly. Picking a different file clears any preview: a preview that outlived the file\n * it described would be the one way this page could lie about what is being applied.\n */\nasync function pick(e: Event): Promise<void> {\n const f = (e.target as HTMLInputElement).files?.[0];\n preview.value = null;\n applied.value = null;\n error.value = '';\n if (!f) {\n sealed.value = '';\n fileName.value = '';\n return;\n }\n fileName.value = f.name;\n sealed.value = await f.text();\n}\n\nfunction clearPreview(): void {\n preview.value = null;\n applied.value = null;\n}\n\nasync function run(mode: 'preview' | 'apply'): Promise<void> {\n error.value = '';\n busy.value = mode;\n const r = await api.post<Preview | Applied>('/api/config/sealed', {\n sealed: sealed.value,\n passphrase: passphrase.value,\n preview: mode === 'preview',\n });\n busy.value = '';\n if (!r.ok) {\n error.value = problem(r, mode === 'preview' ? 'preview this config' : 'apply this config');\n return;\n }\n if (mode === 'preview') {\n preview.value = r.body as Preview;\n return;\n }\n const done = r.body as Applied;\n applied.value = done;\n preview.value = null;\n toast('ok', `Applied: ${done.created.length} created, ${done.skipped.length} already here.`);\n}\n</script>\n\n<template>\n <div class=\"page\">\n <header class=\"page-head\">\n <h1>Apply a configuration</h1>\n <p class=\"dim\">\n A sealed <code>pstack pull config</code> export from another host: accounts, API tokens,\n variables and secrets, notifiers, sign-on, registry logins, routing files and named specs.\n It <b>creates what is missing and never overwrites</b>, so applying one twice changes\n nothing the second time.\n </p>\n </header>\n\n <section class=\"card\">\n <label class=\"field\">\n <span>Sealed export</span>\n <input type=\"file\" accept=\".sealed,.yaml,.yml,.json,application/json\" @change=\"pick\" />\n <small class=\"dim\" v-if=\"fileName\">{{ fileName }} — {{ sealed.length }} bytes</small>\n </label>\n\n <label class=\"field\">\n <span>Passphrase</span>\n <input\n v-model=\"passphrase\"\n type=\"password\"\n autocomplete=\"off\"\n placeholder=\"the passphrase this file was sealed with\"\n @input=\"clearPreview\"\n />\n <small class=\"dim\">\n Sent to this host so it can open the file. That is safe in a way exporting would not be:\n everything inside is about to be stored here in plain text regardless.\n </small>\n </label>\n\n <div class=\"row\">\n <ActionButton\n label=\"Preview\"\n :pending=\"busy === 'preview'\"\n :disabled=\"!sealed || !passphrase || !!busy\"\n @click=\"run('preview')\"\n />\n <ActionButton\n label=\"Apply\"\n variant=\"danger\"\n :pending=\"busy === 'apply'\"\n :disabled=\"!preview || !!busy\"\n @click=\"run('apply')\"\n />\n <small class=\"dim\" v-if=\"!preview && !applied\">Preview first — Apply stays disabled until you have seen what this file does.</small>\n </div>\n </section>\n\n <!--\n The grant, in words, before anything is written. `trusts` names accounts and their roles, API\n tokens, the sign-on provider and every registry and notifier URL — the things a file from\n somewhere else could use to take this host over.\n -->\n <section v-if=\"preview\" class=\"card banner warn\">\n <b>This file will make this host trust:</b>\n <ul>\n <li v-for=\"t in preview.trusts\" :key=\"t\">{{ t }}</li>\n <li v-if=\"!preview.trusts.length\" class=\"dim\">nothing it does not already trust.</li>\n </ul>\n <p class=\"dim\">\n {{ preview.users }} accounts · {{ preview.tokens }} API tokens · {{ preview.vars }} variables ·\n {{ preview.notifiers }} notifiers · {{ preview.registries }} registries ·\n {{ preview.routing }} routing files · {{ preview.specs }} specs<template v-if=\"preview.sso\"> · sign-on ({{ typeof preview.sso === 'number' ? preview.sso : 1 }} provider{{ typeof preview.sso === 'number' && preview.sso > 1 ? 's' : '' }})</template>\n </p>\n <p>Nothing has been written yet.</p>\n </section>\n\n <section v-if=\"applied\" class=\"card\">\n <b>Applied.</b>\n <p class=\"dim\" v-if=\"applied.created.length\">Created:</p>\n <ul>\n <li v-for=\"c in applied.created\" :key=\"c\">{{ c }}</li>\n </ul>\n <p class=\"dim\" v-if=\"applied.skipped.length\">Already here, left alone:</p>\n <ul>\n <li v-for=\"k in applied.skipped\" :key=\"k\" class=\"dim\">{{ k }}</li>\n </ul>\n </section>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"This configuration was not applied.\" />\n\n <p class=\"dim\">\n To <em>take</em> an export, run <code>pstack pull config -o host.sealed</code> on a machine\n that holds this host's <code>PSTACK_TOKEN</code>. It is deliberately not possible from a\n browser session: one click would otherwise hand over every credential on the host.\n </p>\n </div>\n</template>\n"],"names":["sealed","ref","fileName","passphrase","busy","error","preview","applied","pick","e","f","_a","clearPreview","run","mode","r","api","problem","done","toast","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_cache","_hoisted_4","_toDisplayString","_hoisted_5","$event","_hoisted_6","_createVNode","ActionButton","_hoisted_7","_hoisted_8","_Fragment","_renderList","_hoisted_9","_hoisted_10","_createTextVNode","_hoisted_11","_hoisted_12","c","_hoisted_13","k","_createBlock","ErrorNote"],"mappings":"inBA6CA,MAAMA,EAASC,EAAI,EAAE,EACfC,EAAWD,EAAI,EAAE,EACjBE,EAAaF,EAAI,EAAE,EACnBG,EAAOH,EAAI,EAAE,EACbI,EAAQJ,EAAI,EAAE,EACdK,EAAUL,EAAoB,IAAI,EAClCM,EAAUN,EAAoB,IAAI,EASxC,eAAeO,EAAKC,EAAyB,OAC3C,MAAMC,GAAKC,EAAAF,EAAE,OAA4B,QAA9B,YAAAE,EAAsC,GAIjD,GAHAL,EAAQ,MAAQ,KAChBC,EAAQ,MAAQ,KAChBF,EAAM,MAAQ,GACV,CAACK,EAAG,CACNV,EAAO,MAAQ,GACfE,EAAS,MAAQ,GACjB,MACF,CACAA,EAAS,MAAQQ,EAAE,KACnBV,EAAO,MAAQ,MAAMU,EAAE,KAAA,CACzB,CAEA,SAASE,GAAqB,CAC5BN,EAAQ,MAAQ,KAChBC,EAAQ,MAAQ,IAClB,CAEA,eAAeM,EAAIC,EAA0C,CAC3DT,EAAM,MAAQ,GACdD,EAAK,MAAQ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dC1p.js","sources":["../../src/views/ConfigView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Apply a host configuration: a `pstack pull config` export, sealed, from another host.\n *\n * ── WHY THERE IS NO DOWNLOAD BUTTON ──────────────────────────────────────────────────────────────\n *\n * This page applies a config and cannot produce one. That is deliberate and it is not an oversight\n * to be tidied up later.\n *\n * Export is exfiltration: one request and every credential on the host — account hashes, API\n * tokens, host secrets, registry logins, notifier URLs — is in the caller's hands. If a browser\n * session could do that, then an XSS, a borrowed laptop or a stolen cookie could do it too, in one\n * click. So `GET /api/config` refuses a session and answers only to the PSTACK_TOKEN bearer, and\n * the way to take an export is `pstack pull config` on a machine that already holds that token.\n *\n * Import runs the other way. The caller must ALREADY possess the sealed file and its passphrase —\n * so this page reveals nothing its user could not read for themselves — and every secret in it is\n * about to be plaintext on this host anyway. That is also why the passphrase is sent to the server\n * here while `pull` keeps it local: there is nothing left for it to protect from this host.\n *\n * It is still the widest-reaching write in the API. It can create an administrator and choose where\n * this host pulls its images from. Hence Preview: nothing is written until the operator has seen,\n * in words, what the file will make this host trust.\n */\nimport { ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\n\ntype Preview = {\n preview: true;\n trusts: string[];\n users: number;\n tokens: number;\n vars: number;\n notifiers: number;\n registries: number;\n routing: number;\n specs: number;\n /** Count since multi-provider SSO; older servers sent a boolean, and truthiness reads both. */\n sso: number | boolean;\n};\ntype Applied = { trusts: string[]; created: string[]; skipped: string[] };\n\nconst sealed = ref('');\nconst fileName = ref('');\nconst passphrase = ref('');\nconst busy = ref('');\nconst error = ref('');\nconst preview = ref<Preview | null>(null);\nconst applied = ref<Applied | null>(null);\n\n/**\n * Reading the file in the BROWSER, never uploading it as a form part.\n *\n * It is one small JSON envelope, and this keeps the whole thing on one request whose body we can\n * describe exactly. Picking a different file clears any preview: a preview that outlived the file\n * it described would be the one way this page could lie about what is being applied.\n */\nasync function pick(e: Event): Promise<void> {\n const f = (e.target as HTMLInputElement).files?.[0];\n preview.value = null;\n applied.value = null;\n error.value = '';\n if (!f) {\n sealed.value = '';\n fileName.value = '';\n return;\n }\n fileName.value = f.name;\n sealed.value = await f.text();\n}\n\nfunction clearPreview(): void {\n preview.value = null;\n applied.value = null;\n}\n\nasync function run(mode: 'preview' | 'apply'): Promise<void> {\n error.value = '';\n busy.value = mode;\n const r = await api.post<Preview | Applied>('/api/config/sealed', {\n sealed: sealed.value,\n passphrase: passphrase.value,\n preview: mode === 'preview',\n });\n busy.value = '';\n if (!r.ok) {\n error.value = problem(r, mode === 'preview' ? 'preview this config' : 'apply this config');\n return;\n }\n if (mode === 'preview') {\n preview.value = r.body as Preview;\n return;\n }\n const done = r.body as Applied;\n applied.value = done;\n preview.value = null;\n toast('ok', `Applied: ${done.created.length} created, ${done.skipped.length} already here.`);\n}\n</script>\n\n<template>\n <div class=\"page\">\n <header class=\"page-head\">\n <h1>Apply a configuration</h1>\n <p class=\"dim\">\n A sealed <code>pstack pull config</code> export from another host: accounts, API tokens,\n variables and secrets, notifiers, sign-on, registry logins, routing files and named specs.\n It <b>creates what is missing and never overwrites</b>, so applying one twice changes\n nothing the second time.\n </p>\n </header>\n\n <section class=\"card\">\n <label class=\"field\">\n <span>Sealed export</span>\n <input type=\"file\" accept=\".sealed,.yaml,.yml,.json,application/json\" @change=\"pick\" />\n <small class=\"dim\" v-if=\"fileName\">{{ fileName }} — {{ sealed.length }} bytes</small>\n </label>\n\n <label class=\"field\">\n <span>Passphrase</span>\n <input\n v-model=\"passphrase\"\n type=\"password\"\n autocomplete=\"off\"\n placeholder=\"the passphrase this file was sealed with\"\n @input=\"clearPreview\"\n />\n <small class=\"dim\">\n Sent to this host so it can open the file. That is safe in a way exporting would not be:\n everything inside is about to be stored here in plain text regardless.\n </small>\n </label>\n\n <div class=\"row\">\n <ActionButton\n label=\"Preview\"\n :pending=\"busy === 'preview'\"\n :disabled=\"!sealed || !passphrase || !!busy\"\n @click=\"run('preview')\"\n />\n <ActionButton\n label=\"Apply\"\n variant=\"danger\"\n :pending=\"busy === 'apply'\"\n :disabled=\"!preview || !!busy\"\n @click=\"run('apply')\"\n />\n <small class=\"dim\" v-if=\"!preview && !applied\">Preview first — Apply stays disabled until you have seen what this file does.</small>\n </div>\n </section>\n\n <!--\n The grant, in words, before anything is written. `trusts` names accounts and their roles, API\n tokens, the sign-on provider and every registry and notifier URL — the things a file from\n somewhere else could use to take this host over.\n -->\n <section v-if=\"preview\" class=\"card banner warn\">\n <b>This file will make this host trust:</b>\n <ul>\n <li v-for=\"t in preview.trusts\" :key=\"t\">{{ t }}</li>\n <li v-if=\"!preview.trusts.length\" class=\"dim\">nothing it does not already trust.</li>\n </ul>\n <p class=\"dim\">\n {{ preview.users }} accounts · {{ preview.tokens }} API tokens · {{ preview.vars }} variables ·\n {{ preview.notifiers }} notifiers · {{ preview.registries }} registries ·\n {{ preview.routing }} routing files · {{ preview.specs }} specs<template v-if=\"preview.sso\"> · sign-on ({{ typeof preview.sso === 'number' ? preview.sso : 1 }} provider{{ typeof preview.sso === 'number' && preview.sso > 1 ? 's' : '' }})</template>\n </p>\n <p>Nothing has been written yet.</p>\n </section>\n\n <section v-if=\"applied\" class=\"card\">\n <b>Applied.</b>\n <p class=\"dim\" v-if=\"applied.created.length\">Created:</p>\n <ul>\n <li v-for=\"c in applied.created\" :key=\"c\">{{ c }}</li>\n </ul>\n <p class=\"dim\" v-if=\"applied.skipped.length\">Already here, left alone:</p>\n <ul>\n <li v-for=\"k in applied.skipped\" :key=\"k\" class=\"dim\">{{ k }}</li>\n </ul>\n </section>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"This configuration was not applied.\" />\n\n <p class=\"dim\">\n To <em>take</em> an export, run <code>pstack pull config -o host.sealed</code> on a machine\n that holds this host's <code>PSTACK_TOKEN</code>. It is deliberately not possible from a\n browser session: one click would otherwise hand over every credential on the host.\n </p>\n </div>\n</template>\n"],"names":["sealed","ref","fileName","passphrase","busy","error","preview","applied","pick","e","f","_a","clearPreview","run","mode","r","api","problem","done","toast","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_cache","_hoisted_4","_toDisplayString","_hoisted_5","$event","_hoisted_6","_createVNode","ActionButton","_hoisted_7","_hoisted_8","_Fragment","_renderList","_hoisted_9","_hoisted_10","_createTextVNode","_hoisted_11","_hoisted_12","c","_hoisted_13","k","_createBlock","ErrorNote"],"mappings":"inBA6CA,MAAMA,EAASC,EAAI,EAAE,EACfC,EAAWD,EAAI,EAAE,EACjBE,EAAaF,EAAI,EAAE,EACnBG,EAAOH,EAAI,EAAE,EACbI,EAAQJ,EAAI,EAAE,EACdK,EAAUL,EAAoB,IAAI,EAClCM,EAAUN,EAAoB,IAAI,EASxC,eAAeO,EAAKC,EAAyB,OAC3C,MAAMC,GAAKC,EAAAF,EAAE,OAA4B,QAA9B,YAAAE,EAAsC,GAIjD,GAHAL,EAAQ,MAAQ,KAChBC,EAAQ,MAAQ,KAChBF,EAAM,MAAQ,GACV,CAACK,EAAG,CACNV,EAAO,MAAQ,GACfE,EAAS,MAAQ,GACjB,MACF,CACAA,EAAS,MAAQQ,EAAE,KACnBV,EAAO,MAAQ,MAAMU,EAAE,KAAA,CACzB,CAEA,SAASE,GAAqB,CAC5BN,EAAQ,MAAQ,KAChBC,EAAQ,MAAQ,IAClB,CAEA,eAAeM,EAAIC,EAA0C,CAC3DT,EAAM,MAAQ,GACdD,EAAK,MAAQU,EACb,MAAMC,EAAI,MAAMC,EAAI,KAAwB,qBAAsB,CAChE,OAAQhB,EAAO,MACf,WAAYG,EAAW,MACvB,QAASW,IAAS,SAAA,CACnB,EAED,GADAV,EAAK,MAAQ,GACT,CAACW,EAAE,GAAI,CACTV,EAAM,MAAQY,EAAQF,EAAGD,IAAS,UAAY,sBAAwB,mBAAmB,EACzF,MACF,CACA,GAAIA,IAAS,UAAW,CACtBR,EAAQ,MAAQ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,gCAA6B,EAAA,EAAA,aAGnBhB,EAAA,OAAfa,EAAA,EAAAC,EAUU,UAVVoB,EAUU,CATRf,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAH,EAAe,SAAZ,WAAQ,EAAA,GACUhB,EAAA,MAAQ,QAAQ,YAArCc,EAAyD,IAAzDqB,EAA6C,UAAQ,YACrDnB,EAEK,KAAA,KAAA,EADHH,EAAA,EAAA,EAAAC,EAAsDe,EAAA,KAAAC,EAAtC9B,EAAA,MAAQ,QAAboC,IAAXvB,EAAA,EAAAC,EAAsD,KAAA,CAApB,IAAKsB,CAAA,IAAMA,CAAC,EAAA,CAAA,YAE3BpC,EAAA,MAAQ,QAAQ,YAArCc,EAA0E,IAA1EuB,EAA6C,2BAAyB,YACtErB,EAEK,KAAA,KAAA,EADHH,EAAA,EAAA,EAAAC,EAAkEe,EAAA,KAAAC,EAAlD9B,EAAA,MAAQ,QAAbsC,QAAXxB,EAAkE,KAAA,CAAhC,IAAKwB,EAAG,MAAM,KAAA,IAASA,CAAC,EAAA,CAAA,wBAI7CxC,EAAA,WAAjByC,EAAoFC,EAAA,OAA3D,KAAM1C,EAAA,MAAO,MAAM,qCAAA,2CAE5CkB,EAII,IAAA,CAJD,MAAM,OAAK,GAAC,MACV,EAAAA,EAAa,UAAT,MAAI,IAAK,kBAAgB,EAAAA,EAA8C,YAAxC,mCAAiC,IAAO,uCACvD,EAAAA,EAAyB,YAAnB,cAAY,IAAO,8HAElD,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as j,U as k,G as h,J as $,Y as C,C as x,j as f,k as m,Z as I,A as R,$ as T,b as U,d as A,c as r,E as D,a as d,t as b,f as i,e as L,w as N,l as S,o as l}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConflictNote.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{p as j,U as k,G as h,J as $,Y as C,C as x,j as f,k as m,Z as I,A as R,$ as T,b as U,d as A,c as r,E as D,a as d,t as b,f as i,e as L,w as N,l as S,o as l}from"./index-IvJmpI3b.js";import{d as s,v as E,i as g}from"./useDeployment-rA-pgUHZ.js";const p=f(""),u=f(""),w=f(null),v=f(""),B=m(()=>{var e;return((e=s.detail)==null?void 0:e.busy)===!0}),Y=m(()=>{var e;return((e=R.health)==null?void 0:e.authEnforced)===!0&&!T.token&&!U.authed}),Z=m(()=>{const e=s.vars.filter(o=>o.k).map(o=>o.k);return e.length?`Sending ${e.join(", ")} with every action.`:"Using the variables saved with this deployment."});function H(e,o=!1){if(!s.detail)return"The spec has not resolved — the server cannot compute the stack name.";if(B.value&&e!=="down")return`A job is already running or waiting on ${s.detail.stack}. Wait for it, or stop everything on the stack from the Danger tab.`;if(e==="down"&&g.value&&!o)return`Type the stack name "${s.detail.stack}" below to confirm a shared teardown.`;if(e==="sleep"&&g.value)return"A shared deployment cannot sleep — every preview that depends on it would go with it.";if(e==="sleep"&&!s.detail.compose)return"This spec has no compose section — there is nothing to put to sleep.";if(e==="sleep"&&s.detail.asleep)return"Already asleep."}async function K(e,o={}){if(!s.detail)return;p.value=e,u.value="",w.value=null;const t=e==="down"?{verify:o.verify??!0,force:o.force??!1}:{},a=await j.post(`/api/deployments/${encodeURIComponent(s.id)}/${e}${E.value}`,t);if(p.value="",a.status===202){const n=a.body.job;if(n!=null&&n.id){const c=n.state==="queued"?"queued":"started";k("info",`${h(e)} ${c} on ${n.stack}`,{to:`/jobs/${encodeURIComponent(n.id)}`,toLabel:"Follow"}),$(),C.push(`/jobs/${encodeURIComponent(n.id)}`);return}u.value="The action was accepted, but the response carried nothing to follow.";return}if(a.status===409)return F(a.body);u.value=x(a,h(e).toLowerCase()),k("error",`${h(e)} was refused.`)}async function F(e){var c;const o=I(e);w.value=o,v.value="";const t=o.stack||((c=s.detail)==null?void 0:c.stack);if(o.kind!=="other"||!t)return;const n=((await j.get("/api/jobs")).body.jobs??[]).find(y=>y.state==="running"&&y.stack===t);n&&(v.value=n.id)}function O(){p.value="",u.value="",w.value=null,v.value=""}const V={class:"raw",style:{color:"var(--fg-dim)","max-height":"200px"}},q={key:0},J={key:1},W={key:2},z={key:3},G={key:4},P=A({__name:"ConflictNote",props:{conflict:{},jobId:{}},setup(e){return(o,t)=>{const a=S("RouterLink");return l(),r("div",{class:D(["banner",e.conflict.kind==="shared"?"leaked":"info"]),role:"alert"},[t[5]||(t[5]=d("b",null,"Refused — nothing was started.",-1)),d("pre",V,b(e.conflict.text),1),e.conflict.kind==="shared"?(l(),r("p",q,[...t[0]||(t[0]=[i(" Type the stack name in the confirmation field above and press ",-1),d("code",null,"down",-1),i(" again. ",-1)])])):e.conflict.kind==="containers"?(l(),r("p",J,[...t[1]||(t[1]=[i(" Run ",-1),d("code",null,"down",-1),i(" 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)])])):e.conflict.kind==="referenced"?(l(),r("p",W,[t[2]||(t[2]=i(" These deployments still use this spec: ",-1)),d("strong",null,b(e.conflict.deployments.join(", ")),1),t[3]||(t[3]=i(". Deleting it would leave them with no way to be torn down. ",-1))])):e.jobId?(l(),r("p",z,[L(a,{to:`/jobs/${encodeURIComponent(e.jobId)}`},{default:N(()=>[...t[4]||(t[4]=[i("Follow the running job →",-1)])]),_:1},8,["to"])])):(l(),r("p",G,"Nothing was retried. Wait for the current work to finish, then try again."))],2)}}});export{P as _,K as a,B as b,u as c,w as d,v as e,F as o,p,O as r,Y as t,Z as v,H as w};
|
|
2
|
+
//# sourceMappingURL=ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConflictNote.vue_vue_type_script_setup_true_lang-DxO9agCS.js","sources":["../../src/composables/useDeploymentActions.ts","../../src/components/ConflictNote.vue"],"sourcesContent":["/**\n * Lifecycle actions for the open deployment — shared by the detail HEADER (Deploy, Verify) and the\n * Danger tab (Tear down, Forget).\n *\n * WHY THIS MOVED OUT OF THE DANGER TAB. Deploy is the primary action of the entire product, and it\n * lived behind a tab named \"Danger\" — three clicks deep, labelled as something to be afraid of.\n * Deploying and verifying a preview are routine and reversible; they belong in the header, visible\n * from every tab. What stays in Danger is what the name promises: teardown and forgetting.\n *\n * Module-level state, same pattern as `useDeployment`: exactly one deployment detail is open at a\n * time, and the header and the tab must see the SAME pending/conflict state — two components each\n * holding their own copy is how a button stays enabled while the other copy knows a job is running.\n */\nimport { computed, ref } from 'vue';\nimport { api, classifyConflict, problem, type Conflict } from '../api/client';\nimport type { ActionResponse, ConflictBody, JobsResponse } from '../api/types';\nimport { dep, isShared, varsQuery } from './useDeployment';\nimport { loadDeployments, state } from './useControlPlane';\nimport { settings } from './useSettings';\nimport { authState } from './useAuth';\nimport { toast } from './useToasts';\nimport { actionLabel } from './useFormat';\nimport { router } from '../router';\n\nexport type LifecycleAction = 'up' | 'verify' | 'down' | 'sleep' | 'wake';\n\nexport const pending = ref<'' | LifecycleAction | 'forget'>('');\nexport const actionError = ref('');\nexport const conflict = ref<Conflict | null>(null);\nexport const conflictJobId = ref('');\n\nexport const busy = computed(() => dep.detail?.busy === true);\n/**\n * True only when NOTHING can authenticate the caller. This predates accounts and used to check the\n * token alone — so a signed-in operator with no token pasted was told \"every action below will be\n * refused\" while their actions were succeeding. A session is a credential; the warning must know so.\n */\nexport const tokenMissing = computed(\n () => state.health?.authEnforced === true && !settings.token && !authState.authed,\n);\n\n/**\n * The variables an action 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 */\nexport const 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/** A disabled control must say why. This is the text that answers it. */\nexport function whyDisabled(action: LifecycleAction, forceArmed = false): string | undefined {\n if (!dep.detail) return 'The spec has not resolved — the server cannot compute the stack name.';\n // A teardown is NEVER blocked by a busy stack. `down` PREEMPTS on the server — it cancels the\n // running job, drops the one queued behind it, and then runs — so disabling the button here\n // would be this app refusing the one action the server promises will not wait.\n if (busy.value && action !== 'down') {\n // Why DISABLED rather than \"it would queue\": the server WOULD accept it (a second job queues,\n // a third replaces the second), but a person clicking Deploy twice on one screen means the\n // first click, not a burst of pushes. The queue exists for CI; offering it here would just be\n // a way to schedule a duplicate of what is already running. The escape hatch is named.\n return (\n `A job is already running or waiting on ${dep.detail.stack}. ` +\n 'Wait for it, or stop everything on the stack from the Danger tab.'\n );\n }\n if (action === 'down' && isShared.value && !forceArmed) {\n return `Type the stack name \"${dep.detail.stack}\" below to confirm a shared teardown.`;\n }\n if (action === 'sleep' && isShared.value) {\n return 'A shared deployment cannot sleep — every preview that depends on it would go with it.';\n }\n if (action === 'sleep' && !dep.detail.compose) return 'This spec has no compose section — there is nothing to put to sleep.';\n if (action === 'sleep' && dep.detail.asleep) return 'Already asleep.';\n return undefined;\n}\n\nexport async function act(\n action: LifecycleAction,\n opts: { verify?: boolean; force?: boolean } = {},\n): 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: opts.verify ?? true, force: opts.force ?? false }\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 // The 202 says which it is. \"Started\" on a job that is only queued is the toast telling an\n // operator their deploy is running when it has not begun — the exact confusion the queued\n // state exists to remove.\n const verb = job.state === 'queued' ? 'queued' : 'started';\n toast('info', `${actionLabel(action)} ${verb} 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\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 busy stack is no longer a 409 (a second job queues); what is left in this\n * branch is a HOLD — a spec edit or a delete in progress — and \"docker did not answer\", which are\n * shape-identical, so neither is claimed. The server's message is printed verbatim. Never retry.\n */\nexport async function onConflict(body: ConflictBody): Promise<void> {\n const c = classifyConflict(body);\n conflict.value = c;\n conflictJobId.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\n/** Leaving the deployment must not carry a stale error onto the next one. */\nexport function resetActions(): void {\n pending.value = '';\n actionError.value = '';\n conflict.value = null;\n conflictJobId.value = '';\n}\n","<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"],"names":["pending","ref","actionError","conflict","conflictJobId","busy","computed","_a","dep","tokenMissing","state","settings","authState","varsSummary","names","v","whyDisabled","action","forceArmed","isShared","act","opts","body","r","api","varsQuery","job","verb","toast","actionLabel","loadDeployments","router","onConflict","problem","c","classifyConflict","stack","live","j","resetActions","_createElementBlock","_normalizeClass","__props","_cache","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","_component_RouterLink","_openBlock"],"mappings":"yPA0BO,MAAMA,EAAUC,EAAqC,EAAE,EACjDC,EAAcD,EAAI,EAAE,EACpBE,EAAWF,EAAqB,IAAI,EACpCG,EAAgBH,EAAI,EAAE,EAEtBI,EAAOC,EAAS,IAAA,OAAM,QAAAC,EAAAC,EAAI,SAAJ,YAAAD,EAAY,QAAS,GAAI,EAM/CE,EAAeH,EAC1B,WAAM,QAAAC,EAAAG,EAAM,SAAN,YAAAH,EAAc,gBAAiB,IAAQ,CAACI,EAAS,OAAS,CAACC,EAAU,OAC7E,EAMaC,EAAcP,EAAS,IAAM,CACxC,MAAMQ,EAAQN,EAAI,KAAK,OAAQO,GAAMA,EAAE,CAAC,EAAE,IAAKA,GAAMA,EAAE,CAAC,EAGxD,OAAOD,EAAM,OACT,WAAWA,EAAM,KAAK,IAAI,CAAC,sBAC3B,iDACN,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AA,EAAAC,EAAiB,YAAX,OAAI,EAAA,IAAO,oLAGvB,EAAA,CAAA,MACcF,EAAA,SAAS,OAAI,kBAA3BF,EAGI,IAAAS,EAAA,eAH0C,2CACL,EAAA,GAAAL,EAAsD,SAAA,KAAAE,EAA3CJ,EAAA,SAAS,YAAY,KAAI,IAAA,CAAA,EAAA,CAAA,gBAAkB,+DAE/F,EAAA,EAAA,IACcA,EAAA,WAAdF,EAEI,IAAAU,EAAA,CADFC,EAA4FC,EAAA,CAA/E,GAAE,SAAW,mBAAmBV,EAAA,KAAK,CAAA,EAAA,aAAK,IAAwB,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAxB,2BAAwB,EAAA,CAAA,wBAEjFU,EAAA,EAAAb,EAAuF,MAA7E,2EAAyE,EAAA"}
|
|
1
|
+
{"version":3,"file":"ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js","sources":["../../src/composables/useDeploymentActions.ts","../../src/components/ConflictNote.vue"],"sourcesContent":["/**\n * Lifecycle actions for the open deployment — shared by the detail HEADER (Deploy, Verify) and the\n * Danger tab (Tear down, Forget).\n *\n * WHY THIS MOVED OUT OF THE DANGER TAB. Deploy is the primary action of the entire product, and it\n * lived behind a tab named \"Danger\" — three clicks deep, labelled as something to be afraid of.\n * Deploying and verifying a preview are routine and reversible; they belong in the header, visible\n * from every tab. What stays in Danger is what the name promises: teardown and forgetting.\n *\n * Module-level state, same pattern as `useDeployment`: exactly one deployment detail is open at a\n * time, and the header and the tab must see the SAME pending/conflict state — two components each\n * holding their own copy is how a button stays enabled while the other copy knows a job is running.\n */\nimport { computed, ref } from 'vue';\nimport { api, classifyConflict, problem, type Conflict } from '../api/client';\nimport type { ActionResponse, ConflictBody, JobsResponse } from '../api/types';\nimport { dep, isShared, varsQuery } from './useDeployment';\nimport { loadDeployments, state } from './useControlPlane';\nimport { settings } from './useSettings';\nimport { authState } from './useAuth';\nimport { toast } from './useToasts';\nimport { actionLabel } from './useFormat';\nimport { router } from '../router';\n\nexport type LifecycleAction = 'up' | 'verify' | 'down' | 'sleep' | 'wake';\n\nexport const pending = ref<'' | LifecycleAction | 'forget'>('');\nexport const actionError = ref('');\nexport const conflict = ref<Conflict | null>(null);\nexport const conflictJobId = ref('');\n\nexport const busy = computed(() => dep.detail?.busy === true);\n/**\n * True only when NOTHING can authenticate the caller. This predates accounts and used to check the\n * token alone — so a signed-in operator with no token pasted was told \"every action below will be\n * refused\" while their actions were succeeding. A session is a credential; the warning must know so.\n */\nexport const tokenMissing = computed(\n () => state.health?.authEnforced === true && !settings.token && !authState.authed,\n);\n\n/**\n * The variables an action 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 */\nexport const 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/** A disabled control must say why. This is the text that answers it. */\nexport function whyDisabled(action: LifecycleAction, forceArmed = false): string | undefined {\n if (!dep.detail) return 'The spec has not resolved — the server cannot compute the stack name.';\n // A teardown is NEVER blocked by a busy stack. `down` PREEMPTS on the server — it cancels the\n // running job, drops the one queued behind it, and then runs — so disabling the button here\n // would be this app refusing the one action the server promises will not wait.\n if (busy.value && action !== 'down') {\n // Why DISABLED rather than \"it would queue\": the server WOULD accept it (a second job queues,\n // a third replaces the second), but a person clicking Deploy twice on one screen means the\n // first click, not a burst of pushes. The queue exists for CI; offering it here would just be\n // a way to schedule a duplicate of what is already running. The escape hatch is named.\n return (\n `A job is already running or waiting on ${dep.detail.stack}. ` +\n 'Wait for it, or stop everything on the stack from the Danger tab.'\n );\n }\n if (action === 'down' && isShared.value && !forceArmed) {\n return `Type the stack name \"${dep.detail.stack}\" below to confirm a shared teardown.`;\n }\n if (action === 'sleep' && isShared.value) {\n return 'A shared deployment cannot sleep — every preview that depends on it would go with it.';\n }\n if (action === 'sleep' && !dep.detail.compose) return 'This spec has no compose section — there is nothing to put to sleep.';\n if (action === 'sleep' && dep.detail.asleep) return 'Already asleep.';\n return undefined;\n}\n\nexport async function act(\n action: LifecycleAction,\n opts: { verify?: boolean; force?: boolean } = {},\n): 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: opts.verify ?? true, force: opts.force ?? false }\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 // The 202 says which it is. \"Started\" on a job that is only queued is the toast telling an\n // operator their deploy is running when it has not begun — the exact confusion the queued\n // state exists to remove.\n const verb = job.state === 'queued' ? 'queued' : 'started';\n toast('info', `${actionLabel(action)} ${verb} 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\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 busy stack is no longer a 409 (a second job queues); what is left in this\n * branch is a HOLD — a spec edit or a delete in progress — and \"docker did not answer\", which are\n * shape-identical, so neither is claimed. The server's message is printed verbatim. Never retry.\n */\nexport async function onConflict(body: ConflictBody): Promise<void> {\n const c = classifyConflict(body);\n conflict.value = c;\n conflictJobId.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\n/** Leaving the deployment must not carry a stale error onto the next one. */\nexport function resetActions(): void {\n pending.value = '';\n actionError.value = '';\n conflict.value = null;\n conflictJobId.value = '';\n}\n","<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"],"names":["pending","ref","actionError","conflict","conflictJobId","busy","computed","_a","dep","tokenMissing","state","settings","authState","varsSummary","names","v","whyDisabled","action","forceArmed","isShared","act","opts","body","r","api","varsQuery","job","verb","toast","actionLabel","loadDeployments","router","onConflict","problem","c","classifyConflict","stack","live","j","resetActions","_createElementBlock","_normalizeClass","__props","_cache","_createElementVNode","_hoisted_1","_toDisplayString","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_createVNode","_component_RouterLink","_openBlock"],"mappings":"yPA0BO,MAAMA,EAAUC,EAAqC,EAAE,EACjDC,EAAcD,EAAI,EAAE,EACpBE,EAAWF,EAAqB,IAAI,EACpCG,EAAgBH,EAAI,EAAE,EAEtBI,EAAOC,EAAS,IAAA,OAAM,QAAAC,EAAAC,EAAI,SAAJ,YAAAD,EAAY,QAAS,GAAI,EAM/CE,EAAeH,EAC1B,WAAM,QAAAC,EAAAG,EAAM,SAAN,YAAAH,EAAc,gBAAiB,IAAQ,CAACI,EAAS,OAAS,CAACC,EAAU,OAC7E,EAMaC,EAAcP,EAAS,IAAM,CACxC,MAAMQ,EAAQN,EAAI,KAAK,OAAQO,GAAMA,EAAE,CAAC,EAAE,IAAKA,GAAMA,EAAE,CAAC,EAGxD,OAAOD,EAAM,OACT,WAAWA,EAAM,KAAK,IAAI,CAAC,sBAC3B,iDACN,CAAC,EAGM,SAASE,EAAYC,EAAyBC,EAAa,GAA2B,CAC3F,GAAI,CAACV,EAAI,OAAQ,MAAO,wEAIxB,GAAIH,EAAK,OAASY,IAAW,OAK3B,MACE,0CAA0CT,EAAI,OAAO,KAAK,sEAI9D,GAAIS,IAAW,QAAUE,EAAS,OAAS,CAACD,EAC1C,MAAO,wBAAwBV,EAAI,OAAO,KAAK,wCAEjD,GAAIS,IAAW,SAAWE,EAAS,MACjC,MAAO,wFAET,GAAIF,IAAW,SAAW,CAACT,EAAI,OAAO,QAAS,MAAO,uEACtD,GAAIS,IAAW,SAAWT,EAAI,OAAO,OAAQ,MAAO,iBAEtD,CAEA,eAAsBY,EACpBH,EACAI,EAA8C,GAC/B,CACf,GAAI,CAACb,EAAI,OAAQ,O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AA7E,2EAAyE,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as Z,c as d,u as o,a as t,f as n,t as u,e as i,w as p,_ as b,g as v,i as k,L as I,z as L,F as P,v as _,j as f,k as B,U as g,l as ee,o as a,m as te,p as E,C as q,J as M}from"./index-Cllpaxdb.js";import{d as s,i as h,v as W}from"./useDeployment-DsuhE4uh.js";import{a as J,w as F,p as w,b as K,t as ne,v as oe,c as R,d as O,e as se,_ as le,o as ae}from"./ConflictNote.vue_vue_type_script_setup_true_lang-DxO9agCS.js";import{_ as c}from"./ActionButton.vue_vue_type_script_setup_true_lang-Boeac0US.js";import{_ as z}from"./ErrorNote.vue_vue_type_script_setup_true_lang-TuSS3q8x.js";import{E as ie}from"./EquivalentCommand-BO7XtMvC.js";import{_ as re}from"./SelectMenu.vue_vue_type_script_setup_true_lang-CPpw5Oci.js";import"./useVars-VN9gYdR6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-CNXlGDC9.js";const de={key:0,class:"panel"},ue={class:"dim"},pe={class:"row",style:{"margin-top":"var(--s3)"}},ve={key:0,class:"mute"},me={key:1,class:"panel"},fe={class:"phead"},we={class:"dim"},ye={class:"row",style:{"margin-top":"var(--s3)","flex-wrap":"wrap",gap:"var(--s3)"}},be={class:"check"},ke={class:"check"},ge={class:"field inline"},he={key:0,class:"banner ok",style:{"margin-top":"var(--s3)"}},ce={class:"code",style:{"white-space":"pre-wrap","word-break":"break-all"}},xe={class:"row"},Ce=["href"],$e={class:"panel"},Te={key:0,class:"mute"},Se={key:0,class:"banner warn"},Ue={class:"dim"},Ve={class:"row",style:{"margin-top":"var(--s3)"}},je={class:"check"},Ie={key:1,class:"hint"},Re={key:2,class:"hint"},Ae={key:3,class:"banner leaked"},Ne={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},De=["for"],Le=["id","placeholder"],Ee={key:0,class:"s-failed"},qe={class:"row",style:{"margin-top":"var(--s4)"}},Fe={class:"panel"},Oe={key:0,class:"mute"},Pe={class:"dim"},Be={class:"row",style:{"margin-top":"var(--s3)"}},Me={class:"check"},et=Z({__name:"DangerTab",setup(We){const H=te(),A=f(!0),N=f(!0),x=f("7d"),m=f(null),C=f(""),$=f(!1),T=B(()=>[...A.value?["details"]:[],...N.value?["logs"]:[]]);async function Q(){$.value=!0,C.value="",m.value=null;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/share`,{views:T.value,ttl:x.value});if($.value=!1,l.status===201){m.value=l.body;return}C.value=q(l,"mint a share link")}async function Y(){if(m.value)try{await navigator.clipboard.writeText(m.value.url),g("ok","Link copied.")}catch{g("error","Could not reach the clipboard — select the link and copy it.")}}const S=f(!1);async function G(){S.value=!0;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/cancel${W.value}`);if(S.value=!1,!l.ok){g("error",q(l,"stop this stack"));return}const e=l.body.cancelled.length;g(e?"ok":"info",e?`Stopped ${e} job${e>1?"s":""} on ${l.body.stack}. ${l.body.warning}`:`Nothing was running or queued on ${l.body.stack}.`),M()}const U=f(!0),V=f(""),y=f(!1),j=B(()=>{var l;return!!((l=s.detail)!=null&&l.stack)&&V.value===s.detail.stack});async function X(){if(!y.value)return;w.value="forget",R.value="",O.value=null;const l=await E.del(`/api/deployments/${encodeURIComponent(s.id)}${W.value}`);if(w.value="",l.ok){g("ok",`Forgot ${s.id}. Nothing was torn down.`),M(),H.push("/deployments");return}if(l.status===409)return ae(l.body);R.value=q(l,"forget this deployment")}return(l,e)=>{const D=ee("RouterLink");return a(),d("div",null,[o(s).detail&&!o(h)?(a(),d("section",de,[e[19]||(e[19]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Sleep",-1)),t("p",ue,[n(" Takes the "+u(o(s).detail.orchestrator==="swarm"?"swarm stack":"compose project")+" down and ",1),e[14]||(e[14]=t("b",null,"keeps its volumes and every axis",-1)),e[15]||(e[15]=n(". The next request to any of its hostnames brings it back — the visitor sees “spinning up…” for the length of a deploy — and so does ",-1)),e[16]||(e[16]=t("b",null,"Wake",-1)),e[17]||(e[17]=n(" in the header. ",-1)),i(b,{label:"what sleep runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm":"docker compose down"),1),e[9]||(e[9]=n(" — without ",-1)),e[10]||(e[10]=t("code",null,"-v",-1)),e[11]||(e[11]=n(", which is the whole difference from tearing down. A spec can schedule this itself with a ",-1)),e[12]||(e[12]=t("code",null,"sleep:",-1)),e[13]||(e[13]=n(" block (idle / after). ",-1))]),_:1})]),t("div",pe,[i(c,{pending:o(w)==="sleep",disabled:!!o(w)||o(K)||!!o(F)("sleep"),title:o(F)("sleep"),onClick:e[0]||(e[0]=r=>o(J)("sleep"))},{default:p(()=>[...e[18]||(e[18]=[n(" Sleep now ",-1)])]),_:1},8,["pending","disabled","title"]),o(s).detail.asleep?(a(),d("span",ve," Asleep since "+u(new Date(o(s).detail.asleep.since).toLocaleString())+" ("+u(o(s).detail.asleep.reason)+"). ",1)):v("",!0)])])):v("",!0),o(s).detail?(a(),d("section",me,[t("div",fe,[e[20]||(e[20]=t("h2",{class:"section"},"Share a read-only link",-1)),e[21]||(e[21]=t("span",{class:"grow"},null,-1)),i(ie,{what:"this link",method:"POST",path:`/api/deployments/${encodeURIComponent(o(s).id)}/share`,body:{views:T.value,ttl:x.value}},null,8,["path","body"])]),t("p",we,[e[23]||(e[23]=n(" A URL that opens ",-1)),e[24]||(e[24]=t("b",null,"this deployment only",-1)),e[25]||(e[25]=n(", for someone without an account. It carries a signed token that reaches exactly the views below until it expires. ",-1)),i(b,{label:"what a link can and cannot do"},{default:p(()=>[...e[22]||(e[22]=[n(" Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no terminal, no other deployment. There is no per-link revocation; rotating the host's PSTACK_TOKEN invalidates every link at once, so keep the expiry short. ",-1)])]),_:1})]),t("div",ye,[t("label",be,[k(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>A.value=r),type:"checkbox"},null,512),[[I,A.value]]),e[26]||(e[26]=n(" Details & containers",-1))]),t("label",ke,[k(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>N.value=r),type:"checkbox"},null,512),[[I,N.value]]),e[27]||(e[27]=n(" Logs",-1))]),t("div",ge,[e[28]||(e[28]=t("label",{for:"share-ttl"},"Expires",-1)),i(re,{id:"share-ttl",modelValue:x.value,"onUpdate:modelValue":e[3]||(e[3]=r=>x.value=r),label:"How long the link works",options:[{value:"1h",label:"In 1 hour"},{value:"24h",label:"In 24 hours"},{value:"7d",label:"In 7 days"},{value:"30d",label:"In 30 days"}]},null,8,["modelValue"])]),i(c,{variant:"primary",pending:$.value,disabled:$.value||T.value.length===0,title:T.value.length===0?"Pick at least one view.":void 0,onClick:Q},{default:p(()=>[...e[29]||(e[29]=[n(" Create link ",-1)])]),_:1},8,["pending","disabled","title"])]),m.value?(a(),d("div",he,[e[30]||(e[30]=t("b",null,"Your link — copy it now.",-1)),t("p",null,[n(" Opens "+u(m.value.views.join(" and "))+" of ",1),t("b",null,u(o(s).id),1),n(" until "+u(new Date(m.value.expiresAt).toLocaleString())+". It is shown once and stored nowhere. ",1)]),t("pre",ce,u(m.value.url),1),t("div",xe,[t("button",{onClick:Y},"Copy"),t("a",{href:m.value.url,target:"_blank",rel:"noopener"},"Open ↗",8,Ce),t("button",{onClick:e[4]||(e[4]=r=>m.value=null)},"Done")])])):v("",!0),C.value?(a(),L(z,{key:1,text:C.value,title:"No link was created."},null,8,["text"])):v("",!0)])):v("",!0),t("section",$e,[e[57]||(e[57]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Tear down",-1)),o(s).detail?(a(),d(P,{key:1},[o(ne)?(a(),d("div",Se,[e[37]||(e[37]=t("b",null,"No access token set.",-1)),t("p",null,[e[35]||(e[35]=n(" Every action below will be refused. Add your token under ",-1)),i(D,{to:"/settings"},{default:p(()=>[...e[34]||(e[34]=[n("Settings",-1)])]),_:1}),e[36]||(e[36]=n(". ",-1))])])):v("",!0),t("p",Ue,[n(" Stops and removes this deployment's containers, networks and volumes. "+u(o(oe))+" ",1),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[38]||(e[38]=[n("change",-1)])]),_:1},8,["to"])]),t("div",Ve,[i(c,{variant:"danger",pending:o(w)==="down",disabled:!!o(w)||o(h)&&!j.value,title:o(F)("down",j.value),onClick:e[5]||(e[5]=r=>o(J)("down",{verify:U.value,force:o(h)&&j.value}))},{default:p(()=>[n(u(o(h)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),t("label",je,[k(t("input",{"onUpdate:modelValue":e[6]||(e[6]=r=>U.value=r),type:"checkbox"},null,512),[[I,U.value]]),e[39]||(e[39]=n(" Check for leftovers afterwards ",-1))])]),o(K)?(a(),d("p",Ie,[e[41]||(e[41]=n(" Something is already running on ",-1)),t("b",null,u(o(s).detail.stack),1),e[42]||(e[42]=n(" — tearing down ",-1)),e[43]||(e[43]=t("b",null,"cancels it first",-1)),e[44]||(e[44]=n(". ",-1)),i(b,{label:"what happens to the job that is running"},{default:p(()=>[...e[40]||(e[40]=[n(" One job runs per stack at a time; a teardown racing a deploy over the same database would corrupt it. A second ",-1),t("em",null,"deploy",-1),n(" therefore waits its turn (and a third replaces the one waiting). A teardown does not wait: it stops the running job, drops anything queued behind it, and runs. Whatever the stopped job had already done is ",-1),t("b",null,"not",-1),n(" undone — which is what tearing down is about to deal with anyway. ",-1)])]),_:1})])):v("",!0),U.value?v("",!0):(a(),d("p",Re,[...e[45]||(e[45]=[n(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),t("b",null,"Verify",-1),n(" yourself afterwards. ",-1)])])),o(h)?(a(),d("div",Ae,[e[54]||(e[54]=t("b",null,"Shared — read this before tearing down.",-1)),t("p",null,[e[47]||(e[47]=n(" Tearing this down ",-1)),e[48]||(e[48]=t("b",null,"deletes its stored data",-1)),e[49]||(e[49]=n(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[50]||(e[50]=t("b",null,"every preview on this host breaks",-1)),e[51]||(e[51]=n(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),i(b,{label:"what tearing down runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm, then docker volume rm on its volumes":"docker compose down -v"),1),e[46]||(e[46]=n(" — removing the volumes is what makes this different from sleeping. ",-1))]),_:1})]),t("div",Ne,[t("label",{for:`confirm-${o(s).id}`},[e[52]||(e[52]=n(" Type the stack name ",-1)),t("b",null,u(o(s).detail.stack),1),e[53]||(e[53]=n(" to confirm ",-1))],8,De),k(t("input",{id:`confirm-${o(s).id}`,"onUpdate:modelValue":e[7]||(e[7]=r=>V.value=r),type:"text",placeholder:o(s).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Le),[[_,V.value,void 0,{trim:!0}]])]),V.value&&!j.value?(a(),d("p",Ee," That does not match, so tearing down stays disabled. ")):v("",!0)])):v("",!0),t("div",qe,[i(c,{variant:"danger",pending:S.value,disabled:S.value,confirm:"Stop everything? Nothing is undone.",title:"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.",onRun:G},{default:p(()=>[...e[55]||(e[55]=[n(" Stop everything on this stack ",-1)])]),_:1},8,["pending","disabled"]),e[56]||(e[56]=t("span",{class:"mute"}," The running job and the one waiting behind it, in one call — nothing is torn down, and whatever the running job already did stays done. ",-1))]),o(R)?(a(),L(z,{key:4,text:o(R),title:"The action was refused."},null,8,["text"])):v("",!0),o(O)?(a(),L(le,{key:5,conflict:o(O),"job-id":o(se)},null,8,["conflict","job-id"])):v("",!0)],64)):(a(),d("p",Te,[e[32]||(e[32]=n(" Unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[31]||(e[31]=[n(" Config & variables ",-1)])]),_:1},8,["to"]),e[33]||(e[33]=n("first. ",-1))]))]),t("section",Fe,[e[66]||(e[66]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),o(s).detail?(a(),d(P,{key:1},[t("p",Pe,[e[59]||(e[59]=n(" This removes the ",-1)),e[60]||(e[60]=t("em",null,"record only",-1)),e[61]||(e[61]=n(" — ",-1)),e[62]||(e[62]=t("b",null,"it never tears anything down",-1)),e[63]||(e[63]=n(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),i(b,{label:"when forgetting is refused"},{default:p(()=>[...e[58]||(e[58]=[n(" 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})]),t("div",Be,[t("label",Me,[k(t("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>y.value=r),type:"checkbox"},null,512),[[I,y.value]]),e[64]||(e[64]=n(" I have torn this down and want the record removed ",-1))]),i(c,{variant:"danger",pending:o(w)==="forget",disabled:!y.value||!!o(w),title:y.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:p(()=>[...e[65]||(e[65]=[n(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),d("p",Oe," 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{et as default};
|
|
2
|
-
//# sourceMappingURL=DangerTab-
|
|
1
|
+
import{d as Z,c as d,u as o,a as t,f as n,t as u,e as i,w as p,_ as b,g as v,i as k,L as I,z as L,F as P,v as _,j as f,k as B,U as g,l as ee,o as a,m as te,p as E,C as q,J as M}from"./index-IvJmpI3b.js";import{d as s,i as h,v as W}from"./useDeployment-rA-pgUHZ.js";import{a as J,w as F,p as w,b as K,t as ne,v as oe,c as R,d as O,e as se,_ as le,o as ae}from"./ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js";import{_ as c}from"./ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js";import{_ as z}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js";import{E as ie}from"./EquivalentCommand-Bs9vCxV-.js";import{_ as re}from"./SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js";import"./useVars-VN9gYdR6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-bdITH--T.js";const de={key:0,class:"panel"},ue={class:"dim"},pe={class:"row",style:{"margin-top":"var(--s3)"}},ve={key:0,class:"mute"},me={key:1,class:"panel"},fe={class:"phead"},we={class:"dim"},ye={class:"row",style:{"margin-top":"var(--s3)","flex-wrap":"wrap",gap:"var(--s3)"}},be={class:"check"},ke={class:"check"},ge={class:"field inline"},he={key:0,class:"banner ok",style:{"margin-top":"var(--s3)"}},ce={class:"code",style:{"white-space":"pre-wrap","word-break":"break-all"}},xe={class:"row"},Ce=["href"],$e={class:"panel"},Te={key:0,class:"mute"},Se={key:0,class:"banner warn"},Ue={class:"dim"},Ve={class:"row",style:{"margin-top":"var(--s3)"}},je={class:"check"},Ie={key:1,class:"hint"},Re={key:2,class:"hint"},Ae={key:3,class:"banner leaked"},Ne={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},De=["for"],Le=["id","placeholder"],Ee={key:0,class:"s-failed"},qe={class:"row",style:{"margin-top":"var(--s4)"}},Fe={class:"panel"},Oe={key:0,class:"mute"},Pe={class:"dim"},Be={class:"row",style:{"margin-top":"var(--s3)"}},Me={class:"check"},et=Z({__name:"DangerTab",setup(We){const H=te(),A=f(!0),N=f(!0),x=f("7d"),m=f(null),C=f(""),$=f(!1),T=B(()=>[...A.value?["details"]:[],...N.value?["logs"]:[]]);async function Q(){$.value=!0,C.value="",m.value=null;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/share`,{views:T.value,ttl:x.value});if($.value=!1,l.status===201){m.value=l.body;return}C.value=q(l,"mint a share link")}async function Y(){if(m.value)try{await navigator.clipboard.writeText(m.value.url),g("ok","Link copied.")}catch{g("error","Could not reach the clipboard — select the link and copy it.")}}const S=f(!1);async function G(){S.value=!0;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/cancel${W.value}`);if(S.value=!1,!l.ok){g("error",q(l,"stop this stack"));return}const e=l.body.cancelled.length;g(e?"ok":"info",e?`Stopped ${e} job${e>1?"s":""} on ${l.body.stack}. ${l.body.warning}`:`Nothing was running or queued on ${l.body.stack}.`),M()}const U=f(!0),V=f(""),y=f(!1),j=B(()=>{var l;return!!((l=s.detail)!=null&&l.stack)&&V.value===s.detail.stack});async function X(){if(!y.value)return;w.value="forget",R.value="",O.value=null;const l=await E.del(`/api/deployments/${encodeURIComponent(s.id)}${W.value}`);if(w.value="",l.ok){g("ok",`Forgot ${s.id}. Nothing was torn down.`),M(),H.push("/deployments");return}if(l.status===409)return ae(l.body);R.value=q(l,"forget this deployment")}return(l,e)=>{const D=ee("RouterLink");return a(),d("div",null,[o(s).detail&&!o(h)?(a(),d("section",de,[e[19]||(e[19]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Sleep",-1)),t("p",ue,[n(" Takes the "+u(o(s).detail.orchestrator==="swarm"?"swarm stack":"compose project")+" down and ",1),e[14]||(e[14]=t("b",null,"keeps its volumes and every axis",-1)),e[15]||(e[15]=n(". The next request to any of its hostnames brings it back — the visitor sees “spinning up…” for the length of a deploy — and so does ",-1)),e[16]||(e[16]=t("b",null,"Wake",-1)),e[17]||(e[17]=n(" in the header. ",-1)),i(b,{label:"what sleep runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm":"docker compose down"),1),e[9]||(e[9]=n(" — without ",-1)),e[10]||(e[10]=t("code",null,"-v",-1)),e[11]||(e[11]=n(", which is the whole difference from tearing down. A spec can schedule this itself with a ",-1)),e[12]||(e[12]=t("code",null,"sleep:",-1)),e[13]||(e[13]=n(" block (idle / after). ",-1))]),_:1})]),t("div",pe,[i(c,{pending:o(w)==="sleep",disabled:!!o(w)||o(K)||!!o(F)("sleep"),title:o(F)("sleep"),onClick:e[0]||(e[0]=r=>o(J)("sleep"))},{default:p(()=>[...e[18]||(e[18]=[n(" Sleep now ",-1)])]),_:1},8,["pending","disabled","title"]),o(s).detail.asleep?(a(),d("span",ve," Asleep since "+u(new Date(o(s).detail.asleep.since).toLocaleString())+" ("+u(o(s).detail.asleep.reason)+"). ",1)):v("",!0)])])):v("",!0),o(s).detail?(a(),d("section",me,[t("div",fe,[e[20]||(e[20]=t("h2",{class:"section"},"Share a read-only link",-1)),e[21]||(e[21]=t("span",{class:"grow"},null,-1)),i(ie,{what:"this link",method:"POST",path:`/api/deployments/${encodeURIComponent(o(s).id)}/share`,body:{views:T.value,ttl:x.value}},null,8,["path","body"])]),t("p",we,[e[23]||(e[23]=n(" A URL that opens ",-1)),e[24]||(e[24]=t("b",null,"this deployment only",-1)),e[25]||(e[25]=n(", for someone without an account. It carries a signed token that reaches exactly the views below until it expires. ",-1)),i(b,{label:"what a link can and cannot do"},{default:p(()=>[...e[22]||(e[22]=[n(" Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no terminal, no other deployment. There is no per-link revocation; rotating the host's PSTACK_TOKEN invalidates every link at once, so keep the expiry short. ",-1)])]),_:1})]),t("div",ye,[t("label",be,[k(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>A.value=r),type:"checkbox"},null,512),[[I,A.value]]),e[26]||(e[26]=n(" Details & containers",-1))]),t("label",ke,[k(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>N.value=r),type:"checkbox"},null,512),[[I,N.value]]),e[27]||(e[27]=n(" Logs",-1))]),t("div",ge,[e[28]||(e[28]=t("label",{for:"share-ttl"},"Expires",-1)),i(re,{id:"share-ttl",modelValue:x.value,"onUpdate:modelValue":e[3]||(e[3]=r=>x.value=r),label:"How long the link works",options:[{value:"1h",label:"In 1 hour"},{value:"24h",label:"In 24 hours"},{value:"7d",label:"In 7 days"},{value:"30d",label:"In 30 days"}]},null,8,["modelValue"])]),i(c,{variant:"primary",pending:$.value,disabled:$.value||T.value.length===0,title:T.value.length===0?"Pick at least one view.":void 0,onClick:Q},{default:p(()=>[...e[29]||(e[29]=[n(" Create link ",-1)])]),_:1},8,["pending","disabled","title"])]),m.value?(a(),d("div",he,[e[30]||(e[30]=t("b",null,"Your link — copy it now.",-1)),t("p",null,[n(" Opens "+u(m.value.views.join(" and "))+" of ",1),t("b",null,u(o(s).id),1),n(" until "+u(new Date(m.value.expiresAt).toLocaleString())+". It is shown once and stored nowhere. ",1)]),t("pre",ce,u(m.value.url),1),t("div",xe,[t("button",{onClick:Y},"Copy"),t("a",{href:m.value.url,target:"_blank",rel:"noopener"},"Open ↗",8,Ce),t("button",{onClick:e[4]||(e[4]=r=>m.value=null)},"Done")])])):v("",!0),C.value?(a(),L(z,{key:1,text:C.value,title:"No link was created."},null,8,["text"])):v("",!0)])):v("",!0),t("section",$e,[e[57]||(e[57]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Tear down",-1)),o(s).detail?(a(),d(P,{key:1},[o(ne)?(a(),d("div",Se,[e[37]||(e[37]=t("b",null,"No access token set.",-1)),t("p",null,[e[35]||(e[35]=n(" Every action below will be refused. Add your token under ",-1)),i(D,{to:"/settings"},{default:p(()=>[...e[34]||(e[34]=[n("Settings",-1)])]),_:1}),e[36]||(e[36]=n(". ",-1))])])):v("",!0),t("p",Ue,[n(" Stops and removes this deployment's containers, networks and volumes. "+u(o(oe))+" ",1),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[38]||(e[38]=[n("change",-1)])]),_:1},8,["to"])]),t("div",Ve,[i(c,{variant:"danger",pending:o(w)==="down",disabled:!!o(w)||o(h)&&!j.value,title:o(F)("down",j.value),onClick:e[5]||(e[5]=r=>o(J)("down",{verify:U.value,force:o(h)&&j.value}))},{default:p(()=>[n(u(o(h)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),t("label",je,[k(t("input",{"onUpdate:modelValue":e[6]||(e[6]=r=>U.value=r),type:"checkbox"},null,512),[[I,U.value]]),e[39]||(e[39]=n(" Check for leftovers afterwards ",-1))])]),o(K)?(a(),d("p",Ie,[e[41]||(e[41]=n(" Something is already running on ",-1)),t("b",null,u(o(s).detail.stack),1),e[42]||(e[42]=n(" — tearing down ",-1)),e[43]||(e[43]=t("b",null,"cancels it first",-1)),e[44]||(e[44]=n(". ",-1)),i(b,{label:"what happens to the job that is running"},{default:p(()=>[...e[40]||(e[40]=[n(" One job runs per stack at a time; a teardown racing a deploy over the same database would corrupt it. A second ",-1),t("em",null,"deploy",-1),n(" therefore waits its turn (and a third replaces the one waiting). A teardown does not wait: it stops the running job, drops anything queued behind it, and runs. Whatever the stopped job had already done is ",-1),t("b",null,"not",-1),n(" undone — which is what tearing down is about to deal with anyway. ",-1)])]),_:1})])):v("",!0),U.value?v("",!0):(a(),d("p",Re,[...e[45]||(e[45]=[n(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),t("b",null,"Verify",-1),n(" yourself afterwards. ",-1)])])),o(h)?(a(),d("div",Ae,[e[54]||(e[54]=t("b",null,"Shared — read this before tearing down.",-1)),t("p",null,[e[47]||(e[47]=n(" Tearing this down ",-1)),e[48]||(e[48]=t("b",null,"deletes its stored data",-1)),e[49]||(e[49]=n(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[50]||(e[50]=t("b",null,"every preview on this host breaks",-1)),e[51]||(e[51]=n(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),i(b,{label:"what tearing down runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm, then docker volume rm on its volumes":"docker compose down -v"),1),e[46]||(e[46]=n(" — removing the volumes is what makes this different from sleeping. ",-1))]),_:1})]),t("div",Ne,[t("label",{for:`confirm-${o(s).id}`},[e[52]||(e[52]=n(" Type the stack name ",-1)),t("b",null,u(o(s).detail.stack),1),e[53]||(e[53]=n(" to confirm ",-1))],8,De),k(t("input",{id:`confirm-${o(s).id}`,"onUpdate:modelValue":e[7]||(e[7]=r=>V.value=r),type:"text",placeholder:o(s).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Le),[[_,V.value,void 0,{trim:!0}]])]),V.value&&!j.value?(a(),d("p",Ee," That does not match, so tearing down stays disabled. ")):v("",!0)])):v("",!0),t("div",qe,[i(c,{variant:"danger",pending:S.value,disabled:S.value,confirm:"Stop everything? Nothing is undone.",title:"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.",onRun:G},{default:p(()=>[...e[55]||(e[55]=[n(" Stop everything on this stack ",-1)])]),_:1},8,["pending","disabled"]),e[56]||(e[56]=t("span",{class:"mute"}," The running job and the one waiting behind it, in one call — nothing is torn down, and whatever the running job already did stays done. ",-1))]),o(R)?(a(),L(z,{key:4,text:o(R),title:"The action was refused."},null,8,["text"])):v("",!0),o(O)?(a(),L(le,{key:5,conflict:o(O),"job-id":o(se)},null,8,["conflict","job-id"])):v("",!0)],64)):(a(),d("p",Te,[e[32]||(e[32]=n(" Unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[31]||(e[31]=[n(" Config & variables ",-1)])]),_:1},8,["to"]),e[33]||(e[33]=n("first. ",-1))]))]),t("section",Fe,[e[66]||(e[66]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),o(s).detail?(a(),d(P,{key:1},[t("p",Pe,[e[59]||(e[59]=n(" This removes the ",-1)),e[60]||(e[60]=t("em",null,"record only",-1)),e[61]||(e[61]=n(" — ",-1)),e[62]||(e[62]=t("b",null,"it never tears anything down",-1)),e[63]||(e[63]=n(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),i(b,{label:"when forgetting is refused"},{default:p(()=>[...e[58]||(e[58]=[n(" 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})]),t("div",Be,[t("label",Me,[k(t("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>y.value=r),type:"checkbox"},null,512),[[I,y.value]]),e[64]||(e[64]=n(" I have torn this down and want the record removed ",-1))]),i(c,{variant:"danger",pending:o(w)==="forget",disabled:!y.value||!!o(w),title:y.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:p(()=>[...e[65]||(e[65]=[n(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),d("p",Oe," 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{et as default};
|
|
2
|
+
//# sourceMappingURL=DangerTab-CLAU7ElD.js.map
|