@samyx/preview-stacks-ui 0.31.0 → 0.32.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-D8Xlp6c9.js +2 -0
- package/dist/assets/{ActionButton.vue_vue_type_script_setup_true_lang-C6PZurL0.js.map → ActionButton.vue_vue_type_script_setup_true_lang-D8Xlp6c9.js.map} +1 -1
- package/dist/assets/{AxesTab-BNAORqpJ.js → AxesTab-BWzsbFAx.js} +2 -2
- package/dist/assets/{AxesTab-BNAORqpJ.js.map → AxesTab-BWzsbFAx.js.map} +1 -1
- package/dist/assets/ConfigTab-ucr87rD6.js +2 -0
- package/dist/assets/{ConfigTab-8Ifz-gnA.js.map → ConfigTab-ucr87rD6.js.map} +1 -1
- package/dist/assets/{ConfigView-CPj8QeBo.js → ConfigView-BbRYGyvZ.js} +2 -2
- package/dist/assets/{ConfigView-CPj8QeBo.js.map → ConfigView-BbRYGyvZ.js.map} +1 -1
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-DDt6qe65.js +2 -0
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-DDt6qe65.js.map +1 -0
- package/dist/assets/DangerTab-BimKNJab.js +2 -0
- package/dist/assets/DangerTab-BimKNJab.js.map +1 -0
- package/dist/assets/DashboardView-DK0qDo-f.js +2 -0
- package/dist/assets/{DashboardView-CuDBbXnZ.js.map → DashboardView-DK0qDo-f.js.map} +1 -1
- package/dist/assets/DeploymentDetailView-BcImKApM.js +2 -0
- package/dist/assets/{DeploymentDetailView-qtlOQQ0z.js.map → DeploymentDetailView-BcImKApM.js.map} +1 -1
- package/dist/assets/DeploymentsView-Cx9BqQ8Q.js +2 -0
- package/dist/assets/DeploymentsView-Cx9BqQ8Q.js.map +1 -0
- package/dist/assets/DialogTrigger-nWkfUj3N.js +2 -0
- package/dist/assets/DialogTrigger-nWkfUj3N.js.map +1 -0
- package/dist/assets/{EquivalentCommand-DX5xFW-p.js → EquivalentCommand-D92xDU0_.js} +3 -3
- package/dist/assets/{EquivalentCommand-DX5xFW-p.js.map → EquivalentCommand-D92xDU0_.js.map} +1 -1
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-CUZs06O0.js → ErrorNote.vue_vue_type_script_setup_true_lang-DVbGiVTB.js} +2 -2
- package/dist/assets/{ErrorNote.vue_vue_type_script_setup_true_lang-CUZs06O0.js.map → ErrorNote.vue_vue_type_script_setup_true_lang-DVbGiVTB.js.map} +1 -1
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-CSOdBT2E.js +2 -0
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-CSOdBT2E.js.map +1 -0
- package/dist/assets/JobDetailView-B1sXXVJ5.js +2 -0
- package/dist/assets/JobDetailView-B1sXXVJ5.js.map +1 -0
- package/dist/assets/JobsView-CC7lre3Q.css +1 -0
- package/dist/assets/JobsView-DjP5lXHk.js +2 -0
- package/dist/assets/JobsView-DjP5lXHk.js.map +1 -0
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-Bhy_5cyC.js +3 -0
- package/dist/assets/{LogViewer.vue_vue_type_script_setup_true_lang-Sg8LzIyX.js.map → LogViewer.vue_vue_type_script_setup_true_lang-Bhy_5cyC.js.map} +1 -1
- package/dist/assets/{LoginView-Gpnnyg1m.js → LoginView-CIkI9Qm_.js} +2 -2
- package/dist/assets/{LoginView-Gpnnyg1m.js.map → LoginView-CIkI9Qm_.js.map} +1 -1
- package/dist/assets/LogsTab-D8zhR7Eb.js +6 -0
- package/dist/assets/{LogsTab-CZ0fNgsO.js.map → LogsTab-D8zhR7Eb.js.map} +1 -1
- package/dist/assets/{NotFoundView-BE2kvYuP.js → NotFoundView-aUtqh2Qi.js} +2 -2
- package/dist/assets/{NotFoundView-BE2kvYuP.js.map → NotFoundView-aUtqh2Qi.js.map} +1 -1
- package/dist/assets/NotifiersView-aRHInxVx.js +2 -0
- package/dist/assets/{NotifiersView-Df_CM6Bj.js.map → NotifiersView-aRHInxVx.js.map} +1 -1
- package/dist/assets/OverviewTab-ChCj5LAj.js +2 -0
- package/dist/assets/{OverviewTab-BSeic8dR.js.map → OverviewTab-ChCj5LAj.js.map} +1 -1
- package/dist/assets/PublicLogsView-DIWJH7qL.js +4 -0
- package/dist/assets/{PublicLogsView-BDyvxkgj.js.map → PublicLogsView-DIWJH7qL.js.map} +1 -1
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-ZUc7pgOx.js → RefreshButton.vue_vue_type_script_setup_true_lang-P7VwWcRa.js} +2 -2
- package/dist/assets/{RefreshButton.vue_vue_type_script_setup_true_lang-ZUc7pgOx.js.map → RefreshButton.vue_vue_type_script_setup_true_lang-P7VwWcRa.js.map} +1 -1
- package/dist/assets/RegistriesView-D2aCsYIu.js +2 -0
- package/dist/assets/{RegistriesView-DMzsLFcT.js.map → RegistriesView-D2aCsYIu.js.map} +1 -1
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-NGvUfuKC.js +2 -0
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-NGvUfuKC.js.map +1 -0
- package/dist/assets/{RequiresTab-DkuxJsEj.js → RequiresTab-3BhU5BHd.js} +2 -2
- package/dist/assets/{RequiresTab-DkuxJsEj.js.map → RequiresTab-3BhU5BHd.js.map} +1 -1
- package/dist/assets/RouteTarget.vue_vue_type_script_setup_true_lang-Caee0wEB.js +2 -0
- package/dist/assets/RouteTarget.vue_vue_type_script_setup_true_lang-Caee0wEB.js.map +1 -0
- package/dist/assets/RoutingView-T9afX8_M.js +9 -0
- package/dist/assets/RoutingView-T9afX8_M.js.map +1 -0
- package/dist/assets/RoutingView-tn0RQdqM.css +0 -0
- package/dist/assets/RuntimeTab-Bh2gGuhj.js +2 -0
- package/dist/assets/RuntimeTab-Bh2gGuhj.js.map +1 -0
- package/dist/assets/RuntimeTab-By55qdsQ.css +1 -0
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-BtHqT6G1.js +2 -0
- package/dist/assets/{SelectMenu.vue_vue_type_script_setup_true_lang-DKYlHroe.js.map → SelectMenu.vue_vue_type_script_setup_true_lang-BtHqT6G1.js.map} +1 -1
- package/dist/assets/{SettingsView-CgwOmLat.js → SettingsView-DIKjdBdy.js} +2 -2
- package/dist/assets/{SettingsView-CgwOmLat.js.map → SettingsView-DIKjdBdy.js.map} +1 -1
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Bwex16vy.js → SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js} +2 -2
- package/dist/assets/{SkeletonList.vue_vue_type_script_setup_true_lang-Bwex16vy.js.map → SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js.map} +1 -1
- package/dist/assets/SpecDetailView-Bd4Hx-bI.js +2 -0
- package/dist/assets/{SpecDetailView-BlHaL1Y8.js.map → SpecDetailView-Bd4Hx-bI.js.map} +1 -1
- package/dist/assets/SpecsView-B9qQPzkG.js +2 -0
- package/dist/assets/{SpecsView-C-bS2Av2.js.map → SpecsView-B9qQPzkG.js.map} +1 -1
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-aKprkHCF.js → SsoMark.vue_vue_type_script_setup_true_lang-BBiCq_4w.js} +2 -2
- package/dist/assets/{SsoMark.vue_vue_type_script_setup_true_lang-aKprkHCF.js.map → SsoMark.vue_vue_type_script_setup_true_lang-BBiCq_4w.js.map} +1 -1
- package/dist/assets/{SsoView-BUz2EaVq.js → SsoView-CltdTdwt.js} +2 -2
- package/dist/assets/{SsoView-BUz2EaVq.js.map → SsoView-CltdTdwt.js.map} +1 -1
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-nD6Zdx0q.js +2 -0
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-nD6Zdx0q.js.map +1 -0
- package/dist/assets/{SubmitView-s5haxS9q.js → SubmitView-D-jg5Wxy.js} +5 -5
- package/dist/assets/{SubmitView-s5haxS9q.js.map → SubmitView-D-jg5Wxy.js.map} +1 -1
- package/dist/assets/SwarmView-CqFndUrV.js +2 -0
- package/dist/assets/{SwarmView-skNbhHws.js.map → SwarmView-CqFndUrV.js.map} +1 -1
- package/dist/assets/Teleport-I0XiM19H.js +4 -0
- package/dist/assets/{Teleport-CKfsIrp8.js.map → Teleport-I0XiM19H.js.map} +1 -1
- package/dist/assets/TerminalTab-Dleba0ru.js +3 -0
- package/dist/assets/{TerminalTab-CPuFkMzh.js.map → TerminalTab-Dleba0ru.js.map} +1 -1
- package/dist/assets/UsersView-Bd8B9pLD.css +1 -0
- package/dist/assets/UsersView-BrZbuuOg.js +2 -0
- package/dist/assets/UsersView-BrZbuuOg.js.map +1 -0
- package/dist/assets/VarEditor.vue_vue_type_script_setup_true_lang-uPHU_Ugp.js +2 -0
- package/dist/assets/VarEditor.vue_vue_type_script_setup_true_lang-uPHU_Ugp.js.map +1 -0
- package/dist/assets/VarIO-BVE8A4Ur.css +1 -0
- package/dist/assets/VarIO-BldCQ6Xx.js +15 -0
- package/dist/assets/VarIO-BldCQ6Xx.js.map +1 -0
- package/dist/assets/VariablesView-CQp0T7Q6.js +3 -0
- package/dist/assets/VariablesView-CQp0T7Q6.js.map +1 -0
- package/dist/assets/VariablesView-Ck3IyRCN.css +1 -0
- package/dist/assets/index-B1ONXQzZ.css +1 -0
- package/dist/assets/index-Cqe_7QZw.js +154 -0
- package/dist/assets/index-Cqe_7QZw.js.map +1 -0
- package/dist/assets/useDeployment-BDbkdxpo.js +2 -0
- package/dist/assets/{useDeployment-CV0kcdoc.js.map → useDeployment-BDbkdxpo.js.map} +1 -1
- package/dist/assets/useJobQueue-D5JkRJNX.js +2 -0
- package/dist/assets/useJobQueue-D5JkRJNX.js.map +1 -0
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/dist/assets/ActionButton.vue_vue_type_script_setup_true_lang-C6PZurL0.js +0 -2
- package/dist/assets/ConfigTab-8Ifz-gnA.js +0 -2
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-B0PJUns4.js +0 -2
- package/dist/assets/ConflictNote.vue_vue_type_script_setup_true_lang-B0PJUns4.js.map +0 -1
- package/dist/assets/DangerTab-BwXkb6Rr.js +0 -2
- package/dist/assets/DangerTab-BwXkb6Rr.js.map +0 -1
- package/dist/assets/DashboardView-CuDBbXnZ.js +0 -2
- package/dist/assets/DeploymentDetailView-qtlOQQ0z.js +0 -2
- package/dist/assets/DeploymentsView-CQwTTlTI.js +0 -2
- package/dist/assets/DeploymentsView-CQwTTlTI.js.map +0 -1
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-ErbSSi6D.js +0 -2
- package/dist/assets/HelpModal.vue_vue_type_script_setup_true_lang-ErbSSi6D.js.map +0 -1
- package/dist/assets/JobDetailView-BgoEL7EB.js +0 -2
- package/dist/assets/JobDetailView-BgoEL7EB.js.map +0 -1
- package/dist/assets/JobsView-CVG0iuN4.js +0 -2
- package/dist/assets/JobsView-CVG0iuN4.js.map +0 -1
- package/dist/assets/LogViewer.vue_vue_type_script_setup_true_lang-Sg8LzIyX.js +0 -3
- package/dist/assets/LogsTab-CZ0fNgsO.js +0 -6
- package/dist/assets/NotifiersView-Df_CM6Bj.js +0 -2
- package/dist/assets/OverviewTab-BSeic8dR.js +0 -2
- package/dist/assets/PublicLogsView-BDyvxkgj.js +0 -4
- package/dist/assets/RegistriesView-DMzsLFcT.js +0 -2
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-D4NO-r5D.js +0 -2
- package/dist/assets/RelativeTime.vue_vue_type_script_setup_true_lang-D4NO-r5D.js.map +0 -1
- package/dist/assets/RoutingView-BEJ3iJ9c.js +0 -9
- package/dist/assets/RoutingView-BEJ3iJ9c.js.map +0 -1
- package/dist/assets/RuntimeTab-DY8ZYeng.css +0 -1
- package/dist/assets/RuntimeTab-bWJuLJcn.js +0 -2
- package/dist/assets/RuntimeTab-bWJuLJcn.js.map +0 -1
- package/dist/assets/SelectMenu.vue_vue_type_script_setup_true_lang-DKYlHroe.js +0 -2
- package/dist/assets/SpecDetailView-BlHaL1Y8.js +0 -2
- package/dist/assets/SpecsView-C-bS2Av2.js +0 -2
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-C-7EQXcg.js +0 -2
- package/dist/assets/StateBadge.vue_vue_type_script_setup_true_lang-C-7EQXcg.js.map +0 -1
- package/dist/assets/SwarmView-skNbhHws.js +0 -2
- package/dist/assets/Teleport-CKfsIrp8.js +0 -4
- package/dist/assets/TerminalTab-CPuFkMzh.js +0 -3
- package/dist/assets/UsersView-Be77zCYE.css +0 -1
- package/dist/assets/UsersView-CIfFPshj.js +0 -2
- package/dist/assets/UsersView-CIfFPshj.js.map +0 -1
- package/dist/assets/VarEditor.vue_vue_type_script_setup_true_lang-JwR7DqO1.js +0 -2
- package/dist/assets/VarEditor.vue_vue_type_script_setup_true_lang-JwR7DqO1.js.map +0 -1
- package/dist/assets/VariablesView-ByeOvDGJ.css +0 -1
- package/dist/assets/VariablesView-DatC33mT.js +0 -2
- package/dist/assets/VariablesView-DatC33mT.js.map +0 -1
- package/dist/assets/index-B_k9b7xG.css +0 -1
- package/dist/assets/index-T3JGe9ku.js +0 -154
- package/dist/assets/index-T3JGe9ku.js.map +0 -1
- package/dist/assets/useDeployment-CV0kcdoc.js +0 -2
- package/dist/assets/useFormat-DIlTY5Dl.js +0 -2
- package/dist/assets/useFormat-DIlTY5Dl.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as _,c as d,a as t,i as f,v as x,u as s
|
|
2
|
-
//# sourceMappingURL=SettingsView-
|
|
1
|
+
import{d as _,c as d,a as t,i as f,v as x,u as s,$ as o,f as n,e as k,w as v,_ as c,ac as B,t as u,g as m,z as E,F as S,A as l,j as y,k as g,ae as U,U as $,o as r}from"./index-Cqe_7QZw.js";import{_ as A}from"./ActionButton.vue_vue_type_script_setup_true_lang-D8Xlp6c9.js";import{_ as b}from"./SelectMenu.vue_vue_type_script_setup_true_lang-BtHqT6G1.js";import"./Teleport-I0XiM19H.js";const L={class:"panel settings-form"},T={class:"field"},D={class:"mute hint"},N={class:"field"},F=["type"],R={class:"row",style:{"margin-top":"var(--s2)"}},M={key:2,class:"mute",style:{"font-size":"var(--t-xs)"}},j={class:"mute hint"},q={class:"row",style:{gap:"8px","margin-top":"4px"}},z=["disabled"],H={key:0,class:"mute"},I={key:1,class:"bad"},P={class:"panel"},O={class:"field"},W={class:"field"},Y=_({__name:"SettingsView",setup(G){const p=y(!1),h=y(!1),w=g(()=>{const i=o.token;return i.startsWith("pstack_pat_")?"Looks like a personal token.":/^[0-9a-f]{40,}$/i.test(i)?"Looks like a machine token.":`${i.length} characters — this does not look like a pstack token.`}),V=g(()=>{var i;return((i=l.health)==null?void 0:i.authEnforced)??null});async function C(){p.value=!0;try{await U(),$(l.healthError?"error":"ok",l.healthError||"Control plane reachable")}finally{p.value=!1}}return(i,e)=>(r(),d("div",null,[e[19]||(e[19]=t("div",{class:"page-head"},[t("div",null,[t("h1",null,"Settings"),t("div",{class:"sub"},"Stored in this browser only. Nothing here is sent to the server.")])],-1)),t("section",L,[e[14]||(e[14]=t("h2",{class:"phead-title"},"Connection",-1)),t("div",T,[e[8]||(e[8]=t("label",{for:"apiBase"},"API base URL",-1)),f(t("input",{id:"apiBase","onUpdate:modelValue":e[0]||(e[0]=a=>s(o).apiBase=a),type:"url",spellcheck:"false",placeholder:"(same origin)"},null,512),[[x,s(o).apiBase,void 0,{trim:!0}]]),t("div",D,[e[7]||(e[7]=n(" Leave it empty unless you are pointing this page at another host. ",-1)),k(c,{label:"about the API base URL"},{default:v(()=>[...e[6]||(e[6]=[n(" Empty means same-origin, which is how the control stack serves this page — the browser never makes a cross-origin request, so there is no CORS to configure. Set an absolute URL only for a development session against a remote host. ",-1)])]),_:1})])]),t("div",N,[e[11]||(e[11]=t("label",{for:"token"},"Access token",-1)),f(t("input",{id:"token","onUpdate:modelValue":e[1]||(e[1]=a=>s(o).token=a),type:h.value||!s(o).token?"text":"password",name:"pstack-access-token",autocomplete:"off","data-1p-ignore":"","data-lpignore":"true","data-bwignore":"","data-form-type":"other",spellcheck:"false",placeholder:"paste the token from pstack init"},null,8,F),[[B,s(o).token,void 0,{trim:!0}]]),t("div",R,[s(o).token?(r(),d("button",{key:0,class:"ghost sm",onClick:e[2]||(e[2]=a=>h.value=!h.value)},u(h.value?"Hide":"Show"),1)):m("",!0),s(o).token?(r(),E(A,{key:1,variant:"ghost",class:"sm",confirm:"Clear it?",onRun:e[3]||(e[3]=a=>s(o).token="")},{default:v(()=>[...e[9]||(e[9]=[n(" Clear ",-1)])]),_:1})):m("",!0),s(o).token?(r(),d("span",M,u(w.value),1)):m("",!0)]),t("div",j,[e[10]||(e[10]=n(" Authenticates every request — signing in with an account does the same job, so set this only for token-based access (the machine token, or a personal token from your account). ",-1)),V.value===!1?(r(),d(S,{key:0},[n(" This server is not asking for one — it only accepts connections from this machine, so a token here is harmless but unnecessary. ")],64)):m("",!0)])]),t("div",q,[t("button",{class:"btn",disabled:p.value,onClick:C},u(p.value?"Checking…":"Test connection"),9,z),s(l).health?(r(),d("span",H,[n(" Connected to pstack "+u(s(l).health.version)+" ",1),k(c,{label:"where data is stored"},{default:v(()=>[e[12]||(e[12]=n(" Deployment records and stored specs live in ",-1)),t("code",null,u(s(l).health.dataDir),1),e[13]||(e[13]=n(" on the host. ",-1))]),_:1})])):s(l).healthError?(r(),d("span",I,u(s(l).healthError),1)):m("",!0)])]),t("section",P,[e[18]||(e[18]=t("h2",{class:"phead-title"},"Appearance",-1)),t("div",O,[e[15]||(e[15]=t("label",{for:"theme"},"Theme",-1)),k(b,{modelValue:s(o).theme,"onUpdate:modelValue":e[4]||(e[4]=a=>s(o).theme=a),id:"theme",label:"Theme",options:[{value:"system",label:"Follow the system"},{value:"dark",label:"Dark"},{value:"light",label:"Light"}]},null,8,["modelValue"])]),t("div",W,[e[16]||(e[16]=t("label",{for:"motion"},"Motion",-1)),k(b,{modelValue:s(o).motion,"onUpdate:modelValue":e[5]||(e[5]=a=>s(o).motion=a),id:"motion",label:"Motion",options:[{value:"system",label:"Follow the system"},{value:"full",label:"Always animate"},{value:"none",label:"No animation"}]},null,8,["modelValue"]),e[17]||(e[17]=t("div",{class:"mute hint"}," “Follow the system” uses your device's reduce-motion setting. The other two override it, in either direction. ",-1))])])]))}});export{Y as default};
|
|
2
|
+
//# sourceMappingURL=SettingsView-DIKjdBdy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SettingsView-CgwOmLat.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, and how the app looks.\n *\n * Everything here is client-side and persisted to localStorage by `useSettings` — nothing is sent\n * to the server, and there is nothing to save. Bindings write through immediately.\n */\nimport { computed, ref } from 'vue';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth } from '../composables/useControlPlane';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst checking = ref(false);\nconst reveal = ref(false);\n\n/**\n * What is in the token box, described without printing it.\n *\n * The point is to make a WRONG value visible at a glance. A password autofilled into this field is\n * short and matches neither shape, and \"12 characters, not a pstack token\" is the sentence that\n * ends the mystery — before this, the only symptom was every page 401ing.\n */\nconst tokenShape = computed(() => {\n const t = settings.token;\n if (t.startsWith('pstack_pat_')) return 'Looks like a personal token.';\n if (/^[0-9a-f]{40,}$/i.test(t)) return 'Looks like a machine token.';\n return `${t.length} characters — this does not look like a pstack token.`;\n});\n\n/**\n * The server tells us whether it enforces auth. When it does not, it is bound to loopback and a\n * token would be pointless — worth saying, so nobody hunts for one that was never issued.\n */\nconst authEnforced = computed(() => state.health?.authEnforced ?? null);\n\nasync function recheck(): Promise<void> {\n checking.value = true;\n try {\n await loadHealth();\n toast(state.healthError ? 'error' : 'ok', state.healthError || 'Control plane reachable');\n } finally {\n checking.value = false;\n }\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <div class=\"sub\">Stored in this browser only. Nothing here is sent to the server.</div>\n </div>\n </div>\n\n <!-- `settings-form` caps the field widths: a URL input stretched to the panel's full 1500px\n reads as a text editor, not a form — see the rule in app.css. -->\n <section class=\"panel settings-form\">\n <h2 class=\"phead-title\">Connection</h2>\n\n <div class=\"field\">\n <label for=\"apiBase\">API base URL</label>\n <input\n id=\"apiBase\"\n v-model.trim=\"settings.apiBase\"\n type=\"url\"\n spellcheck=\"false\"\n placeholder=\"(same origin)\"\n />\n <div class=\"mute hint\">\n Leave it empty unless you are pointing this page at another host.\n <InfoHint label=\"about the API base URL\">\n Empty means same-origin, which is how the control stack serves this page — the browser\n never makes a cross-origin request, so there is no CORS to configure. Set an absolute\n URL only for a development session against a remote host.\n </InfoHint>\n </div>\n </div>\n\n <div class=\"field\">\n <label for=\"token\">Access token</label>\n <!--\n NOT `type=\"password\"`, and none of these attributes are decorative.\n\n This field is why \"opening Settings signs me out\" was a real bug. A password input is an\n autofill magnet: Chrome and every password manager fill one on sight and ignore\n `autocomplete=\"off\"` while doing it. The filled value went straight through `v-model` into\n localStorage and onto every request as `Authorization: Bearer <someone's password>` — and\n the server used to treat a bad bearer as a hard refusal rather than falling back to the\n session cookie, so a perfectly good login 401'd on every route until site data was cleared.\n\n The server now falls through (that is the real fix), and this field stops inviting the\n fill: a text input that masks itself only while it holds a value, named nothing like a\n password, with the ignore hints the managers respect.\n -->\n <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n :type=\"reveal || !settings.token ? 'text' : 'password'\"\n name=\"pstack-access-token\"\n autocomplete=\"off\"\n data-1p-ignore\n data-lpignore=\"true\"\n data-bwignore\n data-form-type=\"other\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"row\" style=\"margin-top: var(--s2)\">\n <button v-if=\"settings.token\" class=\"ghost sm\" @click=\"reveal = !reveal\">\n {{ reveal ? 'Hide' : 'Show' }}\n </button>\n <ActionButton\n v-if=\"settings.token\"\n variant=\"ghost\"\n class=\"sm\"\n confirm=\"Clear it?\"\n @run=\"settings.token = ''\"\n >\n Clear\n </ActionButton>\n <span v-if=\"settings.token\" class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ tokenShape }}\n </span>\n </div>\n <div class=\"mute hint\">\n Authenticates every request — signing in with an account does the same job, so set this\n only for token-based access (the machine token, or a personal token from your account).\n <template v-if=\"authEnforced === false\">\n This server is not asking for one — it only accepts connections from this machine, so a\n token here is harmless but unnecessary.\n </template>\n </div>\n </div>\n\n <div class=\"row\" style=\"gap: 8px; margin-top: 4px\">\n <button class=\"btn\" :disabled=\"checking\" @click=\"recheck\">\n {{ checking ? 'Checking…' : 'Test connection' }}\n </button>\n <span v-if=\"state.health\" class=\"mute\">\n Connected to pstack {{ state.health.version }}\n <InfoHint label=\"where data is stored\">\n Deployment records and stored specs live in\n <code>{{ state.health.dataDir }}</code> on the host.\n </InfoHint>\n </span>\n <span v-else-if=\"state.healthError\" class=\"bad\">{{ state.healthError }}</span>\n </div>\n </section>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <SelectMenu\n v-model=\"settings.theme\" id=\"theme\"\n label=\"Theme\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'dark', label: 'Dark' },\n { value: 'light', label: 'Light' },\n ]\"\n />\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <SelectMenu\n v-model=\"settings.motion\" id=\"motion\"\n label=\"Motion\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'full', label: 'Always animate' },\n { value: 'none', label: 'No animation' },\n ]\"\n />\n <div class=\"mute hint\">\n “Follow the system” uses your device's reduce-motion setting. The other two override it,\n in either direction.\n </div>\n </div>\n </section>\n </div>\n</template>\n"],"names":["checking","ref","reveal","tokenShape","computed","t","settings","authEnforced","_a","state","recheck","loadHealth","toast","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_6","_createBlock","ActionButton","_hoisted_7","_toDisplayString","_hoisted_8","_Fragment","_hoisted_9","_hoisted_10","_openBlock","_hoisted_11","_createTextVNode","_hoisted_12","_hoisted_13","_hoisted_14","SelectMenu","_hoisted_15"],"mappings":"szBAeA,MAAMA,EAAWC,EAAI,EAAK,EACpBC,EAASD,EAAI,EAAK,EASlBE,EAAaC,EAAS,IAAM,CAChC,MAAMC,EAAIC,EAAS,MACnB,OAAID,EAAE,WAAW,aAAa,EAAU,+BACpC,mBAAmB,KAAKA,CAAC,EAAU,8BAChC,GAAGA,EAAE,MAAM,uDACpB,CAAC,EAMKE,EAAeH,EAAS,IAAA,OAAM,QAAAI,EAAAC,EAAM,SAAN,YAAAD,EAAc,eAAgB,KAAI,EAEtE,eAAeE,GAAyB,CACtCV,EAAS,MAAQ,GACjB,GAAI,CACF,MAAMW,EAAA,EACNC,EAAMH,EAAM,YAAc,QAAU,KAAMA,EAAM,aAAe,yBAAyB,CAC1F,QAAA,CACET,EAAS,MAAQ,EACnB,CACF,mBAIEa,EAwIM,MAAA,KAAA,eAvIJC,EAKM,MAAA,CALD,MAAM,aAAW,CACpBA,EAGM,MAAA,KAAA,CAFJA,EAAiB,UAAb,UAAQ,EACZA,EAAuF,MAAA,CAAlF,MAAM,KAAA,EAAM,kEAAgE,CAAA,SAMrFA,EA2FU,UA3FVC,EA2FU,CA1FRC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAuC,KAAA,CAAnC,MAAM,aAAA,EAAc,aAAU,EAAA,GAElCA,EAiBM,MAjBNG,EAiBM,CAhBJD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAF,EAAyC,QAAA,CAAlC,IAAI,SAAA,EAAU,eAAY,EAAA,KACjCA,EAME,QAAA,CALA,GA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,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAb,CAAA,EAAS,MAAKY,GAAE,GAAG,QAC5B,MAAM,QACL,QAAS,sGAIT,2BAIPJ,EAeM,MAfN0B,EAeM,CAdJxB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAkC,QAAA,CAA3B,IAAI,QAAA,EAAS,SAAM,EAAA,GAC1BO,EAQIkB,EAAA,CAPS,WAAApB,EAAAb,CAAA,EAAS,OAAT,sBAAAU,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAb,CAAA,EAAS,OAAMY,GAAE,GAAG,SAC7B,MAAM,SACL,QAAS,sHAIT,yBAELF,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGM,MAAA,CAHD,MAAM,aAAY,kHAGvB,EAAA,EAAA"}
|
|
1
|
+
{"version":3,"file":"SettingsView-DIKjdBdy.js","sources":["../../src/views/SettingsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Settings: where the API is, how to authenticate to it, and how the app looks.\n *\n * Everything here is client-side and persisted to localStorage by `useSettings` — nothing is sent\n * to the server, and there is nothing to save. Bindings write through immediately.\n */\nimport { computed, ref } from 'vue';\nimport { settings } from '../composables/useSettings';\nimport { state, loadHealth } from '../composables/useControlPlane';\nimport { toast } from '../composables/useToasts';\nimport ActionButton from '../components/ActionButton.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport SelectMenu from '../components/SelectMenu.vue';\n\nconst checking = ref(false);\nconst reveal = ref(false);\n\n/**\n * What is in the token box, described without printing it.\n *\n * The point is to make a WRONG value visible at a glance. A password autofilled into this field is\n * short and matches neither shape, and \"12 characters, not a pstack token\" is the sentence that\n * ends the mystery — before this, the only symptom was every page 401ing.\n */\nconst tokenShape = computed(() => {\n const t = settings.token;\n if (t.startsWith('pstack_pat_')) return 'Looks like a personal token.';\n if (/^[0-9a-f]{40,}$/i.test(t)) return 'Looks like a machine token.';\n return `${t.length} characters — this does not look like a pstack token.`;\n});\n\n/**\n * The server tells us whether it enforces auth. When it does not, it is bound to loopback and a\n * token would be pointless — worth saying, so nobody hunts for one that was never issued.\n */\nconst authEnforced = computed(() => state.health?.authEnforced ?? null);\n\nasync function recheck(): Promise<void> {\n checking.value = true;\n try {\n await loadHealth();\n toast(state.healthError ? 'error' : 'ok', state.healthError || 'Control plane reachable');\n } finally {\n checking.value = false;\n }\n}\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Settings</h1>\n <div class=\"sub\">Stored in this browser only. Nothing here is sent to the server.</div>\n </div>\n </div>\n\n <!-- `settings-form` caps the field widths: a URL input stretched to the panel's full 1500px\n reads as a text editor, not a form — see the rule in app.css. -->\n <section class=\"panel settings-form\">\n <h2 class=\"phead-title\">Connection</h2>\n\n <div class=\"field\">\n <label for=\"apiBase\">API base URL</label>\n <input\n id=\"apiBase\"\n v-model.trim=\"settings.apiBase\"\n type=\"url\"\n spellcheck=\"false\"\n placeholder=\"(same origin)\"\n />\n <div class=\"mute hint\">\n Leave it empty unless you are pointing this page at another host.\n <InfoHint label=\"about the API base URL\">\n Empty means same-origin, which is how the control stack serves this page — the browser\n never makes a cross-origin request, so there is no CORS to configure. Set an absolute\n URL only for a development session against a remote host.\n </InfoHint>\n </div>\n </div>\n\n <div class=\"field\">\n <label for=\"token\">Access token</label>\n <!--\n NOT `type=\"password\"`, and none of these attributes are decorative.\n\n This field is why \"opening Settings signs me out\" was a real bug. A password input is an\n autofill magnet: Chrome and every password manager fill one on sight and ignore\n `autocomplete=\"off\"` while doing it. The filled value went straight through `v-model` into\n localStorage and onto every request as `Authorization: Bearer <someone's password>` — and\n the server used to treat a bad bearer as a hard refusal rather than falling back to the\n session cookie, so a perfectly good login 401'd on every route until site data was cleared.\n\n The server now falls through (that is the real fix), and this field stops inviting the\n fill: a text input that masks itself only while it holds a value, named nothing like a\n password, with the ignore hints the managers respect.\n -->\n <input\n id=\"token\"\n v-model.trim=\"settings.token\"\n :type=\"reveal || !settings.token ? 'text' : 'password'\"\n name=\"pstack-access-token\"\n autocomplete=\"off\"\n data-1p-ignore\n data-lpignore=\"true\"\n data-bwignore\n data-form-type=\"other\"\n spellcheck=\"false\"\n placeholder=\"paste the token from pstack init\"\n />\n <div class=\"row\" style=\"margin-top: var(--s2)\">\n <button v-if=\"settings.token\" class=\"ghost sm\" @click=\"reveal = !reveal\">\n {{ reveal ? 'Hide' : 'Show' }}\n </button>\n <ActionButton\n v-if=\"settings.token\"\n variant=\"ghost\"\n class=\"sm\"\n confirm=\"Clear it?\"\n @run=\"settings.token = ''\"\n >\n Clear\n </ActionButton>\n <span v-if=\"settings.token\" class=\"mute\" style=\"font-size: var(--t-xs)\">\n {{ tokenShape }}\n </span>\n </div>\n <div class=\"mute hint\">\n Authenticates every request — signing in with an account does the same job, so set this\n only for token-based access (the machine token, or a personal token from your account).\n <template v-if=\"authEnforced === false\">\n This server is not asking for one — it only accepts connections from this machine, so a\n token here is harmless but unnecessary.\n </template>\n </div>\n </div>\n\n <div class=\"row\" style=\"gap: 8px; margin-top: 4px\">\n <button class=\"btn\" :disabled=\"checking\" @click=\"recheck\">\n {{ checking ? 'Checking…' : 'Test connection' }}\n </button>\n <span v-if=\"state.health\" class=\"mute\">\n Connected to pstack {{ state.health.version }}\n <InfoHint label=\"where data is stored\">\n Deployment records and stored specs live in\n <code>{{ state.health.dataDir }}</code> on the host.\n </InfoHint>\n </span>\n <span v-else-if=\"state.healthError\" class=\"bad\">{{ state.healthError }}</span>\n </div>\n </section>\n\n <section class=\"panel\">\n <h2 class=\"phead-title\">Appearance</h2>\n\n <div class=\"field\">\n <label for=\"theme\">Theme</label>\n <SelectMenu\n v-model=\"settings.theme\" id=\"theme\"\n label=\"Theme\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'dark', label: 'Dark' },\n { value: 'light', label: 'Light' },\n ]\"\n />\n </div>\n\n <div class=\"field\">\n <label for=\"motion\">Motion</label>\n <SelectMenu\n v-model=\"settings.motion\" id=\"motion\"\n label=\"Motion\"\n :options=\"[\n { value: 'system', label: 'Follow the system' },\n { value: 'full', label: 'Always animate' },\n { value: 'none', label: 'No animation' },\n ]\"\n />\n <div class=\"mute hint\">\n “Follow the system” uses your device's reduce-motion setting. The other two override it,\n in either direction.\n </div>\n </div>\n </section>\n </div>\n</template>\n"],"names":["checking","ref","reveal","tokenShape","computed","t","settings","authEnforced","_a","state","recheck","loadHealth","toast","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","$event","_unref","_hoisted_3","_createVNode","InfoHint","_hoisted_4","_hoisted_6","_createBlock","ActionButton","_hoisted_7","_toDisplayString","_hoisted_8","_Fragment","_hoisted_9","_hoisted_10","_openBlock","_hoisted_11","_createTextVNode","_hoisted_12","_hoisted_13","_hoisted_14","SelectMenu","_hoisted_15"],"mappings":"szBAeA,MAAMA,EAAWC,EAAI,EAAK,EACpBC,EAASD,EAAI,EAAK,EASlBE,EAAaC,EAAS,IAAM,CAChC,MAAMC,EAAIC,EAAS,MACnB,OAAID,EAAE,WAAW,aAAa,EAAU,+BACpC,mBAAmB,KAAKA,CAAC,EAAU,8BAChC,GAAGA,EAAE,MAAM,uDACpB,CAAC,EAMKE,EAAeH,EAAS,IAAA,OAAM,QAAAI,EAAAC,EAAM,SAAN,YAAAD,EAAc,eAAgB,KAAI,EAEtE,eAAeE,GAAyB,CACtCV,EAAS,MAAQ,GACjB,GAAI,CACF,MAAMW,EAAA,EACNC,EAAMH,EAAM,YAAc,QAAU,KAAMA,EAAM,aAAe,yBAAyB,CAC1F,QAAA,CACET,EAAS,MAAQ,EACnB,CACF,mBAIEa,EAwIM,MAAA,KAAA,eAvIJC,EAKM,MAAA,CALD,MAAM,aAAW,CACpBA,EAGM,MAAA,KAAA,CAFJA,EAAiB,UAAb,UAAQ,EACZA,EAAuF,MAAA,CAAlF,MAAM,KAAA,EAAM,kEAAgE,CAAA,SAMrFA,EA2FU,UA3FVC,EA2FU,CA1FRC,EAAA,EA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A,CAAnC,MAAM,aAAA,EAAc,aAAU,EAAA,GAElCA,EAWM,MAXNwB,EAWM,CAVJtB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAgC,QAAA,CAAzB,IAAI,OAAA,EAAQ,QAAK,EAAA,GACxBO,EAQIkB,EAAA,CAPS,WAAApB,EAAAb,CAAA,EAAS,MAAT,sBAAAU,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAb,CAAA,EAAS,MAAKY,GAAE,GAAG,QAC5B,MAAM,QACL,QAAS,sGAIT,2BAIPJ,EAeM,MAfN0B,EAeM,CAdJxB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAAkC,QAAA,CAA3B,IAAI,QAAA,EAAS,SAAM,EAAA,GAC1BO,EAQIkB,EAAA,CAPS,WAAApB,EAAAb,CAAA,EAAS,OAAT,sBAAAU,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAE,GAAAC,EAAAb,CAAA,EAAS,OAAMY,GAAE,GAAG,SAC7B,MAAM,SACL,QAAS,sHAIT,yBAELF,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAGM,MAAA,CAHD,MAAM,aAAY,kHAGvB,EAAA,EAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as s,o as e,c as a,F as o,r,D as n,E as i}from"./index-
|
|
2
|
-
//# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d as s,o as e,c as a,F as o,r,D as n,E as i}from"./index-Cqe_7QZw.js";const c={role:"status","aria-live":"polite","aria-label":"loading"},p=s({__name:"SkeletonList",props:{rows:{default:3},tall:{type:Boolean,default:!1}},setup(l){return(d,u)=>(e(),a("div",c,[(e(!0),a(o,null,r(l.rows,t=>(e(),a("div",{key:t,class:i(["skel",{tall:l.tall}]),style:n({width:`${100-t*7}%`})},null,6))),128))]))}});export{p as _};
|
|
2
|
+
//# sourceMappingURL=SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js","sources":["../../src/components/SkeletonList.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A loading placeholder shaped like the thing that is coming.\n *\n * Deliberately not a spinner on an empty page: a spinner says \"wait\" and nothing else, while a\n * skeleton says what will be there and stops the layout jumping when it arrives. It also makes an\n * empty result visibly different from a slow one, which on this page is the difference between\n * \"nothing is deployed\" and \"the API is not answering\".\n */\nwithDefaults(defineProps<{ rows?: number; tall?: boolean }>(), { rows: 3, tall: false });\n</script>\n\n<template>\n <div role=\"status\" aria-live=\"polite\" aria-label=\"loading\">\n <div v-for=\"n in rows\" :key=\"n\" class=\"skel\" :class=\"{ tall }\" :style=\"{ width: `${100 - n * 7}%` }\" />\n </div>\n</template>\n"],"names":["_openBlock","_createElementBlock","_hoisted_1","_Fragment","_renderList","__props","n","_normalizeClass"],"mappings":"2PAaEA,EAAA,EAAAC,EAEM,MAFNC,EAEM,QADJD,EAAuGE,EAAA,KAAAC,EAAtFC,EAAA,KAALC,QAAZL,EAAuG,MAAA,CAA/E,IAAKK,EAAG,MAAKC,EAAA,CAAC,OAAM,CAAA,KAAWF,EAAA,IAAA,CAAI,CAAA,EAAK,sBAAyBC,EAAC,CAAA,GAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as R,N,A as V,J as z,c as n,a as s,e as c,w as d,t as o,E as B,u as h,M as D,g as m,z as b,F as g,f as l,_ as A,r as I,R as $,j as v,k as L,l as U,o as t,$ as E,p as S,C as j}from"./index-Cqe_7QZw.js";import{_ as q}from"./SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DVbGiVTB.js";const T={class:"page-head"},H={class:"mute",style:{"font-size":"var(--t-sm)"}},J={style:{"font-size":"var(--t-xl)"}},M={class:"sub"},P={key:0},W={key:1},G={key:2},K={key:3,class:"mute"},O={key:1,class:"panel"},Q={class:"banner failed"},X={class:"panel"},Y={key:1,class:"kvlist"},Z={class:"k"},ee={class:"v"},se={key:0},te={key:1,class:"mute"},ne={class:"v"},ae={key:1,class:"mute"},oe={class:"v"},le={class:"v"},ie={key:0,class:"panel"},de={key:0,class:"banner plain"},re={key:1,class:"code"},ue={key:2,class:"mute"},ve=R({__name:"SpecDetailView",props:{name:{}},setup(y){const k=y,a=v(null),r=v(!0),u=v(""),p=v(!1);async function w(){r.value=!0,p.value=!1;const i=await S.getAuthed(`/api/specs/${encodeURIComponent(k.name)}`);if(r.value=!1,i.status===404){p.value=!0;return}if(!i.ok){u.value=j(i,"load this spec");return}u.value="",a.value=i.body}N(()=>k.name,w,{immediate:!0}),N(()=>E.token,w),V.deploymentsLoaded||z();const C=L(()=>V.deployments.filter(i=>i.specName===k.name));return(i,e)=>{var x;const f=U("RouterLink");return t(),n("div",null,[s("div",T,[s("div",null,[s("div",H,[c(f,{to:"/specs"},{default:d(()=>[...e[0]||(e[0]=[l("← specs",-1)])]),_:1})]),s("h1",J,o(y.name),1),s("div",M,[(x=a.value)!=null&&x.description?(t(),n("span",P,o(a.value.description),1)):p.value?(t(),n("span",W,"not found")):r.value?(t(),n("span",G,"loading…")):(t(),n("span",K,"no description"))])]),e[1]||(e[1]=s("span",{class:"grow"},null,-1)),a.value?(t(),n("span",{key:0,class:B(["badge",a.value.kind])},o(h(D)(a.value.kind)),3)):m("",!0)]),u.value?(t(),b(F,{key:0,text:u.value,title:"Could not load this spec."},null,8,["text"])):m("",!0),p.value?(t(),n("section",O,[s("div",Q,[s("b",null,"No spec named “"+o(y.name)+"”.",1),e[2]||(e[2]=s("p",null,"It may have been deleted, or this is an older link.",-1))])])):(t(),n(g,{key:2},[s("section",X,[r.value?(t(),b(q,{key:0,rows:4})):a.value?(t(),n("ul",Y,[s("li",null,[s("span",Z,[e[4]||(e[4]=l(" Needs ",-1)),c(A,{label:"what needs means"},{default:d(()=>[...e[3]||(e[3]=[l(" Variables the spec uses but does not set. Every deployment referencing it supplies these, which is how one spec serves many stacks — and a missing one is refused by name rather than filled in blank. ",-1)])]),_:1})]),s("span",ee,[a.value.requiredVars.length?(t(),n("b",se,o(a.value.requiredVars.join(", ")),1)):(t(),n("span",te,"nothing — every value is fixed by the spec"))])]),s("li",null,[e[6]||(e[6]=s("span",{class:"k"},"Used by",-1)),s("span",ne,[C.value.length?(t(),n(g,{key:0},[(t(!0),n(g,null,I(C.value,_=>(t(),b(f,{key:_.id,to:`/deployments/${encodeURIComponent(_.id)}`,style:{"margin-right":"10px"}},{default:d(()=>[l(o(_.id),1)]),_:2},1032,["to"]))),128)),c(A,{label:"why this matters"},{default:d(()=>[...e[5]||(e[5]=[l(" Deleting a spec while a deployment still references it is refused: that deployment could no longer be resolved, and one that cannot be resolved can never be torn down. ",-1)])]),_:1})],64)):(t(),n("span",ae,"no deployments reference it"))])]),s("li",null,[e[7]||(e[7]=s("span",{class:"k"},"Created",-1)),s("span",oe,o(h($)(a.value.createdAt)),1)]),s("li",null,[e[8]||(e[8]=s("span",{class:"k"},"Updated",-1)),s("span",le,o(h($)(a.value.updatedAt)),1)])])):m("",!0)]),a.value?(t(),n("section",ie,[e[13]||(e[13]=s("div",{class:"phead"},[s("h2",{class:"section"},"Source")],-1)),a.value.sourceWithheld?(t(),n("div",de,[e[12]||(e[12]=s("b",null,"Hidden without an access token.",-1)),s("p",null,[e[10]||(e[10]=l(" A spec's hooks are shell commands, and they often carry a password or an API token inline — so the server does not send the file to an unauthenticated reader. ",-1)),c(f,{to:"/settings"},{default:d(()=>[...e[9]||(e[9]=[l("Add your token",-1)])]),_:1}),e[11]||(e[11]=l(" to see it. ",-1))])])):a.value.source?(t(),n("pre",re,o(a.value.source),1)):(t(),n("p",ue,"The server returned no source for this spec."))])):m("",!0)],64))])}}});export{ve as default};
|
|
2
|
+
//# sourceMappingURL=SpecDetailView-Bd4Hx-bI.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpecDetailView-BlHaL1Y8.js","sources":["../../src/views/SpecDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One stored spec: what it needs, who uses it, and its source.\n *\n * THE SOURCE IS A RESTRICTED READ. Everything else on this API can be read without a token, but a\n * spec's hook bodies are shell strings that routinely carry a credential inline, so the server sends\n * `source` only to an authenticated request and sets `sourceWithheld` otherwise. That is why this\n * one view uses `getAuthed`, and why \"no token\" renders an explanation rather than an empty editor —\n * a blank box would read as an empty spec, which is a different and much more alarming fact.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecDetail } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { settings } from '../composables/useSettings';\nimport { sentence, stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ name: string }>();\n\nconst spec = ref<SpecDetail | null>(null);\nconst loading = ref(true);\nconst error = ref('');\nconst missing = ref(false);\n\nasync function load(): Promise<void> {\n loading.value = true;\n missing.value = false;\n const r = await api.getAuthed<SpecDetail>(`/api/specs/${encodeURIComponent(props.name)}`);\n loading.value = false;\n if (r.status === 404) {\n missing.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load this spec');\n return;\n }\n error.value = '';\n spec.value = r.body;\n}\n\nwatch(() => props.name, load, { immediate: true });\n// Re-fetch when a token is pasted: the same URL returns strictly more with one.\nwatch(() => settings.token, load);\n\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployments that would become unresolvable if this spec were deleted. */\nconst users = computed(() => state.deployments.filter((d) => d.specName === props.name));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/specs\">← specs</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ name }}</h1>\n <div class=\"sub\">\n <span v-if=\"spec?.description\">{{ spec.description }}</span>\n <span v-else-if=\"missing\">not found</span>\n <span v-else-if=\"loading\">loading…</span>\n <span v-else class=\"mute\">no description</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"spec\" class=\"badge\" :class=\"spec.kind\">{{ sentence(spec.kind) }}</span>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load this spec.\" />\n\n <section v-if=\"missing\" class=\"panel\">\n <div class=\"banner failed\">\n <b>No spec named “{{ name }}”.</b>\n <p>It may have been deleted, or this is an older link.</p>\n </div>\n </section>\n\n <template v-else>\n <section class=\"panel\">\n <SkeletonList v-if=\"loading\" :rows=\"4\" />\n <ul v-else-if=\"spec\" class=\"kvlist\">\n <li>\n <span class=\"k\">\n Needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it supplies\n these, which is how one spec serves many stacks — and a missing one is refused by\n name rather than filled in blank.\n </InfoHint>\n </span>\n <span class=\"v\">\n <b v-if=\"spec.requiredVars.length\">{{ spec.requiredVars.join(', ') }}</b>\n <span v-else class=\"mute\">nothing — every value is fixed by the spec</span>\n </span>\n </li>\n <li>\n <span class=\"k\">Used by</span>\n <span class=\"v\">\n <template v-if=\"users.length\">\n <RouterLink\n v-for=\"d in users\"\n :key=\"d.id\"\n :to=\"`/deployments/${encodeURIComponent(d.id)}`\"\n style=\"margin-right: 10px\"\n >{{ d.id }}</RouterLink\n >\n <InfoHint label=\"why this matters\">\n Deleting a spec while a deployment still references it is refused: that deployment\n could no longer be resolved, and one that cannot be resolved can never be torn\n down.\n </InfoHint>\n </template>\n <span v-else class=\"mute\">no deployments reference it</span>\n </span>\n </li>\n <li><span class=\"k\">Created</span><span class=\"v\">{{ stamp(spec.createdAt) }}</span></li>\n <li><span class=\"k\">Updated</span><span class=\"v\">{{ stamp(spec.updatedAt) }}</span></li>\n </ul>\n </section>\n\n <section v-if=\"spec\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Source</h2>\n </div>\n\n <!--\n Withheld, not empty. The server never sent the source, so there is nothing here to reveal —\n the same reasoning as the masked variables: an affordance that promises plaintext the page\n does not have would be a lie.\n -->\n <div v-if=\"spec.sourceWithheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n A spec's hooks are shell commands, and they often carry a password or an API token\n inline — so the server does not send the file to an unauthenticated reader.\n <RouterLink to=\"/settings\">Add your token</RouterLink> to see it.\n </p>\n </div>\n <pre v-else-if=\"spec.source\" class=\"code\">{{ spec.source }}</pre>\n <p v-else class=\"mute\">The server returned no source for this spec.</p>\n </section>\n </template>\n </div>\n</template>\n"],"names":["props","__props","spec","ref","loading","error","missing","load","r","api","problem","watch","settings","state","loadDeployments","users","computed","d","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_a","_hoisted_5","_openBlock","_hoisted_8","_normalizeClass","_unref","sentence","_createBlock","ErrorNote","_hoisted_9","_hoisted_10","_Fragment","_hoisted_11","SkeletonList","_hoisted_12","_hoisted_13","InfoHint","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_createTextVNode","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"s9BAoBA,MAAMA,EAAQC,EAERC,EAAOC,EAAuB,IAAI,EAClCC,EAAUD,EAAI,EAAI,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAUH,EAAI,EAAK,EAEzB,eAAeI,GAAsB,CACnCH,EAAQ,MAAQ,GAChBE,EAAQ,MAAQ,GAChB,MAAME,EAAI,MAAMC,EAAI,UAAsB,cAAc,mBAAmBT,EAAM,IAAI,CAAC,EAAE,EAExF,GADAI,EAAQ,MAAQ,GACZI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,eACxD,EAAA,EAAA,MAEctB,EAAA,MAAK,QAArB4B,EAAA,EAAAZ,EAAiE,MAAjEsC,GAAiE9B,EAApBxB,EAAA,MAAK,MAAM,EAAA,CAAA,QACxDgB,EAAuE,IAAvEuC,GAAuB,8CAA4C,EAAA"}
|
|
1
|
+
{"version":3,"file":"SpecDetailView-Bd4Hx-bI.js","sources":["../../src/views/SpecDetailView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * One stored spec: what it needs, who uses it, and its source.\n *\n * THE SOURCE IS A RESTRICTED READ. Everything else on this API can be read without a token, but a\n * spec's hook bodies are shell strings that routinely carry a credential inline, so the server sends\n * `source` only to an authenticated request and sets `sourceWithheld` otherwise. That is why this\n * one view uses `getAuthed`, and why \"no token\" renders an explanation rather than an empty editor —\n * a blank box would read as an empty spec, which is a different and much more alarming fact.\n */\nimport { computed, ref, watch } from 'vue';\nimport { api, problem } from '../api/client';\nimport type { SpecDetail } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\nimport { settings } from '../composables/useSettings';\nimport { sentence, stamp } from '../composables/useFormat';\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\n\nconst props = defineProps<{ name: string }>();\n\nconst spec = ref<SpecDetail | null>(null);\nconst loading = ref(true);\nconst error = ref('');\nconst missing = ref(false);\n\nasync function load(): Promise<void> {\n loading.value = true;\n missing.value = false;\n const r = await api.getAuthed<SpecDetail>(`/api/specs/${encodeURIComponent(props.name)}`);\n loading.value = false;\n if (r.status === 404) {\n missing.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load this spec');\n return;\n }\n error.value = '';\n spec.value = r.body;\n}\n\nwatch(() => props.name, load, { immediate: true });\n// Re-fetch when a token is pasted: the same URL returns strictly more with one.\nwatch(() => settings.token, load);\n\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployments that would become unresolvable if this spec were deleted. */\nconst users = computed(() => state.deployments.filter((d) => d.specName === props.name));\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <div class=\"mute\" style=\"font-size: var(--t-sm)\">\n <RouterLink to=\"/specs\">← specs</RouterLink>\n </div>\n <h1 style=\"font-size: var(--t-xl)\">{{ name }}</h1>\n <div class=\"sub\">\n <span v-if=\"spec?.description\">{{ spec.description }}</span>\n <span v-else-if=\"missing\">not found</span>\n <span v-else-if=\"loading\">loading…</span>\n <span v-else class=\"mute\">no description</span>\n </div>\n </div>\n <span class=\"grow\" />\n <span v-if=\"spec\" class=\"badge\" :class=\"spec.kind\">{{ sentence(spec.kind) }}</span>\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load this spec.\" />\n\n <section v-if=\"missing\" class=\"panel\">\n <div class=\"banner failed\">\n <b>No spec named “{{ name }}”.</b>\n <p>It may have been deleted, or this is an older link.</p>\n </div>\n </section>\n\n <template v-else>\n <section class=\"panel\">\n <SkeletonList v-if=\"loading\" :rows=\"4\" />\n <ul v-else-if=\"spec\" class=\"kvlist\">\n <li>\n <span class=\"k\">\n Needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it supplies\n these, which is how one spec serves many stacks — and a missing one is refused by\n name rather than filled in blank.\n </InfoHint>\n </span>\n <span class=\"v\">\n <b v-if=\"spec.requiredVars.length\">{{ spec.requiredVars.join(', ') }}</b>\n <span v-else class=\"mute\">nothing — every value is fixed by the spec</span>\n </span>\n </li>\n <li>\n <span class=\"k\">Used by</span>\n <span class=\"v\">\n <template v-if=\"users.length\">\n <RouterLink\n v-for=\"d in users\"\n :key=\"d.id\"\n :to=\"`/deployments/${encodeURIComponent(d.id)}`\"\n style=\"margin-right: 10px\"\n >{{ d.id }}</RouterLink\n >\n <InfoHint label=\"why this matters\">\n Deleting a spec while a deployment still references it is refused: that deployment\n could no longer be resolved, and one that cannot be resolved can never be torn\n down.\n </InfoHint>\n </template>\n <span v-else class=\"mute\">no deployments reference it</span>\n </span>\n </li>\n <li><span class=\"k\">Created</span><span class=\"v\">{{ stamp(spec.createdAt) }}</span></li>\n <li><span class=\"k\">Updated</span><span class=\"v\">{{ stamp(spec.updatedAt) }}</span></li>\n </ul>\n </section>\n\n <section v-if=\"spec\" class=\"panel\">\n <div class=\"phead\">\n <h2 class=\"section\">Source</h2>\n </div>\n\n <!--\n Withheld, not empty. The server never sent the source, so there is nothing here to reveal —\n the same reasoning as the masked variables: an affordance that promises plaintext the page\n does not have would be a lie.\n -->\n <div v-if=\"spec.sourceWithheld\" class=\"banner plain\">\n <b>Hidden without an access token.</b>\n <p>\n A spec's hooks are shell commands, and they often carry a password or an API token\n inline — so the server does not send the file to an unauthenticated reader.\n <RouterLink to=\"/settings\">Add your token</RouterLink> to see it.\n </p>\n </div>\n <pre v-else-if=\"spec.source\" class=\"code\">{{ spec.source }}</pre>\n <p v-else class=\"mute\">The server returned no source for this spec.</p>\n </section>\n </template>\n </div>\n</template>\n"],"names":["props","__props","spec","ref","loading","error","missing","load","r","api","problem","watch","settings","state","loadDeployments","users","computed","d","_createElementBlock","_createElementVNode","_hoisted_1","_hoisted_2","_createVNode","_component_RouterLink","_cache","_hoisted_3","_toDisplayString","_hoisted_4","_a","_hoisted_5","_openBlock","_hoisted_8","_normalizeClass","_unref","sentence","_createBlock","ErrorNote","_hoisted_9","_hoisted_10","_Fragment","_hoisted_11","SkeletonList","_hoisted_12","_hoisted_13","InfoHint","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_renderList","_createTextVNode","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24"],"mappings":"i7BAoBA,MAAMA,EAAQC,EAERC,EAAOC,EAAuB,IAAI,EAClCC,EAAUD,EAAI,EAAI,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAUH,EAAI,EAAK,EAEzB,eAAeI,GAAsB,CACnCH,EAAQ,MAAQ,GAChBE,EAAQ,MAAQ,GAChB,MAAME,EA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,WAAC,IAAc,CAAA,GAAAC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,GAAd,iBAAc,EAAA,CAAA,2BAAa,eACxD,EAAA,EAAA,MAEctB,EAAA,MAAK,QAArB4B,EAAA,EAAAZ,EAAiE,MAAjEsC,GAAiE9B,EAApBxB,EAAA,MAAK,MAAM,EAAA,CAAA,QACxDgB,EAAuE,IAAvEuC,GAAuB,8CAA4C,EAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{d as q,A as k,J as L,c as a,a as t,f as l,e as i,w as y,_ as C,z as x,g as f,F as N,i as U,v as T,r as $,t as r,j as p,p as E,C as z,k as V,l as B,o as s,D,E as A,u as M,M as R}from"./index-Cqe_7QZw.js";import{_ as j}from"./SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js";import{_ as F}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DVbGiVTB.js";import{_ as I}from"./RelativeTime.vue_vue_type_script_setup_true_lang-NGvUfuKC.js";import{E as P}from"./EquivalentCommand-D92xDU0_.js";import{_ as J}from"./RefreshButton.vue_vue_type_script_setup_true_lang-P7VwWcRa.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const K={class:"page-head"},W={class:"sub"},G={key:1,class:"panel"},H={key:2,class:"panel"},O={class:"field",style:{"max-width":"320px","margin-bottom":"var(--s4)"}},Q={class:"cards","data-testid":"specs.list"},X={class:"stagger"},Y={class:"name","data-label":"name"},Z={key:0,class:"mute",style:{"font-size":"var(--t-sm)"}},ee={"data-label":"kind"},te={"data-label":"needs"},se={key:0},ne={key:1,class:"mute"},oe={"data-label":"used by"},ae={key:0},le={key:1,class:"mute"},ie={class:"dim nowrap","data-label":"updated"},re={key:0},de={colspan:"5",class:"mute"},pe={key:2,class:"banner plain"},_e=q({__name:"SpecsView",setup(ue){const u=p([]),v=p(!1),m=p(""),h=p(!1),c=p("");async function b(){const o=await E.get("/api/specs");if(v.value=!0,o.status===404){h.value=!0;return}if(!o.ok){m.value=z(o,"load specs");return}m.value="",u.value=o.body.specs??[]}b(),k.deploymentsLoaded||L();const _=V(()=>{const o=new Map;for(const e of k.deployments){if(!e.specName)continue;const d=o.get(e.specName)??[];d.push(e.id),o.set(e.specName,d)}return o}),w=V(()=>{const o=c.value.trim().toLowerCase();return o?u.value.filter(e=>e.name.toLowerCase().includes(o)||(e.description??"").toLowerCase().includes(o)):u.value});return(o,e)=>{const d=B("RouterLink");return s(),a("div",null,[t("div",K,[t("div",null,[e[3]||(e[3]=t("h1",null,"Specs",-1)),t("div",W,[e[2]||(e[2]=l(" Stored once, used by any number of deployments ",-1)),i(C,{label:"why store a spec"},{default:y(()=>[...e[1]||(e[1]=[l(" Without this, every deployment carries its own copy — 50 open pull requests meant 50 identical files, and fixing a teardown step meant re-submitting it 50 times. ",-1)])]),_:1})])]),e[4]||(e[4]=t("span",{class:"grow"},null,-1)),i(J,{run:b})]),m.value?(s(),x(F,{key:0,text:m.value,title:"Could not load the specs."},null,8,["text"])):f("",!0),h.value?(s(),a("section",G,[...e[5]||(e[5]=[t("div",{class:"banner plain"},[t("b",null,"This server has no stored specs."),t("p",null," It is an older build of pstack — every deployment carries its own copy of its spec, which still works. Upgrade the host to store specs and reference them by name. ")],-1)])])):(s(),a("section",H,[v.value?u.value.length?(s(),a(N,{key:1},[t("div",O,[e[6]||(e[6]=t("label",{for:"q"},"Search",-1)),U(t("input",{id:"q","onUpdate:modelValue":e[0]||(e[0]=n=>c.value=n),type:"search",placeholder:"name or description"},null,512),[[T,c.value]])]),t("table",Q,[t("thead",null,[t("tr",null,[e[9]||(e[9]=t("th",null,"Name",-1)),e[10]||(e[10]=t("th",null,"Kind",-1)),t("th",null,[e[8]||(e[8]=l(" needs ",-1)),i(C,{label:"what needs means"},{default:y(()=>[...e[7]||(e[7]=[l(" Variables the spec uses but does not set. Every deployment referencing it must supply these, which is how one spec serves many stacks. ",-1)])]),_:1})]),e[11]||(e[11]=t("th",null,"Used by",-1)),e[12]||(e[12]=t("th",null,"Updated",-1))])]),t("tbody",X,[(s(!0),a(N,null,$(w.value,(n,S)=>{var g;return s(),a("tr",{key:n.name,style:D({"--i":S})},[t("td",Y,[i(d,{to:`/specs/${encodeURIComponent(n.name)}`},{default:y(()=>[l(r(n.name),1)]),_:2},1032,["to"]),n.description?(s(),a("div",Z,r(n.description),1)):f("",!0)]),t("td",ee,[t("span",{class:A(["badge",n.kind])},r(M(R)(n.kind)),3)]),t("td",te,[n.requiredVars.length?(s(),a("span",se,r(n.requiredVars.join(", ")),1)):(s(),a("span",ne,"nothing"))]),t("td",oe,[(g=_.value.get(n.name))!=null&&g.length?(s(),a("span",ae,r(_.value.get(n.name).length)+" deployment(s) ",1)):(s(),a("span",le,"nothing yet"))]),t("td",ie,[i(I,{at:n.updatedAt},null,8,["at"])])],4)}),128)),w.value.length?f("",!0):(s(),a("tr",re,[t("td",de,"No spec matches “"+r(c.value)+"”.",1)]))])])],64)):(s(),a("div",pe,[e[16]||(e[16]=t("b",null,"No specs stored yet.",-1)),t("p",null,[e[14]||(e[14]=l(" A deployment can carry its own spec inline — see ",-1)),i(d,{to:"/submit"},{default:y(()=>[...e[13]||(e[13]=[l("Submit",-1)])]),_:1}),e[15]||(e[15]=l(" — and that is all you need for a one-off. Storing one here pays off when several deployments share it. ",-1))]),e[17]||(e[17]=t("p",{class:"mute"},"This page cannot store one yet — the command below does.",-1)),i(P,{what:"storing a spec",method:"PUT",path:"/api/specs/my-spec",body:{spec:"…the contents of your preview.yml…"},cli:"pstack validate -f preview.yml # then PUT it with the curl above"})])):(s(),x(j,{key:0,rows:3}))]))])}}});export{_e as default};
|
|
2
|
+
//# sourceMappingURL=SpecsView-B9qQPzkG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpecsView-C-bS2Av2.js","sources":["../../src/views/SpecsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Stored specs: what is on this host, and who is using each one.\n *\n * The \"used by\" count is computed from the deployments already in shared state rather than asked\n * for: every row carries `specName`, so the join is free. It matters because deleting a spec that\n * deployments still reference is refused — a deployment that cannot resolve its spec can never be\n * torn down — so knowing the count before you try is the difference between a plan and a 409.\n *\n * A server built before named specs answers 404 here. That is a capability difference, not an\n * error, so it gets its own explanation instead of a red banner.\n */\nimport { computed, ref } from 'vue';\nimport { sentence } from '../composables/useFormat';\nimport { api, problem } from '../api/client';\nimport type { SpecMeta, SpecsResponse } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\n\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst specs = ref<SpecMeta[]>([]);\nconst loaded = ref(false);\nconst error = ref('');\nconst unsupported = ref(false);\nconst needle = ref('');\n\nasync function load(): Promise<void> {\n const r = await api.get<SpecsResponse>('/api/specs');\n loaded.value = true;\n if (r.status === 404) {\n unsupported.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load specs');\n return;\n }\n error.value = '';\n specs.value = r.body.specs ?? [];\n}\n\nvoid load();\n// The deployment list is what the \"used by\" column joins against; a deep link straight here may\n// arrive before the shell's poll has filled it.\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployment ids referencing each spec, by spec name. */\nconst users = computed(() => {\n const m = new Map<string, string[]>();\n for (const d of state.deployments) {\n if (!d.specName) continue;\n const list = m.get(d.specName) ?? [];\n list.push(d.id);\n m.set(d.specName, list);\n }\n return m;\n});\n\nconst shown = computed(() => {\n const q = needle.value.trim().toLowerCase();\n if (!q) return specs.value;\n return specs.value.filter(\n (s) => s.name.toLowerCase().includes(q) || (s.description ?? '').toLowerCase().includes(q),\n );\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Specs</h1>\n <div class=\"sub\">\n Stored once, used by any number of deployments\n <InfoHint label=\"why store a spec\">\n Without this, every deployment carries its own copy — 50 open pull requests meant 50\n identical files, and fixing a teardown step meant re-submitting it 50 times.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"load\" />\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load the specs.\" />\n\n <section v-if=\"unsupported\" class=\"panel\">\n <div class=\"banner plain\">\n <b>This server has no stored specs.</b>\n <p>\n It is an older build of pstack — every deployment carries its own copy of its spec, which\n still works. Upgrade the host to store specs and reference them by name.\n </p>\n </div>\n </section>\n\n <section v-else class=\"panel\">\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n\n <template v-else-if=\"specs.length\">\n <div class=\"field\" style=\"max-width: 320px; margin-bottom: var(--s4)\">\n <label for=\"q\">Search</label>\n <input id=\"q\" v-model=\"needle\" type=\"search\" placeholder=\"name or description\" />\n </div>\n\n <table class=\"cards\" data-testid=\"specs.list\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Kind</th>\n <th>\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it must\n supply these, which is how one spec serves many stacks.\n </InfoHint>\n </th>\n <th>Used by</th>\n <th>Updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in shown\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"name\">\n <RouterLink :to=\"`/specs/${encodeURIComponent(s.name)}`\">{{ s.name }}</RouterLink>\n <div v-if=\"s.description\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ s.description }}\n </div>\n </td>\n <td data-label=\"kind\">\n <span class=\"badge\" :class=\"s.kind\">{{ sentence(s.kind) }}</span>\n </td>\n <td data-label=\"needs\">\n <span v-if=\"s.requiredVars.length\">{{ s.requiredVars.join(', ') }}</span>\n <span v-else class=\"mute\">nothing</span>\n </td>\n <td data-label=\"used by\">\n <span v-if=\"users.get(s.name)?.length\">\n {{ users.get(s.name)!.length }} deployment(s)\n </span>\n <span v-else class=\"mute\">nothing yet</span>\n </td>\n <td class=\"dim nowrap\" data-label=\"updated\"><RelativeTime :at=\"s.updatedAt\" /></td>\n </tr>\n <tr v-if=\"!shown.length\">\n <td colspan=\"5\" class=\"mute\">No spec matches “{{ needle }}”.</td>\n </tr>\n </tbody>\n </table>\n </template>\n\n <!--\n Honest empty state. This page cannot create a spec yet, so pointing at \"New spec\" would be a\n dead end — it names the way that does work instead.\n -->\n <div v-else class=\"banner plain\">\n <b>No specs stored yet.</b>\n <p>\n A deployment can carry its own spec inline — see\n <RouterLink to=\"/submit\">Submit</RouterLink> — and that is all you need for a one-off.\n Storing one here pays off when several deployments share it.\n </p>\n <p class=\"mute\">This page cannot store one yet — the command below does.</p>\n <EquivalentCommand\n what=\"storing a spec\"\n method=\"PUT\"\n path=\"/api/specs/my-spec\"\n :body=\"{ spec: '…the contents of your preview.yml…' }\"\n cli=\"pstack validate -f preview.yml # then PUT it with the curl above\"\n />\n </div>\n </section>\n </div>\n</template>\n"],"names":["specs","ref","loaded","error","unsupported","needle","load","r","api","problem","state","loadDeployments","users","computed","m","d","list","shown","q","s","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","RefreshButton","_createBlock","ErrorNote","_openBlock","_hoisted_3","_hoisted_4","_Fragment","_hoisted_5","$event","_hoisted_6","_hoisted_7","_renderList","i","_hoisted_8","_component_RouterLink","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_normalizeClass","_unref","sentence","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_a","_hoisted_15","_hoisted_16","_hoisted_17","RelativeTime","_hoisted_18","_hoisted_19","_hoisted_20","EquivalentCommand","SkeletonList"],"mappings":"0xCAyBA,MAAMA,EAAQC,EAAgB,EAAE,EAC1BC,EAASD,EAAI,EAAK,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAcH,EAAI,EAAK,EACvBI,EAASJ,EAAI,EA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B,oBAAiBhB,EAAGtC,EAAA,KAAM,EAAG,KAAE,CAAA,CAAA,eAUpEyB,IAAAV,EAeM,MAfNwC,GAeM,CAdJrC,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA2B,SAAxB,uBAAoB,EAAA,GACvBA,EAII,IAAA,KAAA,iBAJD,qDAED,EAAA,GAAAI,EAA4CgB,EAAA,CAAhC,GAAG,WAAS,WAAC,IAAM,CAAA,GAAAlB,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAA,GAAN,SAAM,EAAA,CAAA,2BAAa,2GAE9C,EAAA,EAAA,GACAA,EAAA,EAAA,IAAAA,EAAA,EAAA,EAAAF,EAA4E,IAAA,CAAzE,MAAM,MAAA,EAAO,2DAAwD,EAAA,GACxEI,EAMEoC,EAAA,CALA,KAAK,iBACL,OAAO,MACP,KAAK,qBACJ,KAAM,CAAA,KAAA,oCAAA,EACP,IAAI,oEAAA,WAvERjC,EAAyCkC,EAAA,OAAX,KAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"SpecsView-B9qQPzkG.js","sources":["../../src/views/SpecsView.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Stored specs: what is on this host, and who is using each one.\n *\n * The \"used by\" count is computed from the deployments already in shared state rather than asked\n * for: every row carries `specName`, so the join is free. It matters because deleting a spec that\n * deployments still reference is refused — a deployment that cannot resolve its spec can never be\n * torn down — so knowing the count before you try is the difference between a plan and a 409.\n *\n * A server built before named specs answers 404 here. That is a capability difference, not an\n * error, so it gets its own explanation instead of a red banner.\n */\nimport { computed, ref } from 'vue';\nimport { sentence } from '../composables/useFormat';\nimport { api, problem } from '../api/client';\nimport type { SpecMeta, SpecsResponse } from '../api/types';\nimport { state, loadDeployments } from '../composables/useControlPlane';\n\nimport SkeletonList from '../components/SkeletonList.vue';\nimport ErrorNote from '../components/ErrorNote.vue';\nimport InfoHint from '../components/InfoHint.vue';\nimport RelativeTime from '../components/RelativeTime.vue';\nimport EquivalentCommand from '../components/EquivalentCommand.vue';\nimport RefreshButton from '../components/RefreshButton.vue';\n\nconst specs = ref<SpecMeta[]>([]);\nconst loaded = ref(false);\nconst error = ref('');\nconst unsupported = ref(false);\nconst needle = ref('');\n\nasync function load(): Promise<void> {\n const r = await api.get<SpecsResponse>('/api/specs');\n loaded.value = true;\n if (r.status === 404) {\n unsupported.value = true;\n return;\n }\n if (!r.ok) {\n error.value = problem(r, 'load specs');\n return;\n }\n error.value = '';\n specs.value = r.body.specs ?? [];\n}\n\nvoid load();\n// The deployment list is what the \"used by\" column joins against; a deep link straight here may\n// arrive before the shell's poll has filled it.\nif (!state.deploymentsLoaded) void loadDeployments();\n\n/** Deployment ids referencing each spec, by spec name. */\nconst users = computed(() => {\n const m = new Map<string, string[]>();\n for (const d of state.deployments) {\n if (!d.specName) continue;\n const list = m.get(d.specName) ?? [];\n list.push(d.id);\n m.set(d.specName, list);\n }\n return m;\n});\n\nconst shown = computed(() => {\n const q = needle.value.trim().toLowerCase();\n if (!q) return specs.value;\n return specs.value.filter(\n (s) => s.name.toLowerCase().includes(q) || (s.description ?? '').toLowerCase().includes(q),\n );\n});\n</script>\n\n<template>\n <div>\n <div class=\"page-head\">\n <div>\n <h1>Specs</h1>\n <div class=\"sub\">\n Stored once, used by any number of deployments\n <InfoHint label=\"why store a spec\">\n Without this, every deployment carries its own copy — 50 open pull requests meant 50\n identical files, and fixing a teardown step meant re-submitting it 50 times.\n </InfoHint>\n </div>\n </div>\n <span class=\"grow\" />\n <RefreshButton :run=\"load\" />\n </div>\n\n <ErrorNote v-if=\"error\" :text=\"error\" title=\"Could not load the specs.\" />\n\n <section v-if=\"unsupported\" class=\"panel\">\n <div class=\"banner plain\">\n <b>This server has no stored specs.</b>\n <p>\n It is an older build of pstack — every deployment carries its own copy of its spec, which\n still works. Upgrade the host to store specs and reference them by name.\n </p>\n </div>\n </section>\n\n <section v-else class=\"panel\">\n <SkeletonList v-if=\"!loaded\" :rows=\"3\" />\n\n <template v-else-if=\"specs.length\">\n <div class=\"field\" style=\"max-width: 320px; margin-bottom: var(--s4)\">\n <label for=\"q\">Search</label>\n <input id=\"q\" v-model=\"needle\" type=\"search\" placeholder=\"name or description\" />\n </div>\n\n <table class=\"cards\" data-testid=\"specs.list\">\n <thead>\n <tr>\n <th>Name</th>\n <th>Kind</th>\n <th>\n needs\n <InfoHint label=\"what needs means\">\n Variables the spec uses but does not set. Every deployment referencing it must\n supply these, which is how one spec serves many stacks.\n </InfoHint>\n </th>\n <th>Used by</th>\n <th>Updated</th>\n </tr>\n </thead>\n <tbody class=\"stagger\">\n <tr v-for=\"(s, i) in shown\" :key=\"s.name\" :style=\"{ '--i': i }\">\n <td class=\"name\" data-label=\"name\">\n <RouterLink :to=\"`/specs/${encodeURIComponent(s.name)}`\">{{ s.name }}</RouterLink>\n <div v-if=\"s.description\" class=\"mute\" style=\"font-size: var(--t-sm)\">\n {{ s.description }}\n </div>\n </td>\n <td data-label=\"kind\">\n <span class=\"badge\" :class=\"s.kind\">{{ sentence(s.kind) }}</span>\n </td>\n <td data-label=\"needs\">\n <span v-if=\"s.requiredVars.length\">{{ s.requiredVars.join(', ') }}</span>\n <span v-else class=\"mute\">nothing</span>\n </td>\n <td data-label=\"used by\">\n <span v-if=\"users.get(s.name)?.length\">\n {{ users.get(s.name)!.length }} deployment(s)\n </span>\n <span v-else class=\"mute\">nothing yet</span>\n </td>\n <td class=\"dim nowrap\" data-label=\"updated\"><RelativeTime :at=\"s.updatedAt\" /></td>\n </tr>\n <tr v-if=\"!shown.length\">\n <td colspan=\"5\" class=\"mute\">No spec matches “{{ needle }}”.</td>\n </tr>\n </tbody>\n </table>\n </template>\n\n <!--\n Honest empty state. This page cannot create a spec yet, so pointing at \"New spec\" would be a\n dead end — it names the way that does work instead.\n -->\n <div v-else class=\"banner plain\">\n <b>No specs stored yet.</b>\n <p>\n A deployment can carry its own spec inline — see\n <RouterLink to=\"/submit\">Submit</RouterLink> — and that is all you need for a one-off.\n Storing one here pays off when several deployments share it.\n </p>\n <p class=\"mute\">This page cannot store one yet — the command below does.</p>\n <EquivalentCommand\n what=\"storing a spec\"\n method=\"PUT\"\n path=\"/api/specs/my-spec\"\n :body=\"{ spec: '…the contents of your preview.yml…' }\"\n cli=\"pstack validate -f preview.yml # then PUT it with the curl above\"\n />\n </div>\n </section>\n </div>\n</template>\n"],"names":["specs","ref","loaded","error","unsupported","needle","load","r","api","problem","state","loadDeployments","users","computed","m","d","list","shown","q","s","_createElementBlock","_createElementVNode","_hoisted_1","_cache","_hoisted_2","_createVNode","InfoHint","RefreshButton","_createBlock","ErrorNote","_openBlock","_hoisted_3","_hoisted_4","_Fragment","_hoisted_5","$event","_hoisted_6","_hoisted_7","_renderList","i","_hoisted_8","_component_RouterLink","_createTextVNode","_toDisplayString","_hoisted_9","_hoisted_10","_normalizeClass","_unref","sentence","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_a","_hoisted_15","_hoisted_16","_hoisted_17","RelativeTime","_hoisted_18","_hoisted_19","_hoisted_20","EquivalentCommand","SkeletonList"],"mappings":"qvCAyBA,MAAMA,EAAQC,EAAgB,EAAE,EAC1BC,EAASD,EAAI,EAAK,EAClBE,EAAQF,EAAI,EAAE,EACdG,EAAcH,EAAI,EAAK,EACvBI,EAASJ,EAAI,EAAE,EAErB,eAAeK,GAAsB,CACnC,MAAMC,EAAI,MAAMC,EAAI,IAAmB,YAAY,EAEnD,GADAN,EAAO,MAAQ,GACXK,EAAE,SAAW,IAAK,CACpBH,EAAY,MAAQ,GACpB,MACF,CACA,GAAI,CAACG,EAAE,GAAI,CACTJ,EAAM,MAAQM,EAAQF,EAAG,YAAY,EACrC,MACF,CACAJ,EAAM,MAAQ,GACdH,EAAM,MAAQO,EAAE,KAAK,OAAS,CAAA,CAChC,CAEKD,EAAA,EAGAI,EAAM,mBAAwBC,EAAA,EAGnC,MAAMC,EAAQC,EAAS,IAAM,CAC3B,MAAMC,MAAQ,IACd,UAAWC,KAAKL,EAAM,YAAa,CACjC,GAAI,CAAC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AA,EAAO,2DAAwD,EAAA,GACxEI,EAMEoC,EAAA,CALA,KAAK,iBACL,OAAO,MACP,KAAK,qBACJ,KAAM,CAAA,KAAA,oCAAA,EACP,IAAI,oEAAA,WAvERjC,EAAyCkC,EAAA,OAAX,KAAM,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d,c as l,a as t,o as h}from"./index-
|
|
2
|
-
//# sourceMappingURL=SsoMark.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import{d,c as l,a as t,o as h}from"./index-Cqe_7QZw.js";const n=["width","height"],s=["width","height"],a=["width","height"],o=["width","height"],u=["width","height"],r=["width","height"],g=["width","height"],w=["width","height"],z=["width","height"],f=d({__name:"SsoMark",props:{preset:{},size:{default:18}},setup(e){return(k,i)=>e.preset==="github"?(h(),l("svg",{key:0,width:e.size,height:e.size,viewBox:"0 0 16 16","aria-hidden":"true"},[...i[0]||(i[0]=[t("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z"},null,-1)])],8,n)):e.preset==="google"?(h(),l("svg",{key:1,width:e.size,height:e.size,viewBox:"0 0 18 18","aria-hidden":"true"},[...i[1]||(i[1]=[t("path",{fill:"#4285F4",d:"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84c-.21 1.13-.84 2.08-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62z"},null,-1),t("path",{fill:"#34A853",d:"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.71H.96v2.33A8.997 8.997 0 0 0 9 18z"},null,-1),t("path",{fill:"#FBBC05",d:"M3.97 10.71A5.41 5.41 0 0 1 3.68 9c0-.59.1-1.17.28-1.71V4.96H.96A8.996 8.996 0 0 0 0 9c0 1.45.35 2.82.96 4.04l3.01-2.33z"},null,-1),t("path",{fill:"#EA4335",d:"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58C13.46.89 11.43 0 9 0A8.997 8.997 0 0 0 .96 4.96l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z"},null,-1)])],8,s)):e.preset==="gitlab"?(h(),l("svg",{key:2,width:e.size,height:e.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...i[2]||(i[2]=[t("path",{fill:"#FC6D26",d:"m23.6 9.593-.033-.086L20.3.98a.851.851 0 0 0-.336-.405.875.875 0 0 0-1 .054.875.875 0 0 0-.29.44l-2.207 6.748H7.537L5.33 1.07a.858.858 0 0 0-.29-.441.875.875 0 0 0-1-.054.86.86 0 0 0-.336.405L.437 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.01.009.03.021 4.977 3.727 2.462 1.863 1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.499-1.132 2.461-1.863 5.006-3.75.013-.01a6.068 6.068 0 0 0 2.005-7.002Z"},null,-1)])],8,a)):e.preset==="bitbucket"?(h(),l("svg",{key:3,width:e.size,height:e.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...i[3]||(i[3]=[t("path",{fill:"#2684FF",d:"M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z"},null,-1)])],8,o)):e.preset==="microsoft"?(h(),l("svg",{key:4,width:e.size,height:e.size,viewBox:"0 0 21 21","aria-hidden":"true"},[...i[4]||(i[4]=[t("rect",{x:"1",y:"1",width:"9",height:"9",fill:"#F25022"},null,-1),t("rect",{x:"11",y:"1",width:"9",height:"9",fill:"#7FBA00"},null,-1),t("rect",{x:"1",y:"11",width:"9",height:"9",fill:"#00A4EF"},null,-1),t("rect",{x:"11",y:"11",width:"9",height:"9",fill:"#FFB900"},null,-1)])],8,u)):e.preset==="okta"?(h(),l("svg",{key:5,width:e.size,height:e.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...i[5]||(i[5]=[t("path",{fill:"#007DC1",d:"M12 0C5.389 0 0 5.35 0 12s5.35 12 12 12 12-5.35 12-12S18.611 0 12 0zm0 18c-3.325 0-6-2.675-6-6s2.675-6 6-6 6 2.675 6 6-2.675 6-6 6z"},null,-1)])],8,r)):e.preset==="auth0"?(h(),l("svg",{key:6,width:e.size,height:e.size,viewBox:"0 0 24 24","aria-hidden":"true"},[...i[6]||(i[6]=[t("path",{fill:"#EB5424",d:"M21.98 7.448 19.62 0H4.347L2.02 7.448c-1.352 4.312.03 9.206 3.815 12.015L12.007 24l6.157-4.552c3.755-2.81 5.182-7.688 3.815-12.015l-6.16 4.58 2.343 7.45-6.157-4.597-6.158 4.58 2.358-7.433-6.188-4.55 7.63-.045L12.008 0l2.356 7.404 7.615.044z"},null,-1)])],8,g)):e.preset==="keycloak"?(h(),l("svg",{key:7,width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"#00B8E3","stroke-width":"1.8","stroke-linejoin":"round","aria-hidden":"true"},[...i[7]||(i[7]=[t("path",{d:"M7 3.2h10l5 8.8-5 8.8H7L2 12z"},null,-1),t("path",{d:"M10.6 8 8.2 12l2.4 4M15 8l-2.4 4L15 16","stroke-linecap":"square"},null,-1)])],8,w)):(h(),l("svg",{key:8,width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[...i[8]||(i[8]=[t("path",{d:"m21 2-9.6 9.6"},null,-1),t("circle",{cx:"7.5",cy:"15.5",r:"5.5"},null,-1),t("path",{d:"m15.5 7.5 3 3L22 7l-3-3"},null,-1)])],8,z))}});export{f as _};
|
|
2
|
+
//# sourceMappingURL=SsoMark.vue_vue_type_script_setup_true_lang-BBiCq_4w.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SsoMark.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"SsoMark.vue_vue_type_script_setup_true_lang-BBiCq_4w.js","sources":["../../src/components/SsoMark.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * The identity-provider brand marks, drawn inline.\n *\n * Inline and bundled ON PURPOSE: the login page is the first thing a browser loads on a fresh\n * host, and fetching marks from a brand CDN would make signing in depend on a third party (and\n * tell that third party about every visit). So each mark is an SVG in this file, in its brand\n * colour — except GitHub and the generic key, whose marks are drawn in black-or-white and\n * therefore use `currentColor` to follow the theme.\n *\n * `preset` is the preset key the API reports (`config.provider`, or `preset` in the health\n * summary). Anything unrecognised — `custom`, a bare OIDC issuer's `''` — gets the generic key,\n * so a provider nobody drew a mark for still renders as *a* provider rather than as a gap.\n *\n * The Keycloak mark is a simplification (their hexagon-and-chevrons icon rebuilt from basic\n * shapes), not traced brand art; the rest follow the providers' published marks.\n */\nwithDefaults(defineProps<{ preset: string; size?: number }>(), { size: 18 });\n</script>\n\n<template>\n <!-- GitHub: the octocat mark ships in black or white only, so it follows the text colour. -->\n <svg v-if=\"preset === 'github'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n <path\n fill=\"currentColor\"\n d=\"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8z\"\n />\n </svg>\n\n <!-- Google: the 'G', four colours, per the sign-in branding assets. -->\n <svg v-else-if=\"preset === 'google'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 18 18\" aria-hidden=\"true\">\n <path fill=\"#4285F4\" d=\"M17.64 9.2c0-.64-.06-1.25-.16-1.84H9v3.48h4.84c-.21 1.13-.84 2.08-1.8 2.72v2.26h2.92c1.7-1.57 2.68-3.88 2.68-6.62z\" />\n <path fill=\"#34A853\" d=\"M9 18c2.43 0 4.47-.8 5.96-2.18l-2.92-2.26c-.8.54-1.84.86-3.04.86-2.34 0-4.32-1.58-5.03-3.71H.96v2.33A8.997 8.997 0 0 0 9 18z\" />\n <path fill=\"#FBBC05\" d=\"M3.97 10.71A5.41 5.41 0 0 1 3.68 9c0-.59.1-1.17.28-1.71V4.96H.96A8.996 8.996 0 0 0 0 9c0 1.45.35 2.82.96 4.04l3.01-2.33z\" />\n <path fill=\"#EA4335\" d=\"M9 3.58c1.32 0 2.5.45 3.44 1.35l2.58-2.58C13.46.89 11.43 0 9 0A8.997 8.997 0 0 0 .96 4.96l3.01 2.33C4.68 5.16 6.66 3.58 9 3.58z\" />\n </svg>\n\n <!-- GitLab: the single-colour tanuki. -->\n <svg v-else-if=\"preset === 'gitlab'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#FC6D26\"\n d=\"m23.6 9.593-.033-.086L20.3.98a.851.851 0 0 0-.336-.405.875.875 0 0 0-1 .054.875.875 0 0 0-.29.44l-2.207 6.748H7.537L5.33 1.07a.858.858 0 0 0-.29-.441.875.875 0 0 0-1-.054.86.86 0 0 0-.336.405L.437 9.502l-.032.086a6.066 6.066 0 0 0 2.012 7.01l.01.009.03.021 4.977 3.727 2.462 1.863 1.5 1.132a1.009 1.009 0 0 0 1.22 0l1.499-1.132 2.461-1.863 5.006-3.75.013-.01a6.068 6.068 0 0 0 2.005-7.002Z\"\n />\n </svg>\n\n <!-- Bitbucket. -->\n <svg v-else-if=\"preset === 'bitbucket'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#2684FF\"\n d=\"M.778 1.213a.768.768 0 0 0-.768.892l3.263 19.81c.084.5.515.868 1.022.873H19.95a.772.772 0 0 0 .77-.646l3.27-20.03a.768.768 0 0 0-.768-.891zM14.52 15.53H9.522L8.17 8.466h7.561z\"\n />\n </svg>\n\n <!-- Microsoft: the four squares. -->\n <svg v-else-if=\"preset === 'microsoft'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 21 21\" aria-hidden=\"true\">\n <rect x=\"1\" y=\"1\" width=\"9\" height=\"9\" fill=\"#F25022\" />\n <rect x=\"11\" y=\"1\" width=\"9\" height=\"9\" fill=\"#7FBA00\" />\n <rect x=\"1\" y=\"11\" width=\"9\" height=\"9\" fill=\"#00A4EF\" />\n <rect x=\"11\" y=\"11\" width=\"9\" height=\"9\" fill=\"#FFB900\" />\n </svg>\n\n <!-- Okta: the circle mark. -->\n <svg v-else-if=\"preset === 'okta'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#007DC1\"\n d=\"M12 0C5.389 0 0 5.35 0 12s5.35 12 12 12 12-5.35 12-12S18.611 0 12 0zm0 18c-3.325 0-6-2.675-6-6s2.675-6 6-6 6 2.675 6 6-2.675 6-6 6z\"\n />\n </svg>\n\n <!-- Auth0: the shield. -->\n <svg v-else-if=\"preset === 'auth0'\" :width=\"size\" :height=\"size\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path\n fill=\"#EB5424\"\n d=\"M21.98 7.448 19.62 0H4.347L2.02 7.448c-1.352 4.312.03 9.206 3.815 12.015L12.007 24l6.157-4.552c3.755-2.81 5.182-7.688 3.815-12.015l-6.16 4.58 2.343 7.45-6.157-4.597-6.158 4.58 2.358-7.433-6.188-4.55 7.63-.045L12.008 0l2.356 7.404 7.615.044z\"\n />\n </svg>\n\n <!-- Keycloak: hexagon and double chevron, simplified — see the header. -->\n <svg\n v-else-if=\"preset === 'keycloak'\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"#00B8E3\"\n stroke-width=\"1.8\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"M7 3.2h10l5 8.8-5 8.8H7L2 12z\" />\n <path d=\"M10.6 8 8.2 12l2.4 4M15 8l-2.4 4L15 16\" stroke-linecap=\"square\" />\n </svg>\n\n <!-- Everything else — custom OAuth2, a bare OIDC issuer, a preset this build has no mark for. -->\n <svg\n v-else\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d=\"m21 2-9.6 9.6\" />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n <path d=\"m15.5 7.5 3 3L22 7l-3-3\" />\n </svg>\n</template>\n"],"names":["__props","_createElementBlock","_createElementVNode"],"mappings":"2UAsBaA,EAAA,SAA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,IAAI,OAAO,IAAI,KAAK,SAAA,oBAIhCF,EAAA,SAAM,YAAtBC,EAKM,MAAA,OAL8B,MAAOD,EAAA,KAAO,OAAQA,EAAA,KAAM,QAAQ,YAAY,cAAY,MAAA,mBAC9FE,EAGE,OAAA,CAFA,KAAK,UACL,EAAE,qIAAA,oBAKUF,EAAA,SAAM,aAAtBC,EAKM,MAAA,OAL+B,MAAOD,EAAA,KAAO,OAAQA,EAAA,KAAM,QAAQ,YAAY,cAAY,MAAA,mBAC/FE,EAGE,OAAA,CAFA,KAAK,UACL,EAAE,kPAAA,oBAMOF,EAAA,SAAM,gBADnBC,EAaM,MAAA,OAXH,MAAOD,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,YACR,KAAK,OACL,OAAO,UACP,eAAa,MACb,kBAAgB,QAChB,cAAY,MAAA,mBAEZE,EAA0C,OAAA,CAApC,EAAE,+BAAA,EAA+B,KAAA,EAAA,EACvCA,EAA2E,OAAA,CAArE,EAAE,yCAAyC,iBAAe,QAAA,yBAIlED,EAeM,MAAA,OAbH,MAAOD,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,YACR,KAAK,OACL,OAAO,eACP,eAAa,IACb,iBAAe,QACf,kBAAgB,QAChB,cAAY,MAAA,mBAEZE,EAA0B,OAAA,CAApB,EAAE,eAAA,EAAe,KAAA,EAAA,EACvBA,EAAqC,SAAA,CAA7B,GAAG,MAAM,GAAG,OAAO,EAAE,KAAA,WAC7BA,EAAoC,OAAA,CAA9B,EAAE,yBAAA,EAAyB,KAAA,EAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d as ne,c as r,a as s,f as a,e as f,w as $,_ as F,g as h,z as j,F as b,t as d,i as u,I as ae,v as p,r as V,Z as ie,j as y,p as q,C as G,k as x,O as L,o as i,u as re,D as de}from"./index-T3JGe9ku.js";import{s as ue}from"./useFormat-DIlTY5Dl.js";import{_ as W}from"./ActionButton.vue_vue_type_script_setup_true_lang-C6PZurL0.js";import{_ as Y}from"./ErrorNote.vue_vue_type_script_setup_true_lang-CUZs06O0.js";import{_ as pe}from"./HelpModal.vue_vue_type_script_setup_true_lang-ErbSSi6D.js";import{_ as ce}from"./RelativeTime.vue_vue_type_script_setup_true_lang-D4NO-r5D.js";import{_ as me}from"./SkeletonList.vue_vue_type_script_setup_true_lang-Bwex16vy.js";import{_ as T}from"./SsoMark.vue_vue_type_script_setup_true_lang-aKprkHCF.js";import{_ as ve}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./Teleport-CKfsIrp8.js";const he={class:"page-head"},fe={class:"sub"},ye={class:"panel"},ge={class:"phead"},ke={class:"section"},be={class:"mute"},we={class:"check"},Ue={key:0,class:"banner plain"},xe=["href"],Ce={class:"field"},_e={class:"row sso-copy"},$e={class:"sso-url"},Ie={key:1,class:"field"},Ae={class:"field"},Re=["placeholder"],Oe={class:"hint"},Se=["for"],Ve=["id","onUpdate:modelValue"],Le={class:"field"},Ee=["data-incomplete"],De={class:"hint"},ze={key:1,class:"field"},je={class:"field"},qe={class:"field"},Ge={class:"hint"},Te={class:"field"},Me=["placeholder"],Ne=["open"],Ke={class:"field"},Be={class:"field"},He={class:"field"},Pe={class:"field"},Fe={class:"field"},We={class:"section",style:{"margin-top":"var(--s4)"}},Ye={class:"row",style:{"flex-wrap":"wrap",gap:"var(--s3)"}},Ze=["for"],Je=["id","onUpdate:modelValue"],Qe={class:"panel"},Xe={class:"field"},es={class:"field"},ss={key:0,class:"field"},ts={key:1,class:"hint"},os={class:"row",style:{gap:"var(--s3)"}},ls={key:3,class:"panel"},ns={class:"phead"},as={class:"section"},is={class:"sso-tiles"},rs=["onClick"],ds={class:"sso-tile-mode"},us={class:"panel"},ps={class:"sso-cards stagger"},cs={class:"sso-card-main"},ms={class:"sso-card-head"},vs={class:"mute"},hs={key:0,class:"badge off"},fs={class:"sso-card-sub"},ys={class:"row-actions"},gs=["onClick"],ks={class:"panel"},bs={class:"row sso-copy"},ws={class:"sso-url"},Us=ne({__name:"SsoView",setup(xs){const E={subject:"sub",username:"preferred_username",email:"email",name:"name",avatar:"picture"},M=()=>({mode:"oidc",enabled:!0,label:"",clientId:"",discoveryUrl:"",provider:"",authorizeUrl:"",tokenUrl:"",userInfoUrl:"",emailsUrl:"",groupsUrl:"",scopes:"",claimMap:{...E},allowedEmailDomains:[],allowedUsernames:[],requiredGroups:[],defaultRole:"admin"}),w=y([]),I=y([]),A=y(""),R=y(!1),g=y(""),o=y(null),C=y(!1),O=y(!1),U=y("");async function D(){const t=await q.get("/api/sso/config");if(R.value=!0,!t.ok){g.value=G(t,"read the sign-on settings");return}g.value="",w.value=t.body.providers??[],I.value=t.body.presets??[],A.value=t.body.callbackUrl}D();const N=x(()=>!o.value&&(C.value||R.value&&!g.value&&w.value.length===0)),Z=x(()=>[...I.value.map(t=>({preset:t,id:t.key,label:t.label,mode:t.mode})),{preset:null,id:"custom-oauth2",label:"Custom OAuth 2.0",mode:"oauth2"},{preset:null,id:"custom-oidc",label:"Custom OpenID Connect",mode:"oidc"}]);function J(t){const e=new Set(w.value.map(n=>n.key));if(!e.has(t))return t;for(let n=2;;n++)if(!e.has(`${t}-${n}`))return`${t}-${n}`}function Q(t){const e=t.preset,n=M();n.mode=t.mode,n.provider=e?e.key:t.mode==="oauth2"?"custom":"",e&&(n.label=e.label,n.scopes=e.scopes,n.claimMap={...E,...e.claimMap},e.mode==="oauth2"?(n.authorizeUrl=e.authorizeUrl,n.tokenUrl=e.tokenUrl,n.userInfoUrl=e.userInfoUrl):e.discoveryUrl.includes("<")||(n.discoveryUrl=e.discoveryUrl)),o.value={originalKey:null,key:J(e?e.key:t.mode==="oauth2"?"custom":"oidc"),preset:e,form:n,secret:"",secretSet:!1,domains:"",usernames:"",groups:"",placeholders:{}},U.value="",C.value=!1}function X(t){o.value={originalKey:t.key,key:t.key,preset:I.value.find(e=>e.key===t.config.provider)??null,form:{...M(),...t.config,claimMap:{...E,...t.config.claimMap}},secret:"",secretSet:t.secretSet,domains:(t.config.allowedEmailDomains??[]).join(", "),usernames:(t.config.allowedUsernames??[]).join(", "),groups:(t.config.requiredGroups??[]).join(", "),placeholders:{}},U.value="",C.value=!1}const _=x(()=>{const t=o.value;if(!t||t.originalKey!==null||!t.preset||t.form.mode!=="oidc")return null;const e=t.preset.discoveryUrl;if(!e.includes("<"))return null;const n=[],c=/<([^>]+)>/g;let m=0;for(let v=c.exec(e);v;v=c.exec(e))v.index>m&&n.push(e.slice(m,v.index)),n.push({ph:v[1]??""}),m=v.index+v[0].length;return m<e.length&&n.push(e.slice(m)),n}),K=x(()=>(_.value??[]).flatMap(t=>typeof t=="string"?[]:[t.ph])),S=x(()=>{const t=_.value,e=o.value;return!t||!e?"":t.map(n=>{var c;return typeof n=="string"?n:((c=e.placeholders[n.ph])==null?void 0:c.trim())||`<${n.ph}>`}).join("")}),ee=/^[a-z0-9][a-z0-9-]{0,31}$/,B=x(()=>{const t=o.value;if(!t)return"nothing is being edited";const e=t.key.trim();if(!ee.test(e))return"the key must be a lowercase slug of letters, digits and dashes (32 at most)";if(t.originalKey===null&&w.value.some(n=>n.key===e))return`a provider is already stored under "${e}" — edit that one instead, or pick another key`;if(!t.form.clientId.trim())return"the client id is required";if(!t.secretSet&&!t.secret.trim())return"the client secret is required";if(t.form.mode==="oidc"){const n=_.value?S.value:t.form.discoveryUrl.trim();if(!n)return"the issuer is required";if(n.includes("<"))return"fill in the issuer placeholder first"}else if(!t.form.authorizeUrl.trim()||!t.form.tokenUrl.trim())return"the authorize and token URLs are required";return""}),z=t=>t.split(",").map(e=>e.trim()).filter(Boolean);async function se(){const t=o.value;if(!t)return;O.value=!0;const e={...t.form,key:t.key.trim(),clientSecret:t.secret.trim(),discoveryUrl:_.value?S.value:t.form.discoveryUrl,allowedEmailDomains:z(t.domains),allowedUsernames:z(t.usernames),requiredGroups:t.form.mode==="oidc"?[]:z(t.groups)},n=await q.put("/api/sso/config",e);if(O.value=!1,!n.ok){U.value=G(n,"save the provider");return}U.value="",L("ok",t.form.mode==="oidc"?"Saved — the issuer answered, so the settings are known good.":"Saved."),o.value=null,D()}async function te(t){const e=await q.del(`/api/sso/config/${t.key}`);if(!e.ok){g.value=G(e,"remove the provider");return}L("ok",`Removed ${t.key}. Existing accounts keep working.`),D()}async function H(){try{await navigator.clipboard.writeText(A.value),L("ok","Copied.")}catch{L("error","Could not reach the clipboard — select the text and copy it.")}}function oe(t){if(t.mode==="oidc")try{return`OpenID Connect · ${new URL(t.discoveryUrl).hostname}`}catch{return"OpenID Connect"}const e=I.value.find(n=>n.key===t.provider);return e?`OAuth 2.0 · ${e.label}`:"OAuth 2.0 · custom endpoints"}function le(t){var n,c,m;const e=[];return(n=t.allowedEmailDomains)!=null&&n.length&&e.push(`domains ${t.allowedEmailDomains.join(", ")}`),(c=t.allowedUsernames)!=null&&c.length&&e.push(`usernames ${t.allowedUsernames.join(", ")}`),(m=t.requiredGroups)!=null&&m.length&&e.push(`groups ${t.requiredGroups.join(", ")}`),e.length?`lets in ${e.join("; ")}`:"lets in anyone the provider allows"}return(t,e)=>{var n,c,m,v;return i(),r("div",null,[s("div",he,[s("div",null,[s("h1",null,[e[19]||(e[19]=a(" Single sign-on ",-1)),f(pe,{title:"How single sign-on works here"},{default:$(()=>[...e[18]||(e[18]=[s("p",null,[s("b",null,"This service is the relying party and nothing more."),a(" You register an OAuth or OIDC application in your own organisation and paste its client id and secret here. Your directory stays yours — no accounts are copied, and nothing is synchronised. ")],-1),s("p",null,[s("b",null,"Anyone who authenticates gets an account"),a(", created on their first sign-in. That is deliberate: your provider already decides who may authenticate (Workspace restricts to internal users, a GitHub app can be org-approved), and duplicating that policy here would just be a second list to keep in step. Narrow it with the sign-in rules on each provider if you need to. ")],-1),s("p",null,[s("b",null,"Identity is the provider's subject, not the email."),a(" Someone changing their address keeps their account, their history and their tokens. An address is only used to adopt an account that already exists here, and only when the provider says it is verified. ")],-1),s("p",null,[s("b",null,"Several providers share the accounts."),a(" Each shows up as its own button on the login page, and the same person arriving from the same directory is the same account — nothing about local accounts or personal tokens changes either way. ")],-1)])]),_:1})]),s("div",fe,[e[21]||(e[21]=a(" Let people sign in with the identity providers you already run ",-1)),f(F,{label:"what is stored"},{default:$(()=>[...e[20]||(e[20]=[a(" One row per provider: the endpoints, the client id, and the client secret. The secret has no read path — this page only learns whether one is stored, and leaving the field empty keeps it. ",-1)])]),_:1})])]),e[22]||(e[22]=s("span",{class:"grow"},null,-1)),R.value&&!g.value&&!o.value&&!N.value?(i(),r("button",{key:0,class:"primary",onClick:e[0]||(e[0]=l=>C.value=!0)},"Add provider")):h("",!0)]),g.value?(i(),j(Y,{key:0,text:g.value,title:"Single sign-on."},null,8,["text"])):h("",!0),R.value?o.value?(i(),r(b,{key:2},[s("section",ye,[s("div",ge,[f(T,{preset:o.value.form.provider,size:20},null,8,["preset"]),s("h2",ke,d(o.value.originalKey?`Edit ${o.value.originalKey}`:`Add ${((n=o.value.preset)==null?void 0:n.label)??(o.value.form.mode==="oidc"?"an OpenID Connect issuer":"a custom OAuth 2.0 provider")}`),1),s("span",be,d(o.value.form.mode==="oidc"?"OpenID Connect":"OAuth 2.0"),1),e[24]||(e[24]=s("span",{class:"grow"},null,-1)),s("label",we,[u(s("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.form.enabled=l),type:"checkbox"},null,512),[[ae,o.value.form.enabled]]),e[23]||(e[23]=a(" Enabled",-1))])]),o.value.preset?(i(),r("div",Ue,[s("b",null,"Register the app with "+d(o.value.preset.label),1),s("p",null,d(o.value.preset.setupHint),1),s("p",null,[s("a",{href:o.value.preset.setupUrl,target:"_blank",rel:"noopener"}," Create the app in "+d(o.value.preset.label)+" → ",9,xe)])])):h("",!0),s("div",Ce,[e[25]||(e[25]=s("label",null,"Redirect URI",-1)),s("div",_e,[s("code",$e,d(A.value),1),s("button",{type:"button",onClick:H},"Copy")]),e[26]||(e[26]=s("p",{class:"hint"}," Paste this into the provider's application as the redirect / callback URL. It has to match byte for byte, and it is the same for every provider on this host — a mismatch is the single most common reason the exchange fails, and the provider's error rarely says so. ",-1))]),o.value.originalKey?h("",!0):(i(),r("div",Ie,[e[27]||(e[27]=s("label",{for:"sso-key"},"Key",-1)),u(s("input",{id:"sso-key","onUpdate:modelValue":e[2]||(e[2]=l=>o.value.key=l),type:"text",spellcheck:"false",class:"sso-key"},null,512),[[p,o.value.key]]),e[28]||(e[28]=s("p",{class:"hint"}," This host's name for the provider — it appears in the sign-in URL and in exports, never to the person signing in. Lowercase letters, digits and dashes. ",-1))])),s("div",Ae,[e[29]||(e[29]=s("label",{for:"sso-label"},"Button text",-1)),u(s("input",{id:"sso-label","onUpdate:modelValue":e[3]||(e[3]=l=>o.value.form.label=l),type:"text",placeholder:((c=o.value.preset)==null?void 0:c.label)||"Acme SSO"},null,8,Re),[[p,o.value.form.label]]),s("p",Oe,"The login page draws it as “Continue with "+d(o.value.form.label||((m=o.value.preset)==null?void 0:m.label)||"…")+"”.",1)]),o.value.form.mode==="oidc"?(i(),r(b,{key:2},[_.value?(i(),r(b,{key:0},[(i(!0),r(b,null,V(K.value,l=>(i(),r("div",{key:l,class:"field"},[s("label",{for:`ph-${l}`},d(re(ue)(l)),9,Se),u(s("input",{id:`ph-${l}`,"onUpdate:modelValue":k=>o.value.placeholders[l]=k,type:"text",spellcheck:"false",class:"sso-key"},null,8,Ve),[[p,o.value.placeholders[l]]])]))),128)),s("div",Le,[e[30]||(e[30]=s("label",null,"Issuer",-1)),s("code",{class:"sso-url","data-incomplete":S.value.includes("<")||void 0},d(S.value),9,Ee),s("p",De," Assembled from the value"+d(K.value.length>1?"s":"")+" above — "+d((v=o.value.preset)==null?void 0:v.label)+" gives every account its own issuer, so there is no single URL a preset could carry. It is fetched when you save, so a typo is refused here rather than at someone's first login. ",1)])],64)):(i(),r("div",ze,[e[31]||(e[31]=s("label",{for:"sso-issuer"},"Issuer",-1)),u(s("input",{id:"sso-issuer","onUpdate:modelValue":e[4]||(e[4]=l=>o.value.form.discoveryUrl=l),type:"text",spellcheck:"false",placeholder:"https://accounts.google.com"},null,512),[[p,o.value.form.discoveryUrl]]),e[32]||(e[32]=s("p",{class:"hint"},[a(" Or the full "),s("code",null,"…/.well-known/openid-configuration"),a(" URL. Everything but the client id and secret is discovered from it, and it is fetched when you save — so a typo is refused here rather than at someone's first login. ")],-1))]))],64)):h("",!0),s("div",je,[e[33]||(e[33]=s("label",{for:"sso-client"},"Client id",-1)),u(s("input",{id:"sso-client","onUpdate:modelValue":e[5]||(e[5]=l=>o.value.form.clientId=l),type:"text",spellcheck:"false",autocomplete:"off"},null,512),[[p,o.value.form.clientId]])]),s("div",qe,[e[34]||(e[34]=s("label",{for:"sso-secret"},"Client secret",-1)),u(s("input",{id:"sso-secret","onUpdate:modelValue":e[6]||(e[6]=l=>o.value.secret=l),type:"password",spellcheck:"false",autocomplete:"new-password"},null,512),[[p,o.value.secret]]),s("p",Ge," Write-only. "+d(o.value.secretSet?"A secret is stored — leave this empty to keep it.":"Stored on save and never returned by any route."),1)]),s("div",Te,[e[35]||(e[35]=s("label",{for:"sso-scopes"},"Scopes",-1)),u(s("input",{id:"sso-scopes","onUpdate:modelValue":e[7]||(e[7]=l=>o.value.form.scopes=l),type:"text",spellcheck:"false",placeholder:o.value.form.mode==="oidc"?"openid profile email":""},null,8,Me),[[p,o.value.form.scopes]])]),o.value.form.mode==="oauth2"?(i(),r("details",{key:3,class:"sso-adv",open:!o.value.preset},[e[46]||(e[46]=s("summary",null,"Endpoints and claim mapping",-1)),s("div",Ke,[e[36]||(e[36]=s("label",{for:"sso-auth"},"Authorize URL",-1)),u(s("input",{id:"sso-auth","onUpdate:modelValue":e[8]||(e[8]=l=>o.value.form.authorizeUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.authorizeUrl]])]),s("div",Be,[e[37]||(e[37]=s("label",{for:"sso-token"},"Token URL",-1)),u(s("input",{id:"sso-token","onUpdate:modelValue":e[9]||(e[9]=l=>o.value.form.tokenUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.tokenUrl]])]),s("div",He,[e[38]||(e[38]=s("label",{for:"sso-userinfo"},"User info URL",-1)),u(s("input",{id:"sso-userinfo","onUpdate:modelValue":e[10]||(e[10]=l=>o.value.form.userInfoUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.userInfoUrl]]),e[39]||(e[39]=s("p",{class:"hint"},"Leave empty to take the identity from the token response alone — a subject and nothing else.",-1))]),s("div",Pe,[e[40]||(e[40]=s("label",{for:"sso-emails"},[a("Emails URL "),s("span",{class:"mute"},"(optional)")],-1)),u(s("input",{id:"sso-emails","onUpdate:modelValue":e[11]||(e[11]=l=>o.value.form.emailsUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.emailsUrl]]),e[41]||(e[41]=s("p",{class:"hint"}," Only consulted when the profile carries no address — which is GitHub's default. Filled in automatically for a preset, and needed only if you pointed the user info URL at your own host. ",-1))]),s("div",Fe,[e[42]||(e[42]=s("label",{for:"sso-groups-url"},[a("Groups URL "),s("span",{class:"mute"},"(optional)")],-1)),u(s("input",{id:"sso-groups-url","onUpdate:modelValue":e[12]||(e[12]=l=>o.value.form.groupsUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.groupsUrl]]),e[43]||(e[43]=s("p",{class:"hint"}," Where this host asks which groups someone is in. Only consulted when there is a group rule below. Filled in automatically for a preset — but only while the user info URL is still the preset's, because a self-hosted host's token must not be sent to the public one, so a self-hosted provider needs this typed. ",-1))]),s("h3",We,[e[45]||(e[45]=a(" Claim mapping ",-1)),f(F,{label:"what this is"},{default:$(()=>[...e[44]||(e[44]=[a(" Which key of the provider's user response holds each field. Flat lookups, not expressions. A preset fills these in; you only touch them for a provider nobody has written a preset for. ",-1)])]),_:1})]),s("div",Ye,[(i(),r(b,null,V(["subject","username","email","name","avatar"],l=>s("div",{key:l,class:"field inline"},[s("label",{for:`cm-${l}`},d(l),9,Ze),u(s("input",{id:`cm-${l}`,"onUpdate:modelValue":k=>o.value.form.claimMap[l]=k,type:"text",spellcheck:"false",style:{width:"11rem"}},null,8,Je),[[p,o.value.form.claimMap[l]]])])),64))])],8,Ne)):h("",!0)]),s("section",Qe,[e[53]||(e[53]=s("div",{class:"phead"},[s("h2",{class:"section"},"Who gets an account")],-1)),e[54]||(e[54]=s("p",{class:"dim"},[a(" By default, anyone this provider lets authenticate. It already owns that decision; this is only here for the case where the application you registered is broader than the people who should reach this control plane. "),s("b",null,"Any one entry in a list is enough to satisfy that list, and every list you fill in has to be satisfied"),a(" — fill all three in and a login needs a listed domain, a matching username, and one of the groups. A list left empty is not a rule at all: it lets everyone past that check, it does not lock everyone out. ")],-1)),s("div",Xe,[e[47]||(e[47]=s("label",{for:"sso-domains"},"Allowed email domains",-1)),u(s("input",{id:"sso-domains","onUpdate:modelValue":e[13]||(e[13]=l=>o.value.domains=l),type:"text",spellcheck:"false",placeholder:"example.com, corp.example"},null,512),[[p,o.value.domains]]),e[48]||(e[48]=s("p",{class:"hint"},[a(" Comma-separated; subdomains count. Empty means no restriction. "),s("b",null,"Non-empty means a login with no email address at all is refused too"),a(" — a provider that hides the address (a private GitHub profile with no "),s("code",null,"user:email"),a(" scope) cannot be checked, so it is not waved through. ")],-1))]),s("div",es,[e[49]||(e[49]=s("label",{for:"sso-usernames"},"Allowed usernames",-1)),u(s("input",{id:"sso-usernames","onUpdate:modelValue":e[14]||(e[14]=l=>o.value.usernames=l),type:"text",spellcheck:"false",placeholder:"octocat, qa-[0-9]*"},null,512),[[p,o.value.usernames]]),e[50]||(e[50]=ie('<p class="hint" data-v-8383cb2f> Comma-separated patterns, case-insensitive: <code data-v-8383cb2f>*</code>, <code data-v-8383cb2f>?</code> and <code data-v-8383cb2f>[0-9]</code> classes. Empty means no restriction. <b data-v-8383cb2f>Non-empty means a login whose provider sends no username is refused too</b> — so this is a rule for a provider that actually has usernames (GitHub's <code data-v-8383cb2f>login</code>, GitLab's <code data-v-8383cb2f>username</code>). On an OpenID Connect issuer that sends no <code data-v-8383cb2f>preferred_username</code> it refuses everyone rather than nobody, so set it only where you know the provider sends one. </p>',1))]),o.value.form.mode==="oauth2"?(i(),r("div",ss,[e[51]||(e[51]=s("label",{for:"sso-groups"},"Required groups",-1)),u(s("input",{id:"sso-groups","onUpdate:modelValue":e[15]||(e[15]=l=>o.value.groups=l),type:"text",spellcheck:"false",placeholder:"acme, acme/backend"},null,512),[[p,o.value.groups]]),e[52]||(e[52]=s("p",{class:"hint"},[a(" Comma-separated, and "),s("b",null,"exact names, not patterns"),a(" — an organisation login, or a group path like "),s("code",null,"acme/backend"),a(". Case-insensitive. Empty means no restriction. Non-empty makes every sign-in ask the provider for that person's groups, so it needs the OAuth scope that endpoint requires: "),s("b",null,"add it to Scopes above, or the save is refused"),a(" — and the refusal names the scope. It also needs a provider whose group list this host knows how to read, which the save checks by name. If that call does not answer, the sign-in is refused rather than allowed. ")],-1))])):(i(),r("p",ts," A group rule needs a provider whose groups endpoint this host knows how to read — an OAuth 2.0 preset (GitHub, GitLab), not a discovered OpenID Connect issuer — so there is none here. "))]),U.value?(i(),j(Y,{key:0,text:U.value,title:"Not saved."},null,8,["text"])):h("",!0),s("div",os,[f(W,{variant:"primary",pending:O.value,disabled:O.value||!!B.value,title:B.value||void 0,onClick:se},{default:$(()=>[a(d(o.value.originalKey?"Save changes":"Add provider"),1)]),_:1},8,["pending","disabled","title"]),s("button",{class:"ghost",onClick:e[16]||(e[16]=l=>o.value=null)},"Cancel")])],64)):N.value?(i(),r("section",ls,[s("div",ns,[s("h2",as,d(w.value.length?"Add a provider":"Pick a provider"),1),e[55]||(e[55]=s("span",{class:"grow"},null,-1)),w.value.length?(i(),r("button",{key:0,class:"ghost",onClick:e[17]||(e[17]=l=>C.value=!1)},"Cancel")):h("",!0)]),e[56]||(e[56]=s("p",{class:"dim"}," Pick where your team already signs in. A preset knows the provider's endpoints and its quirks — the only things it cannot know are the client id and secret you get when you register the app, and the form that opens says exactly where to do that. ",-1)),s("div",is,[(i(!0),r(b,null,V(Z.value,l=>{var k;return i(),r("button",{key:l.id,class:"sso-tile",onClick:P=>Q(l)},[f(T,{preset:((k=l.preset)==null?void 0:k.key)??"custom",size:22},null,8,["preset"]),s("span",null,d(l.label),1),s("span",ds,d(l.mode==="oidc"?"OpenID Connect":"OAuth 2.0"),1)],8,rs)}),128))])])):g.value?h("",!0):(i(),r(b,{key:4},[s("section",us,[e[58]||(e[58]=s("div",{class:"phead"},[s("h2",{class:"section"},"Providers")],-1)),s("div",ps,[(i(!0),r(b,null,V(w.value,(l,k)=>(i(),r("div",{key:l.key,class:"sso-card",style:de({"--i":k})},[f(T,{preset:l.config.provider,size:22},null,8,["preset"]),s("div",cs,[s("div",ms,[s("b",null,d(l.config.label),1),s("code",vs,d(l.key),1),l.config.enabled?h("",!0):(i(),r("span",hs,"disabled"))]),s("div",fs,[a(d(oe(l.config))+" · "+d(le(l.config))+" · updated ",1),f(ce,{at:l.updatedAt},null,8,["at"])])]),s("div",ys,[s("button",{class:"ghost sm",onClick:P=>X(l)},"Edit",8,gs),f(W,{variant:"ghost",class:"sm sso-remove",confirm:`Remove ${l.key}?`,onRun:P=>te(l)},{default:$(()=>[...e[57]||(e[57]=[a(" Remove ",-1)])]),_:1},8,["confirm","onRun"])])],4))),128))]),e[59]||(e[59]=s("p",{class:"mute",style:{"font-size":"var(--t-sm)","margin-top":"var(--s3)"}}," Removing a provider does not delete anyone. Those accounts keep their personal tokens, and pointing the same provider back at this host re-links them by subject. ",-1))]),s("section",ks,[e[60]||(e[60]=s("div",{class:"phead"},[s("h2",{class:"section"},"Callback URL")],-1)),e[61]||(e[61]=s("p",{class:"dim"}," The redirect URI to register with every provider — one URL for all of them, built by the server so it cannot drift from the one the sign-in flow actually sends. ",-1)),s("div",bs,[s("code",ws,d(A.value),1),s("button",{type:"button",onClick:H},"Copy")])])],64)):(i(),j(me,{key:1,rows:4}))])}}}),Es=ve(Us,[["__scopeId","data-v-8383cb2f"]]);export{Es as default};
|
|
2
|
-
//# sourceMappingURL=SsoView-
|
|
1
|
+
import{d as ne,c as r,a as s,f as a,e as f,w as $,_ as F,g as h,z as j,F as b,t as d,i as u,L as ae,v as p,r as L,a3 as ie,j as y,p as q,C as G,k as x,U as O,o as i,u as re,M as de,D as ue}from"./index-Cqe_7QZw.js";import{_ as W}from"./ActionButton.vue_vue_type_script_setup_true_lang-D8Xlp6c9.js";import{_ as Y}from"./ErrorNote.vue_vue_type_script_setup_true_lang-DVbGiVTB.js";import{_ as pe}from"./HelpModal.vue_vue_type_script_setup_true_lang-CSOdBT2E.js";import{_ as ce}from"./RelativeTime.vue_vue_type_script_setup_true_lang-NGvUfuKC.js";import{_ as me}from"./SkeletonList.vue_vue_type_script_setup_true_lang-BmeRGmxf.js";import{_ as M}from"./SsoMark.vue_vue_type_script_setup_true_lang-BBiCq_4w.js";import{_ as ve}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./DialogTrigger-nWkfUj3N.js";import"./Teleport-I0XiM19H.js";const he={class:"page-head"},fe={class:"sub"},ye={class:"panel"},ge={class:"phead"},ke={class:"section"},be={class:"mute"},we={class:"check"},Ue={key:0,class:"banner plain"},xe=["href"],Ce={class:"field"},_e={class:"row sso-copy"},$e={class:"sso-url"},Ie={key:1,class:"field"},Ae={class:"field"},Re=["placeholder"],Se={class:"hint"},Ve=["for"],Le=["id","onUpdate:modelValue"],Oe={class:"field"},Ee=["data-incomplete"],De={class:"hint"},ze={key:1,class:"field"},je={class:"field"},qe={class:"field"},Ge={class:"hint"},Me={class:"field"},Te=["placeholder"],Ne=["open"],Ke={class:"field"},Be={class:"field"},He={class:"field"},Pe={class:"field"},Fe={class:"field"},We={class:"section",style:{"margin-top":"var(--s4)"}},Ye={class:"row",style:{"flex-wrap":"wrap",gap:"var(--s3)"}},Je=["for"],Qe=["id","onUpdate:modelValue"],Xe={class:"panel"},Ze={class:"field"},es={class:"field"},ss={key:0,class:"field"},ts={key:1,class:"hint"},os={class:"row",style:{gap:"var(--s3)"}},ls={key:3,class:"panel"},ns={class:"phead"},as={class:"section"},is={class:"sso-tiles"},rs=["onClick"],ds={class:"sso-tile-mode"},us={class:"panel"},ps={class:"sso-cards stagger"},cs={class:"sso-card-main"},ms={class:"sso-card-head"},vs={class:"mute"},hs={key:0,class:"badge off"},fs={class:"sso-card-sub"},ys={class:"row-actions"},gs=["onClick"],ks={class:"panel"},bs={class:"row sso-copy"},ws={class:"sso-url"},Us=ne({__name:"SsoView",setup(xs){const E={subject:"sub",username:"preferred_username",email:"email",name:"name",avatar:"picture"},T=()=>({mode:"oidc",enabled:!0,label:"",clientId:"",discoveryUrl:"",provider:"",authorizeUrl:"",tokenUrl:"",userInfoUrl:"",emailsUrl:"",groupsUrl:"",scopes:"",claimMap:{...E},allowedEmailDomains:[],allowedUsernames:[],requiredGroups:[],defaultRole:"admin"}),w=y([]),I=y([]),A=y(""),R=y(!1),g=y(""),o=y(null),C=y(!1),S=y(!1),U=y("");async function D(){const t=await q.get("/api/sso/config");if(R.value=!0,!t.ok){g.value=G(t,"read the sign-on settings");return}g.value="",w.value=t.body.providers??[],I.value=t.body.presets??[],A.value=t.body.callbackUrl}D();const N=x(()=>!o.value&&(C.value||R.value&&!g.value&&w.value.length===0)),J=x(()=>[...I.value.map(t=>({preset:t,id:t.key,label:t.label,mode:t.mode})),{preset:null,id:"custom-oauth2",label:"Custom OAuth 2.0",mode:"oauth2"},{preset:null,id:"custom-oidc",label:"Custom OpenID Connect",mode:"oidc"}]);function Q(t){const e=new Set(w.value.map(n=>n.key));if(!e.has(t))return t;for(let n=2;;n++)if(!e.has(`${t}-${n}`))return`${t}-${n}`}function X(t){const e=t.preset,n=T();n.mode=t.mode,n.provider=e?e.key:t.mode==="oauth2"?"custom":"",e&&(n.label=e.label,n.scopes=e.scopes,n.claimMap={...E,...e.claimMap},e.mode==="oauth2"?(n.authorizeUrl=e.authorizeUrl,n.tokenUrl=e.tokenUrl,n.userInfoUrl=e.userInfoUrl):e.discoveryUrl.includes("<")||(n.discoveryUrl=e.discoveryUrl)),o.value={originalKey:null,key:Q(e?e.key:t.mode==="oauth2"?"custom":"oidc"),preset:e,form:n,secret:"",secretSet:!1,domains:"",usernames:"",groups:"",placeholders:{}},U.value="",C.value=!1}function Z(t){o.value={originalKey:t.key,key:t.key,preset:I.value.find(e=>e.key===t.config.provider)??null,form:{...T(),...t.config,claimMap:{...E,...t.config.claimMap}},secret:"",secretSet:t.secretSet,domains:(t.config.allowedEmailDomains??[]).join(", "),usernames:(t.config.allowedUsernames??[]).join(", "),groups:(t.config.requiredGroups??[]).join(", "),placeholders:{}},U.value="",C.value=!1}const _=x(()=>{const t=o.value;if(!t||t.originalKey!==null||!t.preset||t.form.mode!=="oidc")return null;const e=t.preset.discoveryUrl;if(!e.includes("<"))return null;const n=[],c=/<([^>]+)>/g;let m=0;for(let v=c.exec(e);v;v=c.exec(e))v.index>m&&n.push(e.slice(m,v.index)),n.push({ph:v[1]??""}),m=v.index+v[0].length;return m<e.length&&n.push(e.slice(m)),n}),K=x(()=>(_.value??[]).flatMap(t=>typeof t=="string"?[]:[t.ph])),V=x(()=>{const t=_.value,e=o.value;return!t||!e?"":t.map(n=>{var c;return typeof n=="string"?n:((c=e.placeholders[n.ph])==null?void 0:c.trim())||`<${n.ph}>`}).join("")}),ee=/^[a-z0-9][a-z0-9-]{0,31}$/,B=x(()=>{const t=o.value;if(!t)return"nothing is being edited";const e=t.key.trim();if(!ee.test(e))return"the key must be a lowercase slug of letters, digits and dashes (32 at most)";if(t.originalKey===null&&w.value.some(n=>n.key===e))return`a provider is already stored under "${e}" — edit that one instead, or pick another key`;if(!t.form.clientId.trim())return"the client id is required";if(!t.secretSet&&!t.secret.trim())return"the client secret is required";if(t.form.mode==="oidc"){const n=_.value?V.value:t.form.discoveryUrl.trim();if(!n)return"the issuer is required";if(n.includes("<"))return"fill in the issuer placeholder first"}else if(!t.form.authorizeUrl.trim()||!t.form.tokenUrl.trim())return"the authorize and token URLs are required";return""}),z=t=>t.split(",").map(e=>e.trim()).filter(Boolean);async function se(){const t=o.value;if(!t)return;S.value=!0;const e={...t.form,key:t.key.trim(),clientSecret:t.secret.trim(),discoveryUrl:_.value?V.value:t.form.discoveryUrl,allowedEmailDomains:z(t.domains),allowedUsernames:z(t.usernames),requiredGroups:t.form.mode==="oidc"?[]:z(t.groups)},n=await q.put("/api/sso/config",e);if(S.value=!1,!n.ok){U.value=G(n,"save the provider");return}U.value="",O("ok",t.form.mode==="oidc"?"Saved — the issuer answered, so the settings are known good.":"Saved."),o.value=null,D()}async function te(t){const e=await q.del(`/api/sso/config/${t.key}`);if(!e.ok){g.value=G(e,"remove the provider");return}O("ok",`Removed ${t.key}. Existing accounts keep working.`),D()}async function H(){try{await navigator.clipboard.writeText(A.value),O("ok","Copied.")}catch{O("error","Could not reach the clipboard — select the text and copy it.")}}function oe(t){if(t.mode==="oidc")try{return`OpenID Connect · ${new URL(t.discoveryUrl).hostname}`}catch{return"OpenID Connect"}const e=I.value.find(n=>n.key===t.provider);return e?`OAuth 2.0 · ${e.label}`:"OAuth 2.0 · custom endpoints"}function le(t){var n,c,m;const e=[];return(n=t.allowedEmailDomains)!=null&&n.length&&e.push(`domains ${t.allowedEmailDomains.join(", ")}`),(c=t.allowedUsernames)!=null&&c.length&&e.push(`usernames ${t.allowedUsernames.join(", ")}`),(m=t.requiredGroups)!=null&&m.length&&e.push(`groups ${t.requiredGroups.join(", ")}`),e.length?`lets in ${e.join("; ")}`:"lets in anyone the provider allows"}return(t,e)=>{var n,c,m,v;return i(),r("div",null,[s("div",he,[s("div",null,[s("h1",null,[e[19]||(e[19]=a(" Single sign-on ",-1)),f(pe,{title:"How single sign-on works here"},{default:$(()=>[...e[18]||(e[18]=[s("p",null,[s("b",null,"This service is the relying party and nothing more."),a(" You register an OAuth or OIDC application in your own organisation and paste its client id and secret here. Your directory stays yours — no accounts are copied, and nothing is synchronised. ")],-1),s("p",null,[s("b",null,"Anyone who authenticates gets an account"),a(", created on their first sign-in. That is deliberate: your provider already decides who may authenticate (Workspace restricts to internal users, a GitHub app can be org-approved), and duplicating that policy here would just be a second list to keep in step. Narrow it with the sign-in rules on each provider if you need to. ")],-1),s("p",null,[s("b",null,"Identity is the provider's subject, not the email."),a(" Someone changing their address keeps their account, their history and their tokens. An address is only used to adopt an account that already exists here, and only when the provider says it is verified. ")],-1),s("p",null,[s("b",null,"Several providers share the accounts."),a(" Each shows up as its own button on the login page, and the same person arriving from the same directory is the same account — nothing about local accounts or personal tokens changes either way. ")],-1)])]),_:1})]),s("div",fe,[e[21]||(e[21]=a(" Let people sign in with the identity providers you already run ",-1)),f(F,{label:"what is stored"},{default:$(()=>[...e[20]||(e[20]=[a(" One row per provider: the endpoints, the client id, and the client secret. The secret has no read path — this page only learns whether one is stored, and leaving the field empty keeps it. ",-1)])]),_:1})])]),e[22]||(e[22]=s("span",{class:"grow"},null,-1)),R.value&&!g.value&&!o.value&&!N.value?(i(),r("button",{key:0,class:"primary",onClick:e[0]||(e[0]=l=>C.value=!0)},"Add provider")):h("",!0)]),g.value?(i(),j(Y,{key:0,text:g.value,title:"Single sign-on."},null,8,["text"])):h("",!0),R.value?o.value?(i(),r(b,{key:2},[s("section",ye,[s("div",ge,[f(M,{preset:o.value.form.provider,size:20},null,8,["preset"]),s("h2",ke,d(o.value.originalKey?`Edit ${o.value.originalKey}`:`Add ${((n=o.value.preset)==null?void 0:n.label)??(o.value.form.mode==="oidc"?"an OpenID Connect issuer":"a custom OAuth 2.0 provider")}`),1),s("span",be,d(o.value.form.mode==="oidc"?"OpenID Connect":"OAuth 2.0"),1),e[24]||(e[24]=s("span",{class:"grow"},null,-1)),s("label",we,[u(s("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.value.form.enabled=l),type:"checkbox"},null,512),[[ae,o.value.form.enabled]]),e[23]||(e[23]=a(" Enabled",-1))])]),o.value.preset?(i(),r("div",Ue,[s("b",null,"Register the app with "+d(o.value.preset.label),1),s("p",null,d(o.value.preset.setupHint),1),s("p",null,[s("a",{href:o.value.preset.setupUrl,target:"_blank",rel:"noopener"}," Create the app in "+d(o.value.preset.label)+" → ",9,xe)])])):h("",!0),s("div",Ce,[e[25]||(e[25]=s("label",null,"Redirect URI",-1)),s("div",_e,[s("code",$e,d(A.value),1),s("button",{type:"button",onClick:H},"Copy")]),e[26]||(e[26]=s("p",{class:"hint"}," Paste this into the provider's application as the redirect / callback URL. It has to match byte for byte, and it is the same for every provider on this host — a mismatch is the single most common reason the exchange fails, and the provider's error rarely says so. ",-1))]),o.value.originalKey?h("",!0):(i(),r("div",Ie,[e[27]||(e[27]=s("label",{for:"sso-key"},"Key",-1)),u(s("input",{id:"sso-key","onUpdate:modelValue":e[2]||(e[2]=l=>o.value.key=l),type:"text",spellcheck:"false",class:"sso-key"},null,512),[[p,o.value.key]]),e[28]||(e[28]=s("p",{class:"hint"}," This host's name for the provider — it appears in the sign-in URL and in exports, never to the person signing in. Lowercase letters, digits and dashes. ",-1))])),s("div",Ae,[e[29]||(e[29]=s("label",{for:"sso-label"},"Button text",-1)),u(s("input",{id:"sso-label","onUpdate:modelValue":e[3]||(e[3]=l=>o.value.form.label=l),type:"text",placeholder:((c=o.value.preset)==null?void 0:c.label)||"Acme SSO"},null,8,Re),[[p,o.value.form.label]]),s("p",Se,"The login page draws it as “Continue with "+d(o.value.form.label||((m=o.value.preset)==null?void 0:m.label)||"…")+"”.",1)]),o.value.form.mode==="oidc"?(i(),r(b,{key:2},[_.value?(i(),r(b,{key:0},[(i(!0),r(b,null,L(K.value,l=>(i(),r("div",{key:l,class:"field"},[s("label",{for:`ph-${l}`},d(re(de)(l)),9,Ve),u(s("input",{id:`ph-${l}`,"onUpdate:modelValue":k=>o.value.placeholders[l]=k,type:"text",spellcheck:"false",class:"sso-key"},null,8,Le),[[p,o.value.placeholders[l]]])]))),128)),s("div",Oe,[e[30]||(e[30]=s("label",null,"Issuer",-1)),s("code",{class:"sso-url","data-incomplete":V.value.includes("<")||void 0},d(V.value),9,Ee),s("p",De," Assembled from the value"+d(K.value.length>1?"s":"")+" above — "+d((v=o.value.preset)==null?void 0:v.label)+" gives every account its own issuer, so there is no single URL a preset could carry. It is fetched when you save, so a typo is refused here rather than at someone's first login. ",1)])],64)):(i(),r("div",ze,[e[31]||(e[31]=s("label",{for:"sso-issuer"},"Issuer",-1)),u(s("input",{id:"sso-issuer","onUpdate:modelValue":e[4]||(e[4]=l=>o.value.form.discoveryUrl=l),type:"text",spellcheck:"false",placeholder:"https://accounts.google.com"},null,512),[[p,o.value.form.discoveryUrl]]),e[32]||(e[32]=s("p",{class:"hint"},[a(" Or the full "),s("code",null,"…/.well-known/openid-configuration"),a(" URL. Everything but the client id and secret is discovered from it, and it is fetched when you save — so a typo is refused here rather than at someone's first login. ")],-1))]))],64)):h("",!0),s("div",je,[e[33]||(e[33]=s("label",{for:"sso-client"},"Client id",-1)),u(s("input",{id:"sso-client","onUpdate:modelValue":e[5]||(e[5]=l=>o.value.form.clientId=l),type:"text",spellcheck:"false",autocomplete:"off"},null,512),[[p,o.value.form.clientId]])]),s("div",qe,[e[34]||(e[34]=s("label",{for:"sso-secret"},"Client secret",-1)),u(s("input",{id:"sso-secret","onUpdate:modelValue":e[6]||(e[6]=l=>o.value.secret=l),type:"password",spellcheck:"false",autocomplete:"new-password"},null,512),[[p,o.value.secret]]),s("p",Ge," Write-only. "+d(o.value.secretSet?"A secret is stored — leave this empty to keep it.":"Stored on save and never returned by any route."),1)]),s("div",Me,[e[35]||(e[35]=s("label",{for:"sso-scopes"},"Scopes",-1)),u(s("input",{id:"sso-scopes","onUpdate:modelValue":e[7]||(e[7]=l=>o.value.form.scopes=l),type:"text",spellcheck:"false",placeholder:o.value.form.mode==="oidc"?"openid profile email":""},null,8,Te),[[p,o.value.form.scopes]])]),o.value.form.mode==="oauth2"?(i(),r("details",{key:3,class:"sso-adv",open:!o.value.preset},[e[46]||(e[46]=s("summary",null,"Endpoints and claim mapping",-1)),s("div",Ke,[e[36]||(e[36]=s("label",{for:"sso-auth"},"Authorize URL",-1)),u(s("input",{id:"sso-auth","onUpdate:modelValue":e[8]||(e[8]=l=>o.value.form.authorizeUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.authorizeUrl]])]),s("div",Be,[e[37]||(e[37]=s("label",{for:"sso-token"},"Token URL",-1)),u(s("input",{id:"sso-token","onUpdate:modelValue":e[9]||(e[9]=l=>o.value.form.tokenUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.tokenUrl]])]),s("div",He,[e[38]||(e[38]=s("label",{for:"sso-userinfo"},"User info URL",-1)),u(s("input",{id:"sso-userinfo","onUpdate:modelValue":e[10]||(e[10]=l=>o.value.form.userInfoUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.userInfoUrl]]),e[39]||(e[39]=s("p",{class:"hint"},"Leave empty to take the identity from the token response alone — a subject and nothing else.",-1))]),s("div",Pe,[e[40]||(e[40]=s("label",{for:"sso-emails"},[a("Emails URL "),s("span",{class:"mute"},"(optional)")],-1)),u(s("input",{id:"sso-emails","onUpdate:modelValue":e[11]||(e[11]=l=>o.value.form.emailsUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.emailsUrl]]),e[41]||(e[41]=s("p",{class:"hint"}," Only consulted when the profile carries no address — which is GitHub's default. Filled in automatically for a preset, and needed only if you pointed the user info URL at your own host. ",-1))]),s("div",Fe,[e[42]||(e[42]=s("label",{for:"sso-groups-url"},[a("Groups URL "),s("span",{class:"mute"},"(optional)")],-1)),u(s("input",{id:"sso-groups-url","onUpdate:modelValue":e[12]||(e[12]=l=>o.value.form.groupsUrl=l),type:"text",spellcheck:"false"},null,512),[[p,o.value.form.groupsUrl]]),e[43]||(e[43]=s("p",{class:"hint"}," Where this host asks which groups someone is in. Only consulted when there is a group rule below. Filled in automatically for a preset — but only while the user info URL is still the preset's, because a self-hosted host's token must not be sent to the public one, so a self-hosted provider needs this typed. ",-1))]),s("h3",We,[e[45]||(e[45]=a(" Claim mapping ",-1)),f(F,{label:"what this is"},{default:$(()=>[...e[44]||(e[44]=[a(" Which key of the provider's user response holds each field. Flat lookups, not expressions. A preset fills these in; you only touch them for a provider nobody has written a preset for. ",-1)])]),_:1})]),s("div",Ye,[(i(),r(b,null,L(["subject","username","email","name","avatar"],l=>s("div",{key:l,class:"field inline"},[s("label",{for:`cm-${l}`},d(l),9,Je),u(s("input",{id:`cm-${l}`,"onUpdate:modelValue":k=>o.value.form.claimMap[l]=k,type:"text",spellcheck:"false",style:{width:"11rem"}},null,8,Qe),[[p,o.value.form.claimMap[l]]])])),64))])],8,Ne)):h("",!0)]),s("section",Xe,[e[53]||(e[53]=s("div",{class:"phead"},[s("h2",{class:"section"},"Who gets an account")],-1)),e[54]||(e[54]=s("p",{class:"dim"},[a(" By default, anyone this provider lets authenticate. It already owns that decision; this is only here for the case where the application you registered is broader than the people who should reach this control plane. "),s("b",null,"Any one entry in a list is enough to satisfy that list, and every list you fill in has to be satisfied"),a(" — fill all three in and a login needs a listed domain, a matching username, and one of the groups. A list left empty is not a rule at all: it lets everyone past that check, it does not lock everyone out. ")],-1)),s("div",Ze,[e[47]||(e[47]=s("label",{for:"sso-domains"},"Allowed email domains",-1)),u(s("input",{id:"sso-domains","onUpdate:modelValue":e[13]||(e[13]=l=>o.value.domains=l),type:"text",spellcheck:"false",placeholder:"example.com, corp.example"},null,512),[[p,o.value.domains]]),e[48]||(e[48]=s("p",{class:"hint"},[a(" Comma-separated; subdomains count. Empty means no restriction. "),s("b",null,"Non-empty means a login with no email address at all is refused too"),a(" — a provider that hides the address (a private GitHub profile with no "),s("code",null,"user:email"),a(" scope) cannot be checked, so it is not waved through. ")],-1))]),s("div",es,[e[49]||(e[49]=s("label",{for:"sso-usernames"},"Allowed usernames",-1)),u(s("input",{id:"sso-usernames","onUpdate:modelValue":e[14]||(e[14]=l=>o.value.usernames=l),type:"text",spellcheck:"false",placeholder:"octocat, qa-[0-9]*"},null,512),[[p,o.value.usernames]]),e[50]||(e[50]=ie('<p class="hint" data-v-8383cb2f> Comma-separated patterns, case-insensitive: <code data-v-8383cb2f>*</code>, <code data-v-8383cb2f>?</code> and <code data-v-8383cb2f>[0-9]</code> classes. Empty means no restriction. <b data-v-8383cb2f>Non-empty means a login whose provider sends no username is refused too</b> — so this is a rule for a provider that actually has usernames (GitHub's <code data-v-8383cb2f>login</code>, GitLab's <code data-v-8383cb2f>username</code>). On an OpenID Connect issuer that sends no <code data-v-8383cb2f>preferred_username</code> it refuses everyone rather than nobody, so set it only where you know the provider sends one. </p>',1))]),o.value.form.mode==="oauth2"?(i(),r("div",ss,[e[51]||(e[51]=s("label",{for:"sso-groups"},"Required groups",-1)),u(s("input",{id:"sso-groups","onUpdate:modelValue":e[15]||(e[15]=l=>o.value.groups=l),type:"text",spellcheck:"false",placeholder:"acme, acme/backend"},null,512),[[p,o.value.groups]]),e[52]||(e[52]=s("p",{class:"hint"},[a(" Comma-separated, and "),s("b",null,"exact names, not patterns"),a(" — an organisation login, or a group path like "),s("code",null,"acme/backend"),a(". Case-insensitive. Empty means no restriction. Non-empty makes every sign-in ask the provider for that person's groups, so it needs the OAuth scope that endpoint requires: "),s("b",null,"add it to Scopes above, or the save is refused"),a(" — and the refusal names the scope. It also needs a provider whose group list this host knows how to read, which the save checks by name. If that call does not answer, the sign-in is refused rather than allowed. ")],-1))])):(i(),r("p",ts," A group rule needs a provider whose groups endpoint this host knows how to read — an OAuth 2.0 preset (GitHub, GitLab), not a discovered OpenID Connect issuer — so there is none here. "))]),U.value?(i(),j(Y,{key:0,text:U.value,title:"Not saved."},null,8,["text"])):h("",!0),s("div",os,[f(W,{variant:"primary",pending:S.value,disabled:S.value||!!B.value,title:B.value||void 0,onClick:se},{default:$(()=>[a(d(o.value.originalKey?"Save changes":"Add provider"),1)]),_:1},8,["pending","disabled","title"]),s("button",{class:"ghost",onClick:e[16]||(e[16]=l=>o.value=null)},"Cancel")])],64)):N.value?(i(),r("section",ls,[s("div",ns,[s("h2",as,d(w.value.length?"Add a provider":"Pick a provider"),1),e[55]||(e[55]=s("span",{class:"grow"},null,-1)),w.value.length?(i(),r("button",{key:0,class:"ghost",onClick:e[17]||(e[17]=l=>C.value=!1)},"Cancel")):h("",!0)]),e[56]||(e[56]=s("p",{class:"dim"}," Pick where your team already signs in. A preset knows the provider's endpoints and its quirks — the only things it cannot know are the client id and secret you get when you register the app, and the form that opens says exactly where to do that. ",-1)),s("div",is,[(i(!0),r(b,null,L(J.value,l=>{var k;return i(),r("button",{key:l.id,class:"sso-tile",onClick:P=>X(l)},[f(M,{preset:((k=l.preset)==null?void 0:k.key)??"custom",size:22},null,8,["preset"]),s("span",null,d(l.label),1),s("span",ds,d(l.mode==="oidc"?"OpenID Connect":"OAuth 2.0"),1)],8,rs)}),128))])])):g.value?h("",!0):(i(),r(b,{key:4},[s("section",us,[e[58]||(e[58]=s("div",{class:"phead"},[s("h2",{class:"section"},"Providers")],-1)),s("div",ps,[(i(!0),r(b,null,L(w.value,(l,k)=>(i(),r("div",{key:l.key,class:"sso-card",style:ue({"--i":k})},[f(M,{preset:l.config.provider,size:22},null,8,["preset"]),s("div",cs,[s("div",ms,[s("b",null,d(l.config.label),1),s("code",vs,d(l.key),1),l.config.enabled?h("",!0):(i(),r("span",hs,"disabled"))]),s("div",fs,[a(d(oe(l.config))+" · "+d(le(l.config))+" · updated ",1),f(ce,{at:l.updatedAt},null,8,["at"])])]),s("div",ys,[s("button",{class:"ghost sm",onClick:P=>Z(l)},"Edit",8,gs),f(W,{variant:"ghost",class:"sm sso-remove",confirm:`Remove ${l.key}?`,onRun:P=>te(l)},{default:$(()=>[...e[57]||(e[57]=[a(" Remove ",-1)])]),_:1},8,["confirm","onRun"])])],4))),128))]),e[59]||(e[59]=s("p",{class:"mute",style:{"font-size":"var(--t-sm)","margin-top":"var(--s3)"}}," Removing a provider does not delete anyone. Those accounts keep their personal tokens, and pointing the same provider back at this host re-links them by subject. ",-1))]),s("section",ks,[e[60]||(e[60]=s("div",{class:"phead"},[s("h2",{class:"section"},"Callback URL")],-1)),e[61]||(e[61]=s("p",{class:"dim"}," The redirect URI to register with every provider — one URL for all of them, built by the server so it cannot drift from the one the sign-in flow actually sends. ",-1)),s("div",bs,[s("code",ws,d(A.value),1),s("button",{type:"button",onClick:H},"Copy")])])],64)):(i(),j(me,{key:1,rows:4}))])}}}),Es=ve(Us,[["__scopeId","data-v-8383cb2f"]]);export{Es as default};
|
|
2
|
+
//# sourceMappingURL=SsoView-CltdTdwt.js.map
|