@samyx/preview-stacks-ui 0.34.0 → 0.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js → ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js.map → ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js.map} +1 -1
- package/dist/assets/{AxesTab-Bzm6UBFL.js → AxesTab-C0OeAG-v.js} +2 -2
- package/dist/assets/{AxesTab-Bzm6UBFL.js.map → AxesTab-C0OeAG-v.js.map} +1 -1
- package/dist/assets/{ConfigTab-B5Mkn_Xr.js → ConfigTab-CqQK7vQl.js} +2 -2
- package/dist/assets/{ConfigTab-B5Mkn_Xr.js.map → ConfigTab-CqQK7vQl.js.map} +1 -1
- package/dist/assets/{ConfigView-BMINdC1p.js → ConfigView-D6Ourc5o.js} +2 -2
- package/dist/assets/{ConfigView-BMINdC1p.js.map → ConfigView-D6Ourc5o.js.map} +1 -1
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js → ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js} +2 -2
- package/dist/assets/{ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js.map → ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js.map} +1 -1
- package/dist/assets/ControlView-G6A_-Og_.js +2 -0
- package/dist/assets/ControlView-G6A_-Og_.js.map +1 -0
- package/dist/assets/{DangerTab-CLAU7ElD.js → DangerTab-Cn06aqx9.js} +2 -2
- package/dist/assets/{DangerTab-CLAU7ElD.js.map → DangerTab-Cn06aqx9.js.map} +1 -1
- package/dist/assets/{DashboardView-C7Ofmm_R.js → DashboardView-CpJmNcFL.js} +2 -2
- package/dist/assets/{DashboardView-C7Ofmm_R.js.map → DashboardView-CpJmNcFL.js.map} +1 -1
- package/dist/assets/{DeploymentDetailView-BnEVV3jQ.js → DeploymentDetailView-CP2ANsF3.js} +2 -2
- package/dist/assets/{DeploymentDetailView-BnEVV3jQ.js.map → DeploymentDetailView-CP2ANsF3.js.map} +1 -1
- package/dist/assets/{DeploymentsView-BQUywd2O.js → DeploymentsView-CXQxjAem.js} +2 -2
- package/dist/assets/{DeploymentsView-BQUywd2O.js.map → DeploymentsView-CXQxjAem.js.map} +1 -1
- package/dist/assets/{DialogTrigger-K-5IAbpM.js → DialogTrigger-BlkbgxBa.js} +2 -2
- package/dist/assets/{DialogTrigger-K-5IAbpM.js.map → DialogTrigger-BlkbgxBa.js.map} +1 -1
- package/dist/assets/{EquivalentCommand-Bs9vCxV-.js → EquivalentCommand-CbJfYQaC.js} +2 -2
- package/dist/assets/{EquivalentCommand-Bs9vCxV-.js.map → EquivalentCommand-CbJfYQaC.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js → ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js.map} +1 -1
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js → HelpModal.vue_vue_type_script_setup_true_lang-CjoiZrMf.js} +2 -2
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-Cj0ZWsrz.js.map → HelpModal.vue_vue_type_script_setup_true_lang-CjoiZrMf.js.map} +1 -1
- package/dist/assets/{JobDetailView-ClTF4h1t.js → JobDetailView-lYBZcOSg.js} +2 -2
- package/dist/assets/{JobDetailView-ClTF4h1t.js.map → JobDetailView-lYBZcOSg.js.map} +1 -1
- package/dist/assets/{JobsView-WFqrBzR6.js → JobsView-CyZXyEfc.js} +2 -2
- package/dist/assets/{JobsView-WFqrBzR6.js.map → JobsView-CyZXyEfc.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js → LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js} +2 -2
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-Btl7zhUv.js.map → LogViewer.vue_vue_type_script_setup_true_lang-CBVTTiPn.js.map} +1 -1
- package/dist/assets/{LoginView-B3SRuKRK.js → LoginView-Do6LVtZ6.js} +2 -2
- package/dist/assets/{LoginView-B3SRuKRK.js.map → LoginView-Do6LVtZ6.js.map} +1 -1
- package/dist/assets/{LogsTab-DtcfNtY8.js → LogsTab-DMj2p8j8.js} +2 -2
- package/dist/assets/{LogsTab-DtcfNtY8.js.map → LogsTab-DMj2p8j8.js.map} +1 -1
- package/dist/assets/{NotFoundView-1RdXOkoy.js → NotFoundView-DyiW8m6P.js} +2 -2
- package/dist/assets/{NotFoundView-1RdXOkoy.js.map → NotFoundView-DyiW8m6P.js.map} +1 -1
- package/dist/assets/{NotifiersView-diZ_EMYq.js → NotifiersView-CIWU3Ohd.js} +2 -2
- package/dist/assets/{NotifiersView-diZ_EMYq.js.map → NotifiersView-CIWU3Ohd.js.map} +1 -1
- package/dist/assets/{OverviewTab--YuThIvA.js → OverviewTab-tJGh_KZG.js} +2 -2
- package/dist/assets/{OverviewTab--YuThIvA.js.map → OverviewTab-tJGh_KZG.js.map} +1 -1
- package/dist/assets/{PublicLogsView-gChlTDrp.js → PublicLogsView-CwLsI-Nz.js} +2 -2
- package/dist/assets/{PublicLogsView-gChlTDrp.js.map → PublicLogsView-CwLsI-Nz.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js → RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-D8LrAn-h.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js.map} +1 -1
- package/dist/assets/{RegistriesView-Cich0dgu.js → RegistriesView-399hTPKi.js} +2 -2
- package/dist/assets/{RegistriesView-Cich0dgu.js.map → RegistriesView-399hTPKi.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js → RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-surhYF0H.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js.map} +1 -1
- package/dist/assets/{RequiresTab-CxGBOMkm.js → RequiresTab-B53DZ6Dn.js} +2 -2
- package/dist/assets/{RequiresTab-CxGBOMkm.js.map → RequiresTab-B53DZ6Dn.js.map} +1 -1
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js → RouteTarget.vue_vue_type_script_setup_true_lang-B1xfCOxN.js} +2 -2
- package/dist/assets/{RouteTarget.vue_vue_type_script_setup_true_lang-C3qkKTNl.js.map → RouteTarget.vue_vue_type_script_setup_true_lang-B1xfCOxN.js.map} +1 -1
- package/dist/assets/{RoutingView-BXOGdZU4.js → RoutingView-B5gwI-1h.js} +2 -2
- package/dist/assets/{RoutingView-BXOGdZU4.js.map → RoutingView-B5gwI-1h.js.map} +1 -1
- package/dist/assets/RuntimeTab-B9lDbflh.js +3 -0
- package/dist/assets/RuntimeTab-B9lDbflh.js.map +1 -0
- package/dist/assets/{RuntimeTab-CXX0BGYC.css → RuntimeTab-Y2qBJykM.css} +1 -1
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js → SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js} +2 -2
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js.map} +1 -1
- package/dist/assets/{SettingsView-BvscpTdq.js → SettingsView-DGor_LCJ.js} +2 -2
- package/dist/assets/{SettingsView-BvscpTdq.js.map → SettingsView-DGor_LCJ.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js → SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-CUZB1sxf.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js.map} +1 -1
- package/dist/assets/{SpecDetailView-CAPlEmSg.js → SpecDetailView-B0IAuWzl.js} +2 -2
- package/dist/assets/{SpecDetailView-CAPlEmSg.js.map → SpecDetailView-B0IAuWzl.js.map} +1 -1
- package/dist/assets/{SpecsView-BO0QMGrI.js → SpecsView-BTD2qo9l.js} +2 -2
- package/dist/assets/{SpecsView-BO0QMGrI.js.map → SpecsView-BTD2qo9l.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js → SsoMark.vue_vue_type_script_setup_true_lang-BXhQGdjJ.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-EdIcAiak.js.map → SsoMark.vue_vue_type_script_setup_true_lang-BXhQGdjJ.js.map} +1 -1
- package/dist/assets/{SsoView-2q_nGP-Q.js → SsoView-B_GrAR_X.js} +2 -2
- package/dist/assets/{SsoView-2q_nGP-Q.js.map → SsoView-B_GrAR_X.js.map} +1 -1
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js → StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-CwCTE4yP.js.map → StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js.map} +1 -1
- package/dist/assets/{SubmitView-Dxre5OJU.js → SubmitView-D5UffFTS.js} +2 -2
- package/dist/assets/{SubmitView-Dxre5OJU.js.map → SubmitView-D5UffFTS.js.map} +1 -1
- package/dist/assets/{SwarmView-DtwrF08A.js → SwarmView-BG2DN4OG.js} +2 -2
- package/dist/assets/{SwarmView-DtwrF08A.js.map → SwarmView-BG2DN4OG.js.map} +1 -1
- package/dist/assets/{Teleport-bdITH--T.js → Teleport-DwPgOPS3.js} +3 -3
- package/dist/assets/{Teleport-bdITH--T.js.map → Teleport-DwPgOPS3.js.map} +1 -1
- package/dist/assets/{TerminalTab-CfcGPa8t.js → TerminalTab-BLjzwPsG.js} +2 -2
- package/dist/assets/{TerminalTab-CfcGPa8t.js.map → TerminalTab-BLjzwPsG.js.map} +1 -1
- package/dist/assets/{UsersView-nIlVItsK.js → UsersView-BOGuCj7S.js} +2 -2
- package/dist/assets/{UsersView-nIlVItsK.js.map → UsersView-BOGuCj7S.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js → VarEditor.vue_vue_type_script_setup_true_lang-uS04X_Kj.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-Be64GoXx.js.map → VarEditor.vue_vue_type_script_setup_true_lang-uS04X_Kj.js.map} +1 -1
- package/dist/assets/{VarIO-BcNlaWXO.js → VarIO-DkbGdmrU.js} +2 -2
- package/dist/assets/{VarIO-BcNlaWXO.js.map → VarIO-DkbGdmrU.js.map} +1 -1
- package/dist/assets/{VariablesView-CzeCc-0m.js → VariablesView-C5XVfRcx.js} +3 -3
- package/dist/assets/{VariablesView-CzeCc-0m.js.map → VariablesView-C5XVfRcx.js.map} +1 -1
- package/dist/assets/{index-IvJmpI3b.js → index-BzdU0RNE.js} +34 -29
- package/dist/assets/index-BzdU0RNE.js.map +1 -0
- package/dist/assets/{useDeployment-rA-pgUHZ.js → useDeployment-D3f7oVQg.js} +2 -2
- package/dist/assets/{useDeployment-rA-pgUHZ.js.map → useDeployment-D3f7oVQg.js.map} +1 -1
- package/dist/index.html +4 -1
- package/package.json +1 -1
- package/dist/assets/RuntimeTab-_QvQc5F2.js +0 -3
- package/dist/assets/RuntimeTab-_QvQc5F2.js.map +0 -1
- package/dist/assets/index-IvJmpI3b.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as Z,c as d,u as o,a as t,f as n,t as u,e as i,w as p,_ as b,g as v,i as k,L as I,z as L,F as P,v as _,j as f,k as B,U as g,l as ee,o as a,m as te,p as E,C as q,J as M}from"./index-IvJmpI3b.js";import{d as s,i as h,v as W}from"./useDeployment-rA-pgUHZ.js";import{a as J,w as F,p as w,b as K,t as ne,v as oe,c as R,d as O,e as se,_ as le,o as ae}from"./ConflictNote.vue_vue_type_script_setup_true_lang-DcogOjwN.js";import{_ as c}from"./ActionButton.vue_vue_type_script_setup_true_lang-DBfqkgMV.js";import{_ as z}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DrinGQ_J.js";import{E as ie}from"./EquivalentCommand-Bs9vCxV-.js";import{_ as re}from"./SelectMenu.vue_vue_type_script_setup_true_lang-C7bhFOYU.js";import"./useVars-VN9gYdR6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-bdITH--T.js";const de={key:0,class:"panel"},ue={class:"dim"},pe={class:"row",style:{"margin-top":"var(--s3)"}},ve={key:0,class:"mute"},me={key:1,class:"panel"},fe={class:"phead"},we={class:"dim"},ye={class:"row",style:{"margin-top":"var(--s3)","flex-wrap":"wrap",gap:"var(--s3)"}},be={class:"check"},ke={class:"check"},ge={class:"field inline"},he={key:0,class:"banner ok",style:{"margin-top":"var(--s3)"}},ce={class:"code",style:{"white-space":"pre-wrap","word-break":"break-all"}},xe={class:"row"},Ce=["href"],$e={class:"panel"},Te={key:0,class:"mute"},Se={key:0,class:"banner warn"},Ue={class:"dim"},Ve={class:"row",style:{"margin-top":"var(--s3)"}},je={class:"check"},Ie={key:1,class:"hint"},Re={key:2,class:"hint"},Ae={key:3,class:"banner leaked"},Ne={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},De=["for"],Le=["id","placeholder"],Ee={key:0,class:"s-failed"},qe={class:"row",style:{"margin-top":"var(--s4)"}},Fe={class:"panel"},Oe={key:0,class:"mute"},Pe={class:"dim"},Be={class:"row",style:{"margin-top":"var(--s3)"}},Me={class:"check"},et=Z({__name:"DangerTab",setup(We){const H=te(),A=f(!0),N=f(!0),x=f("7d"),m=f(null),C=f(""),$=f(!1),T=B(()=>[...A.value?["details"]:[],...N.value?["logs"]:[]]);async function Q(){$.value=!0,C.value="",m.value=null;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/share`,{views:T.value,ttl:x.value});if($.value=!1,l.status===201){m.value=l.body;return}C.value=q(l,"mint a share link")}async function Y(){if(m.value)try{await navigator.clipboard.writeText(m.value.url),g("ok","Link copied.")}catch{g("error","Could not reach the clipboard — select the link and copy it.")}}const S=f(!1);async function G(){S.value=!0;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/cancel${W.value}`);if(S.value=!1,!l.ok){g("error",q(l,"stop this stack"));return}const e=l.body.cancelled.length;g(e?"ok":"info",e?`Stopped ${e} job${e>1?"s":""} on ${l.body.stack}. ${l.body.warning}`:`Nothing was running or queued on ${l.body.stack}.`),M()}const U=f(!0),V=f(""),y=f(!1),j=B(()=>{var l;return!!((l=s.detail)!=null&&l.stack)&&V.value===s.detail.stack});async function X(){if(!y.value)return;w.value="forget",R.value="",O.value=null;const l=await E.del(`/api/deployments/${encodeURIComponent(s.id)}${W.value}`);if(w.value="",l.ok){g("ok",`Forgot ${s.id}. Nothing was torn down.`),M(),H.push("/deployments");return}if(l.status===409)return ae(l.body);R.value=q(l,"forget this deployment")}return(l,e)=>{const D=ee("RouterLink");return a(),d("div",null,[o(s).detail&&!o(h)?(a(),d("section",de,[e[19]||(e[19]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Sleep",-1)),t("p",ue,[n(" Takes the "+u(o(s).detail.orchestrator==="swarm"?"swarm stack":"compose project")+" down and ",1),e[14]||(e[14]=t("b",null,"keeps its volumes and every axis",-1)),e[15]||(e[15]=n(". The next request to any of its hostnames brings it back — the visitor sees “spinning up…” for the length of a deploy — and so does ",-1)),e[16]||(e[16]=t("b",null,"Wake",-1)),e[17]||(e[17]=n(" in the header. ",-1)),i(b,{label:"what sleep runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm":"docker compose down"),1),e[9]||(e[9]=n(" — without ",-1)),e[10]||(e[10]=t("code",null,"-v",-1)),e[11]||(e[11]=n(", which is the whole difference from tearing down. A spec can schedule this itself with a ",-1)),e[12]||(e[12]=t("code",null,"sleep:",-1)),e[13]||(e[13]=n(" block (idle / after). ",-1))]),_:1})]),t("div",pe,[i(c,{pending:o(w)==="sleep",disabled:!!o(w)||o(K)||!!o(F)("sleep"),title:o(F)("sleep"),onClick:e[0]||(e[0]=r=>o(J)("sleep"))},{default:p(()=>[...e[18]||(e[18]=[n(" Sleep now ",-1)])]),_:1},8,["pending","disabled","title"]),o(s).detail.asleep?(a(),d("span",ve," Asleep since "+u(new Date(o(s).detail.asleep.since).toLocaleString())+" ("+u(o(s).detail.asleep.reason)+"). ",1)):v("",!0)])])):v("",!0),o(s).detail?(a(),d("section",me,[t("div",fe,[e[20]||(e[20]=t("h2",{class:"section"},"Share a read-only link",-1)),e[21]||(e[21]=t("span",{class:"grow"},null,-1)),i(ie,{what:"this link",method:"POST",path:`/api/deployments/${encodeURIComponent(o(s).id)}/share`,body:{views:T.value,ttl:x.value}},null,8,["path","body"])]),t("p",we,[e[23]||(e[23]=n(" A URL that opens ",-1)),e[24]||(e[24]=t("b",null,"this deployment only",-1)),e[25]||(e[25]=n(", for someone without an account. It carries a signed token that reaches exactly the views below until it expires. ",-1)),i(b,{label:"what a link can and cannot do"},{default:p(()=>[...e[22]||(e[22]=[n(" Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no terminal, no other deployment. There is no per-link revocation; rotating the host's PSTACK_TOKEN invalidates every link at once, so keep the expiry short. ",-1)])]),_:1})]),t("div",ye,[t("label",be,[k(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>A.value=r),type:"checkbox"},null,512),[[I,A.value]]),e[26]||(e[26]=n(" Details & containers",-1))]),t("label",ke,[k(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>N.value=r),type:"checkbox"},null,512),[[I,N.value]]),e[27]||(e[27]=n(" Logs",-1))]),t("div",ge,[e[28]||(e[28]=t("label",{for:"share-ttl"},"Expires",-1)),i(re,{id:"share-ttl",modelValue:x.value,"onUpdate:modelValue":e[3]||(e[3]=r=>x.value=r),label:"How long the link works",options:[{value:"1h",label:"In 1 hour"},{value:"24h",label:"In 24 hours"},{value:"7d",label:"In 7 days"},{value:"30d",label:"In 30 days"}]},null,8,["modelValue"])]),i(c,{variant:"primary",pending:$.value,disabled:$.value||T.value.length===0,title:T.value.length===0?"Pick at least one view.":void 0,onClick:Q},{default:p(()=>[...e[29]||(e[29]=[n(" Create link ",-1)])]),_:1},8,["pending","disabled","title"])]),m.value?(a(),d("div",he,[e[30]||(e[30]=t("b",null,"Your link — copy it now.",-1)),t("p",null,[n(" Opens "+u(m.value.views.join(" and "))+" of ",1),t("b",null,u(o(s).id),1),n(" until "+u(new Date(m.value.expiresAt).toLocaleString())+". It is shown once and stored nowhere. ",1)]),t("pre",ce,u(m.value.url),1),t("div",xe,[t("button",{onClick:Y},"Copy"),t("a",{href:m.value.url,target:"_blank",rel:"noopener"},"Open ↗",8,Ce),t("button",{onClick:e[4]||(e[4]=r=>m.value=null)},"Done")])])):v("",!0),C.value?(a(),L(z,{key:1,text:C.value,title:"No link was created."},null,8,["text"])):v("",!0)])):v("",!0),t("section",$e,[e[57]||(e[57]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Tear down",-1)),o(s).detail?(a(),d(P,{key:1},[o(ne)?(a(),d("div",Se,[e[37]||(e[37]=t("b",null,"No access token set.",-1)),t("p",null,[e[35]||(e[35]=n(" Every action below will be refused. Add your token under ",-1)),i(D,{to:"/settings"},{default:p(()=>[...e[34]||(e[34]=[n("Settings",-1)])]),_:1}),e[36]||(e[36]=n(". ",-1))])])):v("",!0),t("p",Ue,[n(" Stops and removes this deployment's containers, networks and volumes. "+u(o(oe))+" ",1),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[38]||(e[38]=[n("change",-1)])]),_:1},8,["to"])]),t("div",Ve,[i(c,{variant:"danger",pending:o(w)==="down",disabled:!!o(w)||o(h)&&!j.value,title:o(F)("down",j.value),onClick:e[5]||(e[5]=r=>o(J)("down",{verify:U.value,force:o(h)&&j.value}))},{default:p(()=>[n(u(o(h)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),t("label",je,[k(t("input",{"onUpdate:modelValue":e[6]||(e[6]=r=>U.value=r),type:"checkbox"},null,512),[[I,U.value]]),e[39]||(e[39]=n(" Check for leftovers afterwards ",-1))])]),o(K)?(a(),d("p",Ie,[e[41]||(e[41]=n(" Something is already running on ",-1)),t("b",null,u(o(s).detail.stack),1),e[42]||(e[42]=n(" — tearing down ",-1)),e[43]||(e[43]=t("b",null,"cancels it first",-1)),e[44]||(e[44]=n(". ",-1)),i(b,{label:"what happens to the job that is running"},{default:p(()=>[...e[40]||(e[40]=[n(" One job runs per stack at a time; a teardown racing a deploy over the same database would corrupt it. A second ",-1),t("em",null,"deploy",-1),n(" therefore waits its turn (and a third replaces the one waiting). A teardown does not wait: it stops the running job, drops anything queued behind it, and runs. Whatever the stopped job had already done is ",-1),t("b",null,"not",-1),n(" undone — which is what tearing down is about to deal with anyway. ",-1)])]),_:1})])):v("",!0),U.value?v("",!0):(a(),d("p",Re,[...e[45]||(e[45]=[n(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),t("b",null,"Verify",-1),n(" yourself afterwards. ",-1)])])),o(h)?(a(),d("div",Ae,[e[54]||(e[54]=t("b",null,"Shared — read this before tearing down.",-1)),t("p",null,[e[47]||(e[47]=n(" Tearing this down ",-1)),e[48]||(e[48]=t("b",null,"deletes its stored data",-1)),e[49]||(e[49]=n(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[50]||(e[50]=t("b",null,"every preview on this host breaks",-1)),e[51]||(e[51]=n(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),i(b,{label:"what tearing down runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm, then docker volume rm on its volumes":"docker compose down -v"),1),e[46]||(e[46]=n(" — removing the volumes is what makes this different from sleeping. ",-1))]),_:1})]),t("div",Ne,[t("label",{for:`confirm-${o(s).id}`},[e[52]||(e[52]=n(" Type the stack name ",-1)),t("b",null,u(o(s).detail.stack),1),e[53]||(e[53]=n(" to confirm ",-1))],8,De),k(t("input",{id:`confirm-${o(s).id}`,"onUpdate:modelValue":e[7]||(e[7]=r=>V.value=r),type:"text",placeholder:o(s).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Le),[[_,V.value,void 0,{trim:!0}]])]),V.value&&!j.value?(a(),d("p",Ee," That does not match, so tearing down stays disabled. ")):v("",!0)])):v("",!0),t("div",qe,[i(c,{variant:"danger",pending:S.value,disabled:S.value,confirm:"Stop everything? Nothing is undone.",title:"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.",onRun:G},{default:p(()=>[...e[55]||(e[55]=[n(" Stop everything on this stack ",-1)])]),_:1},8,["pending","disabled"]),e[56]||(e[56]=t("span",{class:"mute"}," The running job and the one waiting behind it, in one call — nothing is torn down, and whatever the running job already did stays done. ",-1))]),o(R)?(a(),L(z,{key:4,text:o(R),title:"The action was refused."},null,8,["text"])):v("",!0),o(O)?(a(),L(le,{key:5,conflict:o(O),"job-id":o(se)},null,8,["conflict","job-id"])):v("",!0)],64)):(a(),d("p",Te,[e[32]||(e[32]=n(" Unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[31]||(e[31]=[n(" Config & variables ",-1)])]),_:1},8,["to"]),e[33]||(e[33]=n("first. ",-1))]))]),t("section",Fe,[e[66]||(e[66]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),o(s).detail?(a(),d(P,{key:1},[t("p",Pe,[e[59]||(e[59]=n(" This removes the ",-1)),e[60]||(e[60]=t("em",null,"record only",-1)),e[61]||(e[61]=n(" — ",-1)),e[62]||(e[62]=t("b",null,"it never tears anything down",-1)),e[63]||(e[63]=n(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),i(b,{label:"when forgetting is refused"},{default:p(()=>[...e[58]||(e[58]=[n(" Refused while any container for this stack still exists — and refused just as firmly when docker cannot be reached, because “cannot confirm” is not evidence of absence. What is deleted is the stored spec, compose file and metadata. ",-1)])]),_:1})]),t("div",Be,[t("label",Me,[k(t("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>y.value=r),type:"checkbox"},null,512),[[I,y.value]]),e[64]||(e[64]=n(" I have torn this down and want the record removed ",-1))]),i(c,{variant:"danger",pending:o(w)==="forget",disabled:!y.value||!!o(w),title:y.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:p(()=>[...e[65]||(e[65]=[n(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),d("p",Oe," Unavailable until the variables are filled in: this stack's containers are counted before the record can be forgotten, and that needs its name. "))])])}}});export{et as default};
|
|
2
|
-
//# sourceMappingURL=DangerTab-
|
|
1
|
+
import{d as Z,c as d,u as o,a as t,f as n,t as u,e as i,w as p,_ as b,g as v,i as k,L as I,z as L,F as P,v as _,j as f,k as B,U as g,l as ee,o as a,m as te,p as E,C as q,J as M}from"./index-BzdU0RNE.js";import{d as s,i as h,v as W}from"./useDeployment-D3f7oVQg.js";import{a as J,w as F,p as w,b as K,t as ne,v as oe,c as R,d as O,e as se,_ as le,o as ae}from"./ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js";import{_ as c}from"./ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js";import{_ as z}from"./ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js";import{E as ie}from"./EquivalentCommand-CbJfYQaC.js";import{_ as re}from"./SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js";import"./useVars-VN9gYdR6.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-DwPgOPS3.js";const de={key:0,class:"panel"},ue={class:"dim"},pe={class:"row",style:{"margin-top":"var(--s3)"}},ve={key:0,class:"mute"},me={key:1,class:"panel"},fe={class:"phead"},we={class:"dim"},ye={class:"row",style:{"margin-top":"var(--s3)","flex-wrap":"wrap",gap:"var(--s3)"}},be={class:"check"},ke={class:"check"},ge={class:"field inline"},he={key:0,class:"banner ok",style:{"margin-top":"var(--s3)"}},ce={class:"code",style:{"white-space":"pre-wrap","word-break":"break-all"}},xe={class:"row"},Ce=["href"],$e={class:"panel"},Te={key:0,class:"mute"},Se={key:0,class:"banner warn"},Ue={class:"dim"},Ve={class:"row",style:{"margin-top":"var(--s3)"}},je={class:"check"},Ie={key:1,class:"hint"},Re={key:2,class:"hint"},Ae={key:3,class:"banner leaked"},Ne={class:"field",style:{"margin-top":"var(--s3)","max-width":"380px"}},De=["for"],Le=["id","placeholder"],Ee={key:0,class:"s-failed"},qe={class:"row",style:{"margin-top":"var(--s4)"}},Fe={class:"panel"},Oe={key:0,class:"mute"},Pe={class:"dim"},Be={class:"row",style:{"margin-top":"var(--s3)"}},Me={class:"check"},et=Z({__name:"DangerTab",setup(We){const H=te(),A=f(!0),N=f(!0),x=f("7d"),m=f(null),C=f(""),$=f(!1),T=B(()=>[...A.value?["details"]:[],...N.value?["logs"]:[]]);async function Q(){$.value=!0,C.value="",m.value=null;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/share`,{views:T.value,ttl:x.value});if($.value=!1,l.status===201){m.value=l.body;return}C.value=q(l,"mint a share link")}async function Y(){if(m.value)try{await navigator.clipboard.writeText(m.value.url),g("ok","Link copied.")}catch{g("error","Could not reach the clipboard — select the link and copy it.")}}const S=f(!1);async function G(){S.value=!0;const l=await E.post(`/api/deployments/${encodeURIComponent(s.id)}/cancel${W.value}`);if(S.value=!1,!l.ok){g("error",q(l,"stop this stack"));return}const e=l.body.cancelled.length;g(e?"ok":"info",e?`Stopped ${e} job${e>1?"s":""} on ${l.body.stack}. ${l.body.warning}`:`Nothing was running or queued on ${l.body.stack}.`),M()}const U=f(!0),V=f(""),y=f(!1),j=B(()=>{var l;return!!((l=s.detail)!=null&&l.stack)&&V.value===s.detail.stack});async function X(){if(!y.value)return;w.value="forget",R.value="",O.value=null;const l=await E.del(`/api/deployments/${encodeURIComponent(s.id)}${W.value}`);if(w.value="",l.ok){g("ok",`Forgot ${s.id}. Nothing was torn down.`),M(),H.push("/deployments");return}if(l.status===409)return ae(l.body);R.value=q(l,"forget this deployment")}return(l,e)=>{const D=ee("RouterLink");return a(),d("div",null,[o(s).detail&&!o(h)?(a(),d("section",de,[e[19]||(e[19]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Sleep",-1)),t("p",ue,[n(" Takes the "+u(o(s).detail.orchestrator==="swarm"?"swarm stack":"compose project")+" down and ",1),e[14]||(e[14]=t("b",null,"keeps its volumes and every axis",-1)),e[15]||(e[15]=n(". The next request to any of its hostnames brings it back — the visitor sees “spinning up…” for the length of a deploy — and so does ",-1)),e[16]||(e[16]=t("b",null,"Wake",-1)),e[17]||(e[17]=n(" in the header. ",-1)),i(b,{label:"what sleep runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm":"docker compose down"),1),e[9]||(e[9]=n(" — without ",-1)),e[10]||(e[10]=t("code",null,"-v",-1)),e[11]||(e[11]=n(", which is the whole difference from tearing down. A spec can schedule this itself with a ",-1)),e[12]||(e[12]=t("code",null,"sleep:",-1)),e[13]||(e[13]=n(" block (idle / after). ",-1))]),_:1})]),t("div",pe,[i(c,{pending:o(w)==="sleep",disabled:!!o(w)||o(K)||!!o(F)("sleep"),title:o(F)("sleep"),onClick:e[0]||(e[0]=r=>o(J)("sleep"))},{default:p(()=>[...e[18]||(e[18]=[n(" Sleep now ",-1)])]),_:1},8,["pending","disabled","title"]),o(s).detail.asleep?(a(),d("span",ve," Asleep since "+u(new Date(o(s).detail.asleep.since).toLocaleString())+" ("+u(o(s).detail.asleep.reason)+"). ",1)):v("",!0)])])):v("",!0),o(s).detail?(a(),d("section",me,[t("div",fe,[e[20]||(e[20]=t("h2",{class:"section"},"Share a read-only link",-1)),e[21]||(e[21]=t("span",{class:"grow"},null,-1)),i(ie,{what:"this link",method:"POST",path:`/api/deployments/${encodeURIComponent(o(s).id)}/share`,body:{views:T.value,ttl:x.value}},null,8,["path","body"])]),t("p",we,[e[23]||(e[23]=n(" A URL that opens ",-1)),e[24]||(e[24]=t("b",null,"this deployment only",-1)),e[25]||(e[25]=n(", for someone without an account. It carries a signed token that reaches exactly the views below until it expires. ",-1)),i(b,{label:"what a link can and cannot do"},{default:p(()=>[...e[22]||(e[22]=[n(" Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no terminal, no other deployment. There is no per-link revocation; rotating the host's PSTACK_TOKEN invalidates every link at once, so keep the expiry short. ",-1)])]),_:1})]),t("div",ye,[t("label",be,[k(t("input",{"onUpdate:modelValue":e[1]||(e[1]=r=>A.value=r),type:"checkbox"},null,512),[[I,A.value]]),e[26]||(e[26]=n(" Details & containers",-1))]),t("label",ke,[k(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>N.value=r),type:"checkbox"},null,512),[[I,N.value]]),e[27]||(e[27]=n(" Logs",-1))]),t("div",ge,[e[28]||(e[28]=t("label",{for:"share-ttl"},"Expires",-1)),i(re,{id:"share-ttl",modelValue:x.value,"onUpdate:modelValue":e[3]||(e[3]=r=>x.value=r),label:"How long the link works",options:[{value:"1h",label:"In 1 hour"},{value:"24h",label:"In 24 hours"},{value:"7d",label:"In 7 days"},{value:"30d",label:"In 30 days"}]},null,8,["modelValue"])]),i(c,{variant:"primary",pending:$.value,disabled:$.value||T.value.length===0,title:T.value.length===0?"Pick at least one view.":void 0,onClick:Q},{default:p(()=>[...e[29]||(e[29]=[n(" Create link ",-1)])]),_:1},8,["pending","disabled","title"])]),m.value?(a(),d("div",he,[e[30]||(e[30]=t("b",null,"Your link — copy it now.",-1)),t("p",null,[n(" Opens "+u(m.value.views.join(" and "))+" of ",1),t("b",null,u(o(s).id),1),n(" until "+u(new Date(m.value.expiresAt).toLocaleString())+". It is shown once and stored nowhere. ",1)]),t("pre",ce,u(m.value.url),1),t("div",xe,[t("button",{onClick:Y},"Copy"),t("a",{href:m.value.url,target:"_blank",rel:"noopener"},"Open ↗",8,Ce),t("button",{onClick:e[4]||(e[4]=r=>m.value=null)},"Done")])])):v("",!0),C.value?(a(),L(z,{key:1,text:C.value,title:"No link was created."},null,8,["text"])):v("",!0)])):v("",!0),t("section",$e,[e[57]||(e[57]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Tear down",-1)),o(s).detail?(a(),d(P,{key:1},[o(ne)?(a(),d("div",Se,[e[37]||(e[37]=t("b",null,"No access token set.",-1)),t("p",null,[e[35]||(e[35]=n(" Every action below will be refused. Add your token under ",-1)),i(D,{to:"/settings"},{default:p(()=>[...e[34]||(e[34]=[n("Settings",-1)])]),_:1}),e[36]||(e[36]=n(". ",-1))])])):v("",!0),t("p",Ue,[n(" Stops and removes this deployment's containers, networks and volumes. "+u(o(oe))+" ",1),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[38]||(e[38]=[n("change",-1)])]),_:1},8,["to"])]),t("div",Ve,[i(c,{variant:"danger",pending:o(w)==="down",disabled:!!o(w)||o(h)&&!j.value,title:o(F)("down",j.value),onClick:e[5]||(e[5]=r=>o(J)("down",{verify:U.value,force:o(h)&&j.value}))},{default:p(()=>[n(u(o(h)?"Tear down (force)":"Tear down"),1)]),_:1},8,["pending","disabled","title"]),t("label",je,[k(t("input",{"onUpdate:modelValue":e[6]||(e[6]=r=>U.value=r),type:"checkbox"},null,512),[[I,U.value]]),e[39]||(e[39]=n(" Check for leftovers afterwards ",-1))])]),o(K)?(a(),d("p",Ie,[e[41]||(e[41]=n(" Something is already running on ",-1)),t("b",null,u(o(s).detail.stack),1),e[42]||(e[42]=n(" — tearing down ",-1)),e[43]||(e[43]=t("b",null,"cancels it first",-1)),e[44]||(e[44]=n(". ",-1)),i(b,{label:"what happens to the job that is running"},{default:p(()=>[...e[40]||(e[40]=[n(" One job runs per stack at a time; a teardown racing a deploy over the same database would corrupt it. A second ",-1),t("em",null,"deploy",-1),n(" therefore waits its turn (and a third replaces the one waiting). A teardown does not wait: it stops the running job, drops anything queued behind it, and runs. Whatever the stopped job had already done is ",-1),t("b",null,"not",-1),n(" undone — which is what tearing down is about to deal with anyway. ",-1)])]),_:1})])):v("",!0),U.value?v("",!0):(a(),d("p",Re,[...e[45]||(e[45]=[n(" Nothing will check that teardown actually finished. A teardown that silently half-worked is the exact failure this tool exists to catch — run ",-1),t("b",null,"Verify",-1),n(" yourself afterwards. ",-1)])])),o(h)?(a(),d("div",Ae,[e[54]||(e[54]=t("b",null,"Shared — read this before tearing down.",-1)),t("p",null,[e[47]||(e[47]=n(" Tearing this down ",-1)),e[48]||(e[48]=t("b",null,"deletes its stored data",-1)),e[49]||(e[49]=n(": the TLS certificates, the shared database or queue, admin credentials. Nothing here recreates them, so ",-1)),e[50]||(e[50]=t("b",null,"every preview on this host breaks",-1)),e[51]||(e[51]=n(" until someone rebuilds it by hand. The button is the same one that is routine on a single preview. ",-1)),i(b,{label:"what tearing down runs"},{default:p(()=>[t("code",null,u(o(s).detail.orchestrator==="swarm"?"docker stack rm, then docker volume rm on its volumes":"docker compose down -v"),1),e[46]||(e[46]=n(" — removing the volumes is what makes this different from sleeping. ",-1))]),_:1})]),t("div",Ne,[t("label",{for:`confirm-${o(s).id}`},[e[52]||(e[52]=n(" Type the stack name ",-1)),t("b",null,u(o(s).detail.stack),1),e[53]||(e[53]=n(" to confirm ",-1))],8,De),k(t("input",{id:`confirm-${o(s).id}`,"onUpdate:modelValue":e[7]||(e[7]=r=>V.value=r),type:"text",placeholder:o(s).detail.stack,spellcheck:"false",autocomplete:"off"},null,8,Le),[[_,V.value,void 0,{trim:!0}]])]),V.value&&!j.value?(a(),d("p",Ee," That does not match, so tearing down stays disabled. ")):v("",!0)])):v("",!0),t("div",qe,[i(c,{variant:"danger",pending:S.value,disabled:S.value,confirm:"Stop everything? Nothing is undone.",title:"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.",onRun:G},{default:p(()=>[...e[55]||(e[55]=[n(" Stop everything on this stack ",-1)])]),_:1},8,["pending","disabled"]),e[56]||(e[56]=t("span",{class:"mute"}," The running job and the one waiting behind it, in one call — nothing is torn down, and whatever the running job already did stays done. ",-1))]),o(R)?(a(),L(z,{key:4,text:o(R),title:"The action was refused."},null,8,["text"])):v("",!0),o(O)?(a(),L(le,{key:5,conflict:o(O),"job-id":o(se)},null,8,["conflict","job-id"])):v("",!0)],64)):(a(),d("p",Te,[e[32]||(e[32]=n(" Unavailable until this deployment's variables are filled in — without them its stack has no name to act on. Set them under ",-1)),i(D,{to:`/deployments/${encodeURIComponent(o(s).id)}/config`},{default:p(()=>[...e[31]||(e[31]=[n(" Config & variables ",-1)])]),_:1},8,["to"]),e[33]||(e[33]=n("first. ",-1))]))]),t("section",Fe,[e[66]||(e[66]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Forget this deployment",-1)),o(s).detail?(a(),d(P,{key:1},[t("p",Pe,[e[59]||(e[59]=n(" This removes the ",-1)),e[60]||(e[60]=t("em",null,"record only",-1)),e[61]||(e[61]=n(" — ",-1)),e[62]||(e[62]=t("b",null,"it never tears anything down",-1)),e[63]||(e[63]=n(". Afterwards nothing here knows how to remove whatever this deployment created. ",-1)),i(b,{label:"when forgetting is refused"},{default:p(()=>[...e[58]||(e[58]=[n(" Refused while any container for this stack still exists — and refused just as firmly when docker cannot be reached, because “cannot confirm” is not evidence of absence. What is deleted is the stored spec, compose file and metadata. ",-1)])]),_:1})]),t("div",Be,[t("label",Me,[k(t("input",{"onUpdate:modelValue":e[8]||(e[8]=r=>y.value=r),type:"checkbox"},null,512),[[I,y.value]]),e[64]||(e[64]=n(" I have torn this down and want the record removed ",-1))]),i(c,{variant:"danger",pending:o(w)==="forget",disabled:!y.value||!!o(w),title:y.value?void 0:"Confirm you have torn this down first.",onClick:X},{default:p(()=>[...e[65]||(e[65]=[n(" Forget ",-1)])]),_:1},8,["pending","disabled","title"])])],64)):(a(),d("p",Oe," Unavailable until the variables are filled in: this stack's containers are counted before the record can be forgotten, and that needs its name. "))])])}}});export{et as default};
|
|
2
|
+
//# sourceMappingURL=DangerTab-Cn06aqx9.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DangerTab-CLAU7ElD.js","sources":["../../src/views/tabs/DangerTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Teardown and forgetting — everything on this page destroys something, and NOTHING else is here.\n *\n * Deploy and Verify used to live on this tab too, which meant the product's primary action was\n * filed under \"Danger\". They moved to the detail header (`useDeploymentActions`); this tab now\n * carries exactly what its name promises.\n *\n * The two guards that matter:\n *\n * 1. TYPED CONFIRMATION FOR A SHARED `down`. A checkbox is one stray click; typing a name is a\n * decision. The typed string is the resolved STACK NAME — not the deployment id — because the\n * stack is the actual blast target, it is what the server's own 409 refusal names, and it is\n * what `compose down -v` will be pointed at. The server holds the authoritative guard\n * (`down()` refuses without `force`, and the API answers 409 before starting a job), so this\n * is defence in depth, not the only barrier.\n *\n * 2. FORGETTING IS NOT TEARING DOWN. `DELETE` removes the record and never touches a container.\n * The server refuses with 409 while any container exists — and refuses just as firmly when\n * docker did not answer, because \"cannot confirm\" is not evidence of absence.\n */\nimport { computed, ref } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { api, problem } from '../../api/client';\nimport type { CancelStackResponse, ConflictBody, ShareLink, ShareView } from '../../api/types';\nimport { dep, isShared, varsQuery } from '../../composables/useDeployment';\nimport {\n act,\n actionError,\n busy,\n conflict,\n conflictJobId,\n onConflict,\n pending,\n tokenMissing,\n varsSummary,\n whyDisabled,\n} from '../../composables/useDeploymentActions';\nimport { loadDeployments } from '../../composables/useControlPlane';\nimport { toast } from '../../composables/useToasts';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ConflictNote from '../../components/ConflictNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\nimport EquivalentCommand from '../../components/EquivalentCommand.vue';\nimport SelectMenu from '../../components/SelectMenu.vue';\n\nconst router = useRouter();\n\n// ── share link ──────────────────────────────────────────────────────────────────────────────────\n// Here rather than on Overview because it MINTS A CREDENTIAL: a URL that reads this deployment's\n// logs until it expires, with no per-link revocation. The result is shown once and held in\n// component state only — never in Settings, never in storage, never in a toast.\nconst shareDetails = ref(true);\nconst shareLogs = ref(true);\nconst shareTtl = ref('7d');\nconst shareLink = ref<ShareLink | null>(null);\nconst shareError = ref('');\nconst sharePending = ref(false);\nconst shareViews = computed<ShareView[]>(() => [\n ...(shareDetails.value ? (['details'] as const) : []),\n ...(shareLogs.value ? (['logs'] as const) : []),\n]);\n\nasync function share(): Promise<void> {\n sharePending.value = true;\n shareError.value = '';\n shareLink.value = null;\n const r = await api.post<ShareLink>(`/api/deployments/${encodeURIComponent(dep.id)}/share`, {\n views: shareViews.value,\n ttl: shareTtl.value,\n });\n sharePending.value = false;\n if (r.status === 201) {\n shareLink.value = r.body;\n return;\n }\n shareError.value = problem(r, 'mint a share link');\n}\n\nasync function copyShare(): Promise<void> {\n if (!shareLink.value) return;\n try {\n await navigator.clipboard.writeText(shareLink.value.url);\n toast('ok', 'Link copied.');\n } catch {\n toast('error', 'Could not reach the clipboard — select the link and copy it.');\n }\n}\n\n// ── stop everything ─────────────────────────────────────────────────────────────────────────────\n// Here rather than on the job page because a stack's outstanding work is a property of the STACK,\n// and the job page only knows the one job you happened to open. It is not a teardown: it stops the\n// running job and drops the one queued behind it, and destroys nothing.\nconst cancelPending = ref(false);\n\nasync function cancelStack(): Promise<void> {\n cancelPending.value = true;\n const r = await api.post<CancelStackResponse>(\n `/api/deployments/${encodeURIComponent(dep.id)}/cancel${varsQuery.value}`,\n );\n cancelPending.value = false;\n if (!r.ok) {\n toast('error', problem(r, 'stop this stack'));\n return;\n }\n // \"Nothing was outstanding\" is an ANSWER, not a failure — the operator asked whether anything was\n // running and the reply is no. Saying \"stopped 0 jobs\" would read as a bug.\n const n = r.body.cancelled.length;\n toast(\n n ? 'ok' : 'info',\n n\n ? `Stopped ${n} job${n > 1 ? 's' : ''} on ${r.body.stack}. ${r.body.warning}`\n : `Nothing was running or queued on ${r.body.stack}.`,\n );\n void loadDeployments();\n}\n\nconst downVerify = ref(true);\nconst forceTyped = ref('');\nconst forgetArmed = ref(false);\n\n/** Exact match against the resolved stack name. Nothing looser — no trim-insensitive, no prefix. */\nconst forceArmed = computed(\n () => !!dep.detail?.stack && forceTyped.value === dep.detail.stack,\n);\n\nasync function forget(): Promise<void> {\n if (!forgetArmed.value) return;\n pending.value = 'forget';\n actionError.value = '';\n conflict.value = null;\n\n const r = await api.del<ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}${varsQuery.value}`,\n );\n pending.value = '';\n\n if (r.ok) {\n toast('ok', `Forgot ${dep.id}. Nothing was torn down.`);\n void loadDeployments();\n void router.push('/deployments');\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n actionError.value = problem(r, 'forget this deployment');\n}\n</script>\n\n<template>\n <div>\n <!-- ============================ sleep ============================ -->\n <section v-if=\"dep.detail && !isShared\" class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Sleep</h2>\n <p class=\"dim\">\n Takes the {{ dep.detail.orchestrator === 'swarm' ? 'swarm stack' : 'compose project' }} down and\n <b>keeps its volumes and every axis</b>. The next request to any of its hostnames brings it\n back — the visitor sees “spinning up…” for the length of a deploy — and so does <b>Wake</b> in\n the header.\n <InfoHint label=\"what sleep runs\">\n <code>{{ dep.detail.orchestrator === 'swarm' ? 'docker stack rm' : 'docker compose down' }}</code>\n — without <code>-v</code>, which is the whole difference from tearing down. A spec can\n schedule this itself with a <code>sleep:</code> block (idle / after).\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <ActionButton\n :pending=\"pending === 'sleep'\"\n :disabled=\"!!pending || busy || !!whyDisabled('sleep')\"\n :title=\"whyDisabled('sleep')\"\n @click=\"act('sleep')\"\n >\n Sleep now\n </ActionButton>\n <span v-if=\"dep.detail.asleep\" class=\"mute\">\n Asleep since {{ new Date(dep.detail.asleep.since).toLocaleString() }} ({{ dep.detail.asleep.reason }}).\n </span>\n </div>\n </section>\n\n <!-- ============================ share ============================ -->\n <section v-if=\"dep.detail\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Share a read-only link</h2>\n <span class=\"grow\" />\n <EquivalentCommand\n what=\"this link\"\n method=\"POST\"\n :path=\"`/api/deployments/${encodeURIComponent(dep.id)}/share`\"\n :body=\"{ views: shareViews, ttl: shareTtl }\"\n />\n </div>\n <p class=\"dim\">\n A URL that opens <b>this deployment only</b>, for someone without an account. It carries a\n signed token that reaches exactly the views below until it expires.\n <InfoHint label=\"what a link can and cannot do\">\n Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no\n terminal, no other deployment. There is no per-link revocation; rotating the host's\n PSTACK_TOKEN invalidates every link at once, so keep the expiry short.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3); flex-wrap: wrap; gap: var(--s3)\">\n <label class=\"check\"><input v-model=\"shareDetails\" type=\"checkbox\" /> Details & containers</label>\n <label class=\"check\"><input v-model=\"shareLogs\" type=\"checkbox\" /> Logs</label>\n <div class=\"field inline\">\n <label for=\"share-ttl\">Expires</label>\n <SelectMenu\n id=\"share-ttl\"\n v-model=\"shareTtl\"\n label=\"How long the link works\"\n :options=\"[\n { value: '1h', label: 'In 1 hour' },\n { value: '24h', label: 'In 24 hours' },\n { value: '7d', label: 'In 7 days' },\n { value: '30d', label: 'In 30 days' },\n ]\"\n />\n </div>\n <ActionButton\n variant=\"primary\"\n :pending=\"sharePending\"\n :disabled=\"sharePending || shareViews.length === 0\"\n :title=\"shareViews.length === 0 ? 'Pick at least one view.' : undefined\"\n @click=\"share\"\n >\n Create link\n </ActionButton>\n </div>\n <div v-if=\"shareLink\" class=\"banner ok\" style=\"margin-top: var(--s3)\">\n <b>Your link — copy it now.</b>\n <p>\n Opens {{ shareLink.views.join(' and ') }} of <b>{{ dep.id }}</b> until\n {{ new Date(shareLink.expiresAt).toLocaleString() }}. It is shown once and stored nowhere.\n </p>\n <pre class=\"code\" style=\"white-space: pre-wrap; word-break: break-all\">{{ shareLink.url }}</pre>\n <div class=\"row\">\n <button @click=\"copyShare\">Copy</button>\n <a :href=\"shareLink.url\" target=\"_blank\" rel=\"noopener\">Open ↗</a>\n <button @click=\"shareLink = null\">Done</button>\n </div>\n </div>\n <ErrorNote v-if=\"shareError\" :text=\"shareError\" title=\"No link was created.\" />\n </section>\n\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Tear down</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until this deployment's variables are filled in — without them its stack has no\n name to act on. Set them under\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">\n Config & variables </RouterLink\n >first.\n </p>\n\n <template v-else>\n <div v-if=\"tokenMissing\" class=\"banner warn\">\n <b>No access token set.</b>\n <p>\n Every action below will be refused. Add your token under\n <RouterLink to=\"/settings\">Settings</RouterLink>.\n </p>\n </div>\n\n <p class=\"dim\">\n Stops and removes this deployment's containers, networks and volumes.\n {{ varsSummary }}\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">change</RouterLink>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'down'\"\n :disabled=\"!!pending || (isShared && !forceArmed)\"\n :title=\"whyDisabled('down', forceArmed)\"\n @click=\"act('down', { verify: downVerify, force: isShared && forceArmed })\"\n >\n {{ isShared ? 'Tear down (force)' : 'Tear down' }}\n </ActionButton>\n <label class=\"check\">\n <input v-model=\"downVerify\" type=\"checkbox\" />\n Check for leftovers afterwards\n </label>\n </div>\n\n <p v-if=\"busy\" class=\"hint\">\n Something is already running on <b>{{ dep.detail.stack }}</b> — tearing down\n <b>cancels it first</b>.\n <InfoHint label=\"what happens to the job that is running\">\n One job runs per stack at a time; a teardown racing a deploy over the same database\n would corrupt it. A second <em>deploy</em> therefore waits its turn (and a third\n replaces the one waiting). A teardown does not wait: it stops the running job, drops\n anything queued behind it, and runs. Whatever the stopped job had already done is\n <b>not</b> undone — which is what tearing down is about to deal with anyway.\n </InfoHint>\n </p>\n <p v-if=\"!downVerify\" class=\"hint\">\n Nothing will check that teardown actually finished. A teardown that silently half-worked is\n the exact failure this tool exists to catch — run <b>Verify</b> yourself afterwards.\n </p>\n\n <!--\n Gate 1 of 2. The typed name is the point: a checkbox is one stray click, typing the stack\n name is a decision.\n -->\n <div v-if=\"isShared\" class=\"banner leaked\">\n <b>Shared — read this before tearing down.</b>\n <p>\n Tearing this down <b>deletes its stored data</b>: the TLS certificates, the shared\n database or queue, admin credentials. Nothing here recreates them, so\n <b>every preview on this host breaks</b> until someone rebuilds it by hand. The button is\n the same one that is routine on a single preview.\n <InfoHint label=\"what tearing down runs\">\n <code>{{ dep.detail.orchestrator === 'swarm' ? 'docker stack rm, then docker volume rm on its volumes' : 'docker compose down -v' }}</code>\n — removing the volumes is what makes this different from sleeping.\n </InfoHint>\n </p>\n <div class=\"field\" style=\"margin-top: var(--s3); max-width: 380px\">\n <label :for=\"`confirm-${dep.id}`\">\n Type the stack name <b>{{ dep.detail.stack }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${dep.id}`\"\n v-model.trim=\"forceTyped\"\n type=\"text\"\n :placeholder=\"dep.detail.stack\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <p v-if=\"forceTyped && !forceArmed\" class=\"s-failed\">\n That does not match, so tearing down stays disabled.\n </p>\n </div>\n\n <!--\n Stopping is not tearing down, so it sits below the teardown control rather than beside it:\n nothing is destroyed, nothing already done is undone, and a stack left half-deployed is\n the point — you stop a wrong deploy so you can start the right one.\n -->\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton\n variant=\"danger\"\n :pending=\"cancelPending\"\n :disabled=\"cancelPending\"\n confirm=\"Stop everything? Nothing is undone.\"\n title=\"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.\"\n @run=\"cancelStack\"\n >\n Stop everything on this stack\n </ActionButton>\n <span class=\"mute\">\n The running job and the one waiting behind it, in one call — nothing is torn down, and\n whatever the running job already did stays done.\n </span>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote v-if=\"conflict\" :conflict=\"conflict\" :job-id=\"conflictJobId\" />\n </template>\n </section>\n\n <!-- ============================ forget ============================ -->\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Forget this deployment</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until the variables are filled in: this stack's containers are counted before the\n record can be forgotten, and that needs its name.\n </p>\n <template v-else>\n <p class=\"dim\">\n This removes the <em>record only</em> — <b>it never tears anything down</b>. Afterwards\n nothing here knows how to remove whatever this deployment created.\n <InfoHint label=\"when forgetting is refused\">\n Refused while any container for this stack still exists — and refused just as firmly when\n docker cannot be reached, because “cannot confirm” is not evidence of absence. What is\n deleted is the stored spec, compose file and metadata.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"forgetArmed\" type=\"checkbox\" />\n I have torn this down and want the record removed\n </label>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'forget'\"\n :disabled=\"!forgetArmed || !!pending\"\n :title=\"forgetArmed ? undefined : 'Confirm you have torn this down first.'\"\n @click=\"forget\"\n >\n Forget\n </ActionButton>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["router","useRouter","shareDetails","ref","shareLogs","shareTtl","shareLink","shareError","sharePending","shareViews","computed","share","r","api","dep","problem","copyShare","toast","cancelPending","cancelStack","varsQuery","n","loadDeployments","downVerify","forceTyped","forgetArmed","forceArmed","_a","forget","pending","actionError","conflict","onConflict","_createElementBlock","_unref","isShared","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_createTextVNode","_cache","_createVNode","InfoHint","_toDisplayString","_hoisted_3","ActionButton","busy","whyDisabled","act","_hoisted_4","_hoisted_5","_hoisted_6","EquivalentCommand","_hoisted_7","_hoisted_8","_hoisted_9","$event","_hoisted_10","_hoisted_11","SelectMenu","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_createBlock","ErrorNote","_hoisted_16","_Fragment","tokenMissing","_hoisted_18","_component_RouterLink","_hoisted_19","varsSummary","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_28","_hoisted_29","ConflictNote","conflictJobId","_hoisted_17","_hoisted_30","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_31"],"mappings":"+3DA+CA,MAAMA,EAASC,GAAA,EAMTC,EAAeC,EAAI,EAAI,EACvBC,EAAYD,EAAI,EAAI,EACpBE,EAAWF,EAAI,IAAI,EACnBG,EAAYH,EAAsB,IAAI,EACtCI,EAAaJ,EAAI,EAAE,EACnBK,EAAeL,EAAI,EAAK,EACxBM,EAAaC,EAAsB,IAAM,CAC7C,GAAIR,EAAa,MAAS,CAAC,SAAS,EAAc,CAAA,EAClD,GAAIE,EAAU,MAAS,CAAC,MAAM,EAAc,CAAA,CAAC,CAC9C,EAED,eAAeO,GAAuB,CACpCH,EAAa,MAAQ,GACrBD,EAAW,MAAQ,GACnBD,EAAU,MAAQ,KAClB,MAAMM,EAAI,MAAMC,EAAI,KAAgB,oBAAoB,mBAAmBC,EAAI,EAAE,CAAC,SAAU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/Bb,EAAW,MAAAgC,GAAE,KAAK,UAAA,gBAAlBhC,EAAA,KAAW,CAAA,mBAAoB,sDAEjD,EAAA,EAAA,GACAiB,EAQeI,EAAA,CAPb,QAAQ,SACP,QAASZ,EAAAL,CAAA,IAAO,SAChB,SAAQ,CAAGJ,EAAA,OAAW,CAAA,CAAMS,EAAAL,CAAA,EAC5B,MAAOJ,EAAA,MAAc,OAAS,yCAC9B,QAAOG,CAAA,aACT,IAED,CAAA,GAAAa,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA,yDA3BJR,EAGI,IAHJwD,GAAmC,mJAGnC"}
|
|
1
|
+
{"version":3,"file":"DangerTab-Cn06aqx9.js","sources":["../../src/views/tabs/DangerTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Teardown and forgetting — everything on this page destroys something, and NOTHING else is here.\n *\n * Deploy and Verify used to live on this tab too, which meant the product's primary action was\n * filed under \"Danger\". They moved to the detail header (`useDeploymentActions`); this tab now\n * carries exactly what its name promises.\n *\n * The two guards that matter:\n *\n * 1. TYPED CONFIRMATION FOR A SHARED `down`. A checkbox is one stray click; typing a name is a\n * decision. The typed string is the resolved STACK NAME — not the deployment id — because the\n * stack is the actual blast target, it is what the server's own 409 refusal names, and it is\n * what `compose down -v` will be pointed at. The server holds the authoritative guard\n * (`down()` refuses without `force`, and the API answers 409 before starting a job), so this\n * is defence in depth, not the only barrier.\n *\n * 2. FORGETTING IS NOT TEARING DOWN. `DELETE` removes the record and never touches a container.\n * The server refuses with 409 while any container exists — and refuses just as firmly when\n * docker did not answer, because \"cannot confirm\" is not evidence of absence.\n */\nimport { computed, ref } from 'vue';\nimport { useRouter } from 'vue-router';\nimport { api, problem } from '../../api/client';\nimport type { CancelStackResponse, ConflictBody, ShareLink, ShareView } from '../../api/types';\nimport { dep, isShared, varsQuery } from '../../composables/useDeployment';\nimport {\n act,\n actionError,\n busy,\n conflict,\n conflictJobId,\n onConflict,\n pending,\n tokenMissing,\n varsSummary,\n whyDisabled,\n} from '../../composables/useDeploymentActions';\nimport { loadDeployments } from '../../composables/useControlPlane';\nimport { toast } from '../../composables/useToasts';\nimport ActionButton from '../../components/ActionButton.vue';\nimport ConflictNote from '../../components/ConflictNote.vue';\nimport InfoHint from '../../components/InfoHint.vue';\nimport ErrorNote from '../../components/ErrorNote.vue';\nimport EquivalentCommand from '../../components/EquivalentCommand.vue';\nimport SelectMenu from '../../components/SelectMenu.vue';\n\nconst router = useRouter();\n\n// ── share link ──────────────────────────────────────────────────────────────────────────────────\n// Here rather than on Overview because it MINTS A CREDENTIAL: a URL that reads this deployment's\n// logs until it expires, with no per-link revocation. The result is shown once and held in\n// component state only — never in Settings, never in storage, never in a toast.\nconst shareDetails = ref(true);\nconst shareLogs = ref(true);\nconst shareTtl = ref('7d');\nconst shareLink = ref<ShareLink | null>(null);\nconst shareError = ref('');\nconst sharePending = ref(false);\nconst shareViews = computed<ShareView[]>(() => [\n ...(shareDetails.value ? (['details'] as const) : []),\n ...(shareLogs.value ? (['logs'] as const) : []),\n]);\n\nasync function share(): Promise<void> {\n sharePending.value = true;\n shareError.value = '';\n shareLink.value = null;\n const r = await api.post<ShareLink>(`/api/deployments/${encodeURIComponent(dep.id)}/share`, {\n views: shareViews.value,\n ttl: shareTtl.value,\n });\n sharePending.value = false;\n if (r.status === 201) {\n shareLink.value = r.body;\n return;\n }\n shareError.value = problem(r, 'mint a share link');\n}\n\nasync function copyShare(): Promise<void> {\n if (!shareLink.value) return;\n try {\n await navigator.clipboard.writeText(shareLink.value.url);\n toast('ok', 'Link copied.');\n } catch {\n toast('error', 'Could not reach the clipboard — select the link and copy it.');\n }\n}\n\n// ── stop everything ─────────────────────────────────────────────────────────────────────────────\n// Here rather than on the job page because a stack's outstanding work is a property of the STACK,\n// and the job page only knows the one job you happened to open. It is not a teardown: it stops the\n// running job and drops the one queued behind it, and destroys nothing.\nconst cancelPending = ref(false);\n\nasync function cancelStack(): Promise<void> {\n cancelPending.value = true;\n const r = await api.post<CancelStackResponse>(\n `/api/deployments/${encodeURIComponent(dep.id)}/cancel${varsQuery.value}`,\n );\n cancelPending.value = false;\n if (!r.ok) {\n toast('error', problem(r, 'stop this stack'));\n return;\n }\n // \"Nothing was outstanding\" is an ANSWER, not a failure — the operator asked whether anything was\n // running and the reply is no. Saying \"stopped 0 jobs\" would read as a bug.\n const n = r.body.cancelled.length;\n toast(\n n ? 'ok' : 'info',\n n\n ? `Stopped ${n} job${n > 1 ? 's' : ''} on ${r.body.stack}. ${r.body.warning}`\n : `Nothing was running or queued on ${r.body.stack}.`,\n );\n void loadDeployments();\n}\n\nconst downVerify = ref(true);\nconst forceTyped = ref('');\nconst forgetArmed = ref(false);\n\n/** Exact match against the resolved stack name. Nothing looser — no trim-insensitive, no prefix. */\nconst forceArmed = computed(\n () => !!dep.detail?.stack && forceTyped.value === dep.detail.stack,\n);\n\nasync function forget(): Promise<void> {\n if (!forgetArmed.value) return;\n pending.value = 'forget';\n actionError.value = '';\n conflict.value = null;\n\n const r = await api.del<ConflictBody>(\n `/api/deployments/${encodeURIComponent(dep.id)}${varsQuery.value}`,\n );\n pending.value = '';\n\n if (r.ok) {\n toast('ok', `Forgot ${dep.id}. Nothing was torn down.`);\n void loadDeployments();\n void router.push('/deployments');\n return;\n }\n if (r.status === 409) return onConflict(r.body);\n actionError.value = problem(r, 'forget this deployment');\n}\n</script>\n\n<template>\n <div>\n <!-- ============================ sleep ============================ -->\n <section v-if=\"dep.detail && !isShared\" class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Sleep</h2>\n <p class=\"dim\">\n Takes the {{ dep.detail.orchestrator === 'swarm' ? 'swarm stack' : 'compose project' }} down and\n <b>keeps its volumes and every axis</b>. The next request to any of its hostnames brings it\n back — the visitor sees “spinning up…” for the length of a deploy — and so does <b>Wake</b> in\n the header.\n <InfoHint label=\"what sleep runs\">\n <code>{{ dep.detail.orchestrator === 'swarm' ? 'docker stack rm' : 'docker compose down' }}</code>\n — without <code>-v</code>, which is the whole difference from tearing down. A spec can\n schedule this itself with a <code>sleep:</code> block (idle / after).\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <ActionButton\n :pending=\"pending === 'sleep'\"\n :disabled=\"!!pending || busy || !!whyDisabled('sleep')\"\n :title=\"whyDisabled('sleep')\"\n @click=\"act('sleep')\"\n >\n Sleep now\n </ActionButton>\n <span v-if=\"dep.detail.asleep\" class=\"mute\">\n Asleep since {{ new Date(dep.detail.asleep.since).toLocaleString() }} ({{ dep.detail.asleep.reason }}).\n </span>\n </div>\n </section>\n\n <!-- ============================ share ============================ -->\n <section v-if=\"dep.detail\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Share a read-only link</h2>\n <span class=\"grow\" />\n <EquivalentCommand\n what=\"this link\"\n method=\"POST\"\n :path=\"`/api/deployments/${encodeURIComponent(dep.id)}/share`\"\n :body=\"{ views: shareViews, ttl: shareTtl }\"\n />\n </div>\n <p class=\"dim\">\n A URL that opens <b>this deployment only</b>, for someone without an account. It carries a\n signed token that reaches exactly the views below until it expires.\n <InfoHint label=\"what a link can and cannot do\">\n Read-only, and scoped: details and logs of this deployment, nothing else — no actions, no\n terminal, no other deployment. There is no per-link revocation; rotating the host's\n PSTACK_TOKEN invalidates every link at once, so keep the expiry short.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3); flex-wrap: wrap; gap: var(--s3)\">\n <label class=\"check\"><input v-model=\"shareDetails\" type=\"checkbox\" /> Details & containers</label>\n <label class=\"check\"><input v-model=\"shareLogs\" type=\"checkbox\" /> Logs</label>\n <div class=\"field inline\">\n <label for=\"share-ttl\">Expires</label>\n <SelectMenu\n id=\"share-ttl\"\n v-model=\"shareTtl\"\n label=\"How long the link works\"\n :options=\"[\n { value: '1h', label: 'In 1 hour' },\n { value: '24h', label: 'In 24 hours' },\n { value: '7d', label: 'In 7 days' },\n { value: '30d', label: 'In 30 days' },\n ]\"\n />\n </div>\n <ActionButton\n variant=\"primary\"\n :pending=\"sharePending\"\n :disabled=\"sharePending || shareViews.length === 0\"\n :title=\"shareViews.length === 0 ? 'Pick at least one view.' : undefined\"\n @click=\"share\"\n >\n Create link\n </ActionButton>\n </div>\n <div v-if=\"shareLink\" class=\"banner ok\" style=\"margin-top: var(--s3)\">\n <b>Your link — copy it now.</b>\n <p>\n Opens {{ shareLink.views.join(' and ') }} of <b>{{ dep.id }}</b> until\n {{ new Date(shareLink.expiresAt).toLocaleString() }}. It is shown once and stored nowhere.\n </p>\n <pre class=\"code\" style=\"white-space: pre-wrap; word-break: break-all\">{{ shareLink.url }}</pre>\n <div class=\"row\">\n <button @click=\"copyShare\">Copy</button>\n <a :href=\"shareLink.url\" target=\"_blank\" rel=\"noopener\">Open ↗</a>\n <button @click=\"shareLink = null\">Done</button>\n </div>\n </div>\n <ErrorNote v-if=\"shareError\" :text=\"shareError\" title=\"No link was created.\" />\n </section>\n\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Tear down</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until this deployment's variables are filled in — without them its stack has no\n name to act on. Set them under\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">\n Config & variables </RouterLink\n >first.\n </p>\n\n <template v-else>\n <div v-if=\"tokenMissing\" class=\"banner warn\">\n <b>No access token set.</b>\n <p>\n Every action below will be refused. Add your token under\n <RouterLink to=\"/settings\">Settings</RouterLink>.\n </p>\n </div>\n\n <p class=\"dim\">\n Stops and removes this deployment's containers, networks and volumes.\n {{ varsSummary }}\n <RouterLink :to=\"`/deployments/${encodeURIComponent(dep.id)}/config`\">change</RouterLink>\n </p>\n\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'down'\"\n :disabled=\"!!pending || (isShared && !forceArmed)\"\n :title=\"whyDisabled('down', forceArmed)\"\n @click=\"act('down', { verify: downVerify, force: isShared && forceArmed })\"\n >\n {{ isShared ? 'Tear down (force)' : 'Tear down' }}\n </ActionButton>\n <label class=\"check\">\n <input v-model=\"downVerify\" type=\"checkbox\" />\n Check for leftovers afterwards\n </label>\n </div>\n\n <p v-if=\"busy\" class=\"hint\">\n Something is already running on <b>{{ dep.detail.stack }}</b> — tearing down\n <b>cancels it first</b>.\n <InfoHint label=\"what happens to the job that is running\">\n One job runs per stack at a time; a teardown racing a deploy over the same database\n would corrupt it. A second <em>deploy</em> therefore waits its turn (and a third\n replaces the one waiting). A teardown does not wait: it stops the running job, drops\n anything queued behind it, and runs. Whatever the stopped job had already done is\n <b>not</b> undone — which is what tearing down is about to deal with anyway.\n </InfoHint>\n </p>\n <p v-if=\"!downVerify\" class=\"hint\">\n Nothing will check that teardown actually finished. A teardown that silently half-worked is\n the exact failure this tool exists to catch — run <b>Verify</b> yourself afterwards.\n </p>\n\n <!--\n Gate 1 of 2. The typed name is the point: a checkbox is one stray click, typing the stack\n name is a decision.\n -->\n <div v-if=\"isShared\" class=\"banner leaked\">\n <b>Shared — read this before tearing down.</b>\n <p>\n Tearing this down <b>deletes its stored data</b>: the TLS certificates, the shared\n database or queue, admin credentials. Nothing here recreates them, so\n <b>every preview on this host breaks</b> until someone rebuilds it by hand. The button is\n the same one that is routine on a single preview.\n <InfoHint label=\"what tearing down runs\">\n <code>{{ dep.detail.orchestrator === 'swarm' ? 'docker stack rm, then docker volume rm on its volumes' : 'docker compose down -v' }}</code>\n — removing the volumes is what makes this different from sleeping.\n </InfoHint>\n </p>\n <div class=\"field\" style=\"margin-top: var(--s3); max-width: 380px\">\n <label :for=\"`confirm-${dep.id}`\">\n Type the stack name <b>{{ dep.detail.stack }}</b> to confirm\n </label>\n <input\n :id=\"`confirm-${dep.id}`\"\n v-model.trim=\"forceTyped\"\n type=\"text\"\n :placeholder=\"dep.detail.stack\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n />\n </div>\n <p v-if=\"forceTyped && !forceArmed\" class=\"s-failed\">\n That does not match, so tearing down stays disabled.\n </p>\n </div>\n\n <!--\n Stopping is not tearing down, so it sits below the teardown control rather than beside it:\n nothing is destroyed, nothing already done is undone, and a stack left half-deployed is\n the point — you stop a wrong deploy so you can start the right one.\n -->\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton\n variant=\"danger\"\n :pending=\"cancelPending\"\n :disabled=\"cancelPending\"\n confirm=\"Stop everything? Nothing is undone.\"\n title=\"Cancels the job running on this stack and drops the one queued behind it. Destroys nothing.\"\n @run=\"cancelStack\"\n >\n Stop everything on this stack\n </ActionButton>\n <span class=\"mute\">\n The running job and the one waiting behind it, in one call — nothing is torn down, and\n whatever the running job already did stays done.\n </span>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote v-if=\"conflict\" :conflict=\"conflict\" :job-id=\"conflictJobId\" />\n </template>\n </section>\n\n <!-- ============================ forget ============================ -->\n <section class=\"panel\">\n <h2 class=\"section\" style=\"margin-bottom: var(--s3)\">Forget this deployment</h2>\n\n <p v-if=\"!dep.detail\" class=\"mute\">\n Unavailable until the variables are filled in: this stack's containers are counted before the\n record can be forgotten, and that needs its name.\n </p>\n <template v-else>\n <p class=\"dim\">\n This removes the <em>record only</em> — <b>it never tears anything down</b>. Afterwards\n nothing here knows how to remove whatever this deployment created.\n <InfoHint label=\"when forgetting is refused\">\n Refused while any container for this stack still exists — and refused just as firmly when\n docker cannot be reached, because “cannot confirm” is not evidence of absence. What is\n deleted is the stored spec, compose file and metadata.\n </InfoHint>\n </p>\n <div class=\"row\" style=\"margin-top: var(--s3)\">\n <label class=\"check\">\n <input v-model=\"forgetArmed\" type=\"checkbox\" />\n I have torn this down and want the record removed\n </label>\n <ActionButton\n variant=\"danger\"\n :pending=\"pending === 'forget'\"\n :disabled=\"!forgetArmed || !!pending\"\n :title=\"forgetArmed ? undefined : 'Confirm you have torn this down first.'\"\n @click=\"forget\"\n >\n Forget\n </ActionButton>\n </div>\n </template>\n </section>\n </div>\n</template>\n"],"names":["router","useRouter","shareDetails","ref","shareLogs","shareTtl","shareLink","shareError","sharePending","shareViews","computed","share","r","api","dep","problem","copyShare","toast","cancelPending","cancelStack","varsQuery","n","loadDeployments","downVerify","forceTyped","forgetArmed","forceArmed","_a","forget","pending","actionError","conflict","onConflict","_createElementBlock","_unref","isShared","_openBlock","_hoisted_1","_createElementVNode","_hoisted_2","_createTextVNode","_cache","_createVNode","InfoHint","_toDisplayString","_hoisted_3","ActionButton","busy","whyDisabled","act","_hoisted_4","_hoisted_5","_hoisted_6","EquivalentCommand","_hoisted_7","_hoisted_8","_hoisted_9","$event","_hoisted_10","_hoisted_11","SelectMenu","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_createBlock","ErrorNote","_hoisted_16","_Fragment","tokenMissing","_hoisted_18","_component_RouterLink","_hoisted_19","varsSummary","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_28","_hoisted_29","ConflictNote","conflictJobId","_hoisted_17","_hoisted_30","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_31"],"mappings":"+3DA+CA,MAAMA,EAASC,GAAA,EAMTC,EAAeC,EAAI,EAAI,EACvBC,EAAYD,EAAI,EAAI,EACpBE,EAAWF,EAAI,IAAI,EACnBG,EAAYH,EAAsB,IAAI,EACtCI,EAAaJ,EAAI,EAAE,EACnBK,EAAeL,EAAI,EAAK,EACxBM,EAAaC,EAAsB,IAAM,CAC7C,GAAIR,EAAa,MAAS,CAAC,SAAS,EAAc,CAAA,EAClD,GAAIE,EAAU,MAAS,CAAC,MAAM,EAAc,CAAA,CAAC,CAC9C,EAED,eAAeO,GAAuB,CACpCH,EAAa,MAAQ,GACrBD,EAAW,MAAQ,GACnBD,EAAU,MAAQ,KAClB,MAAMM,EAAI,MAAMC,EAAI,KAAgB,oBAAoB,mBAAmBC,EAAI,EAAE,CAAC,SAAU,CAC1F,MAAOL,EAAW,MAClB,IAAKJ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AAA,gBAAlBhC,EAAA,KAAW,CAAA,mBAAoB,sDAEjD,EAAA,EAAA,GACAiB,EAQeI,EAAA,CAPb,QAAQ,SACP,QAASZ,EAAAL,CAAA,IAAO,SAChB,SAAQ,CAAGJ,EAAA,OAAW,CAAA,CAAMS,EAAAL,CAAA,EAC5B,MAAOJ,EAAA,MAAc,OAAS,yCAC9B,QAAOG,CAAA,aACT,IAED,CAAA,GAAAa,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAFC,WAED,EAAA,CAAA,yDA3BJR,EAGI,IAHJwD,GAAmC,mJAGnC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as N,x as R,c as a,a as e,e as u,u as t,y as w,t as l,f as r,w as c,_ as k,F as m,r as z,g as h,z as b,A as v,B as i,j as C,p as S,C as $,k as I,l as V,o,D as j,E as x,G as J,H,I as U,J as F,K as P}from"./index-
|
|
2
|
-
//# sourceMappingURL=DashboardView-
|
|
1
|
+
import{d as N,x as R,c as a,a as e,e as u,u as t,y as w,t as l,f as r,w as c,_ as k,F as m,r as z,g as h,z as b,A as v,B as i,j as C,p as S,C as $,k as I,l as V,o,D as j,E as x,G as J,H,I as U,J as F,K as P}from"./index-BzdU0RNE.js";import{_ as T}from"./StateBadge.vue_vue_type_script_setup_true_lang-jkd_ejVw.js";import{_ as D}from"./SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js";import{_ as q}from"./RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js";const G={class:"page-head"},K={key:0,class:"banner leaked land"},M={class:"grid-2"},O={class:"panel"},Y={class:"phead"},Q={key:0,class:"badge"},W={key:0,class:"s-failed"},X={key:0,class:"banner warn"},Z={key:1,class:"banner warn"},ss={key:2,class:"banner failed"},es={key:3,class:"cards"},ts={class:"stagger"},os={class:"name","data-label":"service"},ns={class:"name dim","data-label":"image"},as={class:"panel"},ls={class:"phead"},rs={key:0,class:"s-failed"},is={class:"stats"},ds=["data-zero"],us={class:"v"},cs=["data-zero"],hs={class:"v"},vs=["data-zero"],ms={class:"v"},ps=["data-zero"],ks={class:"v"},ys=["data-zero"],gs={class:"v"},bs={key:0,class:"stat unknown"},fs={class:"v"},_s={key:0,class:"hint"},ws={key:1,class:"hint"},zs={class:"panel"},Cs={class:"phead"},Ds={key:0,class:"s-failed"},Es={key:2,class:"kvlist stagger"},As={class:"k"},Bs={class:"v"},js={class:"mute",style:{"font-size":"var(--t-xs)"}},xs={key:0,class:"mute"},Is=N({__name:"DashboardView",setup(Ls){const d=C(null),y=C(""),E=C(!1);async function L(){await Promise.all([f(),F(),P()])}async function f(){const g=await S.get("/api/control");if(E.value=!0,!g.ok){y.value=$(g,"load the control stack");return}y.value="";const s=g.body;d.value={project:s.project??"",reachable:s.reachable!==!1,parseError:!!s.parseError,services:Array.isArray(s.services)?s.services:[],managedBy:s.managedBy??"",actionable:s.actionable===!0,note:s.note??""}}R(()=>void f(),1e4);const A=I(()=>v.jobs.slice(0,8));return(g,s)=>{var B;const p=V("RouterLink");return o(),a("div",null,[e("div",G,[s[0]||(s[0]=e("div",null,[e("h1",null,"Dashboard"),e("div",{class:"sub"},"Everything running on this host.")],-1)),s[1]||(s[1]=e("span",{class:"grow"},null,-1)),u(q,{run:L})]),t(w).length?(o(),a("div",K,[e("b",null,l(t(w).length)+" teardown(s) left something behind.",1),e("p",null,[s[3]||(s[3]=r(" Something survived being torn down, and nothing else is going to remove it. ",-1)),u(k,{label:"what was already cleaned up"},{default:c(()=>[...s[2]||(s[2]=[e("code",null,"compose down -v",-1),r(" removed the containers, volumes and networks — whatever is left is outside compose's reach. ",-1)])]),_:1}),(o(!0),a(m,null,z(t(w).slice(0,3),n=>(o(),b(p,{key:n.id,to:`/jobs/${encodeURIComponent(n.id)}`,style:{"margin-left":"8px"}},{default:c(()=>[r(l(n.stack)+" →",1)]),_:2},1032,["to"]))),128))])])):h("",!0),e("div",M,[e("section",O,[e("div",Y,[s[5]||(s[5]=e("h2",{class:"section"},"Control stack",-1)),u(k,{label:"why there are no actions here"},{default:c(()=>{var n;return[s[4]||(s[4]=r(" pstack itself runs in this stack, so starting or stopping it here would kill the process handling the request — and a failed self-upgrade would leave the host with no control plane and no way back in. It is managed from the host instead. ",-1)),(n=d.value)!=null&&n.managedBy?(o(),a(m,{key:0},[r("Managed by "+l(d.value.managedBy)+".",1)],64)):h("",!0)]}),_:1}),(B=d.value)!=null&&B.project?(o(),a("span",Q,l(d.value.project),1)):h("",!0),s[6]||(s[6]=e("span",{class:"grow"},null,-1)),e("button",{class:"sm ghost",onClick:f},"Refresh")]),y.value?(o(),a("p",W,l(y.value),1)):E.value?d.value?(o(),a(m,{key:2},[d.value.reachable?d.value.parseError?(o(),a("div",Z,[...s[10]||(s[10]=[e("b",null,"Docker's answer could not be read.",-1),e("p",null,"Service state is unknown for this refresh; the stack itself may be fine.",-1)])])):d.value.services.length?h("",!0):(o(),a("div",ss,[...s[11]||(s[11]=[e("b",null,"Nothing is running in this project.",-1),e("p",null," Docker answered clearly, so the control stack really is down — yet you are reading a page it serves. You are most likely reaching it by some other route. ",-1)])])):(o(),a("div",X,[s[9]||(s[9]=e("b",null,"Docker did not answer.",-1)),e("p",null,[s[8]||(s[8]=r(" Check Docker is running, then refresh. ",-1)),u(k,{label:"why this is not the same as nothing running"},{default:c(()=>[...s[7]||(s[7]=[r(" This is ",-1),e("em",null,"not",-1),r(" the same as “nothing is running”: the control stack may be perfectly healthy while this process cannot reach the Docker socket. ",-1)])]),_:1})])])),d.value.services.length?(o(),a("table",es,[s[12]||(s[12]=e("thead",null,[e("tr",null,[e("th",null,"Service"),e("th",null,"State"),e("th",null,"Health"),e("th",null,"Image")])],-1)),e("tbody",ts,[(o(!0),a(m,null,z(d.value.services,(n,_)=>(o(),a("tr",{key:n.name,style:j({"--i":_})},[e("td",os,l(n.name),1),e("td",{"data-label":"state",class:x(n.state==="running"?"s-ok":"s-failed")},l(n.state||"—"),3),e("td",{"data-label":"health",class:x(n.health==="healthy"?"s-ok":n.health?"s-failed":"")},l(n.health||"—"),3),e("td",ns,l(n.image||"—"),1)],4))),128))])])):h("",!0)],64)):h("",!0):(o(),b(D,{key:1,rows:3}))]),e("div",null,[e("section",as,[e("div",ls,[s[14]||(s[14]=e("h2",{class:"section"},"Deployments",-1)),s[15]||(s[15]=e("span",{class:"grow"},null,-1)),u(p,{to:"/deployments"},{default:c(()=>[...s[13]||(s[13]=[r("all →",-1)])]),_:1})]),t(v).deploymentsError?(o(),a("p",rs,l(t(v).deploymentsError),1)):t(v).deploymentsLoaded?(o(),a(m,{key:2},[e("div",is,[e("div",{class:"stat","data-zero":t(i).total===0},[e("div",us,l(t(i).total),1),s[16]||(s[16]=e("div",{class:"k"},"total",-1))],8,ds),e("div",{class:"stat","data-zero":t(i).isolated===0},[e("div",hs,l(t(i).isolated),1),s[17]||(s[17]=e("div",{class:"k"},"isolated",-1))],8,cs),e("div",{class:"stat","data-zero":t(i).shared===0},[e("div",ms,l(t(i).shared),1),s[18]||(s[18]=e("div",{class:"k"},"shared",-1))],8,vs),e("div",{class:"stat","data-zero":t(i).running===0},[e("div",ks,l(t(i).running),1),s[19]||(s[19]=e("div",{class:"k"},"running",-1))],8,ps),e("div",{class:"stat busy","data-zero":t(i).busy===0},[e("div",gs,l(t(i).busy),1),s[20]||(s[20]=e("div",{class:"k"},"busy",-1))],8,ys),t(i).unknown?(o(),a("div",bs,[e("div",fs,l(t(i).unknown),1),s[21]||(s[21]=e("div",{class:"k"},"unknown",-1))])):h("",!0)]),t(i).unresolved?(o(),a("p",_s,[r(l(t(i).unresolved)+" deployment(s) are missing variables. ",1),u(p,{to:"/deployments"},{default:c(()=>[...s[22]||(s[22]=[r("Open one and set them.",-1)])]),_:1})])):t(i).unknown?(o(),a("p",ws,[s[24]||(s[24]=r(" “Unknown” means it could not be determined ",-1)),u(k,{label:"what unknown means"},{default:c(()=>[...s[23]||(s[23]=[r(" — ",-1),e("em",null,"not",-1),r(" that the deployment is idle. An unknown is never counted as a zero, which is how a live stack gets reported as torn down. ",-1)])]),_:1})])):h("",!0)],64)):(o(),b(D,{key:1,rows:2,tall:""}))]),e("section",zs,[e("div",Cs,[s[26]||(s[26]=e("h2",{class:"section"},"Recent jobs",-1)),s[27]||(s[27]=e("span",{class:"grow"},null,-1)),u(p,{to:"/jobs"},{default:c(()=>[...s[25]||(s[25]=[r("all →",-1)])]),_:1})]),t(v).jobsError?(o(),a("p",Ds,l(t(v).jobsError),1)):t(v).jobsLoaded?(o(),a("ul",Es,[(o(!0),a(m,null,z(A.value,(n,_)=>(o(),a("li",{key:n.id,style:j({"--i":_})},[e("span",As,[u(T,{state:n.state},null,8,["state"])]),e("span",Bs,[u(p,{to:`/jobs/${encodeURIComponent(n.id)}`},{default:c(()=>[r(l(t(J)(n.action))+" "+l(n.stack),1)]),_:2},1032,["to"]),e("span",js," · "+l(t(H)(n.startedAt))+" · "+l(t(U)(n.startedAt,n.endedAt)),1)])],4))),128)),A.value.length?h("",!0):(o(),a("li",xs,[s[29]||(s[29]=r(" No jobs yet. ",-1)),u(k,{label:"how long job history is kept"},{default:c(()=>[...s[28]||(s[28]=[r(" History is held in memory, so restarting the server clears it. A job record is the transcript of an attempt, not the truth about what exists now. ",-1)])]),_:1})]))])):(o(),b(D,{key:1,rows:4}))])])])])}}});export{Is as default};
|
|
2
|
+
//# sourceMappingURL=DashboardView-CpJmNcFL.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DashboardView-C7Ofmm_R.js","sources":["../../src/views/DashboardView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Dashboard: control-stack health, deployment counts, recent jobs, activity.\n *\n * The deployment and job lists are already polled by the shell, so this view only fetches the one\n * thing nobody else needs — the control stack.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Control } from '../api/types';\nimport { leakedJobs, loadDeployments, loadJobs, state, summary } from '../composables/useControlPlane';\nimport { usePolling } from '../composables/usePolling';\nimport { actionLabel, ago, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst control = ref<Control | null>(null);\nconst controlError = ref('');\nconst controlLoaded = ref(false);\n\n/**\n * Everything this page shows, in one press.\n *\n * The dashboard is four panels from three sources, so refreshing one of them would leave the others\n * looking current while showing older data — worse than not refreshing at all.\n */\nasync function refreshAll(): Promise<void> {\n await Promise.all([loadControl(), loadDeployments(), loadJobs()]);\n}\n\nasync function loadControl(): Promise<void> {\n const r = await api.get<Control>('/api/control');\n controlLoaded.value = true;\n if (!r.ok) {\n controlError.value = problem(r, 'load the control stack');\n return;\n }\n controlError.value = '';\n const b = r.body;\n control.value = {\n project: b.project ?? '',\n // `reachable !== false`, not `!!reachable`: an older build that omits the field should not be\n // reported as \"docker did not answer\".\n reachable: b.reachable !== false,\n parseError: !!b.parseError,\n services: Array.isArray(b.services) ? b.services : [],\n managedBy: b.managedBy ?? '',\n actionable: b.actionable === true,\n note: b.note ?? '',\n };\n}\n\nusePolling(() => void loadControl(), 10000);\n\nconst recentJobs = computed(() => state.jobs.slice(0, 8));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Dashboard</h1>\n <div class=\"sub\">Everything running on this host.</div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"refreshAll\" />\n </div>\n\n <!--\n A leak is the single thing this whole tool exists to catch, so it outranks every other panel\n on the page. Nothing else will clean up what survived a teardown.\n -->\n <div v-if=\"leakedJobs.length\" class=\"banner leaked land\">\n <b>{{ leakedJobs.length }} teardown(s) left something behind.</b>\n <p>\n Something survived being torn down, and nothing else is going to remove it.\n <InfoHint label=\"what was already cleaned up\">\n <code>compose down -v</code> removed the containers, volumes and networks — whatever is\n left is outside compose's reach.\n </InfoHint>\n <RouterLink\n v-for=\"j in leakedJobs.slice(0, 3)\"\n :key=\"j.id\"\n :to=\"`/jobs/${encodeURIComponent(j.id)}`\"\n style=\"margin-left: 8px\"\n >{{ j.stack }} →</RouterLink\n >\n </p>\n </div>\n\n <div class=\"grid-2\">\n <!-- ============================ control stack ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Control stack</h2>\n <InfoHint label=\"why there are no actions here\">\n pstack itself runs in this stack, so starting or stopping it here would kill the process\n handling the request — and a failed self-upgrade would leave the host with no control\n plane and no way back in. It is managed from the host instead.\n <template v-if=\"control?.managedBy\">Managed by {{ control.managedBy }}.</template>\n </InfoHint>\n <span v-if=\"control?.project\" class=\"badge\">{{ control.project }}</span>\n <span class=\"grow\" />\n <button class=\"sm ghost\" @click=\"loadControl\">Refresh</button>\n </div>\n\n <p v-if=\"controlError\" class=\"s-failed\">{{ controlError }}</p>\n <SkeletonList v-else-if=\"!controlLoaded\" :rows=\"3\" />\n\n <template v-else-if=\"control\">\n <!--\n Three distinct failure shapes. Collapsing any of them into \"nothing is running\" would be\n a lie an operator acts on.\n -->\n <div v-if=\"!control.reachable\" class=\"banner warn\">\n <b>Docker did not answer.</b>\n <p>\n Check Docker is running, then refresh.\n <InfoHint label=\"why this is not the same as nothing running\">\n This is <em>not</em> the same as “nothing is running”: the control stack may be\n perfectly healthy while this process cannot reach the Docker socket.\n </InfoHint>\n </p>\n </div>\n <div v-else-if=\"control.parseError\" class=\"banner warn\">\n <b>Docker's answer could not be read.</b>\n <p>Service state is unknown for this refresh; the stack itself may be fine.</p>\n </div>\n <div v-else-if=\"!control.services.length\" class=\"banner failed\">\n <b>Nothing is running in this project.</b>\n <p>\n Docker answered clearly, so the control stack really is down — yet you are reading a\n page it serves. You are most likely reaching it by some other route.\n </p>\n </div>\n\n <table v-if=\"control.services.length\" class=\"cards\">\n <thead>\n <tr>\n <th>Service</th>\n <th>State</th>\n <th>Health</th>\n <th>Image</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in control.services\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"service\">{{ s.name }}</td>\n <td data-label=\"state\" :class=\"s.state === 'running' ? 's-ok' : 's-failed'\">\n {{ s.state || '—' }}\n </td>\n <td\n data-label=\"health\"\n :class=\"s.health === 'healthy' ? 's-ok' : s.health ? 's-failed' : ''\"\n >\n {{ s.health || '—' }}\n </td>\n <td class=\"name dim\" data-label=\"image\">{{ s.image || '—' }}</td>\n </tr>\n </tbody>\n </table>\n\n <!--\n NEVER ADD AN ACTION HERE, not even a safe one. The API serving this page runs INSIDE this\n stack: `up` would kill the process performing it, and a failed self-upgrade leaves the\n host with no control plane and no remote way in. The server says `actionable: false` for\n exactly this reason.\n\n This used to be a banner reading \"Read-only — there are no actions here\", which spent a\n block of the page announcing the ABSENCE of something. Nobody looks at a panel with no\n buttons and wonders why; the handful who do get the reason from the hint in the header.\n -->\n </template>\n </section>\n\n <!-- ============================ deployments + jobs ============================ -->\n <div>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Deployments</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/deployments\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.deploymentsError\" class=\"s-failed\">{{ state.deploymentsError }}</p>\n <SkeletonList v-else-if=\"!state.deploymentsLoaded\" :rows=\"2\" tall />\n <template v-else>\n <!-- `data-zero` dims a nought so it stops competing with the counts that moved. -->\n <div class=\"stats\">\n <div class=\"stat\" :data-zero=\"summary.total === 0\"><div class=\"v\">{{ summary.total }}</div><div class=\"k\">total</div></div>\n <div class=\"stat\" :data-zero=\"summary.isolated === 0\"><div class=\"v\">{{ summary.isolated }}</div><div class=\"k\">isolated</div></div>\n <div class=\"stat\" :data-zero=\"summary.shared === 0\"><div class=\"v\">{{ summary.shared }}</div><div class=\"k\">shared</div></div>\n <div class=\"stat\" :data-zero=\"summary.running === 0\"><div class=\"v\">{{ summary.running }}</div><div class=\"k\">running</div></div>\n <div class=\"stat busy\" :data-zero=\"summary.busy === 0\"><div class=\"v\">{{ summary.busy }}</div><div class=\"k\">busy</div></div>\n <!--\n The server sends `null`, never `false`, when it could not determine busy/running.\n An unknown must never be counted as a zero — that is how a live stack gets reported\n as torn down. It gets its own tile.\n -->\n <div v-if=\"summary.unknown\" class=\"stat unknown\">\n <div class=\"v\">{{ summary.unknown }}</div>\n <div class=\"k\">unknown</div>\n </div>\n </div>\n\n <p v-if=\"summary.unresolved\" class=\"hint\">\n {{ summary.unresolved }} deployment(s) are missing variables.\n <RouterLink to=\"/deployments\">Open one and set them.</RouterLink>\n </p>\n <p v-else-if=\"summary.unknown\" class=\"hint\">\n “Unknown” means it could not be determined\n <InfoHint label=\"what unknown means\">\n — <em>not</em> that the deployment is idle. An unknown is never counted as a zero,\n which is how a live stack gets reported as torn down.\n </InfoHint>\n </p>\n </template>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Recent jobs</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/jobs\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"4\" />\n <ul v-else class=\"kvlist stagger\">\n <li v-for=\"(j, i) in recentJobs\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <span class=\"k\"><StateBadge :state=\"j.state\" /></span>\n <span class=\"v\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n {{ actionLabel(j.action) }} {{ j.stack }}\n </RouterLink>\n <span class=\"mute\" style=\"font-size: var(--t-xs)\">\n · {{ ago(j.startedAt) }} · {{ took(j.startedAt, j.endedAt) }}\n </span>\n </span>\n </li>\n <li v-if=\"!recentJobs.length\" class=\"mute\">\n No jobs yet.\n <InfoHint label=\"how long job history is kept\">\n History is held in memory, so restarting the server clears it. A job record is the\n transcript of an attempt, not the truth about what exists now.\n </InfoHint>\n </li>\n </ul>\n </section>\n </div>\n </div>\n </div>\n</template>\n"],"names":["control","ref","controlError","controlLoaded","refreshAll","loadControl","loadDeployments","loadJobs","r","api","problem","b","usePolling","recentJobs","computed","state","_createElementBlock","_createElementVNode","_hoisted_1","_createVNode","RefreshButton","_unref","leakedJobs","_openBlock","_hoisted_2","_toDisplayString","InfoHint","_cache","_Fragment","_renderList","j","_createBlock","_component_RouterLink","_hoisted_3","_hoisted_4","_hoisted_5","_a","_createTextVNode","_hoisted_6","_hoisted_7","_hoisted_9","_hoisted_10","_hoisted_8","_hoisted_11","_hoisted_12","s","i","_hoisted_13","_normalizeClass","_hoisted_14","SkeletonList","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","summary","_hoisted_20","_hoisted_22","_hoisted_24","_hoisted_26","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","StateBadge","_hoisted_38","actionLabel","_hoisted_39","ago","_hoisted_40"],"mappings":"o7CAkBA,MAAMA,EAAUC,EAAoB,IAAI,EAClCC,EAAeD,EAAI,EAAE,EACrBE,EAAgBF,EAAI,EAAK,EAQ/B,eAAeG,GAA4B,CACzC,MAAM,QAAQ,IAAI,CAACC,EAAA,EAAeC,EAAA,EAAmBC,EAAA,CAAU,CAAC,CAClE,CAEA,eAAeF,GAA6B,CAC1C,MAAMG,EAAI,MAAMC,EAAI,IAAa,cAAc,EAE/C,GADAN,EAAc,MAAQ,GAClB,CAACK,EAAE,GAAI,CACTN,EAAa,MAAQQ,EAAQF,EAAG,wBAAwB,EACxD,MACF,CACAN,EAAa,MAAQ,GACrB,MAAMS,EAAIH,EAAE,KACZR,EAAQ,MAAQ,CACd,QAASW,EAAE,SAAW,GAGtB,UAAWA,EAAE,YAAc,GAC3B,WAAY,CAAC,CAACA,EAAE,WAChB,SAAU,MAAM,QAAQA,EAAE,QAAQ,EAAIA,EAAE,SAAW,CAAA,EACnD,UAAWA,EAAE,WAAa,GAC1B,WAAYA,EAAE,aAAe,GAC7B,KAAMA,EAAE,MAAQ,EAAA,CAEpB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,MAAW,iBAAtBU,IAAAP,EAMK,KANL2D,GAMK,iBANsC,iBAEzC,EAAA,GAAAxD,EAGWO,EAAA,CAHD,MAAM,gCAA8B,WAAC,IAG/C,CAAA,GAAAC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAH+C,sJAG/C,EAAA,CAAA,sBAlBJI,EAAwDmB,EAAA,OAAX,KAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"DashboardView-CpJmNcFL.js","sources":["../../src/views/DashboardView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Dashboard: control-stack health, deployment counts, recent jobs, activity.\n *\n * The deployment and job lists are already polled by the shell, so this view only fetches the one\n * thing nobody else needs — the control stack.\n */\nimport { computed, ref } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { Control } from '../api/types';\nimport { leakedJobs, loadDeployments, loadJobs, state, summary } from '../composables/useControlPlane';\nimport { usePolling } from '../composables/usePolling';\nimport { actionLabel, ago, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst control = ref<Control | null>(null);\nconst controlError = ref('');\nconst controlLoaded = ref(false);\n\n/**\n * Everything this page shows, in one press.\n *\n * The dashboard is four panels from three sources, so refreshing one of them would leave the others\n * looking current while showing older data — worse than not refreshing at all.\n */\nasync function refreshAll(): Promise<void> {\n await Promise.all([loadControl(), loadDeployments(), loadJobs()]);\n}\n\nasync function loadControl(): Promise<void> {\n const r = await api.get<Control>('/api/control');\n controlLoaded.value = true;\n if (!r.ok) {\n controlError.value = problem(r, 'load the control stack');\n return;\n }\n controlError.value = '';\n const b = r.body;\n control.value = {\n project: b.project ?? '',\n // `reachable !== false`, not `!!reachable`: an older build that omits the field should not be\n // reported as \"docker did not answer\".\n reachable: b.reachable !== false,\n parseError: !!b.parseError,\n services: Array.isArray(b.services) ? b.services : [],\n managedBy: b.managedBy ?? '',\n actionable: b.actionable === true,\n note: b.note ?? '',\n };\n}\n\nusePolling(() => void loadControl(), 10000);\n\nconst recentJobs = computed(() => state.jobs.slice(0, 8));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Dashboard</h1>\n <div class=\"sub\">Everything running on this host.</div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"refreshAll\" />\n </div>\n\n <!--\n A leak is the single thing this whole tool exists to catch, so it outranks every other panel\n on the page. Nothing else will clean up what survived a teardown.\n -->\n <div v-if=\"leakedJobs.length\" class=\"banner leaked land\">\n <b>{{ leakedJobs.length }} teardown(s) left something behind.</b>\n <p>\n Something survived being torn down, and nothing else is going to remove it.\n <InfoHint label=\"what was already cleaned up\">\n <code>compose down -v</code> removed the containers, volumes and networks — whatever is\n left is outside compose's reach.\n </InfoHint>\n <RouterLink\n v-for=\"j in leakedJobs.slice(0, 3)\"\n :key=\"j.id\"\n :to=\"`/jobs/${encodeURIComponent(j.id)}`\"\n style=\"margin-left: 8px\"\n >{{ j.stack }} →</RouterLink\n >\n </p>\n </div>\n\n <div class=\"grid-2\">\n <!-- ============================ control stack ============================ -->\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Control stack</h2>\n <InfoHint label=\"why there are no actions here\">\n pstack itself runs in this stack, so starting or stopping it here would kill the process\n handling the request — and a failed self-upgrade would leave the host with no control\n plane and no way back in. It is managed from the host instead.\n <template v-if=\"control?.managedBy\">Managed by {{ control.managedBy }}.</template>\n </InfoHint>\n <span v-if=\"control?.project\" class=\"badge\">{{ control.project }}</span>\n <span class=\"grow\" />\n <button class=\"sm ghost\" @click=\"loadControl\">Refresh</button>\n </div>\n\n <p v-if=\"controlError\" class=\"s-failed\">{{ controlError }}</p>\n <SkeletonList v-else-if=\"!controlLoaded\" :rows=\"3\" />\n\n <template v-else-if=\"control\">\n <!--\n Three distinct failure shapes. Collapsing any of them into \"nothing is running\" would be\n a lie an operator acts on.\n -->\n <div v-if=\"!control.reachable\" class=\"banner warn\">\n <b>Docker did not answer.</b>\n <p>\n Check Docker is running, then refresh.\n <InfoHint label=\"why this is not the same as nothing running\">\n This is <em>not</em> the same as “nothing is running”: the control stack may be\n perfectly healthy while this process cannot reach the Docker socket.\n </InfoHint>\n </p>\n </div>\n <div v-else-if=\"control.parseError\" class=\"banner warn\">\n <b>Docker's answer could not be read.</b>\n <p>Service state is unknown for this refresh; the stack itself may be fine.</p>\n </div>\n <div v-else-if=\"!control.services.length\" class=\"banner failed\">\n <b>Nothing is running in this project.</b>\n <p>\n Docker answered clearly, so the control stack really is down — yet you are reading a\n page it serves. You are most likely reaching it by some other route.\n </p>\n </div>\n\n <table v-if=\"control.services.length\" class=\"cards\">\n <thead>\n <tr>\n <th>Service</th>\n <th>State</th>\n <th>Health</th>\n <th>Image</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in control.services\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"service\">{{ s.name }}</td>\n <td data-label=\"state\" :class=\"s.state === 'running' ? 's-ok' : 's-failed'\">\n {{ s.state || '—' }}\n </td>\n <td\n data-label=\"health\"\n :class=\"s.health === 'healthy' ? 's-ok' : s.health ? 's-failed' : ''\"\n >\n {{ s.health || '—' }}\n </td>\n <td class=\"name dim\" data-label=\"image\">{{ s.image || '—' }}</td>\n </tr>\n </tbody>\n </table>\n\n <!--\n NEVER ADD AN ACTION HERE, not even a safe one. The API serving this page runs INSIDE this\n stack: `up` would kill the process performing it, and a failed self-upgrade leaves the\n host with no control plane and no remote way in. The server says `actionable: false` for\n exactly this reason.\n\n This used to be a banner reading \"Read-only — there are no actions here\", which spent a\n block of the page announcing the ABSENCE of something. Nobody looks at a panel with no\n buttons and wonders why; the handful who do get the reason from the hint in the header.\n -->\n </template>\n </section>\n\n <!-- ============================ deployments + jobs ============================ -->\n <div>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Deployments</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/deployments\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.deploymentsError\" class=\"s-failed\">{{ state.deploymentsError }}</p>\n <SkeletonList v-else-if=\"!state.deploymentsLoaded\" :rows=\"2\" tall />\n <template v-else>\n <!-- `data-zero` dims a nought so it stops competing with the counts that moved. -->\n <div class=\"stats\">\n <div class=\"stat\" :data-zero=\"summary.total === 0\"><div class=\"v\">{{ summary.total }}</div><div class=\"k\">total</div></div>\n <div class=\"stat\" :data-zero=\"summary.isolated === 0\"><div class=\"v\">{{ summary.isolated }}</div><div class=\"k\">isolated</div></div>\n <div class=\"stat\" :data-zero=\"summary.shared === 0\"><div class=\"v\">{{ summary.shared }}</div><div class=\"k\">shared</div></div>\n <div class=\"stat\" :data-zero=\"summary.running === 0\"><div class=\"v\">{{ summary.running }}</div><div class=\"k\">running</div></div>\n <div class=\"stat busy\" :data-zero=\"summary.busy === 0\"><div class=\"v\">{{ summary.busy }}</div><div class=\"k\">busy</div></div>\n <!--\n The server sends `null`, never `false`, when it could not determine busy/running.\n An unknown must never be counted as a zero — that is how a live stack gets reported\n as torn down. It gets its own tile.\n -->\n <div v-if=\"summary.unknown\" class=\"stat unknown\">\n <div class=\"v\">{{ summary.unknown }}</div>\n <div class=\"k\">unknown</div>\n </div>\n </div>\n\n <p v-if=\"summary.unresolved\" class=\"hint\">\n {{ summary.unresolved }} deployment(s) are missing variables.\n <RouterLink to=\"/deployments\">Open one and set them.</RouterLink>\n </p>\n <p v-else-if=\"summary.unknown\" class=\"hint\">\n “Unknown” means it could not be determined\n <InfoHint label=\"what unknown means\">\n — <em>not</em> that the deployment is idle. An unknown is never counted as a zero,\n which is how a live stack gets reported as torn down.\n </InfoHint>\n </p>\n </template>\n </section>\n\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Recent jobs</h2>\n <span class=\"grow\" />\n <RouterLink to=\"/jobs\">all →</RouterLink>\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"4\" />\n <ul v-else class=\"kvlist stagger\">\n <li v-for=\"(j, i) in recentJobs\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <span class=\"k\"><StateBadge :state=\"j.state\" /></span>\n <span class=\"v\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n {{ actionLabel(j.action) }} {{ j.stack }}\n </RouterLink>\n <span class=\"mute\" style=\"font-size: var(--t-xs)\">\n · {{ ago(j.startedAt) }} · {{ took(j.startedAt, j.endedAt) }}\n </span>\n </span>\n </li>\n <li v-if=\"!recentJobs.length\" class=\"mute\">\n No jobs yet.\n <InfoHint label=\"how long job history is kept\">\n History is held in memory, so restarting the server clears it. A job record is the\n transcript of an attempt, not the truth about what exists now.\n </InfoHint>\n </li>\n </ul>\n </section>\n </div>\n </div>\n </div>\n</template>\n"],"names":["control","ref","controlError","controlLoaded","refreshAll","loadControl","loadDeployments","loadJobs","r","api","problem","b","usePolling","recentJobs","computed","state","_createElementBlock","_createElementVNode","_hoisted_1","_createVNode","RefreshButton","_unref","leakedJobs","_openBlock","_hoisted_2","_toDisplayString","InfoHint","_cache","_Fragment","_renderList","j","_createBlock","_component_RouterLink","_hoisted_3","_hoisted_4","_hoisted_5","_a","_createTextVNode","_hoisted_6","_hoisted_7","_hoisted_9","_hoisted_10","_hoisted_8","_hoisted_11","_hoisted_12","s","i","_hoisted_13","_normalizeClass","_hoisted_14","SkeletonList","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","summary","_hoisted_20","_hoisted_22","_hoisted_24","_hoisted_26","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","StateBadge","_hoisted_38","actionLabel","_hoisted_39","ago","_hoisted_40"],"mappings":"o7CAkBA,MAAMA,EAAUC,EAAoB,IAAI,EAClCC,EAAeD,EAAI,E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,EAAA,EAAA,EAAAP,EAUKY,EAAA,KAAAC,EAVgBhB,EAAA,MAAU,CAAnBiB,EAAGgB,SAAf9B,EAUK,KAAA,CAV6B,IAAKc,EAAE,GAAK,eAAgBgB,EAAC,CAAA,GAC7D7B,EAAsD,OAAtDoD,GAAsD,CAAtClD,EAA+BmD,EAAA,CAAlB,MAAOxC,EAAE,KAAA,sBACtCb,EAOO,OAPPsD,GAOO,CANLpD,EAEaa,EAAA,CAFA,GAAE,SAAW,mBAAmBF,EAAE,EAAE,CAAA,EAAA,aAC/C,IAA2B,KAAxBT,EAAAmD,CAAA,EAAY1C,EAAE,MAAM,GAAI,IAACL,EAAGK,EAAE,KAAK,EAAA,CAAA,CAAA,qBAExCb,EAEO,OAFPwD,GAAkD,QAC3CpD,EAAAqD,CAAA,EAAI5C,EAAE,SAAS,GAAI,MAAGL,EAAGJ,KAAKS,EAAE,UAAWA,EAAE,OAAO,CAAA,EAAA,CAAA,CAAA,eAIpDjB,EAAA,MAAW,iBAAtBU,IAAAP,EAMK,KANL2D,GAMK,iBANsC,iBAEzC,EAAA,GAAAxD,EAGWO,EAAA,CAHD,MAAM,gCAA8B,WAAC,IAG/C,CAAA,GAAAC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAH+C,sJAG/C,EAAA,CAAA,sBAlBJI,EAAwDmB,EAAA,OAAX,KAAM,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as L,N as R,c as n,a as l,e as p,w as i,t as b,u as e,f as o,E as N,M as z,g as r,z as u,F as q,r as E,_ as V,l as S,o as s,T as U,m as j,S as F}from"./index-
|
|
2
|
-
//# sourceMappingURL=DeploymentDetailView-
|
|
1
|
+
import{d as L,N as R,c as n,a as l,e as p,w as i,t as b,u as e,f as o,E as N,M as z,g as r,z as u,F as q,r as E,_ as V,l as S,o as s,T as U,m as j,S as F}from"./index-BzdU0RNE.js";import{d as a,l as J,i as M,o as O}from"./useDeployment-D3f7oVQg.js";import{a as v,w as g,p as m,b as k,c as T,d as h,e as W,_ as G,r as H}from"./ConflictNote.vue_vue_type_script_setup_true_lang-BtSm_ZhU.js";import{_ as w}from"./ActionButton.vue_vue_type_script_setup_true_lang-CB94t3xm.js";import{_ as A}from"./ErrorNote.vue_vue_type_script_setup_true_lang-Imao12aK.js";import{_ as K}from"./RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js";import"./useVars-VN9gYdR6.js";const P={class:"page-head"},Q={class:"mute",style:{"font-size":"var(--t-sm)"}},X={style:{"font-size":"var(--t-xl)"}},Y={class:"sub"},Z={key:0},ee={key:1},te={key:2},se={key:1,class:"badge busy"},ae=["title"],oe={key:3,class:"badge",title:"deployed as a swarm stack"},ne={key:4,class:"row",style:{"flex-wrap":"nowrap"}},le={class:"tabs","aria-label":"Deployment sections"},ie={key:3,class:"hint"},re={key:4,class:"hint",style:{"margin-bottom":"var(--s4)"}},ve=L({__name:"DeploymentDetailView",props:{id:{}},setup(f){const _=f,c=j(),B=[{to:"overview",label:"Overview"},{to:"runtime",label:"Containers & routes"},{to:"config",label:"Config & variables"},{to:"axes",label:"Axes"},{to:"requires",label:"Requires"},{to:"logs",label:"Logs"},{to:"terminal",label:"Terminal"},{to:"danger",label:"Danger"}];return R(()=>_.id,y=>{O(y),H()},{immediate:!0}),R(()=>a.error,y=>{y&&c.currentRoute.value.name==="d.overview"&&c.replace(`/deployments/${encodeURIComponent(_.id)}/config`)}),(y,t)=>{var x,$,D;const C=S("RouterLink"),I=S("RouterView");return s(),n("div",null,[l("div",P,[l("div",null,[l("div",Q,[p(C,{to:"/deployments"},{default:i(()=>[...t[3]||(t[3]=[o("← Deployments",-1)])]),_:1})]),l("h1",X,b(f.id),1),l("div",Y,[e(a).detail?(s(),n("span",Z,[t[4]||(t[4]=o(" stack ",-1)),l("b",null,b(e(a).detail.stack),1)])):e(a).error?(s(),n("span",ee,"unresolved")):(s(),n("span",te,"loading…"))])]),t[10]||(t[10]=l("span",{class:"grow"},null,-1)),e(a).detail?(s(),n("span",{key:0,class:N(["badge",e(a).detail.kind])},b(e(z)(e(a).detail.kind)),3)):r("",!0),((x=e(a).detail)==null?void 0:x.busy)===!0?(s(),n("span",se,[...t[5]||(t[5]=[l("span",{class:"dot pulse"},null,-1),o("busy",-1)])])):($=e(a).detail)!=null&&$.asleep?(s(),n("span",{key:2,class:"badge asleep",title:`asleep since ${new Date(e(a).detail.asleep.since).toLocaleString()} (${e(a).detail.asleep.reason})`},[...t[6]||(t[6]=[l("span",{class:"dot"},null,-1),o("asleep",-1)])],8,ae)):r("",!0),((D=e(a).detail)==null?void 0:D.orchestrator)==="swarm"?(s(),n("span",oe,"swarm")):r("",!0),e(a).detail?(s(),n("div",ne,[p(K,{run:e(J),label:"Re-resolve",title:"Read this deployment again and re-run its variable substitution"},null,8,["run"]),e(a).detail.asleep?(s(),u(w,{key:0,variant:"primary",pending:e(m)==="wake",disabled:!!e(m)||e(k),title:e(g)("wake"),onClick:t[0]||(t[0]=d=>e(v)("wake"))},{default:i(()=>[...t[7]||(t[7]=[o(" Wake ",-1)])]),_:1},8,["pending","disabled","title"])):(s(),u(w,{key:1,variant:"primary",pending:e(m)==="up",disabled:!!e(m)||e(k),title:e(g)("up"),onClick:t[1]||(t[1]=d=>e(v)("up"))},{default:i(()=>[...t[8]||(t[8]=[o(" Deploy ",-1)])]),_:1},8,["pending","disabled","title"])),p(w,{pending:e(m)==="verify",disabled:!!e(m)||e(k),title:e(g)("verify"),onClick:t[2]||(t[2]=d=>e(v)("verify"))},{default:i(()=>[...t[9]||(t[9]=[o(" Verify ",-1)])]),_:1},8,["pending","disabled","title"])])):r("",!0)]),e(T)?(s(),u(A,{key:0,text:e(T),title:"The action was refused."},null,8,["text"])):r("",!0),e(h)?(s(),u(G,{key:1,conflict:e(h),"job-id":e(W),style:{"margin-bottom":"var(--s4)"}},null,8,["conflict","job-id"])):r("",!0),l("nav",le,[(s(),n(q,null,E(B,d=>p(C,{key:d.to,to:`/deployments/${encodeURIComponent(f.id)}/${d.to}`},{default:i(()=>[o(b(d.label),1)]),_:2},1032,["to"])),64))]),e(a).error?(s(),u(A,{key:2,text:e(a).error,title:"Could not resolve this deployment."},null,8,["text"])):r("",!0),e(a).error?(s(),n("p",ie,[t[12]||(t[12]=o(" If that message names a variable, add it under ",-1)),t[13]||(t[13]=l("b",null,"Config & variables",-1)),t[14]||(t[14]=o(" and press ",-1)),t[15]||(t[15]=l("b",null,"Apply & reload",-1)),t[16]||(t[16]=o(". ",-1)),p(V,{label:"why the rest of the page is unavailable"},{default:i(()=>[...t[11]||(t[11]=[o(" Until the spec resolves there is no stack name, and every action on this deployment needs one. ",-1)])]),_:1})])):r("",!0),e(M)?(s(),n("p",re,[t[18]||(t[18]=o(" Shared with every preview on this host. ",-1)),p(V,{label:"what a shared deployment is"},{default:i(()=>[...t[17]||(t[17]=[o(" A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no axes, and tearing it down needs an explicit confirmation, because doing so destroys state every other deployment depends on. ",-1)])]),_:1})])):r("",!0),p(I,null,{default:i(({Component:d})=>[p(U,{name:"view",mode:"out-in"},{default:i(()=>[(s(),u(F(d)))]),_:2},1024)]),_:1})])}}});export{ve as default};
|
|
2
|
+
//# sourceMappingURL=DeploymentDetailView-CP2ANsF3.js.map
|
package/dist/assets/{DeploymentDetailView-BnEVV3jQ.js.map → DeploymentDetailView-CP2ANsF3.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DeploymentDetailView-BnEVV3jQ.js","sources":["../../src/views/DeploymentDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The detail shell: breadcrumb, tabs, and the resolve-failure banner that gates the rest.\n *\n * A deployment whose spec will not resolve is not a dead end — the fix (its variables) lives on\n * the Config tab, so this sends the operator there rather than leaving them in front of an error\n * with no control in reach. Everything else stays unavailable until it resolves, because the\n * server cannot name the stack without the variables, and every action needs the stack name.\n */\nimport { watch } from 'vue';\nimport { sentence } from '../composables/useFormat';\nimport { useRouter } from 'vue-router';\nimport { dep, isShared, loadDetail, openDeployment } from '../composables/useDeployment';\nimport {\n act,\n actionError,\n busy,\n conflict,\n conflictJobId,\n pending,\n resetActions,\n whyDisabled,\n} from '../composables/useDeploymentActions';\nimport ActionButton from '../components/ActionButton.vue';\nimport ConflictNote from '../components/ConflictNote.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst props = defineProps<{ id: string }>();\nconst router = useRouter();\n\nconst TABS = [\n { to: 'overview', label: 'Overview' },\n // Second, not buried: \"the hostname does not work\" is the most common question, and this is the\n // only tab that can answer it.\n { to: 'runtime', label: 'Containers & routes' },\n { to: 'config', label: 'Config & variables' },\n { to: 'axes', label: 'Axes' },\n { to: 'requires', label: 'Requires' },\n { to: 'logs', label: 'Logs' },\n // After Logs: a shell is what you reach for when the logs did not answer it.\n { to: 'terminal', label: 'Terminal' },\n { to: 'danger', label: 'Danger' },\n] as const;\n\nwatch(\n () => props.id,\n (id) => {\n openDeployment(id);\n // A stale \"refused\" from the previous deployment must not greet the next one.\n resetActions();\n },\n { immediate: true },\n);\n\n// Land the operator on the editor when the spec will not resolve — but only from the tab that has\n// nothing to show. Sending them away from Logs or Danger mid-read would be its own annoyance.\nwatch(\n () => dep.error,\n (err) => {\n if (err && router.currentRoute.value.name === 'd.overview') {\n void router.replace(`/deployments/${encodeURIComponent(props.id)}/config`);\n }\n },\n);\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/deployments\">← Deployments</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ id }}</h1>\n <div class=\"sub\">\n <span v-if=\"dep.detail\">\n stack <b>{{ dep.detail.stack }}</b>\n </span>\n <span v-else-if=\"dep.error\">unresolved</span>\n <span v-else>loading…</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"dep.detail\" class=\"badge\" :class=\"dep.detail.kind\">{{ sentence(dep.detail.kind) }}</span>\n <span v-if=\"dep.detail?.busy === true\" class=\"badge busy\"><span class=\"dot pulse\" />busy</span>\n <span\n v-else-if=\"dep.detail?.asleep\"\n class=\"badge asleep\"\n :title=\"`asleep since ${new Date(dep.detail.asleep.since).toLocaleString()} (${dep.detail.asleep.reason})`\"\n ><span class=\"dot\" />asleep</span\n >\n <span v-if=\"dep.detail?.orchestrator === 'swarm'\" class=\"badge\" title=\"deployed as a swarm stack\">swarm</span>\n <!--\n Deploy and Verify live HERE, on every tab — they are the product's routine actions, and they\n used to be reachable only through a tab named \"Danger\". Teardown stays there: the header\n carries what is safe to reach for, the Danger tab carries what deserves the walk.\n -->\n <!-- One flex unit, so on a narrow screen the pair wraps together instead of Verify being\n orphaned onto its own line under the title. -->\n <div v-if=\"dep.detail\" class=\"row\" style=\"flex-wrap: nowrap\">\n <RefreshButton :run=\"loadDetail\" label=\"Re-resolve\" title=\"Read this deployment again and re-run its variable substitution\" />\n <!-- Asleep: the primary action is to wake it — the same `up`, recorded as a wake. -->\n <ActionButton\n v-if=\"dep.detail.asleep\"\n variant=\"primary\"\n :pending=\"pending === 'wake'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('wake')\"\n @click=\"act('wake')\"\n >\n Wake\n </ActionButton>\n <ActionButton\n v-else\n variant=\"primary\"\n :pending=\"pending === 'up'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('up')\"\n @click=\"act('up')\"\n >\n Deploy\n </ActionButton>\n <ActionButton\n :pending=\"pending === 'verify'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('verify')\"\n @click=\"act('verify')\"\n >\n Verify\n </ActionButton>\n </div>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote\n v-if=\"conflict\"\n :conflict=\"conflict\"\n :job-id=\"conflictJobId\"\n style=\"margin-bottom: var(--s4)\"\n />\n\n <nav class=\"tabs\" aria-label=\"Deployment sections\">\n <RouterLink\n v-for=\"t in TABS\"\n :key=\"t.to\"\n :to=\"`/deployments/${encodeURIComponent(id)}/${t.to}`\"\n >{{ t.label }}</RouterLink\n >\n </nav>\n\n <ErrorNote v-if=\"dep.error\" :text=\"dep.error\" title=\"Could not resolve this deployment.\">\n </ErrorNote>\n <p v-if=\"dep.error\" class=\"hint\">\n If that message names a variable, add it under <b>Config & variables</b> and press\n <b>Apply & reload</b>.\n <InfoHint label=\"why the rest of the page is unavailable\">\n Until the spec resolves there is no stack name, and every action on this deployment needs one.\n </InfoHint>\n </p>\n\n <p v-if=\"isShared\" class=\"hint\" style=\"margin-bottom: var(--s4)\">\n Shared with every preview on this host.\n <InfoHint label=\"what a shared deployment is\">\n A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no\n axes, and tearing it down needs an explicit confirmation, because doing so destroys state\n every other deployment depends on.\n </InfoHint>\n </p>\n\n <RouterView v-slot=\"{ Component }\">\n <Transition name=\"view\" mode=\"out-in\">\n <component :is=\"Component\" />\n </Transition>\n </RouterView>\n </div>\n</template>\n"],"names":["props","__props","router","useRouter","TABS","watch","id","openDeployment","resetActions","dep","err","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_unref","_hoisted_5","_openBlock","sentence","_hoisted_8","_hoisted_10","_hoisted_11","RefreshButton","loadDetail","_createBlock","ActionButton","pending","busy","whyDisabled","act","actionError","ErrorNote","conflict","ConflictNote","conflictJobId","_hoisted_12","_Fragment","_renderList","t","_createTextVNode","_hoisted_13","InfoHint","isShared","_hoisted_14","_component_RouterView","_withCtx","Component","_Transition","_resolveDynamicComponent"],"mappings":"4pCA6BA,MAAMA,EAAQC,EACRC,EAASC,EAAA,EAETC,EAAO,CACX,CAAE,GAAI,WAAY,MAAO,UAAA,EAGzB,CAAE,GAAI,UAAW,MAAO,qBAAA,EACxB,CAAE,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,EAAAL,EAA6B,SAA1B,qBAAsB,EAAA,mBAAI,cAC5E,EAAA,GAAAK,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAL,EAAyB,SAAtB,iBAAkB,EAAA,mBAAI,KACzB,EAAA,GAAAG,EAEWgC,EAAA,CAFD,MAAM,2CAAyC,WAAC,IAE1D,CAAA,GAAA9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAF0D,mGAE1D,EAAA,CAAA,uBAGOI,EAAA2B,CAAA,GAATzB,IAAAZ,EAOI,IAPJsC,GAOI,iBAP6D,4CAE/D,EAAA,GAAAlC,EAIWgC,EAAA,CAJD,MAAM,+BAA6B,WAAC,IAI9C,CAAA,GAAA9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ8C,gOAI9C,EAAA,CAAA,uBAGFF,EAIamC,EAAA,KAAA,CAHX,QAAAC,EAAA,CAEa,CAHO,UAAAC,KAAS,CAC7BrC,EAEasC,EAAA,CAFD,KAAK,OAAO,KAAK,QAAA,aAC3B,IAA6B,EAA7B9B,IAAAO,EAA6BwB,EAAbF,CAAS,CAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"DeploymentDetailView-CP2ANsF3.js","sources":["../../src/views/DeploymentDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The detail shell: breadcrumb, tabs, and the resolve-failure banner that gates the rest.\n *\n * A deployment whose spec will not resolve is not a dead end — the fix (its variables) lives on\n * the Config tab, so this sends the operator there rather than leaving them in front of an error\n * with no control in reach. Everything else stays unavailable until it resolves, because the\n * server cannot name the stack without the variables, and every action needs the stack name.\n */\nimport { watch } from 'vue';\nimport { sentence } from '../composables/useFormat';\nimport { useRouter } from 'vue-router';\nimport { dep, isShared, loadDetail, openDeployment } from '../composables/useDeployment';\nimport {\n act,\n actionError,\n busy,\n conflict,\n conflictJobId,\n pending,\n resetActions,\n whyDisabled,\n} from '../composables/useDeploymentActions';\nimport ActionButton from '../components/ActionButton.vue';\nimport ConflictNote from '../components/ConflictNote.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst props = defineProps<{ id: string }>();\nconst router = useRouter();\n\nconst TABS = [\n { to: 'overview', label: 'Overview' },\n // Second, not buried: \"the hostname does not work\" is the most common question, and this is the\n // only tab that can answer it.\n { to: 'runtime', label: 'Containers & routes' },\n { to: 'config', label: 'Config & variables' },\n { to: 'axes', label: 'Axes' },\n { to: 'requires', label: 'Requires' },\n { to: 'logs', label: 'Logs' },\n // After Logs: a shell is what you reach for when the logs did not answer it.\n { to: 'terminal', label: 'Terminal' },\n { to: 'danger', label: 'Danger' },\n] as const;\n\nwatch(\n () => props.id,\n (id) => {\n openDeployment(id);\n // A stale \"refused\" from the previous deployment must not greet the next one.\n resetActions();\n },\n { immediate: true },\n);\n\n// Land the operator on the editor when the spec will not resolve — but only from the tab that has\n// nothing to show. Sending them away from Logs or Danger mid-read would be its own annoyance.\nwatch(\n () => dep.error,\n (err) => {\n if (err && router.currentRoute.value.name === 'd.overview') {\n void router.replace(`/deployments/${encodeURIComponent(props.id)}/config`);\n }\n },\n);\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/deployments\">← Deployments</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ id }}</h1>\n <div class=\"sub\">\n <span v-if=\"dep.detail\">\n stack <b>{{ dep.detail.stack }}</b>\n </span>\n <span v-else-if=\"dep.error\">unresolved</span>\n <span v-else>loading…</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"dep.detail\" class=\"badge\" :class=\"dep.detail.kind\">{{ sentence(dep.detail.kind) }}</span>\n <span v-if=\"dep.detail?.busy === true\" class=\"badge busy\"><span class=\"dot pulse\" />busy</span>\n <span\n v-else-if=\"dep.detail?.asleep\"\n class=\"badge asleep\"\n :title=\"`asleep since ${new Date(dep.detail.asleep.since).toLocaleString()} (${dep.detail.asleep.reason})`\"\n ><span class=\"dot\" />asleep</span\n >\n <span v-if=\"dep.detail?.orchestrator === 'swarm'\" class=\"badge\" title=\"deployed as a swarm stack\">swarm</span>\n <!--\n Deploy and Verify live HERE, on every tab — they are the product's routine actions, and they\n used to be reachable only through a tab named \"Danger\". Teardown stays there: the header\n carries what is safe to reach for, the Danger tab carries what deserves the walk.\n -->\n <!-- One flex unit, so on a narrow screen the pair wraps together instead of Verify being\n orphaned onto its own line under the title. -->\n <div v-if=\"dep.detail\" class=\"row\" style=\"flex-wrap: nowrap\">\n <RefreshButton :run=\"loadDetail\" label=\"Re-resolve\" title=\"Read this deployment again and re-run its variable substitution\" />\n <!-- Asleep: the primary action is to wake it — the same `up`, recorded as a wake. -->\n <ActionButton\n v-if=\"dep.detail.asleep\"\n variant=\"primary\"\n :pending=\"pending === 'wake'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('wake')\"\n @click=\"act('wake')\"\n >\n Wake\n </ActionButton>\n <ActionButton\n v-else\n variant=\"primary\"\n :pending=\"pending === 'up'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('up')\"\n @click=\"act('up')\"\n >\n Deploy\n </ActionButton>\n <ActionButton\n :pending=\"pending === 'verify'\"\n :disabled=\"!!pending || busy\"\n :title=\"whyDisabled('verify')\"\n @click=\"act('verify')\"\n >\n Verify\n </ActionButton>\n </div>\n </div>\n\n <ErrorNote v-if=\"actionError\" :text=\"actionError\" title=\"The action was refused.\" />\n <ConflictNote\n v-if=\"conflict\"\n :conflict=\"conflict\"\n :job-id=\"conflictJobId\"\n style=\"margin-bottom: var(--s4)\"\n />\n\n <nav class=\"tabs\" aria-label=\"Deployment sections\">\n <RouterLink\n v-for=\"t in TABS\"\n :key=\"t.to\"\n :to=\"`/deployments/${encodeURIComponent(id)}/${t.to}`\"\n >{{ t.label }}</RouterLink\n >\n </nav>\n\n <ErrorNote v-if=\"dep.error\" :text=\"dep.error\" title=\"Could not resolve this deployment.\">\n </ErrorNote>\n <p v-if=\"dep.error\" class=\"hint\">\n If that message names a variable, add it under <b>Config & variables</b> and press\n <b>Apply & reload</b>.\n <InfoHint label=\"why the rest of the page is unavailable\">\n Until the spec resolves there is no stack name, and every action on this deployment needs one.\n </InfoHint>\n </p>\n\n <p v-if=\"isShared\" class=\"hint\" style=\"margin-bottom: var(--s4)\">\n Shared with every preview on this host.\n <InfoHint label=\"what a shared deployment is\">\n A host singleton that previews borrow — a database, a queue, a registry mirror. It declares no\n axes, and tearing it down needs an explicit confirmation, because doing so destroys state\n every other deployment depends on.\n </InfoHint>\n </p>\n\n <RouterView v-slot=\"{ Component }\">\n <Transition name=\"view\" mode=\"out-in\">\n <component :is=\"Component\" />\n </Transition>\n </RouterView>\n </div>\n</template>\n"],"names":["props","__props","router","useRouter","TABS","watch","id","openDeployment","resetActions","dep","err","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_unref","_hoisted_5","_openBlock","sentence","_hoisted_8","_hoisted_10","_hoisted_11","RefreshButton","loadDetail","_createBlock","ActionButton","pending","busy","whyDisabled","act","actionError","ErrorNote","conflict","ConflictNote","conflictJobId","_hoisted_12","_Fragment","_renderList","t","_createTextVNode","_hoisted_13","InfoHint","isShared","_hoisted_14","_component_RouterView","_withCtx","Component","_Transition","_resolveDynamicComponent"],"mappings":"4pCA6BA,MAAMA,EAAQC,EACRC,EAASC,EAAA,EAETC,EAAO,CACX,CAAE,GAAI,WAAY,MAAO,UAAA,EAGzB,CAAE,GAAI,UAAW,MAAO,qBAAA,EACxB,CAAE,GAAI,SAAU,MAAO,oBAAA,EACvB,CAAE,GAAI,OAAQ,MAAO,MAAA,EACrB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GAAI,OAAQ,MAAO,MAAA,EAErB,CAAE,GAAI,WAAY,MAAO,UAAA,EACzB,CAAE,GA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CAAyC,WAAC,IAE1D,CAAA,GAAA9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAF0D,mGAE1D,EAAA,CAAA,uBAGOI,EAAA2B,CAAA,GAATzB,IAAAZ,EAOI,IAPJsC,GAOI,iBAP6D,4CAE/D,EAAA,GAAAlC,EAIWgC,EAAA,CAJD,MAAM,+BAA6B,WAAC,IAI9C,CAAA,GAAA9B,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAJ8C,gOAI9C,EAAA,CAAA,uBAGFF,EAIamC,EAAA,KAAA,CAHX,QAAAC,EAAA,CAEa,CAHO,UAAAC,KAAS,CAC7BrC,EAEasC,EAAA,CAFD,KAAK,OAAO,KAAK,QAAA,aAC3B,IAA6B,EAA7B9B,IAAAO,EAA6BwB,EAAbF,CAAS,CAAA,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as x,o as l,c as n,a as s,f as o,t as i,u as r,B as g,e as d,J as V,w as c,i as _,v as B,g as h,L as N,A as m,z as R,F as b,r as $,j as f,k as C,l as D,D as U,E as A,M as I}from"./index-
|
|
2
|
-
//# sourceMappingURL=DeploymentsView-
|
|
1
|
+
import{d as x,o as l,c as n,a as s,f as o,t as i,u as r,B as g,e as d,J as V,w as c,i as _,v as B,g as h,L as N,A as m,z as R,F as b,r as $,j as f,k as C,l as D,D as U,E as A,M as I}from"./index-BzdU0RNE.js";import{_ as q}from"./SkeletonList.vue_vue_type_script_setup_true_lang-DMvuIcZF.js";import{_ as z}from"./RelativeTime.vue_vue_type_script_setup_true_lang-ze6IGxQV.js";import{_ as E}from"./SelectMenu.vue_vue_type_script_setup_true_lang-JY8m6tfk.js";import{_ as M}from"./RefreshButton.vue_vue_type_script_setup_true_lang-C5aXqJdu.js";import"./Teleport-DwPgOPS3.js";const F={key:0,class:"badge busy",title:"a job is running on this stack, or waiting its turn — open Jobs to see which"},T=["title"],j={key:2,class:"badge ok"},J={key:3,class:"badge unknown",title:"the server could not determine this — it is not the same as idle"},K={key:4,class:"badge"},G=x({__name:"RunStateBadge",props:{busy:{type:[Boolean,null]},running:{type:[Boolean,null]},asleep:{}},setup(u){return(y,a)=>u.busy===!0?(l(),n("span",F,[...a[0]||(a[0]=[s("span",{class:"dot pulse"},null,-1),o("Busy",-1)])])):u.asleep?(l(),n("span",{key:1,class:"badge asleep",title:`asleep since ${new Date(u.asleep.since).toLocaleString()} (${u.asleep.reason}) — a request to its hostname wakes it`},[...a[1]||(a[1]=[s("span",{class:"dot"},null,-1),o("Asleep",-1)])],8,T)):u.running===!0?(l(),n("span",j,[...a[2]||(a[2]=[s("span",{class:"dot"},null,-1),o("Running",-1)])])):u.busy===null||u.running===null?(l(),n("span",J,"Unknown")):(l(),n("span",K,"Idle"))}}),H={class:"page-head"},O={class:"sub"},P={class:"panel"},Q={class:"phead"},W={class:"searchbox"},X={key:0},Y={class:"check"},Z={key:0,class:"s-failed"},ee={class:"cards"},se={class:"stagger"},te={"data-label":"id"},le={key:0,class:"mute",style:{"font-size":"var(--t-xs)"}},ne={"data-label":"kind"},oe={class:"name dim","data-label":"stack"},ae={key:0},ie={key:1,class:"badge warn",title:"the spec could not be resolved without variables"},re={"data-label":"state"},ue={class:"dim nowrap","data-label":"updated"},de={key:0},pe={colspan:"5",class:"mute"},me={class:"mono"},he=x({__name:"DeploymentsView",setup(u){const y=f(""),a=f("all"),v=f(!1),w=C(()=>{const p=y.value.trim().toLowerCase();return m.deployments.filter(e=>a.value!=="all"&&e.kind!==a.value||v.value&&!(e.running===!0||e.busy===!0||e.asleep)?!1:p?e.id.toLowerCase().includes(p)||(e.stack??"").toLowerCase().includes(p)||(e.specName??"").toLowerCase().includes(p):!0)}),L=C(()=>m.deployments.filter(p=>p.unresolved));return(p,e)=>{const k=D("RouterLink");return l(),n("div",null,[s("div",H,[s("div",null,[e[3]||(e[3]=s("h1",null,"Deployments",-1)),s("div",O,i(r(g).total)+" submitted · "+i(r(g).running)+" running · "+i(r(g).busy)+" busy ",1)]),e[5]||(e[5]=s("span",{class:"grow"},null,-1)),d(M,{run:r(V)},null,8,["run"]),d(k,{to:"/submit",class:"btn"},{default:c(()=>[...e[4]||(e[4]=[o("+ Submit",-1)])]),_:1})]),s("section",P,[s("div",Q,[s("div",W,[e[6]||(e[6]=s("svg",{viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},[s("circle",{cx:"11",cy:"11",r:"7",fill:"none",stroke:"currentColor","stroke-width":"2"}),s("path",{d:"M16.5 16.5 21 21",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),_(s("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=t=>y.value=t),"data-search":"",type:"search","aria-label":"Search deployments",placeholder:"Search by id, stack or spec",spellcheck:"false"},null,512),[[B,y.value]]),y.value?h("",!0):(l(),n("kbd",X,"/"))]),d(E,{modelValue:a.value,"onUpdate:modelValue":e[1]||(e[1]=t=>a.value=t),label:"Filter by kind",options:[{value:"all",label:"All kinds"},{value:"isolated",label:"Isolated"},{value:"shared",label:"Shared"}]},null,8,["modelValue"]),s("label",Y,[_(s("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>v.value=t),type:"checkbox"},null,512),[[N,v.value]]),e[7]||(e[7]=o(" Running or busy only ",-1))])]),r(m).deploymentsError?(l(),n("p",Z,i(r(m).deploymentsError),1)):r(m).deploymentsLoaded?(l(),n(b,{key:2},[s("table",ee,[e[11]||(e[11]=s("thead",null,[s("tr",null,[s("th",null,"ID"),s("th",null,"Kind"),s("th",null,"Stack"),s("th",null,"State"),s("th",null,"Updated")])],-1)),s("tbody",se,[(l(!0),n(b,null,$(w.value,(t,S)=>(l(),n("tr",{key:t.id,style:U({"--i":S})},[s("td",te,[d(k,{to:`/deployments/${encodeURIComponent(t.id)}`},{default:c(()=>[o(i(t.id),1)]),_:2},1032,["to"]),t.specName?(l(),n("div",le," spec: "+i(t.specName),1)):h("",!0)]),s("td",ne,[s("span",{class:A(["badge",t.kind])},i(r(I)(t.kind)),3)]),s("td",oe,[t.stack?(l(),n("span",ae,i(t.stack),1)):(l(),n("span",ie," needs variables "))]),s("td",re,[d(G,{busy:t.busy,running:t.running,asleep:t.asleep},null,8,["busy","running","asleep"])]),s("td",ue,[d(z,{at:t.updatedAt},null,8,["at"])])],4))),128)),w.value.length?h("",!0):(l(),n("tr",de,[s("td",pe,[r(m).deployments.length?(l(),n(b,{key:0},[o(" Nothing matches this filter. ")],64)):(l(),n(b,{key:1},[e[9]||(e[9]=o(" Nothing submitted yet — ",-1)),d(k,{to:"/submit"},{default:c(()=>[...e[8]||(e[8]=[o("submit a spec",-1)])]),_:1}),e[10]||(e[10]=o(" to put a deployment in the registry. ",-1))],64))])]))])]),(l(!0),n(b,null,$(L.value,t=>(l(),n("div",{key:`u-${t.id}`,class:"banner warn"},[s("b",null,i(t.id),1),e[19]||(e[19]=o(" could not be resolved: ",-1)),s("span",me,i(t.unresolved),1),s("p",null,[e[13]||(e[13]=o(" This listing resolves every spec with the ",-1)),e[14]||(e[14]=s("em",null,"same",-1)),e[15]||(e[15]=o(" (empty) request variables, so a spec with a ",-1)),e[16]||(e[16]=s("code",null,"${VAR}",-1)),e[17]||(e[17]=o(" the server does not already hold will always appear here. ",-1)),d(k,{to:`/deployments/${encodeURIComponent(t.id)}/config`},{default:c(()=>[...e[12]||(e[12]=[o(" Set its variables ",-1)])]),_:1},8,["to"]),e[18]||(e[18]=o(" and the detail view will resolve. ",-1))])]))),128))],64)):(l(),R(q,{key:1,rows:4,tall:""}))])])}}});export{he as default};
|
|
2
|
+
//# sourceMappingURL=DeploymentsView-CXQxjAem.js.map
|