@samyx/preview-stacks-ui 0.25.2 → 0.27.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-D5wrEmB2.js → ActionButton.vue_vue_type_script_setup_true_lang-B0qf7_XI.js} +2 -2
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-D5wrEmB2.js.map → ActionButton.vue_vue_type_script_setup_true_lang-B0qf7_XI.js.map} +1 -1
- package/dist/assets/{AxesTab-DPb0krkI.js → AxesTab-BxVd_LDI.js} +2 -2
- package/dist/assets/{AxesTab-DPb0krkI.js.map → AxesTab-BxVd_LDI.js.map} +1 -1
- package/dist/assets/{ConfigTab-DLhjDiis.js → ConfigTab-DSHTlGAK.js} +2 -2
- package/dist/assets/{ConfigTab-DLhjDiis.js.map → ConfigTab-DSHTlGAK.js.map} +1 -1
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-R1IfGYYT.js +2 -0
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-R1IfGYYT.js.map +1 -0
- package/dist/assets/DangerTab-BZ5e4YGe.js +2 -0
- package/dist/assets/DangerTab-BZ5e4YGe.js.map +1 -0
- package/dist/assets/{DashboardView-DxZUkxRF.js → DashboardView-TYfDe8IH.js} +2 -2
- package/dist/assets/{DashboardView-DxZUkxRF.js.map → DashboardView-TYfDe8IH.js.map} +1 -1
- package/dist/assets/DeploymentDetailView-RSDMb2tC.js +2 -0
- package/dist/assets/DeploymentDetailView-RSDMb2tC.js.map +1 -0
- package/dist/assets/DeploymentsView-DYAPYBih.js +2 -0
- package/dist/assets/DeploymentsView-DYAPYBih.js.map +1 -0
- package/dist/assets/{EquivalentCommand-C45BzkNz.js → EquivalentCommand-GFG6rkn5.js} +3 -3
- package/dist/assets/{EquivalentCommand-C45BzkNz.js.map → EquivalentCommand-GFG6rkn5.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-B3hfwyPR.js → ErrorNote.vue_vue_type_script_setup_true_lang-DNaY6OBe.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-B3hfwyPR.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DNaY6OBe.js.map} +1 -1
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-DEjnzS2A.js +2 -0
- package/dist/assets/{HelpModal.vue_vue_type_script_setup_true_lang-BSOuxyyP.js.map → HelpModal.vue_vue_type_script_setup_true_lang-DEjnzS2A.js.map} +1 -1
- package/dist/assets/JobDetailView-DvFGqRQj.js +2 -0
- package/dist/assets/{JobDetailView-HFOJln2b.js.map → JobDetailView-DvFGqRQj.js.map} +1 -1
- package/dist/assets/{JobsView-dWw_uNGE.js → JobsView-C-rxx15K.js} +2 -2
- package/dist/assets/{JobsView-dWw_uNGE.js.map → JobsView-C-rxx15K.js.map} +1 -1
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-5r84oNls.js → LogViewer.vue_vue_type_script_setup_true_lang-6CJlo0ox.js} +3 -3
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-5r84oNls.js.map → LogViewer.vue_vue_type_script_setup_true_lang-6CJlo0ox.js.map} +1 -1
- package/dist/assets/LoginView-CAXL0Xhr.js +2 -0
- package/dist/assets/LoginView-CAXL0Xhr.js.map +1 -0
- package/dist/assets/LoginView-Djedwklv.css +1 -0
- package/dist/assets/LogsTab-Bzz4JBQM.js +6 -0
- package/dist/assets/LogsTab-Bzz4JBQM.js.map +1 -0
- package/dist/assets/{NotFoundView-jZIc0wDm.js → NotFoundView-BRn9Jn4H.js} +2 -2
- package/dist/assets/{NotFoundView-jZIc0wDm.js.map → NotFoundView-BRn9Jn4H.js.map} +1 -1
- package/dist/assets/{NotifiersView-DJu-c-a6.js → NotifiersView-Bd13G-1b.js} +2 -2
- package/dist/assets/{NotifiersView-DJu-c-a6.js.map → NotifiersView-Bd13G-1b.js.map} +1 -1
- package/dist/assets/OverviewTab-Ae5-H5DV.js +2 -0
- package/dist/assets/OverviewTab-Ae5-H5DV.js.map +1 -0
- package/dist/assets/PublicLogsView-BAe90EbI.css +1 -0
- package/dist/assets/PublicLogsView-DvCE0GT1.js +4 -0
- package/dist/assets/PublicLogsView-DvCE0GT1.js.map +1 -0
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-CXCY3Vlc.js → RefreshButton.vue_vue_type_script_setup_true_lang-DpeOKN8U.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-CXCY3Vlc.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-DpeOKN8U.js.map} +1 -1
- package/dist/assets/RegistriesView-ZRRfxVTX.js +2 -0
- package/dist/assets/{RegistriesView-BeiFx468.js.map → RegistriesView-ZRRfxVTX.js.map} +1 -1
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-BGissyps.js → RelativeTime.vue_vue_type_script_setup_true_lang-Dm9XnXF7.js} +2 -2
- package/dist/assets/{RelativeTime.vue_vue_type_script_setup_true_lang-BGissyps.js.map → RelativeTime.vue_vue_type_script_setup_true_lang-Dm9XnXF7.js.map} +1 -1
- package/dist/assets/{RequiresTab-Bb3_lYqC.js → RequiresTab-CLfNJHOh.js} +2 -2
- package/dist/assets/{RequiresTab-Bb3_lYqC.js.map → RequiresTab-CLfNJHOh.js.map} +1 -1
- package/dist/assets/{RoutingView-y8L_ex2z.js → RoutingView-BCsr0bjm.js} +3 -3
- package/dist/assets/{RoutingView-y8L_ex2z.js.map → RoutingView-BCsr0bjm.js.map} +1 -1
- package/dist/assets/RuntimeTab-CeJS5wuv.js +2 -0
- package/dist/assets/RuntimeTab-CeJS5wuv.js.map +1 -0
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-BLfPhhAj.js +2 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-D8NGgBfa.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-BLfPhhAj.js.map} +1 -1
- package/dist/assets/{SettingsView-C-xJVgVw.js → SettingsView-Bo-SQP0q.js} +2 -2
- package/dist/assets/{SettingsView-C-xJVgVw.js.map → SettingsView-Bo-SQP0q.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-qMyLRAMp.js → SkeletonList.vue_vue_type_script_setup_true_lang-DjfNq2KM.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-qMyLRAMp.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-DjfNq2KM.js.map} +1 -1
- package/dist/assets/SpecDetailView-C68gpDhO.js +2 -0
- package/dist/assets/{SpecDetailView-CGQZS7NU.js.map → SpecDetailView-C68gpDhO.js.map} +1 -1
- package/dist/assets/{SpecsView-D9mKql2j.js → SpecsView-mr3zSd-0.js} +2 -2
- package/dist/assets/{SpecsView-D9mKql2j.js.map → SpecsView-mr3zSd-0.js.map} +1 -1
- package/dist/assets/SsoView-D2yf-noE.js +2 -0
- package/dist/assets/SsoView-D2yf-noE.js.map +1 -0
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-BgbZLzlL.js → StateBadge.vue_vue_type_script_setup_true_lang-BqldkWlT.js} +2 -2
- package/dist/assets/{StateBadge.vue_vue_type_script_setup_true_lang-BgbZLzlL.js.map → StateBadge.vue_vue_type_script_setup_true_lang-BqldkWlT.js.map} +1 -1
- package/dist/assets/{SubmitView-DuGtFMgF.js → SubmitView-Cdxo6Chq.js} +5 -5
- package/dist/assets/{SubmitView-DuGtFMgF.js.map → SubmitView-Cdxo6Chq.js.map} +1 -1
- package/dist/assets/SwarmView-DVKI5lNe.js +2 -0
- package/dist/assets/SwarmView-DVKI5lNe.js.map +1 -0
- package/dist/assets/Teleport-BUn4ayOo.js +4 -0
- package/dist/assets/{Teleport-DfE2iP8c.js.map → Teleport-BUn4ayOo.js.map} +1 -1
- package/dist/assets/TerminalTab-BRumgZMI.js +3 -0
- package/dist/assets/{TerminalTab-D5ncE4Cv.js.map → TerminalTab-BRumgZMI.js.map} +1 -1
- package/dist/assets/{UsersView-BxU2ho4N.js → UsersView-B7C2Bc3R.js} +2 -2
- package/dist/assets/{UsersView-BxU2ho4N.js.map → UsersView-B7C2Bc3R.js.map} +1 -1
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-SKwJUsNC.js → VarEditor.vue_vue_type_script_setup_true_lang-CyOlKVt5.js} +2 -2
- package/dist/assets/{VarEditor.vue_vue_type_script_setup_true_lang-SKwJUsNC.js.map → VarEditor.vue_vue_type_script_setup_true_lang-CyOlKVt5.js.map} +1 -1
- package/dist/assets/{VariablesView-BnW2I-92.js → VariablesView-UCBhNd_o.js} +2 -2
- package/dist/assets/{VariablesView-BnW2I-92.js.map → VariablesView-UCBhNd_o.js.map} +1 -1
- package/dist/assets/index-9Ra4jfL4.js +149 -0
- package/dist/assets/index-9Ra4jfL4.js.map +1 -0
- package/dist/assets/index-B_k9b7xG.css +1 -0
- package/dist/assets/useDeployment-DFOIiXrd.js +2 -0
- package/dist/assets/useDeployment-DFOIiXrd.js.map +1 -0
- package/dist/assets/useFormat-DIlTY5Dl.js +2 -0
- package/dist/assets/useFormat-DIlTY5Dl.js.map +1 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-HglPeTkY.js +0 -2
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-HglPeTkY.js.map +0 -1
- package/dist/assets/DangerTab-BLDIlbN5.js +0 -2
- package/dist/assets/DangerTab-BLDIlbN5.js.map +0 -1
- package/dist/assets/DeploymentDetailView-CEg8sA5I.js +0 -2
- package/dist/assets/DeploymentDetailView-CEg8sA5I.js.map +0 -1
- package/dist/assets/DeploymentsView-BfhwFiiQ.js +0 -2
- package/dist/assets/DeploymentsView-BfhwFiiQ.js.map +0 -1
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-BSOuxyyP.js +0 -2
- package/dist/assets/JobDetailView-HFOJln2b.js +0 -2
- package/dist/assets/LoginView-0vIrAhlr.js +0 -2
- package/dist/assets/LoginView-0vIrAhlr.js.map +0 -1
- package/dist/assets/LoginView-BFIG7vGw.css +0 -1
- package/dist/assets/LogsTab-CFlgBsW3.js +0 -6
- package/dist/assets/LogsTab-CFlgBsW3.js.map +0 -1
- package/dist/assets/OverviewTab-DlJt0MIg.js +0 -2
- package/dist/assets/OverviewTab-DlJt0MIg.js.map +0 -1
- package/dist/assets/RegistriesView-BeiFx468.js +0 -2
- package/dist/assets/RuntimeTab-DWZ5eFho.js +0 -2
- package/dist/assets/RuntimeTab-DWZ5eFho.js.map +0 -1
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-D8NGgBfa.js +0 -2
- package/dist/assets/SpecDetailView-CGQZS7NU.js +0 -2
- package/dist/assets/Teleport-DfE2iP8c.js +0 -4
- package/dist/assets/TerminalTab-D5ncE4Cv.js +0 -3
- package/dist/assets/index-DVMQBHXF.js +0 -139
- package/dist/assets/index-DVMQBHXF.js.map +0 -1
- package/dist/assets/index-lyuEu6lW.css +0 -1
- package/dist/assets/useDeployment-DGzBsXE-.js +0 -2
- package/dist/assets/useDeployment-DGzBsXE-.js.map +0 -1
- package/dist/assets/useFormat-DVXTfIS-.js +0 -2
- package/dist/assets/useFormat-DVXTfIS-.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as y,c as o,a as t,f as r,e as l,w as _,_ as w,u as n,H as g,i as x,v as C,g as f,
|
|
2
|
-
//# sourceMappingURL=JobsView-
|
|
1
|
+
import{d as y,c as o,a as t,f as r,e as l,w as _,_ as w,u as n,H as g,i as x,v as C,g as f,A as i,t as d,z as V,F as h,y as L,r as k,j as S,o as a,D as $,k as A}from"./index-9Ra4jfL4.js";import{a as N,t as B}from"./useFormat-DIlTY5Dl.js";import{_ as R}from"./StateBadge.vue_vue_type_script_setup_true_lang-BqldkWlT.js";import{_ as F}from"./SkeletonList.vue_vue_type_script_setup_true_lang-DjfNq2KM.js";import{_ as T}from"./RelativeTime.vue_vue_type_script_setup_true_lang-Dm9XnXF7.js";import{_ as U}from"./SelectMenu.vue_vue_type_script_setup_true_lang-BLfPhhAj.js";import{_ as D}from"./RefreshButton.vue_vue_type_script_setup_true_lang-DpeOKN8U.js";import"./Teleport-BUn4ayOo.js";const E={class:"page-head"},J={class:"sub"},M={class:"panel"},j={class:"phead"},q={class:"searchbox"},z={key:0},I={key:0,class:"s-failed"},H={key:2,class:"cards"},O={class:"stagger"},G={"data-label":"state"},K={"data-label":"action"},P={class:"name","data-label":"stack"},Q={class:"dim nowrap","data-label":"started"},W={class:"dim nowrap","data-label":"took"},X={class:"dim","data-label":"steps"},Y={key:0},Z={colspan:"6",class:"mute"},dt=y({__name:"JobsView",setup(tt){const u=k(""),c=k("all"),p=S(()=>{const m=u.value.trim().toLowerCase();return i.jobs.filter(e=>c.value!=="all"&&e.state!==c.value?!1:m?e.stack.toLowerCase().includes(m)||e.action.includes(m):!0)});return(m,e)=>{const b=A("RouterLink");return a(),o("div",null,[t("div",E,[t("div",null,[e[4]||(e[4]=t("h1",null,"Jobs",-1)),t("div",J,[e[3]||(e[3]=r(" Most recent first, capped at the last 50 ",-1)),l(w,{label:"why old jobs disappear"},{default:_(()=>[...e[2]||(e[2]=[r(" The history is held in memory and a server restart clears it. A job record is the transcript of an attempt, not the truth about what exists — that truth lives in the containers themselves and in each axis's own probe. ",-1)])]),_:1})])]),e[5]||(e[5]=t("span",{class:"grow"},null,-1)),l(D,{run:n(g)},null,8,["run"])]),t("section",M,[t("div",j,[t("div",q,[e[6]||(e[6]=t("svg",{viewBox:"0 0 24 24",width:"15",height:"15","aria-hidden":"true"},[t("circle",{cx:"11",cy:"11",r:"7",fill:"none",stroke:"currentColor","stroke-width":"2"}),t("path",{d:"M16.5 16.5 21 21",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})],-1)),x(t("input",{id:"jq","onUpdate:modelValue":e[0]||(e[0]=s=>u.value=s),"data-search":"",type:"search","aria-label":"Search jobs",placeholder:"Search by stack or action",spellcheck:"false"},null,512),[[C,u.value]]),u.value?f("",!0):(a(),o("kbd",z,"/"))]),l(U,{id:"js",modelValue:c.value,"onUpdate:modelValue":e[1]||(e[1]=s=>c.value=s),label:"Filter by state",options:[{value:"all",label:"All states"},{value:"running",label:"Running"},{value:"ok",label:"Ok"},{value:"leaked",label:"Leaked"},{value:"failed",label:"Failed"}]},null,8,["modelValue"])]),n(i).jobsError?(a(),o("p",I,d(n(i).jobsError),1)):n(i).jobsLoaded?(a(),o("table",H,[e[7]||(e[7]=t("thead",null,[t("tr",null,[t("th",null,"State"),t("th",null,"Action"),t("th",null,"Stack"),t("th",null,"Started"),t("th",null,"Took"),t("th",null,"Steps")])],-1)),t("tbody",O,[(a(!0),o(h,null,L(p.value,(s,v)=>(a(),o("tr",{key:s.id,style:$({"--i":v})},[t("td",G,[l(b,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:_(()=>[l(R,{state:s.state},null,8,["state"])]),_:2},1032,["to"])]),t("td",K,d(n(N)(s.action)),1),t("td",P,[l(b,{to:`/jobs/${encodeURIComponent(s.id)}`},{default:_(()=>[r(d(s.stack),1)]),_:2},1032,["to"])]),t("td",Q,[l(T,{at:s.startedAt},null,8,["at"])]),t("td",W,d(n(B)(s.startedAt,s.endedAt)),1),t("td",X,d(s.outcome?s.outcome.steps.length:"—"),1)],4))),128)),p.value.length?f("",!0):(a(),o("tr",Y,[t("td",Z,[n(i).jobs.length?(a(),o(h,{key:0},[r("Nothing matches this filter.")],64)):(a(),o(h,{key:1},[r("No jobs recorded.")],64))])]))])])):(a(),V(F,{key:1,rows:5}))])])}}});export{dt as default};
|
|
2
|
+
//# sourceMappingURL=JobsView-C-rxx15K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JobsView-
|
|
1
|
+
{"version":3,"file":"JobsView-C-rxx15K.js","sources":["../../src/views/JobsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/** Job history. Polled by the shell already, so this view only filters what is in memory. */\nimport { computed, ref } from 'vue';\nimport { loadJobs, state } from '../composables/useControlPlane';\nimport { actionLabel, took } from '../composables/useFormat';\nimport StateBadge from '../components/StateBadge.vue';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport type { JobState } from '../api/types';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst q = ref('');\nconst only = ref<'all' | JobState>('all');\n\nconst rows = computed(() => {\n const needle = q.value.trim().toLowerCase();\n return state.jobs.filter((j) => {\n if (only.value !== 'all' && j.state !== only.value) return false;\n if (!needle) return true;\n return j.stack.toLowerCase().includes(needle) || j.action.includes(needle);\n });\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Jobs</h1>\n <div class=\"sub\">\n Most recent first, capped at the last 50\n <InfoHint label=\"why old jobs disappear\">\n The history is held in memory and a server restart clears it. A job record is the\n transcript of an attempt, not the truth about what exists — that truth lives in the\n containers themselves and in each axis's own probe.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"loadJobs\" />\n </div>\n\n <section class=\"panel\">\n <!-- Same one-row toolbar as Deployments — this page had kept the old stacked-label layout,\n and two list pages with two different toolbars reads as two different products. -->\n <div class=\"phead\">\n <div class=\"searchbox\">\n <svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" aria-hidden=\"true\">\n <circle cx=\"11\" cy=\"11\" r=\"7\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" />\n <path d=\"M16.5 16.5 21 21\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" />\n </svg>\n <input\n id=\"jq\"\n v-model=\"q\"\n data-search\n type=\"search\"\n aria-label=\"Search jobs\"\n placeholder=\"Search by stack or action\"\n spellcheck=\"false\"\n />\n <kbd v-if=\"!q\">/</kbd>\n </div>\n <SelectMenu\n id=\"js\"\n v-model=\"only\"\n label=\"Filter by state\"\n :options=\"[\n { value: 'all', label: 'All states' },\n { value: 'running', label: 'Running' },\n { value: 'ok', label: 'Ok' },\n { value: 'leaked', label: 'Leaked' },\n { value: 'failed', label: 'Failed' },\n ]\"\n />\n </div>\n\n <p v-if=\"state.jobsError\" class=\"s-failed\">{{ state.jobsError }}</p>\n <SkeletonList v-else-if=\"!state.jobsLoaded\" :rows=\"5\" />\n\n <table v-else class=\"cards\">\n <thead>\n <tr>\n <th>State</th>\n <th>Action</th>\n <th>Stack</th>\n <th>Started</th>\n <th>Took</th>\n <th>Steps</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(j, i) in rows\" :key=\"j.id\" :style=\"{ '--i': i }\">\n <td data-label=\"state\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">\n <StateBadge :state=\"j.state\" />\n </RouterLink>\n </td>\n <td data-label=\"action\">{{ actionLabel(j.action) }}</td>\n <td class=\"name\" data-label=\"stack\">\n <RouterLink :to=\"`/jobs/${encodeURIComponent(j.id)}`\">{{ j.stack }}</RouterLink>\n </td>\n <td class=\"dim nowrap\" data-label=\"started\"><RelativeTime :at=\"j.startedAt\" /></td>\n <td class=\"dim nowrap\" data-label=\"took\">{{ took(j.startedAt, j.endedAt) }}</td>\n <td class=\"dim\" data-label=\"steps\">{{ j.outcome ? j.outcome.steps.length : '—' }}</td>\n </tr>\n <tr v-if=\"!rows.length\">\n <td colspan=\"6\" class=\"mute\">\n <template v-if=\"state.jobs.length\">Nothing matches this filter.</template>\n <template v-else>No jobs recorded.</template>\n </td>\n </tr>\n </tbody>\n </table>\n </section>\n </div>\n</template>\n"],"names":["q","ref","only","rows","computed","needle","state","j","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","RefreshButton","_unref","loadJobs","_hoisted_3","_hoisted_4","_hoisted_5","$event","_openBlock","SelectMenu","_hoisted_7","_toDisplayString","_hoisted_8","_hoisted_9","_Fragment","_renderList","i","_hoisted_10","_component_RouterLink","StateBadge","_hoisted_11","_hoisted_12","_createTextVNode","_hoisted_13","RelativeTime","_hoisted_14","took","_hoisted_15","_hoisted_16","_hoisted_17","_createBlock","SkeletonList"],"mappings":"goCAaA,MAAMA,EAAIC,EAAI,EAAE,EACVC,EAAOD,EAAsB,KAAK,EAElCE,EAAOC,EAAS,IAAM,CAC1B,MAAMC,EAASL,EAAE,MAAM,KAAA,EAAO,YAAA,EAC9B,OAAOM,EAAM,KAAK,OAAQC,GACpBL,EAAK,QAAU,OAASK,EAAE,QAAUL,EAAK,MAAc,GACtDG,EACEE,EAAE,MAAM,YAAA,EAAc,SAASF,CAAM,GAAKE,EAAE,OAAO,SAASF,CAAM,EADrD,EAErB,CACH,CAAC,mDAICG,EAyFM,MAAA,KAAA,CAxFJC,EAcM,MAdNC,EAcM,CAbJD,EAUM,MAAA,KAAA,CATJE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAAa,UAAT,OAAI,EAAA,GACRA,EAOM,MAPNG,EAOM,eAPW,6CAEf,EAAA,GAAAC,EAIWC,EAAA,CAJD,MAAM,0BAAwB,WAAC,IAIzC,CAAA,GAAAH,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAJyC,8NAIzC,EAAA,CAAA,2BAGJF,EAAqB,OAAA,CAAf,MAAM,MAAA,EAAM,KAAA,EAAA,GAClBI,EAAiCE,EAAA,CAAjB,IAAKC,EAAAC,CAAA,CAAA,EAAQ,KAAA,EAAA,CAAA,KAAA,CAAA,CAAA,GAG/BR,EAuEU,UAvEVS,EAuEU,CApERT,EA6BM,MA7BNU,EA6BM,CA5BJV,EAeM,MAfNW,EAeM,aAdJX,EAGM,MAAA,CAHD,QAAQ,YAAY,MAAM,KAAK,OAAO,KAAK,cAAY,MAAA,GAC1DA,EAAmF,SAAA,CAA3E,GAAG,KAAK,GAAG,KAAK,EAAE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MAAM,CAAA,EAAA,CAAA,EAC/CE,EAEK,KAFL0B,EAEK,CADHtB,EAAgFmB,EAAA,CAAnE,GAAE,SAAW,mBAAmBzB,EAAE,EAAE,CAAA,EAAA,aAAK,IAAa,CAAV6B,EAAAX,EAAAlB,EAAE,KAAK,EAAA,CAAA,CAAA,uBAElEE,EAAmF,KAAnF4B,EAAmF,CAAvCxB,EAAkCyB,EAAA,CAAnB,GAAI/B,EAAE,SAAA,mBACjEE,EAAgF,KAAhF8B,EAAgFd,EAApCT,EAAAwB,CAAA,EAAKjC,EAAE,UAAWA,EAAE,OAAO,CAAA,EAAA,CAAA,EACvEE,EAAsF,KAAtFgC,EAAsFhB,EAAhDlB,EAAE,QAAUA,EAAE,QAAQ,MAAM,OAAM,GAAA,EAAA,CAAA,CAAA,aAE/DJ,EAAA,MAAK,qBAAhBK,EAKK,KAAAkC,EAAA,CAJHjC,EAGK,KAHLkC,EAGK,CAFa3B,EAAAV,CAAA,EAAM,KAAK,YAA3BE,EAA0EoB,EAAA,CAAA,IAAA,CAAA,EAAA,GAAvC,8BAA4B,CAAA,YAC/DpB,EAA6CoB,EAAA,CAAA,IAAA,GAAA,GAA5B,mBAAiB,CAAA,sBA/B1CgB,EAAwDC,EAAA,OAAX,KAAM,CAAA"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as x,J as b,
|
|
2
|
-
`);try{await navigator.clipboard.writeText(t),g("ok","Copied.")}catch{g("error","Could not copy — your browser blocked clipboard access.")}}const p=V(()=>r.rows.filter(t=>!t.separator).length);return T(()=>{}),(t,o)=>(l(),s("div",
|
|
3
|
-
//# sourceMappingURL=LogViewer.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as x,J as b,K as _,M as T,c as s,a,t as n,f as C,g as c,$ as B,F as m,y as N,r as y,a0 as S,O as g,j as V,o as l,E as j}from"./index-9Ra4jfL4.js";const F={class:"lv"},H={class:"lv-bar"},E={class:"lv-count"},L={key:0,class:"badge running"},M=["disabled"],$={key:0,class:"lv-empty"},z={key:0,class:"lv-sep"},D=["title"],J=["title"],K={class:"lv-msg"},P=x({__name:"LogViewer",props:{rows:{},live:{type:Boolean},copyText:{},emptyText:{}},setup(i){const r=i,d=y(null),u=y(!0);function f(){const t=d.value;return!!t&&t.scrollHeight-t.scrollTop-t.clientHeight<24}function k(){u.value=f()}async function v(){await S();const t=d.value;t&&u.value&&(t.scrollTop=t.scrollHeight)}b(()=>r.rows.length,v),_(v);function h(){u.value=!0,v()}async function w(){const t=r.copyText??r.rows.filter(o=>!o.separator).map(o=>[o.time,o.gutter,o.text].filter(Boolean).join(" ")).join(`
|
|
2
|
+
`);try{await navigator.clipboard.writeText(t),g("ok","Copied.")}catch{g("error","Could not copy — your browser blocked clipboard access.")}}const p=V(()=>r.rows.filter(t=>!t.separator).length);return T(()=>{}),(t,o)=>(l(),s("div",F,[a("div",H,[a("span",E,n(p.value)+" line"+n(p.value===1?"":"s"),1),i.live?(l(),s("span",L,[...o[0]||(o[0]=[a("span",{class:"dot pulse"},null,-1),C("live",-1)])])):c("",!0),o[1]||(o[1]=a("span",{class:"grow"},null,-1)),i.live&&!u.value?(l(),s("button",{key:1,class:"ghost sm",onClick:h},"↓ Follow")):c("",!0),a("button",{class:"ghost sm",disabled:!p.value,onClick:w},"Copy",8,M),B(t.$slots,"actions")]),a("div",{ref_key:"box",ref:d,class:"lv-box",role:"log","aria-live":"polite",onScrollPassive:k},[i.rows.length?c("",!0):(l(),s("p",$,n(i.emptyText??"No output."),1)),(l(!0),s(m,null,N(i.rows,e=>(l(),s(m,{key:e.key},[e.separator?(l(),s("div",z,[a("span",null,n(e.text),1)])):(l(),s("div",{key:1,class:j(["lv-row",e.tone])},[e.time!==void 0?(l(),s("span",{key:0,class:"lv-time",title:e.timeTitle},n(e.time),9,D)):c("",!0),e.gutter!==void 0?(l(),s("span",{key:1,class:"lv-gutter",title:e.gutterTitle},n(e.gutter),9,J)):c("",!0),a("span",K,n(e.text),1)],2))],64))),128))],544)]))}});export{P as _};
|
|
3
|
+
//# sourceMappingURL=LogViewer.vue_vue_type_script_setup_true_lang-6CJlo0ox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogViewer.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"LogViewer.vue_vue_type_script_setup_true_lang-6CJlo0ox.js","sources":["../../src/components/LogViewer.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The log surface — used by the job page (structured events) and the container-logs tab (raw text\n * that the parent parses into rows).\n *\n * WHY NOT A LIBRARY. There is no widely-adopted Vue log viewer to reach for (the React ones —\n * react-lazylog and friends — have no Vue counterpart with real adoption), and xterm — already a\n * dependency for the terminal — renders to canvas, so log text would stop being selectable,\n * copyable and findable with ⌘F. For LOGS those are the whole point. What a log view actually\n * needs is small: a gutter that never wraps, a message that wraps with a hanging indent, stickiness\n * at the bottom, and cheap rendering for thousands of rows (`content-visibility: auto` — the\n * browser skips layout for off-screen rows, no virtualisation library required).\n *\n * THE GUTTER IS TIME-OF-DAY, NOT A FULL TIMESTAMP. `2026-08-04 03:47:45` per line is 19 characters\n * of the same date repeated hundreds of times — on a narrow panel it wrapped every entry onto five\n * or six lines. Within one log the date almost never changes, so each row carries `03:47:45` and a\n * date SEPARATOR row appears only when the day actually flips. The full stamp survives in the\n * row's tooltip.\n *\n * FOLLOW IS A STATE THE USER CONTROLS BY SCROLLING. Pinned to the bottom, new lines keep it there;\n * one scroll up releases it (reading must never be yanked away); the \"Follow\" chip puts it back.\n */\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue';\nimport { toast } from '../composables/useToasts';\nimport type { LogRow } from './log-viewer-types';\n\nconst props = defineProps<{\n rows: LogRow[];\n /** Renders the live pulse and keeps follow meaningful; a finished log needs neither. */\n live?: boolean;\n /** What Copy puts on the clipboard — the parent knows the faithful raw form, this view does not. */\n copyText?: string;\n emptyText?: string;\n}>();\n\nconst box = ref<HTMLElement | null>(null);\nconst follow = ref(true);\n\nfunction atBottom(): boolean {\n const el = box.value;\n return !!el && el.scrollHeight - el.scrollTop - el.clientHeight < 24;\n}\n\nfunction onScroll(): void {\n // The USER moved — follow reflects where they left the viewport, with no flag juggling for\n // programmatic scrolls: after scrollTo(bottom), atBottom() is simply true.\n follow.value = atBottom();\n}\n\nasync function stick(): Promise<void> {\n await nextTick();\n const el = box.value;\n if (el && follow.value) el.scrollTop = el.scrollHeight;\n}\n\nwatch(() => props.rows.length, stick);\nonMounted(stick);\n\nfunction resume(): void {\n follow.value = true;\n void stick();\n}\n\nasync function copy(): Promise<void> {\n const text =\n props.copyText ??\n props.rows\n .filter((r) => !r.separator)\n .map((r) => [r.time, r.gutter, r.text].filter(Boolean).join(' '))\n .join('\\n');\n try {\n await navigator.clipboard.writeText(text);\n toast('ok', 'Copied.');\n } catch {\n toast('error', 'Could not copy — your browser blocked clipboard access.');\n }\n}\n\nconst count = computed(() => props.rows.filter((r) => !r.separator).length);\n\n// A page-level listener would steal browser find; scoping ⌘F to the box when it has focus would be\n// surprising. The box is plain DOM precisely so the browser's own find works — nothing to do here.\nonBeforeUnmount(() => {});\n</script>\n\n<template>\n <div class=\"lv\">\n <div class=\"lv-bar\">\n <span class=\"lv-count\">{{ count }} line{{ count === 1 ? '' : 's' }}</span>\n <span v-if=\"live\" class=\"badge running\"><span class=\"dot pulse\" />live</span>\n <span class=\"grow\" />\n <button v-if=\"live && !follow\" class=\"ghost sm\" @click=\"resume\">↓ Follow</button>\n <button class=\"ghost sm\" :disabled=\"!count\" @click=\"copy\">Copy</button>\n <slot name=\"actions\" />\n </div>\n\n <div ref=\"box\" class=\"lv-box\" role=\"log\" aria-live=\"polite\" @scroll.passive=\"onScroll\">\n <p v-if=\"!rows.length\" class=\"lv-empty\">{{ emptyText ?? 'No output.' }}</p>\n <template v-for=\"r in rows\" :key=\"r.key\">\n <div v-if=\"r.separator\" class=\"lv-sep\"><span>{{ r.text }}</span></div>\n <div v-else class=\"lv-row\" :class=\"r.tone\">\n <span v-if=\"r.time !== undefined\" class=\"lv-time\" :title=\"r.timeTitle\">{{ r.time }}</span>\n <span v-if=\"r.gutter !== undefined\" class=\"lv-gutter\" :title=\"r.gutterTitle\">{{ r.gutter }}</span>\n <span class=\"lv-msg\">{{ r.text }}</span>\n </div>\n </template>\n </div>\n </div>\n</template>\n"],"names":["props","__props","box","ref","follow","atBottom","el","onScroll","stick","nextTick","watch","onMounted","resume","copy","text","r","toast","count","computed","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_hoisted_3","_toDisplayString","_hoisted_4","_cache","_hoisted_5","_renderSlot","_ctx","_hoisted_6","_Fragment","_renderList","_hoisted_7","_normalizeClass","_hoisted_8","_hoisted_9","_hoisted_10"],"mappings":"ocA0BA,MAAMA,EAAQC,EASRC,EAAMC,EAAwB,IAAI,EAClCC,EAASD,EAAI,EAAI,EAEvB,SAASE,GAAoB,CAC3B,MAAMC,EAAKJ,EAAI,MACf,MAAO,CAAC,CAACI,GAAMA,EAAG,aAAeA,EAAG,UAAYA,EAAG,aAAe,EACpE,CAEA,SAASC,GAAiB,CAGxBH,EAAO,MAAQC,EAAA,CACjB,CAEA,eAAeG,GAAuB,CACpC,MAAMC,EAAA,EACN,MAAMH,EAAKJ,EAAI,MACXI,GAAMF,EAAO,QAAOE,EAAG,UAAYA,EAAG,aAC5C,CAEAI,EAAM,IAAMV,EAAM,KAAK,OAAQQ,CAAK,EACpCG,EAAUH,CAAK,EAEf,SAASI,GAAe,CACtBR,EAAO,MAAQ,GACVI,EAAA,CACP,CAEA,eAAeK,GAAsB,CACnC,MAAMC,EACJd,EAAM,UACNA,EAAM,KACH,OAAQe,GAAM,CAACA,EAAE,SAAS,EAC1B,IAAKA,GAAM,CAACA,EAAE,KAAMA,EAAE,OAAQA,EAAE,IAAI,EAAE,OAAO,OAAO,EAAE,KAAK,IAAI,CAAC,EAChE,KAAK;AAAA,CAAI,EACd,GAAI,CACF,MAAM,UAAU,UAAU,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AI,EAAA,CAAA,CAAA,SACtDM,EAIM,MAAA,OAJM,MAAKe,EAAA,CAAC,SAAiBrB,EAAE,IAAI,CAAA,CAAA,GAC3BA,EAAE,OAAS,YAAvBM,EAA0F,OAAA,OAAxD,MAAM,UAAW,MAAON,EAAE,SAAA,EAAcW,EAAAX,EAAE,IAAI,EAAA,EAAAsB,CAAA,YACpEtB,EAAE,SAAW,YAAzBM,EAAkG,OAAA,OAA9D,MAAM,YAAa,MAAON,EAAE,WAAA,EAAgBW,EAAAX,EAAE,MAAM,EAAA,EAAAuB,CAAA,YACxFf,EAAwC,OAAxCgB,EAAwCb,EAAhBX,EAAE,IAAI,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as E,c as i,a as t,u as v,b as f,F as _,e as o,f as s,w as l,_ as S,g as c,t as u,h as I,i as C,v as q,r as g,j as V,k as L,l as B,m as P,o as d,n as $,p as z,q as A}from"./index-9Ra4jfL4.js";import{_ as U}from"./ActionButton.vue_vue_type_script_setup_true_lang-B0qf7_XI.js";import{E as D}from"./EquivalentCommand-GFG6rkn5.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";const M={class:"login-wrap"},W={class:"login-card panel"},j={class:"banner plain",style:{"margin-top":"var(--s3)"}},O={class:"mute",style:{"margin-top":"var(--s3)"}},G={key:0,class:"banner failed",style:{"margin-top":"var(--s3)"}},H={class:"field",style:{"margin-top":"var(--s4)"}},J={class:"field"},K={key:0,class:"banner failed",style:{"margin-top":"var(--s3)"}},Q={class:"row",style:{"margin-top":"var(--s4)"}},X=E({__name:"LoginView",setup(Y){const N=B(),a=P(),p=g(""),n=g(""),r=g(!1),m=g(""),w=V(()=>typeof a.query.next=="string"&&a.query.next.startsWith("/")?a.query.next:"/"),b=V(()=>typeof a.query.sso_error=="string"?a.query.sso_error:"");function R(){window.location.assign($.url(`/api/auth/sso/start?next=${encodeURIComponent(w.value)}`))}async function k(){r.value=!0,m.value="";const y=await z(p.value.trim(),n.value);if(r.value=!1,y){m.value=y,n.value="";return}await A(),N.replace(w.value)}return(y,e)=>{var x;const T=L("RouterLink");return d(),i("div",M,[t("div",W,[e[13]||(e[13]=t("h1",{style:{"font-size":"var(--t-xl)","margin-bottom":"var(--s2)"}},"Sign in",-1)),v(f).hasUsers===!1?(d(),i(_,{key:0},[e[6]||(e[6]=t("p",{class:"dim"}," No accounts exist on this server yet — create the first one, then sign in. ",-1)),t("div",j,[e[4]||(e[4]=t("b",null,"Create the first account",-1)),e[5]||(e[5]=t("p",null," This has to be done with the host token, from a terminal — a browser has no way to prove it is allowed to claim a fresh server. ",-1)),o(D,{what:"creating the first account",method:"POST",path:"/api/auth/bootstrap",body:{username:"you",password:"…"}}),t("p",O,[e[3]||(e[3]=s(" It can also be set up ahead of time when the host is first provisioned. ",-1)),o(S,{label:"how"},{default:l(()=>[...e[2]||(e[2]=[s(" Set the admin username and password in the environment before running the setup command on the host. They are honoured only while no account exists, so they cannot overwrite one later. ",-1)])]),_:1})])])],64)):c("",!0),(x=v(f).sso)!=null&&x.enabled?(d(),i(_,{key:1},[b.value?(d(),i("div",G,[t("b",null,"Signing in with "+u(v(f).sso.label)+" did not work.",1),t("p",null,u(b.value),1)])):c("",!0),o(U,{variant:"primary",style:{width:"100%","margin-top":"var(--s4)"},onClick:R},{default:l(()=>[s(" Sign in with "+u(v(f).sso.label),1)]),_:1}),e[7]||(e[7]=t("div",{class:"row",style:{margin:"var(--s4) 0","align-items":"center",gap:"var(--s3)"}},[t("hr",{style:{flex:"1",border:"0","border-top":"1px solid var(--line)"}}),t("span",{class:"mute",style:{"font-size":"var(--t-sm)"}},"or with a local account"),t("hr",{style:{flex:"1",border:"0","border-top":"1px solid var(--line)"}})],-1))],64)):c("",!0),t("form",{onSubmit:I(k,["prevent"])},[t("div",H,[e[8]||(e[8]=t("label",{for:"u"},"Username",-1)),C(t("input",{id:"u","onUpdate:modelValue":e[0]||(e[0]=h=>p.value=h),type:"text",autocomplete:"username",spellcheck:"false"},null,512),[[q,p.value]])]),t("div",J,[e[9]||(e[9]=t("label",{for:"p"},"Password",-1)),C(t("input",{id:"p","onUpdate:modelValue":e[1]||(e[1]=h=>n.value=h),type:"password",autocomplete:"current-password"},null,512),[[q,n.value]])]),m.value?(d(),i("div",K,[t("p",null,u(m.value),1)])):c("",!0),t("div",Q,[o(U,{variant:"primary",pending:r.value,disabled:r.value||!p.value.trim()||!n.value,onClick:k},{default:l(()=>[s(u(r.value?"Signing in…":"Sign in"),1)]),_:1},8,["pending","disabled"]),e[12]||(e[12]=t("span",{class:"grow"},null,-1)),o(T,{to:"/settings",class:"mute"},{default:l(()=>[e[11]||(e[11]=s(" Use a token instead ",-1)),o(S,{label:"token access",align:"end"},{default:l(()=>[...e[10]||(e[10]=[s(" A bearer token in Settings — the machine token from ",-1),t("code",null,"pstack init",-1),s(", or a personal token from your account — authenticates every request without a session. ",-1)])]),_:1})]),_:1})])],32)])])}}}),oe=F(X,[["__scopeId","data-v-06638fa7"]]);export{oe as default};
|
|
2
|
+
//# sourceMappingURL=LoginView-CAXL0Xhr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoginView-CAXL0Xhr.js","sources":["../../src/views/LoginView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Sign in — the one page reachable without a session.\n *\n * Two states it must distinguish, because they need opposite instructions:\n * - accounts exist → the form\n * - no accounts yet → bootstrap guidance. A dead login form with no way to create the\n * account it asks for is the worst version of this page.\n *\n * A bearer token in Settings also authenticates (CI-style access); the link stays visible for\n * operators who have the machine token and no account yet.\n */\nimport { computed, ref } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { authState, checkAuth, login } from '../composables/useAuth';\nimport { api } from '../api/client';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\n\nconst router = useRouter();\nconst route = useRoute();\n\nconst username = ref('');\nconst password = ref('');\nconst pending = ref(false);\nconst error = ref('');\n\n/** Where the guard wanted to go. Also what the SSO round trip carries and comes back to. */\nconst next = computed(() =>\n typeof route.query.next === 'string' && route.query.next.startsWith('/') ? route.query.next : '/',\n);\n\n/**\n * The provider failed or refused. It arrives in the query string because the callback is a REDIRECT\n * — there is no fetch to read a body from — and it is the provider's own words, so it renders as\n * text and never as markup.\n */\nconst ssoError = computed(() => (typeof route.query.sso_error === 'string' ? route.query.sso_error : ''));\n\n/**\n * A full navigation, not a fetch: the whole point is to leave this origin for the provider's\n * consent screen. `api.url` so a dev session pointed at a tunnelled host still reaches its API.\n */\nfunction signInWithProvider(): void {\n window.location.assign(api.url(`/api/auth/sso/start?next=${encodeURIComponent(next.value)}`));\n}\n\nasync function submit(): Promise<void> {\n pending.value = true;\n error.value = '';\n const failure = await login(username.value.trim(), password.value);\n pending.value = false;\n if (failure) {\n error.value = failure;\n password.value = '';\n return;\n }\n await checkAuth();\n // Back to wherever the guard bounced them from, or home.\n void router.replace(next.value);\n}\n</script>\n\n<template>\n <div class=\"login-wrap\">\n <div class=\"login-card panel\">\n <h1 style=\"font-size: var(--t-xl); margin-bottom: var(--s2)\">Sign in</h1>\n\n <template v-if=\"authState.hasUsers === false\">\n <p class=\"dim\">\n No accounts exist on this server yet — create the first one, then sign in.\n </p>\n <!--\n A curl block used to sit here permanently, on the FIRST screen anyone sees. It is needed\n exactly once per host and by one person; behind the button it costs a click then and\n nothing on every later visit — and it is generated, so it cannot drift from the route.\n -->\n <div class=\"banner plain\" style=\"margin-top: var(--s3)\">\n <b>Create the first account</b>\n <p>\n This has to be done with the host token, from a terminal — a browser has no way to prove\n it is allowed to claim a fresh server.\n </p>\n <EquivalentCommand\n what=\"creating the first account\"\n method=\"POST\"\n path=\"/api/auth/bootstrap\"\n :body=\"{ username: 'you', password: '…' }\"\n />\n <p class=\"mute\" style=\"margin-top: var(--s3)\">\n It can also be set up ahead of time when the host is first provisioned.\n <InfoHint label=\"how\">\n Set the admin username and password in the environment before running the setup\n command on the host. They are honoured only while no account exists, so they cannot\n overwrite one later.\n </InfoHint>\n </p>\n </div>\n </template>\n\n <!-- ── the provider, above the form: for most people on a host with SSO it is the only\n control on this page they should touch. -->\n <template v-if=\"authState.sso?.enabled\">\n <div v-if=\"ssoError\" class=\"banner failed\" style=\"margin-top: var(--s3)\">\n <b>Signing in with {{ authState.sso.label }} did not work.</b>\n <p>{{ ssoError }}</p>\n </div>\n <ActionButton variant=\"primary\" style=\"width: 100%; margin-top: var(--s4)\" @click=\"signInWithProvider\">\n Sign in with {{ authState.sso.label }}\n </ActionButton>\n <div class=\"row\" style=\"margin: var(--s4) 0; align-items: center; gap: var(--s3)\">\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n <span class=\"mute\" style=\"font-size: var(--t-sm)\">or with a local account</span>\n <hr style=\"flex: 1; border: 0; border-top: 1px solid var(--line)\" />\n </div>\n </template>\n\n <form @submit.prevent=\"submit\">\n <div class=\"field\" style=\"margin-top: var(--s4)\">\n <label for=\"u\">Username</label>\n <input id=\"u\" v-model=\"username\" type=\"text\" autocomplete=\"username\" spellcheck=\"false\" />\n </div>\n <div class=\"field\">\n <label for=\"p\">Password</label>\n <input id=\"p\" v-model=\"password\" type=\"password\" autocomplete=\"current-password\" />\n </div>\n\n <div v-if=\"error\" class=\"banner failed\" style=\"margin-top: var(--s3)\">\n <p>{{ error }}</p>\n </div>\n\n <div class=\"row\" style=\"margin-top: var(--s4)\">\n <ActionButton\n variant=\"primary\"\n :pending=\"pending\"\n :disabled=\"pending || !username.trim() || !password\"\n @click=\"submit\"\n >\n {{ pending ? 'Signing in…' : 'Sign in' }}\n </ActionButton>\n <span class=\"grow\" />\n <RouterLink to=\"/settings\" class=\"mute\">\n Use a token instead\n <InfoHint label=\"token access\" align=\"end\">\n A bearer token in Settings — the machine token from <code>pstack init</code>, or a\n personal token from your account — authenticates every request without a session.\n </InfoHint>\n </RouterLink>\n </div>\n </form>\n </div>\n </div>\n</template>\n\n<style scoped>\n/* The shell centres this now — see `.shell.no-rail .view`. A second centring context here would\n * fight it, and `min-height: 70vh` was what pinned the card toward the top of the window. */\n/* `100%`, not `92vw`: the shell already insets this by its own padding, so a viewport-relative\n * width added on top overflowed the right edge on a phone (measured 32px/0px at 390). */\n.login-wrap {\n width: min(420px, 100%);\n}\n.login-card {\n width: 100%;\n}\n</style>\n"],"names":["router","useRouter","route","useRoute","username","ref","password","pending","error","next","computed","ssoError","signInWithProvider","api","submit","failure","login","checkAuth","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_unref","authState","_Fragment","_hoisted_3","_createVNode","EquivalentCommand","_hoisted_4","InfoHint","_hoisted_5","_toDisplayString","ActionButton","_createTextVNode","_hoisted_6","$event","_hoisted_7","_hoisted_8","_hoisted_9","_component_RouterLink"],"mappings":"20BAoBA,MAAMA,EAASC,EAAA,EACTC,EAAQC,EAAA,EAERC,EAAWC,EAAI,EAAE,EACjBC,EAAWD,EAAI,EAAE,EACjBE,EAAUF,EAAI,EAAK,EACnBG,EAAQH,EAAI,EAAE,EAGdI,EAAOC,EAAS,IACpB,OAAOR,EAAM,MAAM,MAAS,UAAYA,EAAM,MAAM,KAAK,WAAW,GAAG,EAAIA,EAAM,MAAM,KAAO,GAAA,EAQ1FS,EAAWD,EAAS,IAAO,OAAOR,EAAM,MAAM,WAAc,SAAWA,EAAM,MAAM,UAAY,EAAG,EAMxG,SAASU,GAA2B,CAClC,OAAO,SAAS,OAAOC,EAAI,IAAI,4BAA4B,mBAAmBJ,EAAK,KAAK,CAAC,EAAE,CAAC,CAC9F,CAEA,eAAeK,GAAwB,CACrCP,EAAQ,MAAQ,GAChBC,EAAM,MAAQ,GACd,MAAMO,EAAU,MAAMC,EAAMZ,EAAS,MAAM,KAAA,EAAQE,EAAS,KAAK,EAEjE,GADAC,EAAQ,MAAQ,GACZQ,EAAS,CACXP,EAAM,MAAQO,EACdT,EAAS,MAAQ,GACjB,MACF,CACA,MAAMW,EAAA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ANb,QAAQ,UACP,QAAS3B,EAAA,MACT,SAAUA,EAAA,OAAO,CAAKH,QAAS,KAAA,IAAWE,EAAA,MAC1C,QAAOQ,CAAA,aAER,IAAyC,KAAtCP,EAAA,MAAO,cAAA,SAAA,EAAA,CAAA,CAAA,gDAEZc,EAAqB,OAAA,CAAf,MAAM,MAAA,EAAM,KAAA,EAAA,GAClBO,EAMaa,EAAA,CAND,GAAG,YAAY,MAAM,MAAA,aAAO,IAEtC,iBAFsC,wBAEtC,EAAA,GAAAb,EAGWG,EAAA,CAHD,MAAM,eAAe,MAAM,KAAA,aAAM,IACW,CAAA,GAAAR,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GADX,wDACW,EAAA,EAAAF,EAAwB,YAAlB,cAAW,EAAA,IAAO,4FAE9E,EAAA,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.login-wrap[data-v-06638fa7]{width:min(420px,100%)}.login-card[data-v-06638fa7]{width:100%}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{d as ue,J as O,M as de,c as n,a as s,e as I,i as P,I as K,f as i,u as w,E as M,t as r,g as x,F as y,y as ve,v as me,w as Q,_ as Y,z as ce,r as c,j as A,n as W,P as H,C as pe,m as fe,l as he,o as a}from"./index-9Ra4jfL4.js";import{d as u}from"./useDeployment-DFOIiXrd.js";import{s as ge}from"./useFormat-DIlTY5Dl.js";import{_ as ee}from"./SelectMenu.vue_vue_type_script_setup_true_lang-BLfPhhAj.js";import{_ as ye}from"./LogViewer.vue_vue_type_script_setup_true_lang-6CJlo0ox.js";import"./useVars-VN9gYdR6.js";import"./Teleport-BUn4ayOo.js";const be={class:"panel"},ke={class:"phead"},we={class:"field inline"},xe={class:"field inline"},Ce={class:"check"},_e=["disabled","title"],Le=["disabled","title"],Se={key:0,class:"progress","aria-hidden":"true"},$e={key:0,class:"mute"},Fe={key:1,class:"mute"},Re={key:0,class:"banner failed"},Te={key:1,class:"banner warn"},Ue={class:"logs-split"},Ve={class:"clist","aria-label":"Containers"},Ne={class:"clist-sub"},Ee=["onClick"],Ie={class:"clist-name"},Me={key:0,class:"badge warn"},Ae={class:"clist-sub mono"},qe={key:0,class:"hint"},Be={class:"logs-main"},je={class:"row",style:{"margin-bottom":"var(--s3)"}},ze={class:"field grow"},De={class:"check"},Oe={key:0,class:"log"},Pe={key:2,class:"hint"},We={key:3,class:"hint"},He={key:1,class:"mute"},J=5e3,tt=ue({__name:"LogsTab",setup(Je){const X=fe(),te=he(),S=c(200),R=c(""),$=c(!1),f=c(""),p=c([]),g=A(()=>p.value.find(t=>t.name===f.value)??null),q=A(()=>{var t;return((t=g.value)==null?void 0:t.service)??""});async function se(){const t=await W.get(`/api/deployments/${encodeURIComponent(u.id)}/runtime${H(u.vars)}`);t.ok&&(p.value=[...t.body.containers].sort((e,l)=>(e.service??e.name).localeCompare(l.service??l.name)))}const T=c(""),d=c(null),U=c(""),C=c(!1);O(()=>{var t;return[u.id,!!((t=u.detail)!=null&&t.compose)]},([t,e],l)=>{(!l||l[0]!==t)&&(p.value=[],f.value="",d.value=null),e&&p.value.length===0&&se()},{immediate:!0}),O([p,()=>X.query.container],([t,e])=>{const l=typeof e=="string"?e:"";!l||!t.length||f.value===l||t.some(m=>m.name===l)&&(f.value=l,B())},{immediate:!0});function Z(t){f.value!==t&&(f.value=t,te.replace({query:{...X.query,container:t||void 0}}),B())}async function B(){var m;if(!((m=u.detail)!=null&&m.compose))return;const t=u.id;C.value=!0,U.value="";const e=q.value,l=await W.get(`/api/deployments/${encodeURIComponent(t)}/logs${H(u.vars,{tail:S.value,...e?{service:e}:{},...R.value?{since:R.value}:{},...$.value?{timestamps:1}:{}})}`);if(C.value=!1,u.id===t&&!(l.ok&&(l.body.service??"")!==e)){if(!l.ok){d.value=null,U.value=pe(l,"load the logs");return}d.value={...l.body,ok:l.body.ok!==!1,text:l.body.text??""}}}const v=c(!1),h=c([]);let b=null;function F(){b==null||b.close(),b=null,v.value=!1}function G(){F(),h.value=[];const t=H(u.vars,{tail:S.value,...q.value?{service:q.value}:{},...$.value?{timestamps:1}:{}});b=new EventSource(W.url(`/api/deployments/${encodeURIComponent(u.id)}/logs/stream${t}`)),v.value=!0,b.onmessage=e=>{const l=JSON.parse(e.data);if(l.done){h.value.push(`— ${l.reason??"stream ended"} —`),F();return}l.line!==void 0&&(h.value.push(l.line),h.value.length>J&&h.value.splice(0,h.value.length-J))},b.onerror=()=>F()}function le(){v.value?F():G()}O([f,$,S],()=>{v.value&&G()}),de(F);const j=A(()=>{var m;const t=v.value||h.value.length?h.value.join(`
|
|
2
|
+
`):((m=d.value)==null?void 0:m.text)??"",e=T.value.trim().toLowerCase();if(!e)return t;const l=t.split(`
|
|
3
|
+
`).filter(k=>k.toLowerCase().includes(e));return l.length?l.join(`
|
|
4
|
+
`):`(no line matches "${T.value}")`}),z=c(!1),oe=/^(\S+)\s+\| /,ae=/^(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\s/,ne=A(()=>{var k;const t=j.value;if(!t||t.startsWith("(no line matches"))return[];const e=new Map,l=((k=g.value)==null?void 0:k.name)??"",m=[];return t.split(`
|
|
5
|
+
`).forEach((_,o)=>{const V=oe.exec(_);if(!V){m.push({key:o,text:_});return}const L=V[1];if(l&&L!==l&&p.value.some(re=>re.name===L))return;let N=_.slice(V[0].length),E;const D=ae.exec(N);D&&(E=D[1],N=N.slice(D[0].length)),e.has(L)||e.set(L,e.size%6),m.push({key:o,gutter:L,text:N,tone:`svc-${e.get(L)}`,...E?{time:new Date(E).toTimeString().slice(0,8),timeTitle:E}:{}})}),m}),ie=t=>t.state==="running"&&t.health!=="unhealthy"?"s-ok":t.state==="exited"&&t.exitCode===0?"mute":"s-failed";return(t,e)=>{var l,m,k,_;return a(),n("section",be,[s("div",ke,[e[9]||(e[9]=s("h2",{class:"section"},"Compose logs",-1)),e[10]||(e[10]=s("span",{class:"grow"},null,-1)),s("div",we,[e[6]||(e[6]=s("label",{for:"tail"},"Lines",-1)),I(ee,{id:"tail","model-value":String(S.value),label:"How many lines",options:[{value:"50",label:"50"},{value:"200",label:"200"},{value:"500",label:"500"},{value:"1000",label:"1000"},{value:"2000",label:"2000"}],"onUpdate:modelValue":e[0]||(e[0]=o=>S.value=Number(o))},null,8,["model-value"])]),s("div",xe,[e[7]||(e[7]=s("label",{for:"since"},"Since",-1)),I(ee,{id:"since",modelValue:R.value,"onUpdate:modelValue":e[1]||(e[1]=o=>R.value=o),label:"How far back",options:[{value:"",label:"Anything kept"},{value:"5m",label:"Last 5 minutes"},{value:"30m",label:"Last 30 minutes"},{value:"1h",label:"Last hour"},{value:"24h",label:"Last day"}]},null,8,["modelValue"])]),s("label",Ce,[P(s("input",{"onUpdate:modelValue":e[2]||(e[2]=o=>$.value=o),type:"checkbox"},null,512),[[K,$.value]]),e[8]||(e[8]=i(" Timestamps ",-1))]),s("button",{class:M(v.value?"danger":""),disabled:!((l=w(u).detail)!=null&&l.compose),title:v.value?"Stop streaming":"Stream new lines as they arrive",onClick:le},r(v.value?"Stop following":"Follow"),11,_e),s("button",{class:"primary",disabled:C.value||v.value||!((m=w(u).detail)!=null&&m.compose),title:v.value?"Already streaming live.":void 0,onClick:B},[i(r(C.value?"Reading…":d.value?"Refresh":"Fetch")+" ",1),C.value?(a(),n("span",Se)):x("",!0)],8,Le)]),w(u).detail?w(u).detail.compose?(a(),n(y,{key:2},[U.value?(a(),n("div",Re,r(U.value),1)):d.value&&!d.value.ok?(a(),n("div",Te,[s("b",null,r(((k=w(u).detail)==null?void 0:k.orchestrator)==="swarm"?"docker service logs":"Compose")+" exited non-zero.",1),s("p",null,[(_=w(u).detail)!=null&&_.asleep?(a(),n(y,{key:0},[e[12]||(e[12]=i(" This deployment is ",-1)),e[13]||(e[13]=s("b",null,"asleep",-1)),e[14]||(e[14]=i(" — its containers are gone until something wakes it, and there is nothing to read logs from. ",-1))],64)):(a(),n(y,{key:1},[i(" Most often the project does not exist yet (nothing has been brought up), or a profile is missing. Any output it did produce is below. ")],64))])])):x("",!0),s("div",Ue,[s("aside",Ve,[s("button",{class:M(["clist-item",{on:f.value===""}]),onClick:e[3]||(e[3]=o=>Z(""))},[e[15]||(e[15]=s("span",{class:"clist-name"},"All services",-1)),s("span",Ne,r(p.value.length)+" container"+r(p.value.length===1?"":"s"),1)],2),(a(!0),n(y,null,ve(p.value,o=>(a(),n("button",{key:o.id,class:M(["clist-item",{on:f.value===o.name}]),onClick:V=>Z(o.name)},[s("span",Ie,[i(r(o.service??o.name)+" ",1),o.restartCount>0?(a(),n("span",Me,r(o.restartCount)+"×",1)):x("",!0)]),s("span",Ae,r(o.name),1),s("span",{class:M(["clist-state",ie(o)])},r(w(ge)(o.health??o.state)),3)],10,Ee))),128)),p.value.length?x("",!0):(a(),n("p",qe," No containers. Nothing has been brought up, or their profile is not selected. "))]),s("div",Be,[s("div",je,[s("div",ze,[e[16]||(e[16]=s("label",{for:"lf"},"Search in these lines",-1)),P(s("input",{id:"lf","onUpdate:modelValue":e[4]||(e[4]=o=>T.value=o),"data-search":"",type:"search",placeholder:"Substring",spellcheck:"false"},null,512),[[me,T.value]])]),s("label",De,[P(s("input",{"onUpdate:modelValue":e[5]||(e[5]=o=>z.value=o),type:"checkbox"},null,512),[[K,z.value]]),e[18]||(e[18]=i(" Raw output ",-1)),I(Y,{label:"when raw matters"},{default:Q(()=>[...e[17]||(e[17]=[i(" The pretty view lifts each line's container prefix into a coloured column and its timestamp into the time gutter. Raw is the exact text the server sent — the form to paste into a bug report or compare with someone else's copy. ",-1)])]),_:1})])]),d.value||v.value||h.value.length?(a(),n(y,{key:0},[z.value?(a(),n("pre",Oe,r(j.value||"(no output)"),1)):(a(),ce(ye,{key:1,rows:ne.value,live:v.value,"copy-text":j.value,"empty-text":v.value?"Waiting for output…":"(no output)"},null,8,["rows","live","copy-text","empty-text"])),v.value?(a(),n("p",Pe," Following "+r(g.value?g.value.name:"the whole stack")+" — new lines appear as they are written, up to "+r(J.toLocaleString())+" kept on screen. ",1)):d.value?(a(),n("p",We,[i(r(d.value.lines??0)+" line"+r((d.value.lines??0)===1?"":"s")+" ",1),g.value?(a(),n(y,{key:0},[e[19]||(e[19]=i("from ",-1)),s("b",null,r(g.value.name),1)],64)):(a(),n(y,{key:1},[i("across the stack")],64)),d.value.since?(a(),n(y,{key:2},[i(", last "+r(d.value.since),1)],64)):x("",!0),i(", tail "+r(d.value.tail)+". Redacted on the host before sending: credentials inside URLs, ",1),e[21]||(e[21]=s("code",null,"NAME=value",-1)),e[22]||(e[22]=i(" pairs whose name reads as a secret, and this server's own token. ",-1)),I(Y,{label:"why this is not live"},{default:Q(()=>[...e[20]||(e[20]=[i(" Fetched on demand, never polled: an auto-refresh against a chatty stack would hammer the host that runs everyone else's previews. ",-1)])]),_:1})])):x("",!0)],64)):C.value?x("",!0):(a(),n("p",He,[e[23]||(e[23]=i(" Press ",-1)),e[24]||(e[24]=s("b",null,"Fetch",-1)),e[25]||(e[25]=i(" for the last lines, or ",-1)),e[26]||(e[26]=s("b",null,"Follow",-1)),i(" to stream them live"+r(g.value?` from ${g.value.name}`:"")+". ",1)]))])])],64)):(a(),n("p",Fe,[...e[11]||(e[11]=[i(" This spec has no ",-1),s("code",null,"compose:",-1),i(" section, so there are no compose logs to read. Its axes may still have created resources — check those at their own source. ",-1)])])):(a(),n("p",$e,"Unavailable until the spec resolves."))])}}});export{tt as default};
|
|
6
|
+
//# sourceMappingURL=LogsTab-Bzz4JBQM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LogsTab-Bzz4JBQM.js","sources":["../../src/views/tabs/LogsTab.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Compose logs, fetched ON DEMAND.\n *\n * Never polled: an auto-refresh against a chatty stack would hammer the host through\n * `docker compose logs` — the same host that is running everyone else's previews. The tail is\n * clamped to 1–2000 by the server for the same reason.\n *\n * ── THE CONTAINER LIST IS A PANEL, NOT A DROPDOWN ────────────────────────────────────────────────\n *\n * A picker hides the fleet behind a click and shows one name at a time. Reading logs is a hunt —\n * \"which of these is the one that's broken\" — so the containers are a standing list beside the\n * output, each with its state, and one click switches the pane. It scrolls, because a stack with\n * twenty containers must not push the log off the screen.\n *\n * Selecting a CONTAINER narrows two ways at once: the server is asked for that container's service\n * (so the whole tail is spent on it), and rows whose prefix names a different replica are dropped\n * client-side. Selecting \"All services\" restores the interleaved view.\n *\n * ── WHY THE OPTIONS EXIST ────────────────────────────────────────────────────────────────────────\n *\n * `--timestamps` is what makes a line comparable to anything else — a deploy, a healthcheck flap,\n * another service. `--since` is what makes a long-lived container readable: a tail of 2000 on a\n * service that logs every request is 2000 lines of the last four minutes.\n */\nimport { computed, onBeforeUnmount, ref, watch } from 'vue';\nimport { useRoute, useRouter } from 'vue-router';\nimport { api, problem, query } from '../../api/client';\nimport type { LogsResponse, RuntimeContainer, RuntimeResponse } from '../../api/types';\nimport { dep } from '../../composables/useDeployment';\nimport { sentence } from '../../composables/useFormat';\nimport InfoHint from '../../components/InfoHint.vue';\nimport SelectMenu from '../../components/SelectMenu.vue';\nimport LogViewer from '../../components/LogViewer.vue';\nimport type { LogRow } from '../../components/log-viewer-types';\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst tail = ref(200);\nconst since = ref('');\nconst timestamps = ref(false);\n/** '' means the whole stack; otherwise a CONTAINER name (its service is what the server is asked for). */\nconst selected = ref('');\nconst containers = ref<RuntimeContainer[]>([]);\n\nconst current = computed(() => containers.value.find((c) => c.name === selected.value) ?? null);\n/** What the server is asked to narrow to — compose narrows by service, not by container. */\nconst service = computed(() => current.value?.service ?? '');\n\nasync function loadContainers(): Promise<void> {\n const r = await api.get<RuntimeResponse>(\n `/api/deployments/${encodeURIComponent(dep.id)}/runtime${query(dep.vars)}`,\n );\n if (!r.ok) return; // the panel is a convenience; the whole-stack read still works without it\n containers.value = [...r.body.containers].sort((a, b) =>\n (a.service ?? a.name).localeCompare(b.service ?? b.name),\n );\n}\n\nconst filter = ref('');\nconst logs = ref<LogsResponse | null>(null);\nconst error = ref('');\nconst loading = ref(false);\n\nwatch(\n () => [dep.id, !!dep.detail?.compose] as const,\n ([id, hasCompose], prev) => {\n if (!prev || prev[0] !== id) {\n containers.value = [];\n selected.value = '';\n logs.value = null;\n }\n // Gated on the RESOLVED spec, not just the id: this component mounts before the parent has\n // resolved the deployment, so an id-only watcher saw `dep.detail === undefined` and the\n // container panel never appeared.\n if (hasCompose && containers.value.length === 0) void loadContainers();\n },\n { immediate: true },\n);\n\n/**\n * `?container=` deep link — how the Containers table jumps straight here.\n *\n * Applied once the container list has arrived, because the name has to resolve to a real container\n * to pick its service; and it fetches immediately, since arriving from \"show me this container's\n * logs\" and then being asked to press Fetch is a wasted click.\n */\nwatch(\n [containers, () => route.query.container],\n ([list, wanted]) => {\n const name = typeof wanted === 'string' ? wanted : '';\n if (!name || !list.length || selected.value === name) return;\n if (!list.some((c) => c.name === name)) return;\n selected.value = name;\n void fetchLogs();\n },\n { immediate: true },\n);\n\nfunction select(name: string): void {\n if (selected.value === name) return;\n selected.value = name;\n // Keep the URL honest so the pane can be linked to and survives a reload.\n void router.replace({ query: { ...route.query, container: name || undefined } });\n void fetchLogs();\n}\n\nasync function fetchLogs(): Promise<void> {\n if (!dep.detail?.compose) return;\n const id = dep.id;\n loading.value = true;\n error.value = '';\n const chosen = service.value;\n const r = await api.get<LogsResponse>(\n `/api/deployments/${encodeURIComponent(id)}/logs${query(dep.vars, {\n tail: tail.value,\n ...(chosen ? { service: chosen } : {}),\n ...(since.value ? { since: since.value } : {}),\n ...(timestamps.value ? { timestamps: 1 } : {}),\n })}`,\n );\n loading.value = false;\n if (dep.id !== id) return; // navigated away mid-flight\n // A slow response for the previously-selected service must not land in a pane now labelled with a\n // different one.\n if (r.ok && (r.body.service ?? '') !== chosen) return;\n if (!r.ok) {\n logs.value = null;\n error.value = problem(r, 'load the logs');\n return;\n }\n logs.value = { ...r.body, ok: r.body.ok !== false, text: r.body.text ?? '' };\n}\n\n/**\n * FOLLOW — one `compose logs --follow` on the server, streamed here over SSE.\n *\n * Not a poll. Re-fetching a full tail every few seconds would re-send everything each time and hit\n * the host that is running everyone else's previews; a followed process sends each line once and\n * costs nothing in between. That is why the \"never polled\" rule in this file survives a live tail.\n *\n * The buffer is CAPPED. A chatty service can emit thousands of lines a minute, and an unbounded\n * array behind a DOM list is how a tab left open overnight ends up unresponsive.\n */\nconst MAX_FOLLOW_LINES = 5_000;\nconst following = ref(false);\nconst liveLines = ref<string[]>([]);\nlet source: EventSource | null = null;\n\nfunction stopFollow(): void {\n source?.close();\n source = null;\n following.value = false;\n}\n\nfunction startFollow(): void {\n stopFollow();\n liveLines.value = [];\n const q = query(dep.vars, {\n tail: tail.value,\n ...(service.value ? { service: service.value } : {}),\n ...(timestamps.value ? { timestamps: 1 } : {}),\n });\n // EventSource cannot set headers, which is exactly why sessions are cookies — the request is\n // same-origin and carries the session automatically. A token-only browser session is the one case\n // this cannot serve, and the server answers 401 rather than streaming nothing.\n source = new EventSource(\n api.url(`/api/deployments/${encodeURIComponent(dep.id)}/logs/stream${q}`),\n );\n following.value = true;\n source.onmessage = (ev) => {\n const payload = JSON.parse(ev.data) as { line?: string; done?: boolean; reason?: string };\n if (payload.done) {\n // The stack stopped, or the follow hit its cap. Say which, rather than leaving a live-looking\n // pane that will never produce another line.\n liveLines.value.push(`— ${payload.reason ?? 'stream ended'} —`);\n stopFollow();\n return;\n }\n if (payload.line === undefined) return;\n liveLines.value.push(payload.line);\n if (liveLines.value.length > MAX_FOLLOW_LINES) {\n liveLines.value.splice(0, liveLines.value.length - MAX_FOLLOW_LINES);\n }\n };\n source.onerror = () => stopFollow();\n}\n\nfunction toggleFollow(): void {\n if (following.value) stopFollow();\n else startFollow();\n}\n\n// Switching container/options mid-follow must re-open the stream, or the pane keeps showing the\n// previous selection's lines under the new label.\nwatch([selected, timestamps, tail], () => {\n if (following.value) startFollow();\n});\nonBeforeUnmount(stopFollow);\n\n/** Search-in-logs: filter to matching lines rather than highlighting inside a wall of text. */\nconst shown = computed(() => {\n // While following, the live buffer IS the log — one source of truth for the pane, so the pretty\n // view, raw view, search and copy all agree about what is on screen.\n const text = following.value || liveLines.value.length ? liveLines.value.join('\\n') : (logs.value?.text ?? '');\n const needle = filter.value.trim().toLowerCase();\n if (!needle) return text;\n const lines = text.split('\\n').filter((l) => l.toLowerCase().includes(needle));\n return lines.length ? lines.join('\\n') : `(no line matches \"${filter.value}\")`;\n});\n\n/**\n * Raw is ALWAYS available, one click away. The pretty view re-arranges compose's output, and a\n * re-arranged log is the wrong thing to paste into a bug report or diff against a colleague's —\n * raw shows the exact bytes the server sent, filter and all.\n */\nconst raw = ref(false);\n\n/**\n * Compose prefixes every line with `container-name | `, and with `--timestamps` the timestamp\n * follows it. The pretty view lifts the prefix into a non-wrapping gutter with a stable per-service\n * colour and the timestamp into the viewer's own time column, so interleaved services stop reading\n * as one grey wall. A line with no prefix (a compose warning, a continuation) gets an empty gutter\n * rather than being guessed at.\n */\nconst PREFIX = /^(\\S+)\\s+\\| /;\n/** Docker's own stamp: RFC3339 with nanoseconds, always first after the prefix. */\nconst TS = /^(\\d{4}-\\d{2}-\\d{2}T[\\d:.]+Z?)\\s/;\n\nconst logRows = computed<LogRow[]>(() => {\n const text = shown.value;\n if (!text || text.startsWith('(no line matches')) return [];\n const hues = new Map<string, number>();\n const only = current.value?.name ?? '';\n const rows: LogRow[] = [];\n text.split('\\n').forEach((line, i) => {\n const m = PREFIX.exec(line);\n if (!m) {\n rows.push({ key: i, text: line });\n return;\n }\n const from = m[1]!;\n // A service with several replicas answers as one stream; keep only the chosen replica's lines.\n if (only && from !== only && containers.value.some((c) => c.name === from)) return;\n let rest = line.slice(m[0].length);\n let when: string | undefined;\n const t = TS.exec(rest);\n if (t) {\n when = t[1]!;\n rest = rest.slice(t[0].length);\n }\n if (!hues.has(from)) hues.set(from, hues.size % 6);\n rows.push({\n key: i,\n gutter: from,\n text: rest,\n tone: `svc-${hues.get(from)}`,\n ...(when ? { time: new Date(when).toTimeString().slice(0, 8), timeTitle: when } : {}),\n });\n });\n return rows;\n});\n\nconst stateTone = (c: RuntimeContainer): string =>\n c.state === 'running' && c.health !== 'unhealthy' ? 's-ok' : c.state === 'exited' && c.exitCode === 0 ? 'mute' : 's-failed';\n</script>\n\n<template>\n <section class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Compose logs</h2>\n <span class=\"grow\" />\n <div class=\"field inline\">\n <label for=\"tail\">Lines</label>\n <SelectMenu\n id=\"tail\"\n :model-value=\"String(tail)\"\n label=\"How many lines\"\n :options=\"[\n { value: '50', label: '50' },\n { value: '200', label: '200' },\n { value: '500', label: '500' },\n { value: '1000', label: '1000' },\n { value: '2000', label: '2000' },\n ]\"\n @update:model-value=\"(v) => (tail = Number(v))\"\n />\n </div>\n <div class=\"field inline\">\n <label for=\"since\">Since</label>\n <SelectMenu\n id=\"since\"\n v-model=\"since\"\n label=\"How far back\"\n :options=\"[\n { value: '', label: 'Anything kept' },\n { value: '5m', label: 'Last 5 minutes' },\n { value: '30m', label: 'Last 30 minutes' },\n { value: '1h', label: 'Last hour' },\n { value: '24h', label: 'Last day' },\n ]\"\n />\n </div>\n <label class=\"check\">\n <input v-model=\"timestamps\" type=\"checkbox\" />\n Timestamps\n </label>\n <button\n :class=\"following ? 'danger' : ''\"\n :disabled=\"!dep.detail?.compose\"\n :title=\"following ? 'Stop streaming' : 'Stream new lines as they arrive'\"\n @click=\"toggleFollow\"\n >\n {{ following ? 'Stop following' : 'Follow' }}\n </button>\n <button\n class=\"primary\"\n :disabled=\"loading || following || !dep.detail?.compose\"\n :title=\"following ? 'Already streaming live.' : undefined\"\n @click=\"fetchLogs\"\n >\n {{ loading ? 'Reading…' : logs ? 'Refresh' : 'Fetch' }}\n <span v-if=\"loading\" class=\"progress\" aria-hidden=\"true\" />\n </button>\n </div>\n\n <p v-if=\"!dep.detail\" class=\"mute\">Unavailable until the spec resolves.</p>\n <!-- Guard on the field rather than calling and interpreting the failure after the fact. -->\n <p v-else-if=\"!dep.detail.compose\" class=\"mute\">\n This spec has no <code>compose:</code> section, so there are no compose logs to read. Its axes\n may still have created resources — check those at their own source.\n </p>\n\n <template v-else>\n <div v-if=\"error\" class=\"banner failed\">{{ error }}</div>\n\n <!--\n `ok: false` means compose exited non-zero. Usually \"no such project\" because the stack was\n never brought up — not a server fault, so it is a note rather than an error.\n -->\n <div v-else-if=\"logs && !logs.ok\" class=\"banner warn\">\n <b>{{ dep.detail?.orchestrator === 'swarm' ? 'docker service logs' : 'Compose' }} exited non-zero.</b>\n <p>\n <template v-if=\"dep.detail?.asleep\">\n This deployment is <b>asleep</b> — its containers are gone until something wakes it, and\n there is nothing to read logs from.\n </template>\n <template v-else>\n Most often the project does not exist yet (nothing has been brought up), or a profile is\n missing. Any output it did produce is below.\n </template>\n </p>\n </div>\n\n <div class=\"logs-split\">\n <!-- ============================ the container panel ============================ -->\n <aside class=\"clist\" aria-label=\"Containers\">\n <button class=\"clist-item\" :class=\"{ on: selected === '' }\" @click=\"select('')\">\n <span class=\"clist-name\">All services</span>\n <span class=\"clist-sub\">{{ containers.length }} container{{ containers.length === 1 ? '' : 's' }}</span>\n </button>\n <button\n v-for=\"c in containers\"\n :key=\"c.id\"\n class=\"clist-item\"\n :class=\"{ on: selected === c.name }\"\n @click=\"select(c.name)\"\n >\n <span class=\"clist-name\">\n {{ c.service ?? c.name }}\n <span v-if=\"c.restartCount > 0\" class=\"badge warn\">{{ c.restartCount }}×</span>\n </span>\n <span class=\"clist-sub mono\">{{ c.name }}</span>\n <span class=\"clist-state\" :class=\"stateTone(c)\">\n {{ sentence(c.health ?? c.state) }}\n </span>\n </button>\n <p v-if=\"!containers.length\" class=\"hint\">\n No containers. Nothing has been brought up, or their profile is not selected.\n </p>\n </aside>\n\n <!-- ============================ the output ============================ -->\n <div class=\"logs-main\">\n <div class=\"row\" style=\"margin-bottom: var(--s3)\">\n <div class=\"field grow\">\n <label for=\"lf\">Search in these lines</label>\n <input\n id=\"lf\"\n v-model=\"filter\"\n data-search\n type=\"search\"\n placeholder=\"Substring\"\n spellcheck=\"false\"\n />\n </div>\n <label class=\"check\">\n <input v-model=\"raw\" type=\"checkbox\" />\n Raw output\n <InfoHint label=\"when raw matters\">\n The pretty view lifts each line's container prefix into a coloured column and its\n timestamp into the time gutter. Raw is the exact text the server sent — the form to\n paste into a bug report or compare with someone else's copy.\n </InfoHint>\n </label>\n </div>\n\n <template v-if=\"logs || following || liveLines.length\">\n <pre v-if=\"raw\" class=\"log\">{{ shown || '(no output)' }}</pre>\n <LogViewer\n v-else\n :rows=\"logRows\"\n :live=\"following\"\n :copy-text=\"shown\"\n :empty-text=\"following ? 'Waiting for output…' : '(no output)'\"\n />\n <p v-if=\"following\" class=\"hint\">\n Following {{ current ? current.name : 'the whole stack' }} — new lines appear as they\n are written, up to {{ MAX_FOLLOW_LINES.toLocaleString() }} kept on screen.\n </p>\n <p v-else-if=\"logs\" class=\"hint\">\n {{ logs.lines ?? 0 }} line{{ (logs.lines ?? 0) === 1 ? '' : 's' }}\n <template v-if=\"current\">from <b>{{ current.name }}</b></template>\n <template v-else>across the stack</template>\n <template v-if=\"logs.since\">, last {{ logs.since }}</template>, tail {{ logs.tail }}.\n Redacted on the host before sending: credentials inside URLs,\n <code>NAME=value</code> pairs whose name reads as a secret, and this server's own token.\n <InfoHint label=\"why this is not live\">\n Fetched on demand, never polled: an auto-refresh against a chatty stack would hammer\n the host that runs everyone else's previews.\n </InfoHint>\n </p>\n </template>\n <p v-else-if=\"!loading\" class=\"mute\">\n Press <b>Fetch</b> for the last lines, or <b>Follow</b> to stream them live{{\n current ? ` from ${current.name}` : ''\n }}.\n </p>\n </div>\n </div>\n </template>\n </section>\n</template>\n"],"names":["MAX_FOLLOW_LINES","route","useRoute","router","useRouter","tail","ref","since","timestamps","selected","containers","current","computed","c","service","_a","loadContainers","r","api","dep","query","a","b","filter","logs","error","loading","watch","id","hasCompose","prev","list","wanted","name","fetchLogs","select","chosen","problem","following","liveLines","source","stopFollow","startFollow","q","ev","payload","toggleFollow","onBeforeUnmount","shown","text","needle","lines","l","raw","PREFIX","TS","logRows","hues","only","rows","line","i","m","from","rest","when","t","stateTone","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_cache","_hoisted_3","_createVNode","SelectMenu","v","_hoisted_4","$event","_hoisted_5","_unref","_hoisted_6","_hoisted_8","_Fragment","_hoisted_11","_toDisplayString","_hoisted_12","_hoisted_13","_hoisted_14","_normalizeClass","_hoisted_15","_renderList","_hoisted_17","_createTextVNode","_hoisted_18","_hoisted_19","sentence","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","InfoHint","_hoisted_25","_createBlock","LogViewer","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_10","_hoisted_9"],"mappings":"kxCAiJMA,EAAmB,sCA7GzB,MAAMC,EAAQC,GAAA,EACRC,GAASC,GAAA,EAETC,EAAOC,EAAI,GAAG,EACdC,EAAQD,EAAI,EAAE,EACdE,EAAaF,EAAI,EAAK,EAEtBG,EAAWH,EAAI,EAAE,EACjBI,EAAaJ,EAAwB,EAAE,EAEvCK,EAAUC,EAAS,IAAMF,EAAW,MAAM,KAAMG,GAAMA,EAAE,OAASJ,EAAS,KAAK,GAAK,IAAI,EAExFK,EAAUF,EAAS,IAAA,OAAM,QAAAG,EAAAJ,EAAQ,QAAR,YAAAI,EAAe,UAAW,GAAE,EAE3D,eAAeC,IAAgC,CAC7C,MAAMC,EAAI,MAAMC,EAAI,IAClB,oBAAoB,mBAAmBC,EAAI,EAAE,CAAC,WAAWC,EAAMD,EAAI,IAAI,CAAC,EAAA,EAErEF,EAAE,KACPP,EAAW,MAAQ,CAAC,GAAGO,EAAE,KAAK,UAAU,EAAE,KAAK,CAACI,EAAGC,KAChDD,EAAE,SAAWA,EAAE,MAAM,cAAcC,EAAE,SAAWA,EAAE,IAAI,CAAA,EAE3D,CAEA,MAAMC,EAASjB,EAAI,EAAE,EACfkB,EAAOlB,EAAyB,IAAI,EACpCmB,EAAQnB,EAAI,EAAE,EACdo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AAA,EAAA,EAAA,EAAA,GAH4C,qBAC7B,EAAA,EAAAF,EAAqB,YAAf,WAAQ,EAAA,IAAO,gIAExC,EAAA,CAAA,WALAF,EAA2E,IAA3E0C,GAAmC,sCAAoC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as i,c as d,a as o,f as s,t as r,u,e as n,w as l,
|
|
2
|
-
//# sourceMappingURL=NotFoundView-
|
|
1
|
+
import{d as i,c as d,a as o,f as s,t as r,u,e as n,w as l,m as p,k as m,o as f}from"./index-9Ra4jfL4.js";const y={class:"page-head"},b={class:"sub"},g={class:"panel"},k={class:"row",style:{"margin-top":"12px",gap:"8px"}},x=i({__name:"NotFoundView",setup(v){const a=p();return(w,t)=>{const e=m("RouterLink");return f(),d("div",null,[o("div",y,[o("div",null,[t[2]||(t[2]=o("h1",null,"Not found",-1)),o("div",b,[t[0]||(t[0]=s("Nothing is routed at ",-1)),o("code",null,r(u(a).fullPath),1),t[1]||(t[1]=s(".",-1))])])]),o("section",g,[t[6]||(t[6]=o("p",{class:"mute"}," If you followed a link to a deployment that has since been forgotten, it will not resolve — the control plane only knows deployments that are still in its registry. ",-1)),o("div",k,[n(e,{class:"btn",to:"/"},{default:l(()=>[...t[3]||(t[3]=[s("Dashboard",-1)])]),_:1}),n(e,{class:"btn",to:"/deployments"},{default:l(()=>[...t[4]||(t[4]=[s("Deployments",-1)])]),_:1}),n(e,{class:"btn",to:"/jobs"},{default:l(()=>[...t[5]||(t[5]=[s("Jobs",-1)])]),_:1})])])])}}});export{x as default};
|
|
2
|
+
//# sourceMappingURL=NotFoundView-BRn9Jn4H.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotFoundView-
|
|
1
|
+
{"version":3,"file":"NotFoundView-BRn9Jn4H.js","sources":["../../src/views/NotFoundView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Catch-all route.\n *\n * Exists so a mistyped or stale deep link renders something with a way out, rather than the blank\n * screen a SPA gives you by default when no route matches.\n */\nimport { useRoute } from 'vue-router';\n\nconst route = useRoute();\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Not found</h1>\n <div class=\"sub\">Nothing is routed at <code>{{ route.fullPath }}</code>.</div>\n </div>\n </div>\n\n <section class=\"panel\">\n <p class=\"mute\">\n If you followed a link to a deployment that has since been forgotten, it will not resolve —\n the control plane only knows deployments that are still in its registry.\n </p>\n <div class=\"row\" style=\"margin-top: 12px; gap: 8px\">\n <RouterLink class=\"btn\" to=\"/\">Dashboard</RouterLink>\n <RouterLink class=\"btn\" to=\"/deployments\">Deployments</RouterLink>\n <RouterLink class=\"btn\" to=\"/jobs\">Jobs</RouterLink>\n </div>\n </section>\n </div>\n</template>\n"],"names":["route","useRoute","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_toDisplayString","_unref","_hoisted_3","_hoisted_4","_createVNode","_component_RouterLink"],"mappings":"iQASA,MAAMA,EAAQC,EAAA,mDAIZC,EAmBM,MAAA,KAAA,CAlBJC,EAKM,MALNC,EAKM,CAJJD,EAGM,MAAA,KAAA,CAFJE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAAkB,UAAd,YAAS,EAAA,GACbA,EAA8E,MAA9EG,EAA8E,eAA7D,wBAAqB,EAAA,GAAAH,EAAiC,OAAA,KAAAI,EAAxBC,EAAAR,CAAA,EAAM,QAAQ,EAAA,CAAA,gBAAU,IAAC,EAAA,EAAA,OAI5EG,EAUU,UAVVM,EAUU,CATRJ,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAGI,IAAA,CAHD,MAAM,MAAA,EAAO,yKAGhB,EAAA,GACAA,EAIM,MAJNO,EAIM,CAHJC,EAAqDC,EAAA,CAAzC,MAAM,MAAM,GAAG,GAAA,aAAI,IAAS,CAAA,GAAAP,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAT,YAAS,EAAA,CAAA,WACxCM,EAAkEC,EAAA,CAAtD,MAAM,MAAM,GAAG,cAAA,aAAe,IAAW,CAAA,GAAAP,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAX,cAAW,EAAA,CAAA,WACrDM,EAAoDC,EAAA,CAAxC,MAAM,MAAM,GAAG,OAAA,aAAQ,IAAI,CAAA,GAAAP,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAJ,OAAI,EAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as ie,J as le,c as l,a as t,f as n,e as f,w as m,_ as S,x as D,g as c,F as k,t as r,s as N,i as I,v as M,r as u,C as U,A as y,B as g,o as i,D as oe,u as B,E as O,L as x}from"./index-DVMQBHXF.js";import{s as W,c as ne}from"./useFormat-DVXTfIS-.js";import{_ as P}from"./ActionButton.vue_vue_type_script_setup_true_lang-D5wrEmB2.js";import{_ as J}from"./ErrorNote.vue_vue_type_script_setup_true_lang-B3hfwyPR.js";import{_ as re}from"./SkeletonList.vue_vue_type_script_setup_true_lang-qMyLRAMp.js";import{_ as de}from"./RelativeTime.vue_vue_type_script_setup_true_lang-BGissyps.js";import{_ as ue}from"./SelectMenu.vue_vue_type_script_setup_true_lang-D8NGgBfa.js";import{_ as Q}from"./RefreshButton.vue_vue_type_script_setup_true_lang-CXCY3Vlc.js";import"./Teleport-DfE2iP8c.js";const ve={class:"page-head"},ce={class:"sub"},pe={key:1,class:"panel"},fe={key:0,class:"banner ok"},ye={class:"code"},he={class:"row"},me={class:"panel"},ke={key:1,class:"cards"},ge={class:"stagger"},be={class:"name","data-label":"name"},_e={class:"mute",style:{"font-size":"var(--t-sm)"}},we={"data-label":"events"},$e={key:0,class:"badge"},xe={key:1},Ce={"data-label":"last delivery"},Te={key:0,class:"mute"},Ee={key:2,class:"mute",style:{"font-size":"var(--t-sm)"}},Re={"data-label":""},Se={class:"row",style:{"justify-content":"flex-end"}},De={key:0,class:"badge off"},Ne=["onClick"],Ve=["onClick"],Ae=["onClick"],ze={colspan:"4"},Ue={class:"row",style:{"margin-bottom":"var(--s2)"}},Be={key:0,class:"badge busy"},Pe={key:0,class:"kvlist"},je={class:"k"},qe={class:"v"},He={class:"mute",style:{"font-size":"var(--t-sm)"}},Le={key:0,class:"s-failed",style:{"font-size":"var(--t-sm)"}},Xe={key:1,class:"mute"},Fe={key:2,class:"mute"},Ie={class:"panel"},Me={key:0,class:"field",style:{"max-width":"320px"}},Oe={class:"field",style:{"max-width":"380px"}},We=["for"],Je=["id","onUpdate:modelValue","placeholder"],Qe={class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},Ye={class:"row"},Ge={class:"check"},Ke=["checked"],Ze={key:1,class:"check-grid"},et=["checked","onChange"],tt={class:"row",style:{"margin-top":"var(--s4)"}},st={key:3,class:"hint"},at={key:4,class:"hint"},yt=ie({__name:"NotifiersView",setup(it){const V=u([]),b=u(null),j=u(!1),h=u(""),q=u(!1),w=u(null),o=u({name:"",type:"webhook",events:[],config:{}}),$=u(!1),C=u(""),p=u(null),T=u([]),E=u(0),A=u(0),Y=U(()=>{var s;return(((s=b.value)==null?void 0:s.types)??[]).map(e=>({value:e.kind,label:e.label}))}),z=U(()=>{var s;return((s=b.value)==null?void 0:s.types.find(e=>e.kind===o.value.type))??null});le(()=>o.value.type,()=>{o.value.config={}});const G=U(()=>{var s;return!$.value&&!!o.value.name.trim()&&o.value.events.length>0&&(((s=z.value)==null?void 0:s.fields)??[]).every(e=>{var v;return!e.required||!!((v=o.value.config[e.key])!=null&&v.trim())})});async function _(){const[s,e]=await Promise.all([y.get("/api/notifiers"),y.get("/api/notifiers/meta")]);if(j.value=!0,s.status===404||e.status===404){q.value=!0;return}if(!s.ok){h.value=g(s,"load the notifiers");return}h.value="",V.value=s.body.notifiers??[],e.ok&&(b.value=e.body)}_();function H(s){const e=o.value.events.indexOf(s);e===-1?o.value.events.push(s):o.value.events.splice(e,1)}async function K(){$.value=!0,C.value="";const s=await y.post("/api/notifiers",{name:o.value.name.trim(),type:o.value.type,events:o.value.events,config:o.value.config});if($.value=!1,!s.ok){C.value=g(s,"register this notifier");return}w.value=s.body.secret?{name:s.body.notifier.name,secret:s.body.secret}:null,o.value={name:"",type:o.value.type,events:[],config:{}},_()}async function Z(s,e){const v=await y.patch(`/api/notifiers/${s.id}`,{enabled:e});v.ok||(h.value=g(v,"update this notifier")),_()}async function ee(s){const e=await y.del(`/api/notifiers/${s.id}`);if(!e.ok){h.value=g(e,"delete this notifier");return}p.value===s.id&&(p.value=null),x("ok",`Removed ${s.name}.`),_()}async function te(s){const e=await y.post(`/api/notifiers/${s.id}/test`,{});if(!e.ok){h.value=g(e,"send a test delivery");return}const v=e.body.result;v.ok?x("ok",`${s.name} accepted the test delivery.`):x("error",`${s.name}: ${v.error??`HTTP ${v.status}`}`),_()}async function se(s){if(p.value===s.id){p.value=null;return}const e=await y.get(`/api/notifiers/${s.id}/deliveries`);if(!e.ok){h.value=g(e,"load the delivery log");return}T.value=e.body.deliveries??[],E.value=e.body.queued??0,p.value=s.id}async function L(){const s=p.value;if(s===null)return;const e=await y.get(`/api/notifiers/${s}/deliveries`);e.ok&&(T.value=e.body.deliveries??[],E.value=e.body.queued??0)}async function ae(s){if(p.value===null)return;A.value=s.id;const e=await y.post(`/api/notifiers/${p.value}/deliveries/${s.id}/redeliver`);if(A.value=0,!e.ok){x("error",g(e,"redeliver this event"));return}x("ok",e.body.note??"Queued for redelivery."),await L()}return(s,e)=>{var v,X,F;return i(),l("div",null,[t("div",ve,[t("div",null,[e[6]||(e[6]=t("h1",null,"Notifiers",-1)),t("div",ce,[e[5]||(e[5]=n(" Where events on this host get sent ",-1)),f(S,{label:"what a notifier is"},{default:m(()=>[...e[4]||(e[4]=[n(" A registration that receives events — a teardown that leaked, a deployment created, a job that failed. Webhooks today; the server decides what other kinds exist, and this page renders whatever it offers. ",-1)])]),_:1})])]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),f(Q,{run:_})]),h.value?(i(),D(J,{key:0,text:h.value,title:"Could not load the notifiers."},null,8,["text"])):c("",!0),q.value?(i(),l("section",pe,[...e[8]||(e[8]=[t("div",{class:"banner plain"},[t("b",null,"This server has no notifiers."),t("p",null,"It is an older build of pstack. Upgrade the host to register webhooks.")],-1)])])):(i(),l(k,{key:2},[w.value?(i(),l("div",fe,[t("b",null,"Signing secret for “"+r(w.value.name)+"” — copy it now.",1),t("p",null,[e[10]||(e[10]=n(" This is the only time it is shown — the server keeps no way to show it again. Your receiver uses it to check that a delivery really came from here. ",-1)),f(S,{label:"how a receiver checks it"},{default:m(()=>[...e[9]||(e[9]=[n(" Each delivery carries a signature header computed from this secret and the exact body sent. Recompute it on your side and compare; a mismatch means the delivery was not sent by this host, or was altered on the way. ",-1)])]),_:1})]),t("pre",ye,r(w.value.secret),1),t("div",he,[t("button",{class:"btn",onClick:e[0]||(e[0]=a=>w.value=null)},"I have stored it")])])):c("",!0),t("section",me,[e[17]||(e[17]=t("div",{class:"phead"},[t("h2",{class:"section"},"Registered")],-1)),j.value?V.value.length?(i(),l("table",ke,[e[16]||(e[16]=t("thead",null,[t("tr",null,[t("th",null,"Name"),t("th",null,"Events"),t("th",null,"Last delivery"),t("th")])],-1)),t("tbody",ge,[(i(!0),l(k,null,N(V.value,(a,R)=>(i(),l(k,{key:a.id},[t("tr",{style:oe({"--i":R})},[t("td",be,[n(r(a.name)+" ",1),t("div",_e,r(B(W)(a.type))+" · "+r(String(a.config.url??a.config.webhookUrl??"")),1)]),t("td",we,[a.events.includes("*")?(i(),l("span",$e,"all events")):(i(),l("span",xe,r(a.events.join(", ")),1))]),t("td",Ce,[a.lastStatus?(i(),l("span",{key:1,class:O(a.lastStatus==="ok"?"s-ok":"s-failed")},r(a.lastStatus),3)):(i(),l("span",Te,"never")),a.lastAt?(i(),l("div",Ee,[f(de,{at:a.lastAt},null,8,["at"])])):c("",!0)]),t("td",Re,[t("div",Se,[a.enabled?c("",!0):(i(),l("span",De,"disabled")),t("button",{class:"ghost sm",onClick:d=>se(a)},r(p.value===a.id?"Hide":"Deliveries"),9,Ne),t("button",{class:"ghost sm",onClick:d=>te(a)},"Test",8,Ve),t("button",{class:"ghost sm",onClick:d=>Z(a,!a.enabled)},r(a.enabled?"Disable":"Enable"),9,Ae),f(P,{variant:"danger",onClick:d=>ee(a)},{default:m(()=>[...e[11]||(e[11]=[n("Remove",-1)])]),_:1},8,["onClick"])])])],4),p.value===a.id?(i(),l("tr",{key:`d${a.id}`},[t("td",ze,[t("div",Ue,[E.value>0?(i(),l("span",Be,[e[12]||(e[12]=t("span",{class:"dot pulse"},null,-1)),n(r(E.value)+" queued ",1)])):c("",!0),e[13]||(e[13]=t("span",{class:"mute",style:{"font-size":"var(--t-xs)"}}," Events wait their turn per notifier — one delivery at a time, so a slow receiver cannot starve the others. ",-1)),e[14]||(e[14]=t("span",{class:"grow"},null,-1)),f(Q,{run:L})]),T.value.length?(i(),l("ul",Pe,[(i(!0),l(k,null,N(T.value,d=>(i(),l("li",{key:d.id},[t("span",je,[t("span",{class:O(d.status==="ok"?"s-ok":"s-failed")},r(B(W)(d.status)),3)]),t("span",qe,[n(r(d.event)+" ",1),t("span",He,[n(" · "+r(B(ne)(d.createdAt))+" · "+r(d.attempts)+" attempt(s)",1),d.responseCode?(i(),l(k,{key:0},[n(" · HTTP "+r(d.responseCode),1)],64)):c("",!0)]),d.error?(i(),l("div",Le,r(d.error),1)):c("",!0)]),d.replayable?(i(),D(P,{key:0,class:"sm",variant:"ghost",pending:A.value===d.id,confirm:"Send it again?",title:"Sends this exact event again, with its original id so a receiver that already handled it can dedupe.",onRun:lt=>ae(d)},{default:m(()=>[...e[15]||(e[15]=[n(" Redeliver ",-1)])]),_:1},8,["pending","onRun"])):c("",!0)]))),128))])):(i(),l("p",Xe,"Nothing delivered yet."))])])):c("",!0)],64))),128))])])):(i(),l("p",Fe," Nothing registered. Events still happen — nobody is being told about them. ")):(i(),D(re,{key:0,rows:2}))]),t("section",Ie,[e[25]||(e[25]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Add a notifier",-1)),b.value&&b.value.types.length>1?(i(),l("div",Me,[e[18]||(e[18]=t("label",{for:"ty"},"Type",-1)),f(ue,{modelValue:o.value.type,"onUpdate:modelValue":e[1]||(e[1]=a=>o.value.type=a),id:"ty",label:"Notifier type",options:Y.value},null,8,["modelValue","options"])])):c("",!0),t("div",Oe,[e[19]||(e[19]=t("label",{for:"nn"},"Name",-1)),I(t("input",{id:"nn","onUpdate:modelValue":e[2]||(e[2]=a=>o.value.name=a),type:"text",placeholder:"ops-slack-bridge",spellcheck:"false"},null,512),[[M,o.value.name,void 0,{trim:!0}]])]),(i(!0),l(k,null,N(((v=z.value)==null?void 0:v.fields)??[],a=>(i(),l("div",{key:a.key,class:"field",style:{"max-width":"380px"}},[t("label",{for:`cfg-${a.key}`},r(a.label),9,We),I(t("input",{id:`cfg-${a.key}`,"onUpdate:modelValue":R=>o.value.config[a.key]=R,type:"text",placeholder:a.placeholder,spellcheck:"false"},null,8,Je),[[M,o.value.config[a.key],void 0,{trim:!0}]])]))),128)),t("h2",Qe,[e[21]||(e[21]=n(" Events ",-1)),f(S,{label:"which events to pick"},{default:m(()=>[...e[20]||(e[20]=[t("b",null,"All events",-1),n(" also covers events added in later versions — a specific list does not, and the failure mode of that is silence nobody can explain. ",-1),t("code",null,"job.leaked",-1),n(" is the one worth alerting on: a teardown ran and something survived it. ",-1)])]),_:1})]),t("div",Ye,[t("label",Ge,[t("input",{type:"checkbox",checked:o.value.events.includes("*"),onChange:e[3]||(e[3]=a=>H("*"))},null,40,Ke),e[22]||(e[22]=n(" All events ",-1))])]),o.value.events.includes("*")?c("",!0):(i(),l("div",Ze,[(i(!0),l(k,null,N(((X=b.value)==null?void 0:X.events)??[],a=>(i(),l("label",{key:a,class:"check"},[t("input",{type:"checkbox",checked:o.value.events.includes(a),onChange:R=>H(a)},null,40,et),n(" "+r(a),1)]))),128))])),C.value?(i(),D(J,{key:2,text:C.value,title:"Could not register this notifier."},null,8,["text"])):c("",!0),t("div",tt,[f(P,{variant:"primary",pending:$.value,disabled:!G.value,onClick:K},{default:m(()=>[n(r($.value?"Registering…":"Register"),1)]),_:1},8,["pending","disabled"])]),((F=z.value)==null?void 0:F.signs)!==!1?(i(),l("p",st,[e[24]||(e[24]=n(" Deliveries are signed with a secret shown once at registration, retried twice on failure, and logged here. ",-1)),f(S,{label:"how a receiver verifies a delivery"},{default:m(()=>[...e[23]||(e[23]=[n(" Recompute ",-1),t("code",null,"HMAC-SHA256(secret, `${timestamp}.${rawBody}`)",-1),n(" and compare against ",-1),t("code",null,"X-Pstack-Signature",-1),n(", using the ",-1),t("em",null,"raw",-1),n(" body — re-serialising it changes the bytes. Reject anything whose ",-1),t("code",null,"X-Pstack-Timestamp",-1),n(" is more than five minutes old, and dedupe on ",-1),t("code",null,"X-Pstack-Delivery",-1),n(": delivery is at-least-once, and that id is stable across retries. ",-1)])]),_:1})])):(i(),l("p",at," The webhook URL is the credential — it is stored write-only and scrubbed from logs, and no signing secret is involved. Deliveries are retried twice on failure and logged here. "))])],64))])}}});export{yt as default};
|
|
2
|
-
//# sourceMappingURL=NotifiersView-
|
|
1
|
+
import{d as ie,J as le,c as l,a as t,f as n,e as f,w as m,_ as S,z as D,g as c,F as k,t as r,y as N,i as F,v as I,r as u,j as U,n as y,C as g,o as i,D as oe,u as j,E as M,O as x}from"./index-9Ra4jfL4.js";import{s as W,c as ne}from"./useFormat-DIlTY5Dl.js";import{_ as P}from"./ActionButton.vue_vue_type_script_setup_true_lang-B0qf7_XI.js";import{_ as J}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DNaY6OBe.js";import{_ as re}from"./SkeletonList.vue_vue_type_script_setup_true_lang-DjfNq2KM.js";import{_ as de}from"./RelativeTime.vue_vue_type_script_setup_true_lang-Dm9XnXF7.js";import{_ as ue}from"./SelectMenu.vue_vue_type_script_setup_true_lang-BLfPhhAj.js";import{_ as Q}from"./RefreshButton.vue_vue_type_script_setup_true_lang-DpeOKN8U.js";import"./Teleport-BUn4ayOo.js";const ve={class:"page-head"},ce={class:"sub"},pe={key:1,class:"panel"},fe={key:0,class:"banner ok"},ye={class:"code"},he={class:"row"},me={class:"panel"},ke={key:1,class:"cards"},ge={class:"stagger"},be={class:"name","data-label":"name"},_e={class:"mute",style:{"font-size":"var(--t-sm)"}},we={"data-label":"events"},$e={key:0,class:"badge"},xe={key:1},Ce={"data-label":"last delivery"},Te={key:0,class:"mute"},Ee={key:2,class:"mute",style:{"font-size":"var(--t-sm)"}},Re={"data-label":""},Se={class:"row",style:{"justify-content":"flex-end"}},De={key:0,class:"badge off"},Ne=["onClick"],Ve=["onClick"],Ae=["onClick"],ze={colspan:"4"},Ue={class:"row",style:{"margin-bottom":"var(--s2)"}},je={key:0,class:"badge busy"},Pe={key:0,class:"kvlist"},qe={class:"k"},Be={class:"v"},He={class:"mute",style:{"font-size":"var(--t-sm)"}},Le={key:0,class:"s-failed",style:{"font-size":"var(--t-sm)"}},Oe={key:1,class:"mute"},Xe={key:2,class:"mute"},Fe={class:"panel"},Ie={key:0,class:"field",style:{"max-width":"320px"}},Me={class:"field",style:{"max-width":"380px"}},We=["for"],Je=["id","onUpdate:modelValue","placeholder"],Qe={class:"section",style:{margin:"var(--s5) 0 var(--s3)"}},Ye={class:"row"},Ge={class:"check"},Ke=["checked"],Ze={key:1,class:"check-grid"},et=["checked","onChange"],tt={class:"row",style:{"margin-top":"var(--s4)"}},st={key:3,class:"hint"},at={key:4,class:"hint"},yt=ie({__name:"NotifiersView",setup(it){const V=u([]),b=u(null),q=u(!1),h=u(""),B=u(!1),w=u(null),o=u({name:"",type:"webhook",events:[],config:{}}),$=u(!1),C=u(""),p=u(null),T=u([]),E=u(0),A=u(0),Y=U(()=>{var s;return(((s=b.value)==null?void 0:s.types)??[]).map(e=>({value:e.kind,label:e.label}))}),z=U(()=>{var s;return((s=b.value)==null?void 0:s.types.find(e=>e.kind===o.value.type))??null});le(()=>o.value.type,()=>{o.value.config={}});const G=U(()=>{var s;return!$.value&&!!o.value.name.trim()&&o.value.events.length>0&&(((s=z.value)==null?void 0:s.fields)??[]).every(e=>{var v;return!e.required||!!((v=o.value.config[e.key])!=null&&v.trim())})});async function _(){const[s,e]=await Promise.all([y.get("/api/notifiers"),y.get("/api/notifiers/meta")]);if(q.value=!0,s.status===404||e.status===404){B.value=!0;return}if(!s.ok){h.value=g(s,"load the notifiers");return}h.value="",V.value=s.body.notifiers??[],e.ok&&(b.value=e.body)}_();function H(s){const e=o.value.events.indexOf(s);e===-1?o.value.events.push(s):o.value.events.splice(e,1)}async function K(){$.value=!0,C.value="";const s=await y.post("/api/notifiers",{name:o.value.name.trim(),type:o.value.type,events:o.value.events,config:o.value.config});if($.value=!1,!s.ok){C.value=g(s,"register this notifier");return}w.value=s.body.secret?{name:s.body.notifier.name,secret:s.body.secret}:null,o.value={name:"",type:o.value.type,events:[],config:{}},_()}async function Z(s,e){const v=await y.patch(`/api/notifiers/${s.id}`,{enabled:e});v.ok||(h.value=g(v,"update this notifier")),_()}async function ee(s){const e=await y.del(`/api/notifiers/${s.id}`);if(!e.ok){h.value=g(e,"delete this notifier");return}p.value===s.id&&(p.value=null),x("ok",`Removed ${s.name}.`),_()}async function te(s){const e=await y.post(`/api/notifiers/${s.id}/test`,{});if(!e.ok){h.value=g(e,"send a test delivery");return}const v=e.body.result;v.ok?x("ok",`${s.name} accepted the test delivery.`):x("error",`${s.name}: ${v.error??`HTTP ${v.status}`}`),_()}async function se(s){if(p.value===s.id){p.value=null;return}const e=await y.get(`/api/notifiers/${s.id}/deliveries`);if(!e.ok){h.value=g(e,"load the delivery log");return}T.value=e.body.deliveries??[],E.value=e.body.queued??0,p.value=s.id}async function L(){const s=p.value;if(s===null)return;const e=await y.get(`/api/notifiers/${s}/deliveries`);e.ok&&(T.value=e.body.deliveries??[],E.value=e.body.queued??0)}async function ae(s){if(p.value===null)return;A.value=s.id;const e=await y.post(`/api/notifiers/${p.value}/deliveries/${s.id}/redeliver`);if(A.value=0,!e.ok){x("error",g(e,"redeliver this event"));return}x("ok",e.body.note??"Queued for redelivery."),await L()}return(s,e)=>{var v,O,X;return i(),l("div",null,[t("div",ve,[t("div",null,[e[6]||(e[6]=t("h1",null,"Notifiers",-1)),t("div",ce,[e[5]||(e[5]=n(" Where events on this host get sent ",-1)),f(S,{label:"what a notifier is"},{default:m(()=>[...e[4]||(e[4]=[n(" A registration that receives events — a teardown that leaked, a deployment created, a job that failed. Webhooks today; the server decides what other kinds exist, and this page renders whatever it offers. ",-1)])]),_:1})])]),e[7]||(e[7]=t("span",{class:"grow"},null,-1)),f(Q,{run:_})]),h.value?(i(),D(J,{key:0,text:h.value,title:"Could not load the notifiers."},null,8,["text"])):c("",!0),B.value?(i(),l("section",pe,[...e[8]||(e[8]=[t("div",{class:"banner plain"},[t("b",null,"This server has no notifiers."),t("p",null,"It is an older build of pstack. Upgrade the host to register webhooks.")],-1)])])):(i(),l(k,{key:2},[w.value?(i(),l("div",fe,[t("b",null,"Signing secret for “"+r(w.value.name)+"” — copy it now.",1),t("p",null,[e[10]||(e[10]=n(" This is the only time it is shown — the server keeps no way to show it again. Your receiver uses it to check that a delivery really came from here. ",-1)),f(S,{label:"how a receiver checks it"},{default:m(()=>[...e[9]||(e[9]=[n(" Each delivery carries a signature header computed from this secret and the exact body sent. Recompute it on your side and compare; a mismatch means the delivery was not sent by this host, or was altered on the way. ",-1)])]),_:1})]),t("pre",ye,r(w.value.secret),1),t("div",he,[t("button",{class:"btn",onClick:e[0]||(e[0]=a=>w.value=null)},"I have stored it")])])):c("",!0),t("section",me,[e[17]||(e[17]=t("div",{class:"phead"},[t("h2",{class:"section"},"Registered")],-1)),q.value?V.value.length?(i(),l("table",ke,[e[16]||(e[16]=t("thead",null,[t("tr",null,[t("th",null,"Name"),t("th",null,"Events"),t("th",null,"Last delivery"),t("th")])],-1)),t("tbody",ge,[(i(!0),l(k,null,N(V.value,(a,R)=>(i(),l(k,{key:a.id},[t("tr",{style:oe({"--i":R})},[t("td",be,[n(r(a.name)+" ",1),t("div",_e,r(j(W)(a.type))+" · "+r(String(a.config.url??a.config.webhookUrl??"")),1)]),t("td",we,[a.events.includes("*")?(i(),l("span",$e,"all events")):(i(),l("span",xe,r(a.events.join(", ")),1))]),t("td",Ce,[a.lastStatus?(i(),l("span",{key:1,class:M(a.lastStatus==="ok"?"s-ok":"s-failed")},r(a.lastStatus),3)):(i(),l("span",Te,"never")),a.lastAt?(i(),l("div",Ee,[f(de,{at:a.lastAt},null,8,["at"])])):c("",!0)]),t("td",Re,[t("div",Se,[a.enabled?c("",!0):(i(),l("span",De,"disabled")),t("button",{class:"ghost sm",onClick:d=>se(a)},r(p.value===a.id?"Hide":"Deliveries"),9,Ne),t("button",{class:"ghost sm",onClick:d=>te(a)},"Test",8,Ve),t("button",{class:"ghost sm",onClick:d=>Z(a,!a.enabled)},r(a.enabled?"Disable":"Enable"),9,Ae),f(P,{variant:"danger",onClick:d=>ee(a)},{default:m(()=>[...e[11]||(e[11]=[n("Remove",-1)])]),_:1},8,["onClick"])])])],4),p.value===a.id?(i(),l("tr",{key:`d${a.id}`},[t("td",ze,[t("div",Ue,[E.value>0?(i(),l("span",je,[e[12]||(e[12]=t("span",{class:"dot pulse"},null,-1)),n(r(E.value)+" queued ",1)])):c("",!0),e[13]||(e[13]=t("span",{class:"mute",style:{"font-size":"var(--t-xs)"}}," Events wait their turn per notifier — one delivery at a time, so a slow receiver cannot starve the others. ",-1)),e[14]||(e[14]=t("span",{class:"grow"},null,-1)),f(Q,{run:L})]),T.value.length?(i(),l("ul",Pe,[(i(!0),l(k,null,N(T.value,d=>(i(),l("li",{key:d.id},[t("span",qe,[t("span",{class:M(d.status==="ok"?"s-ok":"s-failed")},r(j(W)(d.status)),3)]),t("span",Be,[n(r(d.event)+" ",1),t("span",He,[n(" · "+r(j(ne)(d.createdAt))+" · "+r(d.attempts)+" attempt(s)",1),d.responseCode?(i(),l(k,{key:0},[n(" · HTTP "+r(d.responseCode),1)],64)):c("",!0)]),d.error?(i(),l("div",Le,r(d.error),1)):c("",!0)]),d.replayable?(i(),D(P,{key:0,class:"sm",variant:"ghost",pending:A.value===d.id,confirm:"Send it again?",title:"Sends this exact event again, with its original id so a receiver that already handled it can dedupe.",onRun:lt=>ae(d)},{default:m(()=>[...e[15]||(e[15]=[n(" Redeliver ",-1)])]),_:1},8,["pending","onRun"])):c("",!0)]))),128))])):(i(),l("p",Oe,"Nothing delivered yet."))])])):c("",!0)],64))),128))])])):(i(),l("p",Xe," Nothing registered. Events still happen — nobody is being told about them. ")):(i(),D(re,{key:0,rows:2}))]),t("section",Fe,[e[25]||(e[25]=t("h2",{class:"section",style:{"margin-bottom":"var(--s3)"}},"Add a notifier",-1)),b.value&&b.value.types.length>1?(i(),l("div",Ie,[e[18]||(e[18]=t("label",{for:"ty"},"Type",-1)),f(ue,{modelValue:o.value.type,"onUpdate:modelValue":e[1]||(e[1]=a=>o.value.type=a),id:"ty",label:"Notifier type",options:Y.value},null,8,["modelValue","options"])])):c("",!0),t("div",Me,[e[19]||(e[19]=t("label",{for:"nn"},"Name",-1)),F(t("input",{id:"nn","onUpdate:modelValue":e[2]||(e[2]=a=>o.value.name=a),type:"text",placeholder:"ops-slack-bridge",spellcheck:"false"},null,512),[[I,o.value.name,void 0,{trim:!0}]])]),(i(!0),l(k,null,N(((v=z.value)==null?void 0:v.fields)??[],a=>(i(),l("div",{key:a.key,class:"field",style:{"max-width":"380px"}},[t("label",{for:`cfg-${a.key}`},r(a.label),9,We),F(t("input",{id:`cfg-${a.key}`,"onUpdate:modelValue":R=>o.value.config[a.key]=R,type:"text",placeholder:a.placeholder,spellcheck:"false"},null,8,Je),[[I,o.value.config[a.key],void 0,{trim:!0}]])]))),128)),t("h2",Qe,[e[21]||(e[21]=n(" Events ",-1)),f(S,{label:"which events to pick"},{default:m(()=>[...e[20]||(e[20]=[t("b",null,"All events",-1),n(" also covers events added in later versions — a specific list does not, and the failure mode of that is silence nobody can explain. ",-1),t("code",null,"job.leaked",-1),n(" is the one worth alerting on: a teardown ran and something survived it. ",-1)])]),_:1})]),t("div",Ye,[t("label",Ge,[t("input",{type:"checkbox",checked:o.value.events.includes("*"),onChange:e[3]||(e[3]=a=>H("*"))},null,40,Ke),e[22]||(e[22]=n(" All events ",-1))])]),o.value.events.includes("*")?c("",!0):(i(),l("div",Ze,[(i(!0),l(k,null,N(((O=b.value)==null?void 0:O.events)??[],a=>(i(),l("label",{key:a,class:"check"},[t("input",{type:"checkbox",checked:o.value.events.includes(a),onChange:R=>H(a)},null,40,et),n(" "+r(a),1)]))),128))])),C.value?(i(),D(J,{key:2,text:C.value,title:"Could not register this notifier."},null,8,["text"])):c("",!0),t("div",tt,[f(P,{variant:"primary",pending:$.value,disabled:!G.value,onClick:K},{default:m(()=>[n(r($.value?"Registering…":"Register"),1)]),_:1},8,["pending","disabled"])]),((X=z.value)==null?void 0:X.signs)!==!1?(i(),l("p",st,[e[24]||(e[24]=n(" Deliveries are signed with a secret shown once at registration, retried twice on failure, and logged here. ",-1)),f(S,{label:"how a receiver verifies a delivery"},{default:m(()=>[...e[23]||(e[23]=[n(" Recompute ",-1),t("code",null,"HMAC-SHA256(secret, `${timestamp}.${rawBody}`)",-1),n(" and compare against ",-1),t("code",null,"X-Pstack-Signature",-1),n(", using the ",-1),t("em",null,"raw",-1),n(" body — re-serialising it changes the bytes. Reject anything whose ",-1),t("code",null,"X-Pstack-Timestamp",-1),n(" is more than five minutes old, and dedupe on ",-1),t("code",null,"X-Pstack-Delivery",-1),n(": delivery is at-least-once, and that id is stable across retries. ",-1)])]),_:1})])):(i(),l("p",at," The webhook URL is the credential — it is stored write-only and scrubbed from logs, and no signing secret is involved. Deliveries are retried twice on failure and logged here. "))])],64))])}}});export{yt as default};
|
|
2
|
+
//# sourceMappingURL=NotifiersView-Bd13G-1b.js.map
|