@samyx/preview-stacks-ui 0.39.1 → 0.40.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-OewKsFrK.js → ActionButton-BaGfzZKv.js} +2 -2
- package/dist/assets/{ActionButton-OewKsFrK.js.map → ActionButton-BaGfzZKv.js.map} +1 -1
- package/dist/assets/{AxesTab-DSzgRhgG.js → AxesTab-8px21p5I.js} +2 -2
- package/dist/assets/{AxesTab-DSzgRhgG.js.map → AxesTab-8px21p5I.js.map} +1 -1
- package/dist/assets/{ConfigTab-DhtUF0Dh.js → ConfigTab-XMpNHvgd.js} +2 -2
- package/dist/assets/{ConfigTab-DhtUF0Dh.js.map → ConfigTab-XMpNHvgd.js.map} +1 -1
- package/dist/assets/{ConfigView-wXO4j8H7.js → ConfigView-Ed9sCukp.js} +2 -2
- package/dist/assets/{ConfigView-wXO4j8H7.js.map → ConfigView-Ed9sCukp.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-B2fgJAmK.js → ConflictNote.vue_vue_type_script_setup_true_lang-B4a9DxS8.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-B2fgJAmK.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-B4a9DxS8.js.map} +1 -1
- package/dist/assets/ControlView-B-gr_xQ3.css +1 -0
- package/dist/assets/ControlView-C4R1joVF.js +2 -0
- package/dist/assets/ControlView-C4R1joVF.js.map +1 -0
- package/dist/assets/{DangerTab-D2dFrj4t.js → DangerTab-CMIMyWEv.js} +2 -2
- package/dist/assets/{DangerTab-D2dFrj4t.js.map → DangerTab-CMIMyWEv.js.map} +1 -1
- package/dist/assets/{DashboardView-FpEFhaCl.js → DashboardView-gTjtsiF-.js} +2 -2
- package/dist/assets/{DashboardView-FpEFhaCl.js.map → DashboardView-gTjtsiF-.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-B1dKUzvp.js → DeploymentDetailView-Dg-9p6_v.js} +2 -2
- package/dist/assets/{DeploymentDetailView-B1dKUzvp.js.map → DeploymentDetailView-Dg-9p6_v.js.map} +1 -1
- package/dist/assets/{DeploymentsView-_V93UC6F.js → DeploymentsView-CNzMaxE7.js} +2 -2
- package/dist/assets/{DeploymentsView-_V93UC6F.js.map → DeploymentsView-CNzMaxE7.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-D-mkbReY.js → EquivalentCommand-CAhOGrAR.js} +2 -2
- package/dist/assets/{EquivalentCommand-D-mkbReY.js.map → EquivalentCommand-CAhOGrAR.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-FEOV8vdM.js → ErrorNote.vue_vue_type_script_setup_true_lang-DU01Dqor.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-FEOV8vdM.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DU01Dqor.js.map} +1 -1
- package/dist/assets/{JobDetailView-RD5MxdA7.js → JobDetailView-ChKP7xeI.js} +2 -2
- package/dist/assets/{JobDetailView-RD5MxdA7.js.map → JobDetailView-ChKP7xeI.js.map} +1 -1
- package/dist/assets/{JobsView-BJrH9ViP.js → JobsView-DndjCwKL.js} +2 -2
- package/dist/assets/{JobsView-BJrH9ViP.js.map → JobsView-DndjCwKL.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-BRSt9Exf.js → LogViewer.vue_vue_type_script_setup_true_lang-D2yEiI2n.js} +2 -2
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-BRSt9Exf.js.map → LogViewer.vue_vue_type_script_setup_true_lang-D2yEiI2n.js.map} +1 -1
- package/dist/assets/LoginView-B9aLjuvQ.css +1 -0
- package/dist/assets/LoginView-C2Yny6iz.js +2 -0
- package/dist/assets/LoginView-C2Yny6iz.js.map +1 -0
- package/dist/assets/{LogsTab--Q-KHeWj.js → LogsTab-B6R6j6Uv.js} +2 -2
- package/dist/assets/{LogsTab--Q-KHeWj.js.map → LogsTab-B6R6j6Uv.js.map} +1 -1
- package/dist/assets/{NotFoundView-1lI66Xt-.js → NotFoundView-CvHMcInC.js} +2 -2
- package/dist/assets/{NotFoundView-1lI66Xt-.js.map → NotFoundView-CvHMcInC.js.map} +1 -1
- package/dist/assets/{NotifiersView-BfWfRzg4.js → NotifiersView-9rwo6wXV.js} +2 -2
- package/dist/assets/{NotifiersView-BfWfRzg4.js.map → NotifiersView-9rwo6wXV.js.map} +1 -1
- package/dist/assets/{OverviewTab-P3htOnPs.js → OverviewTab-BO8-8pTB.js} +2 -2
- package/dist/assets/{OverviewTab-P3htOnPs.js.map → OverviewTab-BO8-8pTB.js.map} +1 -1
- package/dist/assets/{PublicLogsView-DcDQMivg.js → PublicLogsView-BA7ao_jC.js} +2 -2
- package/dist/assets/{PublicLogsView-DcDQMivg.js.map → PublicLogsView-BA7ao_jC.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-CQvD4Out.js → RefreshButton.vue_vue_type_script_setup_true_lang-Dk-lSii3.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-CQvD4Out.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-Dk-lSii3.js.map} +1 -1
- package/dist/assets/{RegistriesView-9hPjVsOW.js → RegistriesView-y9nKbmQz.js} +2 -2
- package/dist/assets/{RegistriesView-9hPjVsOW.js.map → RegistriesView-y9nKbmQz.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-BxIqRu_b.js → RelativeTime.vue_vue_type_script_setup_true_lang-B1_l0Vtf.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-BxIqRu_b.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-B1_l0Vtf.js.map} +1 -1
- package/dist/assets/{RequiresTab--C-3QPQB.js → RequiresTab-DJZagYBh.js} +2 -2
- package/dist/assets/{RequiresTab--C-3QPQB.js.map → RequiresTab-DJZagYBh.js.map} +1 -1
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-D3FLq6Mt.js → RouteTarget.vue_vue_type_script_setup_true_lang-Ct40NR9a.js} +2 -2
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-D3FLq6Mt.js.map → RouteTarget.vue_vue_type_script_setup_true_lang-Ct40NR9a.js.map} +1 -1
- package/dist/assets/{RoutingView-CC8xPrcT.js → RoutingView-DzE98-qV.js} +2 -2
- package/dist/assets/{RoutingView-CC8xPrcT.js.map → RoutingView-DzE98-qV.js.map} +1 -1
- package/dist/assets/{RuntimeTab-Do1xfTp8.js → RuntimeTab-Cp6CxBJG.js} +2 -2
- package/dist/assets/{RuntimeTab-Do1xfTp8.js.map → RuntimeTab-Cp6CxBJG.js.map} +1 -1
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CMLYr7A7.js → SelectMenu.vue_vue_type_script_setup_true_lang-PIaLSNsk.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-CMLYr7A7.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-PIaLSNsk.js.map} +1 -1
- package/dist/assets/{SettingsView-Dxbl6HZA.js → SettingsView-iWRluEj5.js} +2 -2
- package/dist/assets/{SettingsView-Dxbl6HZA.js.map → SettingsView-iWRluEj5.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-D4pkKZAr.js → SkeletonList.vue_vue_type_script_setup_true_lang-7pKEuaEM.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-D4pkKZAr.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-7pKEuaEM.js.map} +1 -1
- package/dist/assets/{SpecDetailView-DyFAAMfr.js → SpecDetailView-Ca4WXLH1.js} +2 -2
- package/dist/assets/{SpecDetailView-DyFAAMfr.js.map → SpecDetailView-Ca4WXLH1.js.map} +1 -1
- package/dist/assets/{SpecsView-CfV1_GDx.js → SpecsView-DN6EIbcC.js} +2 -2
- package/dist/assets/{SpecsView-CfV1_GDx.js.map → SpecsView-DN6EIbcC.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-BU6ThRhq.js → SsoMark.vue_vue_type_script_setup_true_lang-rMP20d_u.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-BU6ThRhq.js.map → SsoMark.vue_vue_type_script_setup_true_lang-rMP20d_u.js.map} +1 -1
- package/dist/assets/{SsoView-CxFylJ9d.js → SsoView-wGpab5Q8.js} +2 -2
- package/dist/assets/{SsoView-CxFylJ9d.js.map → SsoView-wGpab5Q8.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CfjzlWSc.js → StateBadge.vue_vue_type_script_setup_true_lang-aK93ZMhG.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CfjzlWSc.js.map → StateBadge.vue_vue_type_script_setup_true_lang-aK93ZMhG.js.map} +1 -1
- package/dist/assets/{SubmitView-BcAcTlwC.js → SubmitView-BTK9zNDd.js} +2 -2
- package/dist/assets/{SubmitView-BcAcTlwC.js.map → SubmitView-BTK9zNDd.js.map} +1 -1
- package/dist/assets/SwarmView-DXLQlbD0.css +1 -0
- package/dist/assets/SwarmView-m2XvvAfR.js +2 -0
- package/dist/assets/SwarmView-m2XvvAfR.js.map +1 -0
- package/dist/assets/{TerminalTab-DF8cSjcg.js → TerminalTab-CFKfVx8D.js} +2 -2
- package/dist/assets/{TerminalTab-DF8cSjcg.js.map → TerminalTab-CFKfVx8D.js.map} +1 -1
- package/dist/assets/{UsersView-CbPtmnP6.js → UsersView-BnN_hvh2.js} +2 -2
- package/dist/assets/{UsersView-CbPtmnP6.js.map → UsersView-BnN_hvh2.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BNQTEru_.js → VarEditor.vue_vue_type_script_setup_true_lang-Dg_ORvZN.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-BNQTEru_.js.map → VarEditor.vue_vue_type_script_setup_true_lang-Dg_ORvZN.js.map} +1 -1
- package/dist/assets/{VarIO-BFBaI8oU.js → VarIO-CNugbzeb.js} +2 -2
- package/dist/assets/{VarIO-BFBaI8oU.js.map → VarIO-CNugbzeb.js.map} +1 -1
- package/dist/assets/{VariablesView-BEcI8Bi0.js → VariablesView-qrqDNseI.js} +2 -2
- package/dist/assets/{VariablesView-BEcI8Bi0.js.map → VariablesView-qrqDNseI.js.map} +1 -1
- package/dist/assets/{index-D_Ks6aQi.js → index-DlhYSSKq.js} +25 -20
- package/dist/assets/index-DlhYSSKq.js.map +1 -0
- package/dist/assets/{useDeployment-DFuBcVnK.js → useDeployment-BJuUhf9K.js} +2 -2
- package/dist/assets/{useDeployment-DFuBcVnK.js.map → useDeployment-BJuUhf9K.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/ControlView-ninZ6BIV.js +0 -2
- package/dist/assets/ControlView-ninZ6BIV.js.map +0 -1
- package/dist/assets/LoginView-wAfA0Ozk.css +0 -1
- package/dist/assets/LoginView-zWd9FvKS.js +0 -2
- package/dist/assets/LoginView-zWd9FvKS.js.map +0 -1
- package/dist/assets/SwarmView-BHtmW4QF.js +0 -2
- package/dist/assets/SwarmView-BHtmW4QF.js.map +0 -1
- package/dist/assets/index-D_Ks6aQi.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as y,Q as p,c as r,ag as B,u as c,E as g,t as u,Y as h,f as m,z as k,a as w,aX as C,j as I,b0 as A,i as T,o}from"./index-
|
|
2
|
-
//# sourceMappingURL=ActionButton-
|
|
1
|
+
import{d as y,Q as p,c as r,ag as B,u as c,E as g,t as u,Y as h,f as m,z as k,a as w,aX as C,j as I,b0 as A,i as T,o}from"./index-DlhYSSKq.js";import{_ as x}from"./_plugin-vue_export-helper-DlAUqK2U.js";const z=["disabled","aria-disabled","aria-describedby","title","aria-busy"],D={key:0},E={key:2,class:"progress","aria-hidden":"true"},K=["id"],N=y({__name:"ActionButton",props:{pending:{type:Boolean},disabled:{type:Boolean},variant:{},title:{},confirm:{}},emits:["run"],setup(e,{emit:f}){const t=e,b=f,d=I(()=>!!(t.disabled&&t.title&&!t.pending)),l=A(),a=T(!1);let i=null;function n(){a.value=!1,i&&clearTimeout(i),i=null}function v(s){if(t.pending||t.disabled){s.preventDefault(),s.stopImmediatePropagation();return}if(t.confirm){if(a.value){n(),b("run");return}a.value=!0,i=setTimeout(n,5e3)}}return p(n),(s,S)=>(o(),r("button",{class:g([e.variant,a.value&&"armed"]),disabled:e.pending||e.disabled&&!e.title,"aria-disabled":d.value||void 0,"aria-describedby":d.value?c(l):void 0,title:e.title,"aria-busy":e.pending?"true":void 0,onClick:v,onBlur:n,onKeydown:B(n,["esc"])},[a.value?(o(),r("span",D,u(e.confirm),1)):h(s.$slots,"default",{},void 0,!0,1),e.pending?(o(),r("span",E)):m("",!0),d.value?(o(),k(C,{key:3,to:"body"},[w("span",{id:c(l),class:"ab-why"},u(e.title),9,K)])):m("",!0)],42,z))}}),P=x(N,[["__scopeId","data-v-08a25454"]]);export{P as A};
|
|
2
|
+
//# sourceMappingURL=ActionButton-BaGfzZKv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton-
|
|
1
|
+
{"version":3,"file":"ActionButton-BaGfzZKv.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 { computed, onBeforeUnmount, ref, useId } from 'vue';\n\nconst props = defineProps<{\n pending?: boolean;\n disabled?: boolean;\n variant?: 'primary' | 'danger' | 'ghost';\n /** Says WHY a disabled control is disabled; read out as the control's description. */\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\n/**\n * BLOCKED BY A PRECONDITION, not natively disabled. `disabled` takes the button out of the tab\n * order, and with it the `title` that explains why — so keyboard, touch and screen-reader users\n * met a dead control with no reason attached. `aria-disabled` keeps it focusable and the reason\n * reachable; `onClick` does the blocking the attribute used to do.\n *\n * `pending` stays natively disabled: transiently unavailable, nothing to explain.\n */\nconst blocked = computed(() => Boolean(props.disabled && props.title && !props.pending));\nconst whyId = useId();\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(e: MouseEvent): void {\n if (props.pending || props.disabled) {\n // An aria-disabled button still takes clicks and still submits a form. preventDefault kills the\n // implicit submit; stopImmediatePropagation drops the parent's own fallthrough @click, which\n // Vue merges onto this element after this handler.\n e.preventDefault();\n e.stopImmediatePropagation();\n return;\n }\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 && !title)\"\n :aria-disabled=\"blocked || undefined\"\n :aria-describedby=\"blocked ? whyId : undefined\"\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 <!-- Teleported, not a second root node: a fragment root would stop the calling view's scoped\n styles from reaching this button, and left inside it the reason would join the button's\n accessible NAME instead of describing it. -->\n <Teleport v-if=\"blocked\" to=\"body\">\n <span :id=\"whyId\" class=\"ab-why\">{{ title }}</span>\n </Teleport>\n </button>\n</template>\n\n<style scoped>\n/* app.css paints `button:disabled`; a blocked button is aria-disabled instead, so it repaints the\n same look here — minus the focus ring, which a now-focusable button needs. */\nbutton[aria-disabled='true'] {\n opacity: 0.45;\n cursor: not-allowed;\n}\nbutton[aria-disabled='true']:not(:focus-visible) {\n box-shadow: none;\n}\n.ab-why {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n}\n</style>\n"],"names":["props","__props","emit","__emit","blocked","computed","whyId","useId","armed","ref","timer","disarm","onClick","e","onBeforeUnmount","_createElementBlock","_normalizeClass","_unref","_openBlock","_renderSlot","_ctx","_hoisted_3","_createBlock","_Teleport","_createElementVNode","_hoisted_4"],"mappings":"2eA6BA,MAAMA,EAAQC,EAURC,EAAOC,EAUPC,EAAUC,EAAS,IAAM,GAAQL,EAAM,UAAYA,EAAM,OAAS,CAACA,EAAM,QAAQ,EACjFM,EAAQC,EAAA,EAERC,EAA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,c as t,a as e,u as a,F as c,n as l,e as g,h as f,_ as y,r as p,f as _,t as i,o,D as v,E as x}from"./index-DlhYSSKq.js";import"./useVars-VN9gYdR6.js";const k={class:"panel"},w={key:0,class:"mute"},A={role:"table",class:"cards"},N={role:"rowgroup"},C={role:"row"},V={role:"columnheader"},B={role:"rowgroup",class:"stagger"},S={role:"cell",class:"name","data-label":"axis"},T={role:"cell","data-label":"hooks"},z={role:"cell","data-label":"provable"},D={key:0,class:"badge ok"},E={key:1,class:"badge warn",title:"verify cannot prove this axis was cleaned up — this is not a pass"},F={key:0,role:"row"},O={key:0,class:"banner warn"},U=b({__name:"AxesTab",setup($){const m=["up","assert_live","down","assert_gone"];return(j,s)=>(o(),t("section",k,[s[6]||(s[6]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Axes",-1)),a(u).detail?(o(),t(c,{key:1},[e("table",A,[e("thead",N,[e("tr",C,[s[2]||(s[2]=e("th",{role:"columnheader"},"Axis",-1)),e("th",V,[s[1]||(s[1]=l(" hooks ",-1)),g(y,{label:"what the four hooks do"},{default:f(()=>[...s[0]||(s[0]=[e("code",null,"up",-1),l(" provisions · ",-1),e("code",null,"assert_live",-1),l(" checks it exists · ",-1),e("code",null,"down",-1),l(" destroys · ",-1),e("code",null,"assert_gone",-1),l(" proves it is gone. ",-1)])]),_:1})]),s[3]||(s[3]=e("th",{role:"columnheader"},"Teardown provable?",-1))])]),e("tbody",B,[(o(!0),t(c,null,p(a(u).detail.axes,(n,h)=>(o(),t("tr",{key:n.name,role:"row",style:v({"--i":h})},[e("td",S,i(n.name),1),e("td",T,[(o(),t(c,null,p(m,d=>e("span",{key:d,class:x(["badge",{off:!n.hooks.includes(d)}]),style:{"margin-right":"4px"}},i(d),3)),64))]),e("td",z,[n.verifiable?(o(),t("span",D,"assert_gone")):(o(),t("span",E,"unverifiable"))])],4))),128)),a(u).detail.axes.length?_("",!0):(o(),t("tr",F,[...s[4]||(s[4]=[e("td",{role:"cell",colspan:"3",class:"mute"},"No axes.",-1)])]))])]),a(r).length?(o(),t("div",O,[e("b",null,i(a(r).length===1?"1 axis cannot":`${a(r).length} axes cannot`)+" be verified: "+i(a(r).join(", "))+". ",1),s[5]||(s[5]=e("p",null,[l("A green "),e("code",null,"verify"),l(" says nothing about them — it is not a pass.")],-1))])):_("",!0)],64)):(o(),t("p",w,"Unavailable until the spec resolves."))]))}});export{U as default};
|
|
2
|
+
//# sourceMappingURL=AxesTab-8px21p5I.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AxesTab-
|
|
1
|
+
{"version":3,"file":"AxesTab-8px21p5I.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, 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)\">Axes</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n <template v-else>\n <table role=\"table\" class=\"cards\">\n <thead role=\"rowgroup\">\n <tr role=\"row\">\n <th role=\"columnheader\">Axis</th>\n <th role=\"columnheader\">\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.\n </InfoHint>\n </th>\n <th role=\"columnheader\">Teardown provable?</th>\n </tr>\n </thead>\n <tbody role=\"rowgroup\" class=\"stagger\">\n <tr v-for=\"(a, i) in dep.detail.axes\" :key=\"a.name\" role=\"row\" :style=\"{ '--i': i }\">\n <td role=\"cell\" class=\"name\" data-label=\"axis\">{{ a.name }}</td>\n <td role=\"cell\" 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 role=\"cell\" 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\" role=\"row\">\n <td role=\"cell\" colspan=\"3\" class=\"mute\">No axes.</td>\n </tr>\n </tbody>\n </table>\n\n <!-- The third state, stated once: a green `verify` is silence about these axes, never a pass.\n Colouring them green is the false confidence this tool exists to remove. -->\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>A green <code>verify</code> says nothing about them — it is not a pass.</p>\n </div>\n </template>\n </section>\n</template>\n"],"names":["HOOKS","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_unref","dep","_Fragment","_hoisted_3","_hoisted_4","_hoisted_5","_cache","_hoisted_6","_createVNode","InfoHint","_hoisted_7","_renderList","a","i","_hoisted_8","_toDisplayString","_hoisted_9","h","_normalizeClass","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","unverifiableAxes","_hoisted_14","_hoisted_2"],"mappings":"ytBAcA,MAAMA,EAAoB,CAAC,KAAM,cAAe,OAAQ,aAAa,gBAInEC,EAAA,EAAAC,EA0DU,UA1DVC,EA0DU,aAzDRC,EAA8D,KAAA,CAA1D,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,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A,CAAA,UAGTlB,EAQK,KARLoB,EAQK,CAPSP,EAAE,gBAAdf,EAA6D,OAA7DuB,EAA2C,aAAW,QACtDvB,EAKC,OALDwB,EAIG,cAAY,EAAA,eAIRrB,EAAAC,CAAA,EAAI,OAAO,KAAK,iBAA3BL,IAAAC,EAEK,KAFLyB,EAEK,CAAA,GAAAhB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CADHP,EAAsD,KAAA,CAAlD,KAAK,OAAO,QAAQ,IAAI,MAAM,MAAA,EAAO,WAAQ,EAAA,CAAA,UAO5CC,EAAAuB,CAAA,EAAiB,QAA5B3B,IAAAC,EAMM,MANN2B,EAMM,CALJzB,EAGI,IAAA,KAAAgB,EAFCf,EAAAuB,CAAA,EAAiB,8BAAoCvB,EAAAuB,CAAA,EAAiB,MAAM,cAAA,EAAiB,iBACnFR,EAAGf,EAAAuB,CAAA,EAAiB,YAAa,KAChD,CAAA,cACAxB,EAA8E,IAAA,KAAA,GAA3E,UAAQ,EAAAA,EAAmB,YAAb,QAAM,IAAO,8CAA4C,CAAA,8BApD9EF,EAA2E,IAA3E4B,EAAmC,sCAAoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as f,c as l,a as e,e as w,u as o,t as n,F as p,r as y,f as d,n as i,j as u,o as a,E as g,M as V}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConfigTab-
|
|
1
|
+
import{d as f,c as l,a as e,e as w,u as o,t as n,F as p,r as y,f as d,n as i,j as u,o as a,E as g,M as V}from"./index-DlhYSSKq.js";import{p as C,d as r,a as k,r as j}from"./useDeployment-BJuUhf9K.js";import{c as x}from"./useVars-VN9gYdR6.js";import{_ as A}from"./VarEditor.vue_vue_type_script_setup_true_lang-Dg_ORvZN.js";import"./VarIO-CNugbzeb.js";import"./SelectMenu.vue_vue_type_script_setup_true_lang-PIaLSNsk.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const L={class:"panel"},N={class:"row",style:{"margin-top":"var(--s3)"}},T={class:"mute",style:{"font-size":"var(--t-xs)"}},z={key:0,class:"panel"},B={class:"kvlist",style:{"margin-top":"var(--s3)"}},O={class:"k"},$={class:"v mono"},D={key:0,class:"banner warn"},E={class:"panel"},F={key:0,class:"mute"},I={role:"table",class:"cards"},R={role:"rowgroup"},S={role:"cell",class:"name","data-label":"key"},U={role:"cell","data-label":"visibility"},q={role:"cell",class:"dim","data-label":"length"},K={key:0,class:"badge warn",style:{"margin-left":"6px"}},M={key:0,role:"row"},Z=f({__name:"ConfigTab",setup(G){const m=u(()=>Object.keys(r.vars??{}).length),c=u(()=>{var v;return(v=j.value)==null?void 0:v.vars}),h=u(()=>Object.entries(c.value??{})),b=u(()=>x(r.vars,c.value));return(v,s)=>(a(),l("div",null,[e("section",L,[s[2]||(s[2]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Request variables",-1)),s[3]||(s[3]=e("p",{class:"hint"}," Remembered in this browser. Another browser, a CI job or the command line supplies its own. ",-1)),w(A,{modelValue:o(r).vars,"onUpdate:modelValue":s[0]||(s[0]=t=>o(r).vars=t),onChange:o(C)},null,8,["modelValue","onChange"]),e("div",N,[e("button",{class:"primary",onClick:s[1]||(s[1]=(...t)=>o(k)&&o(k)(...t))},"Apply & reload"),e("span",T,n(m.value?`${m.value} variable${m.value===1?"":"s"}`:"no variables"),1)]),s[4]||(s[4]=e("p",{class:"hint"}," Add any variable you need — the list below is only what the spec declares. ",-1))]),h.value.length?(a(),l("section",z,[s[6]||(s[6]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Stored on the server",-1)),s[7]||(s[7]=e("p",{class:"dim",style:{"font-size":"var(--t-sm)"}},"Anything set above overrides these.",-1)),e("ul",B,[(a(!0),l(p,null,y(h.value,([t,_])=>(a(),l("li",{key:t},[e("span",O,[e("b",null,n(t),1)]),e("span",$,n(_),1)]))),128))]),b.value.length?(a(),l("div",D,[e("b",null,"Overridden: "+n(b.value.join(", "))+".",1),s[5]||(s[5]=e("p",null,"This page and the CLI resolve to different stacks. Clear the override unless you mean it.",-1))])):d("",!0)])):d("",!0),e("section",E,[s[11]||(s[11]=e("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},[i(" Declared env "),e("span",{class:"mute"},"(after interpolation)")],-1)),o(r).detail?(a(),l(p,{key:1},[e("table",I,[s[9]||(s[9]=e("thead",{role:"rowgroup"},[e("tr",{role:"row"},[e("th",{role:"columnheader"},"Key"),e("th",{role:"columnheader"},"Value"),e("th",{role:"columnheader"},"Visibility"),e("th",{role:"columnheader"},"Length")])],-1)),e("tbody",R,[(a(!0),l(p,null,y(o(r).detail.env,t=>(a(),l("tr",{key:t.key,role:"row"},[e("td",S,n(t.key),1),e("td",{role:"cell",class:g(["name",{masked:t.visibility==="masked"}]),"data-label":"value"},n(t.value),3),e("td",U,[e("span",{class:g(["badge",t.visibility==="masked"?"warn":""])},n(o(V)(t.visibility)),3)]),e("td",q,[i(n(t.length)+" chars ",1),t.length===0?(a(),l("span",K,"never set")):d("",!0)])]))),128)),o(r).detail.env.length?d("",!0):(a(),l("tr",M,[...s[8]||(s[8]=[e("td",{role:"cell",colspan:"4",class:"mute"},[i("This spec declares no "),e("code",null,"env:"),i(" block.")],-1)])]))])]),s[10]||(s[10]=e("p",{class:"hint"},[i(" A "),e("b",null,"masked"),i(" value was never sent to this page — there is nothing to reveal. ")],-1))],64)):(a(),l("p",F,"Unavailable until the spec resolves."))])]))}});export{Z as default};
|
|
2
|
+
//# sourceMappingURL=ConfigTab-XMpNHvgd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigTab-
|
|
1
|
+
{"version":3,"file":"ConfigTab-XMpNHvgd.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, kept in separate sections rather than merged into one table.\n */\nimport { computed } from 'vue';\nimport { sentence } from '../../composables/useFormat';\nimport { applyVars, dep, persistVars, row } from '../../composables/useDeployment';\n\nimport { conflictingVars } from '../../composables/useVars';\nimport VarEditor from '../../components/VarEditor.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 </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 only what the spec declares.\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)\">Anything set above overrides these.</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>Overridden: {{ clashes.join(', ') }}.</b>\n <p>This page and the CLI resolve to different stacks. Clear the override unless you mean it.</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 role=\"table\" class=\"cards\">\n <thead role=\"rowgroup\">\n <tr role=\"row\">\n <th role=\"columnheader\">Key</th>\n <th role=\"columnheader\">Value</th>\n <th role=\"columnheader\">Visibility</th>\n <th role=\"columnheader\">Length</th>\n </tr>\n </thead>\n <tbody role=\"rowgroup\">\n <tr v-for=\"e in dep.detail.env\" :key=\"e.key\" role=\"row\">\n <td role=\"cell\" class=\"name\" data-label=\"key\">{{ e.key }}</td>\n <td role=\"cell\" class=\"name\" :class=\"{ masked: e.visibility === 'masked' }\" data-label=\"value\">\n {{ e.value }}\n </td>\n <td role=\"cell\" 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 role=\"cell\" 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\" role=\"row\">\n <td role=\"cell\" 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 never sent to this page — there is nothing to reveal.\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","_cache","_createVNode","VarEditor","_unref","$event","persistVars","_hoisted_2","applyVars","args","_hoisted_3","_toDisplayString","_openBlock","_hoisted_4","_hoisted_5","_Fragment","_renderList","k","v","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_11","_hoisted_12","e","_hoisted_13","_normalizeClass","_hoisted_14","sentence","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_10"],"mappings":"ijCAaA,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,EA2GM,MAAA,KAAA,CA1GJC,EA6BU,UA7BVC,EA6BU,aA5BRD,EAA2E,KAAA,CAAvE,MAAM,UAAU,MAAA,CAAA,gBAAA,WAAA,CAAA,EAAiC,oBAAiB,EAAA,GAYtEE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAEI,IAAA,CAFD,MAAM,MAAA,EAAO,gGAEhB,EAAA,GAEAG,EAAsDC,EAAA,CAAlC,WAAAC,EAAAb,CAAA,EAAI,KAAJ,sBAAAU,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAI,GAAAD,EAAAb,CAAA,EAAI,KAAIc,GAAG,SAAQD,EAAAE,C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FiC,EAAwE,WAAS,wBAG1E3B,EAAAb,CAAA,EAAI,OAAO,IAAI,iBAA1BqB,IAAAd,EAEK,KAFLkC,EAEK,CAAA,GAAA/B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,CADHF,EAA4F,KAAA,CAAxF,KAAK,OAAO,QAAQ,IAAI,MAAM,MAAA,KAAO,wBAAsB,EAAAA,EAAiB,YAAX,MAAI,IAAO,SAAO,CAAA,6BAW7FA,EAEI,IAAA,CAFD,MAAM,QAAM,GAAC,KACZ,EAAAA,EAAa,SAAV,QAAM,IAAI,mEACjB,CAAA,kBA9CFD,EAA2E,IAA3EmC,EAAmC,sCAAoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as A,c as n,a as l,t as i,f as u,g as C,v as N,e as w,F as y,r as h,n as f,z as T,i as p,p as P,C as V,a6 as B,o as a}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConfigView-
|
|
1
|
+
import{d as A,c as n,a as l,t as i,f as u,g as C,v as N,e as w,F as y,r as h,n as f,z as T,i as p,p as P,C as V,a6 as B,o as a}from"./index-DlhYSSKq.js";import{A as b}from"./ActionButton-BaGfzZKv.js";import{_ as $}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DU01Dqor.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const S={class:"page"},j={class:"card"},D={class:"field"},E={key:0,class:"dim"},F={class:"field"},I={class:"row"},K={key:0,class:"dim"},z={key:0,class:"card banner warn"},L={key:0,class:"dim"},M={class:"dim"},O={key:1,class:"card"},U={key:0,class:"dim"},q={key:1,class:"dim"},W=A({__name:"ConfigView",setup(G){const v=p(""),m=p(""),g=p(""),d=p(""),c=p(""),s=p(null),o=p(null);async function _(r){var t;const e=(t=r.target.files)==null?void 0:t[0];if(s.value=null,o.value=null,c.value="",!e){v.value="",m.value="";return}m.value=e.name,v.value=await e.text()}function x(){s.value=null,o.value=null}async function k(r){c.value="",d.value=r;const e=await P.post("/api/config/sealed",{sealed:v.value,passphrase:g.value,preview:r==="preview"});if(d.value="",!e.ok){c.value=V(e,r==="preview"?"preview this config":"apply this config");return}if(r==="preview"){s.value=e.body;return}const t=e.body;o.value=t,s.value=null,B("ok",`Applied: ${t.created.length} created, ${t.skipped.length} already here.`)}return(r,e)=>(a(),n("div",S,[e[9]||(e[9]=l("header",{class:"page-head"},[l("h1",null,"Apply a configuration"),l("p",{class:"dim"},"A sealed export from another host. Creates what is missing, never overwrites.")],-1)),l("section",j,[l("label",D,[e[3]||(e[3]=l("span",null,"Sealed export",-1)),l("input",{type:"file",accept:".sealed,.yaml,.yml,.json,application/json",onChange:_},null,32),m.value?(a(),n("small",E,i(m.value)+" — "+i(v.value.length)+" bytes",1)):u("",!0)]),l("label",F,[e[4]||(e[4]=l("span",null,"Passphrase",-1)),C(l("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),[[N,g.value]]),e[5]||(e[5]=l("small",{class:"dim"},"Sent to this host to open the file.",-1))]),l("div",I,[w(b,{label:"Preview",pending:d.value==="preview",disabled:!v.value||!g.value||!!d.value,onClick:e[1]||(e[1]=t=>k("preview"))},null,8,["pending","disabled"]),w(b,{label:"Apply",variant:"danger",pending:d.value==="apply",disabled:!s.value||!!d.value,onClick:e[2]||(e[2]=t=>k("apply"))},null,8,["pending","disabled"]),!s.value&&!o.value?(a(),n("small",K,"Preview before applying.")):u("",!0)])]),s.value?(a(),n("section",z,[e[6]||(e[6]=l("b",null,"This file will make this host trust:",-1)),l("ul",null,[(a(!0),n(y,null,h(s.value.trusts,t=>(a(),n("li",{key:t},i(t),1))),128)),s.value.trusts.length?u("",!0):(a(),n("li",L,"nothing it does not already trust."))]),l("p",M,[f(i(s.value.users)+" accounts · "+i(s.value.tokens)+" API tokens · "+i(s.value.vars)+" variables · "+i(s.value.notifiers)+" notifiers · "+i(s.value.registries)+" registries · "+i(s.value.routing)+" routing files · "+i(s.value.specs)+" specs",1),s.value.sso?(a(),n(y,{key:0},[f(" · sign-on ("+i(typeof s.value.sso=="number"?s.value.sso:1)+" provider"+i(typeof s.value.sso=="number"&&s.value.sso>1?"s":"")+")",1)],64)):u("",!0)]),e[7]||(e[7]=l("p",null,"Nothing has been written yet.",-1))])):u("",!0),o.value?(a(),n("section",O,[e[8]||(e[8]=l("b",null,"Applied.",-1)),o.value.created.length?(a(),n("p",U,"Created:")):u("",!0),l("ul",null,[(a(!0),n(y,null,h(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),l("ul",null,[(a(!0),n(y,null,h(o.value.skipped,t=>(a(),n("li",{key:t,class:"dim"},i(t),1))),128))])])):u("",!0),c.value?(a(),T($,{key:2,text:c.value,title:"This configuration was not applied."},null,8,["text"])):u("",!0),e[10]||(e[10]=l("p",{class:"dim"},[f(" Take an export with "),l("code",null,"pstack pull config -o host.sealed"),f(" on a machine holding this host's "),l("code",null,"PSTACK_TOKEN"),f(". ")],-1))]))}});export{W as default};
|
|
2
|
+
//# sourceMappingURL=ConfigView-Ed9sCukp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigView-wXO4j8H7.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\">A sealed export from another host. Creates what is missing, never overwrites.</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\">Sent to this host to open the file.</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 before applying.</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 Take an export with <code>pstack pull config -o host.sealed</code> on a machine holding this\n host's <code>PSTACK_TOKEN</code>.\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":"8nBA6CA,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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AA,CAHD,MAAM,OAAK,GAAC,uBACO,EAAAA,EAA8C,YAAxC,mCAAiC,IAAO,oCAC3D,EAAAA,EAAyB,YAAnB,cAAY,IAAO,IAClC,CAAA"}
|
|
1
|
+
{"version":3,"file":"ConfigView-Ed9sCukp.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\">A sealed export from another host. Creates what is missing, never overwrites.</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\">Sent to this host to open the file.</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 before applying.</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 Take an export with <code>pstack pull config -o host.sealed</code> on a machine holding this\n host's <code>PSTACK_TOKEN</code>.\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":"8nBA6CA,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,MAAQS,EAAE,KAClB,MACF,CACA,MAAMG,EAAOH,EAAE,KACfR,EAA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e,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,EAGI,IAAA,CAHD,MAAM,OAAK,GAAC,uBACO,EAAAA,EAA8C,YAAxC,mCAAiC,IAAO,oCAC3D,EAAAA,EAAyB,YAAnB,cAAY,IAAO,IAClC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as j,a6 as b,G as h,J as C,aa as $,C as x,i as f,j as m,ab as I,A as R,ac as S,b as T,d as A,c as r,E as D,a as d,t as k,n as i,e as L,h as N,k as U,o as l}from"./index-
|
|
2
|
-
//# sourceMappingURL=ConflictNote.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{p as j,a6 as b,G as h,J as C,aa as $,C as x,i as f,j as m,ab as I,A as R,ac as S,b as T,d as A,c as r,E as D,a as d,t as k,n as i,e as L,h as N,k as U,o as l}from"./index-DlhYSSKq.js";import{d as s,v as E,i as g}from"./useDeployment-BJuUhf9K.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}),H=m(()=>{var e;return((e=R.health)==null?void 0:e.authEnforced)===!0&&!S.token&&!T.authed}),K=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 O(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 P(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";b("info",`${h(e)} ${c} on ${n.stack}`,{to:`/jobs/${encodeURIComponent(n.id)}`,toLabel:"Follow"}),C(),$.push(`/jobs/${encodeURIComponent(n.id)}`);return}u.value="Started, but no job to follow — check Jobs.";return}if(a.status===409)return F(a.body);u.value=x(a,h(e).toLowerCase()),b("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 X(){p.value="",u.value="",w.value=null,v.value=""}const J={class:"raw",style:{color:"var(--fg-dim)","max-height":"200px"}},V={key:0},q={key:1},W={key:2},z={key:3},G={key:4},Y=A({__name:"ConflictNote",props:{conflict:{},jobId:{}},setup(e){return(o,t)=>{const a=U("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",J,k(e.conflict.text),1),e.conflict.kind==="shared"?(l(),r("p",V,[...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",q,[...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,k(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{Y as _,P as a,B as b,u as c,w as d,v as e,F as o,p,X as r,H as t,K as v,O as w};
|
|
2
|
+
//# sourceMappingURL=ConflictNote.vue_vue_type_script_setup_true_lang-B4a9DxS8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConflictNote.vue_vue_type_script_setup_true_lang-B2fgJAmK.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 = 'Started, but no job to follow — check Jobs.';\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":"6PA0BO,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,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CJ,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-B4a9DxS8.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 = 'Started, but no job to follow — check Jobs.';\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","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2 @@
|
|
|
1
|
+
import{d as xe,x as Q,N as Ce,c as o,a as s,E as z,t as n,f as i,e as $,z as B,n as v,F as A,r as ue,u as f,af as h,g as y,v as k,ag as Se,h as C,R as De,L as Ae,i as d,j as R,k as Re,o as a,D as Me,M as Ve,H as $e,p as b,C as N,a6 as c,A as Be}from"./index-DlhYSSKq.js";import{i as Ie,s as Ke}from"./useJobQueue-JaWoydCt.js";import{A as M}from"./ActionButton-BaGfzZKv.js";import{_ as ve}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DU01Dqor.js";import{_ as Ue}from"./RefreshButton.vue_vue_type_script_setup_true_lang-Dk-lSii3.js";import{_ as ze}from"./SelectMenu.vue_vue_type_script_setup_true_lang-PIaLSNsk.js";import{_ as Ne}from"./SkeletonList.vue_vue_type_script_setup_true_lang-7pKEuaEM.js";import{_ as Pe}from"./_plugin-vue_export-helper-DlAUqK2U.js";const je={class:"page-head"},Le={key:0,class:"vitals"},Ee={key:0,class:"v-fail"},Te={key:1},Fe={key:3},Oe={key:2,class:"panel"},Ge={key:0,class:"banner warn"},He={key:1,role:"table",class:"cards"},Je={role:"rowgroup",class:"stagger"},We={role:"cell",class:"name","data-label":"service"},Ye={key:0,class:"badge info",title:"the container answering this page"},qe={role:"cell","data-label":"image",class:"mono mute"},Qe={role:"cell","data-label":"state"},Xe={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},Ze={role:"cell","data-label":"restarts"},es={key:0,class:"badge failed",title:"Killed by the kernel for exceeding its memory limit"},ss={role:"cell","data-label":"memory",class:"mono mute"},ts={role:"cell","data-label":"started",class:"mute"},ls={role:"cell","data-label":""},as={key:1,class:"mute",style:{"font-size":"var(--t-sm)"},title:"Restart this one from the host"},os={key:2,class:"mute",style:{"font-size":"var(--t-sm)"},title:"No compose service label, so the restart API cannot address it."},ns={key:2,class:"mute"},is={key:3,class:"panel"},rs={class:"phead"},ds={class:"mute",style:{"font-size":"var(--t-sm)"}},us={class:"mono"},vs={class:"kvlist",style:{margin:"var(--s3) 0"}},ms={class:"k mono"},ps={class:"k mono"},cs={class:"v"},ys={class:"mute"},gs=["disabled","onClick"],ks={key:0,class:"row",style:{gap:"var(--s3)","flex-wrap":"wrap"}},fs={class:"field inline",style:{flex:"1 1 18rem"}},bs={key:4,class:"panel"},ws={class:"phead"},_s={class:"kvlist",style:{margin:"var(--s3) 0"}},hs={class:"v mono"},xs={class:"v"},Cs={class:"v"},Ss={key:0,class:"badge warn"},Ds={key:0,class:"row"},As={class:"field"},Rs={class:"field"},Ms={key:2,class:"mute"},Vs={class:"row",style:{"margin-top":"var(--s4)","align-items":"center"}},$s={key:3,class:"mute",style:{"margin-top":"var(--s2)"}},Bs={key:5,class:"panel settings-form"},Is={class:"phead"},Ks={class:"badge info"},Us={key:0,class:"mute"},zs={class:"field"},Ns={class:"row"},Ps=["min","max"],js={class:"field"},Ls={class:"row"},Es=["min","max"],Ts={class:"field"},Fs={class:"row"},Os=["min","max"],Gs={class:"field"},Hs={class:"row"},Js=["min","max"],Ws={class:"field"},Ys={class:"row",style:{"margin-top":"var(--s4)"}},qs={class:"row",role:"group","aria-label":"Storage",style:{"margin-top":"var(--s5)"}},Qs=["aria-pressed","disabled"],Xs=["aria-pressed","disabled"],Zs={key:1,class:"hint"},et={class:"field"},st=["disabled"],tt={class:"field"},lt=["disabled"],at={class:"field"},ot=["disabled"],nt={class:"field"},it={class:"check"},rt=["disabled"],dt={class:"field"},ut=["disabled"],vt={class:"field"},mt={class:"hint"},pt={class:"row",style:{"margin-top":"var(--s4)"}},ct=xe({__name:"ControlView",setup(yt){const S=d(null),P=d(""),ee=d(!1);async function X(){const t=await b.get("/api/control/runtime");if(ee.value=!0,!t.ok){P.value=N(t,"read the control stack");return}P.value="",S.value={...t.body,containers:t.body.containers??[]}}Q(X,1e4);const O=d("");async function me(t){O.value=t;const e=await b.post("/api/control/restart",{service:t});if(O.value="",!e.ok){c("error",N(e,`restart ${t}`));return}c("ok",`Restarting ${e.body.container}.`),await X()}function pe(t){return t===null?"unlimited":t>=1024*1024*1024?`${(t/(1024*1024*1024)).toFixed(1)} GiB`:`${Math.round(t/(1024*1024))} MiB`}const w=d(null),I=d(""),j=d(!1);async function se(){const t=await b.get("/api/domains");t.ok&&(w.value={...t.body,domains:t.body.domains??[]})}Q(se,3e4);async function te(t){j.value=!0;const e=await b.put("/api/domains",{domains:t});if(j.value=!1,!e.ok){c("error",N(e,"save the domains"));return}I.value="",c("ok","Domains saved."),await Promise.all([se(),G()])}const le=()=>{var t;return te([...((t=w.value)==null?void 0:t.domains)??[],I.value.trim()])},ce=t=>{var e;return te((((e=w.value)==null?void 0:e.domains)??[]).filter(u=>u!==t))},p=d(null);async function G(){const t=await b.get("/api/tls");t.ok&&(p.value=t.body)}Q(G,3e4);const ae=R(()=>{var t;return(((t=S.value)==null?void 0:t.containers)??[]).reduce((e,u)=>e+u.restartCount,0)}),ye=R(()=>{var t;return(((t=S.value)==null?void 0:t.containers)??[]).some(e=>e.oomKilled)}),Z=R(()=>w.value?w.value.domains.length+(w.value.primary?1:0):0),K=R(()=>{var t;return(t=p.value)!=null&&t.wildcard?Math.floor((p.value.wildcard.notAfter-Date.now())/864e5):null}),L=d(""),E=d(""),H=d(!1);async function ge(){H.value=!0;const t=await b.put("/api/tls/wildcard",{cert:L.value,key:E.value});if(H.value=!1,!t.ok){c("error",N(t,"store the wildcard"));return}L.value="",E.value="",c("ok","Stored — redeploy all stacks."),D.value=null,await G()}const J=d(!1);async function ke(){J.value=!0;const t=await b.del("/api/tls/wildcard");if(J.value=!1,!t.ok){c("error",N(t,"remove the wildcard"));return}c("ok","Removed — redeploy all stacks."),D.value=null,await G()}const W=d(!1),D=d(null);async function fe(){W.value=!0;const t=await b.post("/api/tls/redeploy",{});if(W.value=!1,!t.ok){c("error",N(t,"redeploy the stacks"));return}D.value=t.body,c("ok",`Redeploying ${t.body.started.length}, skipped ${t.body.skipped.length}.`)}const r=d(null),Y=d(""),T=d(!1),x=d(null),m=d({retentionDays:"",idlePeriodMinutes:"",maxAgeMinutes:"",targetSizeKiB:"",encoding:""}),U=d("filesystem"),g=d({endpoint:"",region:"",bucket:"",pathStyle:!1,accessKeyId:""}),q=d("");Ce(()=>r.value&&JSON.stringify([r.value.retentionDays,r.value.chunks,r.value.storage]),()=>{const t=r.value;if(!t)return;m.value={retentionDays:t.retentionDays,...t.chunks},U.value=t.storage.type;const e=t.storage.s3;g.value={endpoint:(e==null?void 0:e.endpoint)??"",region:(e==null?void 0:e.region)??"",bucket:(e==null?void 0:e.bucket)??"",pathStyle:(e==null?void 0:e.pathStyle)??!1,accessKeyId:(e==null?void 0:e.accessKeyId)??""}});const oe=R(()=>{var t;return((t=r.value)==null?void 0:t.storage.type)==="s3"}),V=R(()=>oe.value||!h("admin")),be=R(()=>{var t;return(((t=r.value)==null?void 0:t.limits.encodings)??[]).map(e=>({value:e,label:e}))}),we=R(()=>{var e;const t=(e=r.value)==null?void 0:e.storage.s3;return t?t.cutover>new Date().toISOString().slice(0,10)?`S3 from ${t.cutover}`:"S3":"Filesystem"});async function _e(t){var F;const e=await b.get(`/api/jobs/${encodeURIComponent(t)}`);if(x.value!==t)return;if(e.status===404){x.value=null;return}if(!e.ok||!Ie(e.body.job.state))return;const u=e.body.job;if(u.state==="superseded"){x.value=((F=Ke(u,Be.jobs))==null?void 0:F.id)??t;return}x.value=null;const _={to:`/jobs/${encodeURIComponent(t)}`};u.state==="ok"?c("ok","Applied.",_):u.state==="cancelled"?c("warn","Cancelled.",_):c("error","Apply failed.",_)}async function ne(){if(!h("maintainer"))return;x.value&&await _e(x.value);const t=await b.get("/api/logging");t.ok&&(r.value=t.body)}Q(ne,1e4);async function ie(t,e){T.value=!0;const u=await b.put(t,e);if(T.value=!1,!u.ok){Y.value=u.body.error??`HTTP ${u.status}`;return}Y.value="",q.value="";const _=u.body;"job"in _?(x.value=_.job.id,c("info","Applying.",{to:`/jobs/${encodeURIComponent(_.job.id)}`,toLabel:"Follow"})):c("ok","No change."),await ne()}const he=()=>ie("/api/logging",{retentionDays:Number(m.value.retentionDays),chunks:{idlePeriodMinutes:Number(m.value.idlePeriodMinutes),maxAgeMinutes:Number(m.value.maxAgeMinutes),targetSizeKiB:Number(m.value.targetSizeKiB),encoding:m.value.encoding}});async function re(){var u;const t=r.value;if(!t)return;const e={type:"s3",...g.value,secretAccessKey:q.value,cutover:((u=t.storage.s3)==null?void 0:u.cutover)??t.limits.earliestCutover};await ie("/api/logging/storage",e)}return(t,e)=>{var _,F;const u=Re("RouterLink");return a(),o("div",null,[s("div",je,[s("div",null,[e[17]||(e[17]=s("h1",null,"Control stack",-1)),(_=S.value)!=null&&_.reachable?(a(),o("div",Le,[s("span",{class:z(ae.value?"v-warn":"")},n(ae.value)+" restarts",3),ye.value?(a(),o("span",Ee,"OOM")):i("",!0),p.value?(a(),o("span",Te,n(p.value.mode),1)):i("",!0),K.value!==null?(a(),o("span",{key:2,class:z(K.value<21?"v-fail":"")},n(K.value)+"d cert",3)):i("",!0),Z.value?(a(),o("span",Fe,n(Z.value)+" domain"+n(Z.value>1?"s":""),1)):i("",!0)])):i("",!0)]),e[18]||(e[18]=s("span",{class:"grow"},null,-1)),$(Ue,{run:X})]),P.value?(a(),B(ve,{key:0,text:P.value,title:"Could not read the control stack."},null,8,["text"])):i("",!0),!ee.value&&!P.value?(a(),B(Ne,{key:1,rows:3})):S.value?(a(),o("section",Oe,[e[22]||(e[22]=s("div",{class:"phead"},[s("h2",{class:"section"},"Containers")],-1)),S.value.reachable?S.value.containers.length?(a(),o("table",He,[e[21]||(e[21]=s("thead",{role:"rowgroup"},[s("tr",{role:"row"},[s("th",{role:"columnheader"},"Service"),s("th",{role:"columnheader"},"Image"),s("th",{role:"columnheader"},"State"),s("th",{role:"columnheader"},"Restarts"),s("th",{role:"columnheader"},"Memory limit"),s("th",{role:"columnheader"},"Started"),s("th",{role:"columnheader"})])],-1)),s("tbody",Je,[(a(!0),o(A,null,ue(S.value.containers,(l,de)=>(a(),o("tr",{key:l.id,role:"row",style:Me({"--i":de})},[s("td",We,[v(n(l.service||l.name)+" ",1),l.service==="pstack"?(a(),o("span",Ye,"This API")):i("",!0)]),s("td",qe,n(l.image),1),s("td",Qe,[s("span",{class:z(l.state==="running"?"s-ok":"s-failed")},n(f(Ve)(l.state)),3),l.health?(a(),o("span",Xe," · "+n(l.health),1)):i("",!0)]),s("td",Ze,[s("span",{class:z(l.restartCount>0?"badge warn":"mute")},n(l.restartCount),3),l.oomKilled?(a(),o("span",es,"OOM")):i("",!0)]),s("td",ss,n(pe(l.memLimitBytes)),1),s("td",ts,n(l.startedAt?f($e)(l.startedAt):"—"),1),s("td",ls,[l.service&&l.service!=="pstack"?(a(),B(M,{key:0,variant:"ghost",pending:O.value===l.service,disabled:O.value!=="",onClick:gt=>me(l.service)},{default:C(()=>[...e[20]||(e[20]=[v(" Restart ",-1)])]),_:1},8,["pending","disabled","onClick"])):l.service==="pstack"?(a(),o("span",as," host-only ")):(a(),o("span",os," — "))])],4))),128))])])):(a(),o("p",ns,"None listed — the project label changed, not the stack stopped.")):(a(),o("div",Ge,[...e[19]||(e[19]=[s("b",null,"Docker isn't answering.",-1),v(" Nothing here is known.",-1)])]))])):i("",!0),w.value?(a(),o("section",is,[s("div",rs,[e[24]||(e[24]=s("h2",{class:"section"},"Domains",-1)),e[25]||(e[25]=s("span",{class:"grow"},null,-1)),s("span",ds,[e[23]||(e[23]=v("primary ",-1)),s("span",us,n(w.value.primary||"—"),1)])]),s("ul",vs,[s("li",null,[s("span",ms,n(w.value.primary||"not set"),1),e[26]||(e[26]=s("span",{class:"v mute"},"primary",-1))]),(a(!0),o(A,null,ue(w.value.domains,l=>(a(),o("li",{key:l},[s("span",ps,n(l),1),s("span",cs,[s("span",ys,"control."+n(l)+" · api."+n(l)+" · wakes sleeping previews",1),f(h)("maintainer")?(a(),o("button",{key:0,class:"sm ghost",disabled:j.value,onClick:de=>ce(l)},"Remove",8,gs)):i("",!0)])]))),128))]),f(h)("maintainer")?(a(),o("div",ks,[s("div",fs,[e[27]||(e[27]=s("label",{for:"new-domain"},"Add a domain",-1)),y(s("input",{id:"new-domain","onUpdate:modelValue":e[0]||(e[0]=l=>I.value=l),class:"mono",placeholder:"preview.new-company.com",spellcheck:"false",onKeyup:e[1]||(e[1]=Se(l=>I.value.trim()&&le(),["enter"]))},null,544),[[k,I.value]])]),$(M,{variant:"primary",pending:j.value,disabled:j.value||!I.value.trim(),onClick:le},{default:C(()=>[...e[28]||(e[28]=[v(" Add ",-1)])]),_:1},8,["pending","disabled"])])):i("",!0)])):i("",!0),p.value?(a(),o("section",bs,[s("div",ws,[e[29]||(e[29]=s("h2",{class:"section"},"Certificates",-1)),e[30]||(e[30]=s("span",{class:"grow"},null,-1)),s("span",{class:z(["badge",p.value.mode==="dns-persist-01"?"ok":"info"])},n(p.value.mode),3)]),p.value.wildcard?(a(),o(A,{key:0},[s("ul",_s,[s("li",null,[e[31]||(e[31]=s("span",{class:"k"},"Covers",-1)),s("span",hs,n(p.value.wildcard.domains.join(", ")),1)]),s("li",null,[e[32]||(e[32]=s("span",{class:"k"},"Valid until",-1)),s("span",xs,[v(n(f(De)(p.value.wildcard.notAfter))+" ",1),s("span",{class:z(K.value!==null&&K.value<21?"badge failed":"mute")},n(K.value)+" days left",3)])]),s("li",null,[e[33]||(e[33]=s("span",{class:"k"},"Issuer",-1)),s("span",Cs,[v(n(p.value.wildcard.issuer||"unnamed")+" ",1),p.value.wildcard.selfSigned?(a(),o("span",Ss,"self-signed — browsers will warn")):i("",!0)])])]),f(h)("admin")?(a(),o("div",Ds,[$(M,{variant:"danger",pending:J.value,disabled:J.value,confirm:"Remove it? Deployed stacks lose TLS.",onRun:ke},{default:C(()=>[...e[34]||(e[34]=[v(" Remove wildcard ",-1)])]),_:1},8,["pending","disabled"]),e[35]||(e[35]=s("span",{class:"mute"},"Stacks deployed under it serve no certificate until redeployed.",-1))])):i("",!0)],64)):i("",!0),f(h)("admin")?(a(),o(A,{key:1},[e[38]||(e[38]=s("p",{class:"dim"},"Stored 0600. Never returned.",-1)),s("div",As,[e[36]||(e[36]=s("label",{for:"tls-cert"},"Certificate (PEM, leaf first, chain after)",-1)),y(s("textarea",{id:"tls-cert","onUpdate:modelValue":e[2]||(e[2]=l=>L.value=l),rows:"5",class:"mono",spellcheck:"false",placeholder:"-----BEGIN CERTIFICATE-----"},null,512),[[k,L.value]])]),s("div",Rs,[e[37]||(e[37]=s("label",{for:"tls-key"},"Private key (PEM)",-1)),y(s("textarea",{id:"tls-key","onUpdate:modelValue":e[3]||(e[3]=l=>E.value=l),rows:"4",class:"mono",spellcheck:"false",placeholder:"-----BEGIN PRIVATE KEY-----"},null,512),[[k,E.value]])]),$(M,{variant:"primary",pending:H.value,disabled:H.value||!L.value||!E.value,onClick:ge},{default:C(()=>[v(n(p.value.wildcard?"Replace wildcard":"Store wildcard"),1)]),_:1},8,["pending","disabled"])],64)):p.value.wildcard?i("",!0):(a(),o("p",Ms,"Admin only.")),s("div",Vs,[$(M,{pending:W.value,disabled:W.value,onClick:fe},{default:C(()=>[...e[39]||(e[39]=[v(" Redeploy all stacks ",-1)])]),_:1},8,["pending","disabled"]),e[40]||(e[40]=s("span",{class:"mute"},"Router labels are stamped at deploy time. Asleep stacks pick them up on wake.",-1))]),D.value?(a(),o("p",$s,[v(" Started "+n(D.value.started.length)+" · skipped "+n(D.value.skipped.length),1),D.value.skipped.length?(a(),o(A,{key:0},[v(" ("+n(D.value.skipped.map(l=>`${l.id}: ${l.reason}`).join("; "))+")",1)],64)):i("",!0),e[41]||(e[41]=v(" — watch them under Jobs. ",-1))])):i("",!0)])):i("",!0),f(h)("maintainer")&&r.value&&r.value.enabled!==!1?(a(),o("section",Bs,[s("div",Is,[e[43]||(e[43]=s("h2",{class:"section"},"Logging",-1)),e[44]||(e[44]=s("a",{class:"hint-btn",href:"https://github.com/samishal1998/preview-stacks/blob/main/docs/usage.md#loki-settings",target:"_blank",rel:"noreferrer","aria-label":"Help"},"?",-1)),e[45]||(e[45]=s("span",{class:"grow"},null,-1)),x.value?(a(),B(u,{key:0,class:"badge running",to:`/jobs/${encodeURIComponent(x.value)}`},{default:C(()=>[...e[42]||(e[42]=[v("Applying",-1)])]),_:1},8,["to"])):i("",!0),s("span",Ks,n(we.value),1)]),r.value.enabled===null?(a(),o("p",Us,"Docker did not answer.")):(a(),o(A,{key:1},[Y.value?(a(),B(ve,{key:0,text:Y.value},null,8,["text"])):i("",!0),s("div",zs,[e[47]||(e[47]=s("label",{for:"loki-retention"},"Retention",-1)),s("div",Ns,[y(s("input",{id:"loki-retention","onUpdate:modelValue":e[4]||(e[4]=l=>m.value.retentionDays=l),type:"number",step:"1",inputmode:"numeric",min:r.value.limits.retentionDays.min,max:r.value.limits.retentionDays.max,style:{width:"8rem"}},null,8,Ps),[[k,m.value.retentionDays]]),e[46]||(e[46]=s("span",{class:"mute"},"days",-1))])]),s("div",js,[e[49]||(e[49]=s("label",{for:"loki-idle"},"Chunk idle",-1)),s("div",Ls,[y(s("input",{id:"loki-idle","onUpdate:modelValue":e[5]||(e[5]=l=>m.value.idlePeriodMinutes=l),type:"number",step:"1",inputmode:"numeric",min:r.value.limits.idlePeriodMinutes.min,max:r.value.limits.idlePeriodMinutes.max,style:{width:"8rem"}},null,8,Es),[[k,m.value.idlePeriodMinutes]]),e[48]||(e[48]=s("span",{class:"mute"},"min",-1))])]),s("div",Ts,[e[51]||(e[51]=s("label",{for:"loki-max-age"},"Chunk max age",-1)),s("div",Fs,[y(s("input",{id:"loki-max-age","onUpdate:modelValue":e[6]||(e[6]=l=>m.value.maxAgeMinutes=l),type:"number",step:"1",inputmode:"numeric",min:r.value.limits.maxAgeMinutes.min,max:r.value.limits.maxAgeMinutes.max,style:{width:"8rem"}},null,8,Os),[[k,m.value.maxAgeMinutes]]),e[50]||(e[50]=s("span",{class:"mute"},"min",-1))])]),s("div",Gs,[e[53]||(e[53]=s("label",{for:"loki-size"},"Chunk size",-1)),s("div",Hs,[y(s("input",{id:"loki-size","onUpdate:modelValue":e[7]||(e[7]=l=>m.value.targetSizeKiB=l),type:"number",step:"1",inputmode:"numeric",min:r.value.limits.targetSizeKiB.min,max:r.value.limits.targetSizeKiB.max,style:{width:"8rem"}},null,8,Js),[[k,m.value.targetSizeKiB]]),e[52]||(e[52]=s("span",{class:"mute"},"KiB",-1))])]),s("div",Ws,[e[54]||(e[54]=s("label",{for:"loki-encoding"},"Encoding",-1)),$(ze,{id:"loki-encoding",modelValue:m.value.encoding,"onUpdate:modelValue":e[8]||(e[8]=l=>m.value.encoding=l),label:"Encoding",options:be.value},null,8,["modelValue","options"])]),s("div",Ys,[$(M,{variant:"primary",pending:T.value,onClick:he},{default:C(()=>[...e[55]||(e[55]=[v("Save",-1)])]),_:1},8,["pending"]),e[56]||(e[56]=s("span",{class:"mute"},"Restarts Loki.",-1))]),s("div",qs,[s("button",{"aria-pressed":U.value==="filesystem",disabled:V.value,onClick:e[9]||(e[9]=l=>U.value="filesystem")}," Filesystem ",8,Qs),s("button",{"aria-pressed":U.value==="s3",disabled:V.value,onClick:e[10]||(e[10]=l=>U.value="s3")},"S3",8,Xs)]),V.value?(a(),o("p",Zs,n(f(h)("admin")?"Fixed once saved.":"Admin only."),1)):i("",!0),U.value==="s3"?(a(),o(A,{key:2},[s("div",et,[e[57]||(e[57]=s("label",{for:"loki-endpoint"},"Endpoint",-1)),y(s("input",{id:"loki-endpoint","onUpdate:modelValue":e[11]||(e[11]=l=>g.value.endpoint=l),type:"url",class:"mono",spellcheck:"false",disabled:V.value},null,8,st),[[k,g.value.endpoint]])]),s("div",tt,[e[58]||(e[58]=s("label",{for:"loki-region"},"Region",-1)),y(s("input",{id:"loki-region","onUpdate:modelValue":e[12]||(e[12]=l=>g.value.region=l),type:"text",class:"mono",spellcheck:"false",disabled:V.value},null,8,lt),[[k,g.value.region]])]),s("div",at,[e[59]||(e[59]=s("label",{for:"loki-bucket"},"Bucket",-1)),y(s("input",{id:"loki-bucket","onUpdate:modelValue":e[13]||(e[13]=l=>g.value.bucket=l),type:"text",class:"mono",spellcheck:"false",disabled:V.value},null,8,ot),[[k,g.value.bucket]])]),s("div",nt,[s("label",it,[y(s("input",{"onUpdate:modelValue":e[14]||(e[14]=l=>g.value.pathStyle=l),type:"checkbox",disabled:V.value},null,8,rt),[[Ae,g.value.pathStyle]]),e[60]||(e[60]=v(" Path-style",-1))])]),s("div",dt,[e[61]||(e[61]=s("label",{for:"loki-key-id"},"Access key ID",-1)),y(s("input",{id:"loki-key-id","onUpdate:modelValue":e[15]||(e[15]=l=>g.value.accessKeyId=l),type:"text",class:"mono",spellcheck:"false",autocomplete:"off",disabled:!f(h)("admin")},null,8,ut),[[k,g.value.accessKeyId]])]),f(h)("admin")?(a(),o(A,{key:0},[s("div",vt,[e[62]||(e[62]=s("label",{for:"loki-secret"},"Secret access key",-1)),y(s("input",{id:"loki-secret","onUpdate:modelValue":e[16]||(e[16]=l=>q.value=l),type:"password",spellcheck:"false",autocomplete:"new-password"},null,512),[[k,q.value]]),s("p",mt,"Write-only."+n((F=r.value.storage.s3)!=null&&F.secretSet?" Leave empty to keep.":""),1)]),s("div",pt,[oe.value?(a(),B(M,{key:0,pending:T.value,onClick:re},{default:C(()=>[...e[63]||(e[63]=[v("Save keys",-1)])]),_:1},8,["pending"])):(a(),B(M,{key:1,pending:T.value,confirm:`One-way. S3 from ${r.value.limits.earliestCutover} UTC?`,onRun:re},{default:C(()=>[...e[64]||(e[64]=[v(" Switch to S3 ",-1)])]),_:1},8,["pending","confirm"]))])],64)):i("",!0)],64)):i("",!0)],64))])):i("",!0)])}}}),St=Pe(ct,[["__scopeId","data-v-98cbddab"]]);export{St as default};
|
|
2
|
+
//# sourceMappingURL=ControlView-C4R1joVF.js.map
|