PageSourceSearch

https://www.schulweg.ch/_nuxt/D8jQQP3y.js

js schulweg.ch collected 2026-10-07 03:46:28 UTC 14,294 bytes, 1 lines download raw bytes

1import{aR as se,bA as O,aY as d,aZ as s,bs as U,b0 as i,b2 as q,b3 as v,b6 as m,b5 as E,bk as B,bc as r,be as ae,aU as fe,bo as we,aW as be,bi as ve,b1 as b,bl as X,bm as ye,bG as he,bB as J,bD as K,a_ as Q,bH as G}from"./DusadLuI.js";(function(){try{var l=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};l.SENTRY_RELEASE={id:"ed3b7066d750926bf41c003e0cec31acf3ac8236"};var _=new l.Error().stack;_&&(l._sentryDebugIds=l._sentryDebugIds||{},l._sentryDebugIds[_]="14900a6e-dcc9-4eae-b53f-e42f2951275a",l._sentryDebugIdIdentifier="sentry-dbid-14900a6e-dcc9-4eae-b53f-e42f2951275a")}catch{}})();const L=12,F=72;function te(l){return new TextEncoder().encode(l).length}function ne(l){return l.length<L?"too-short":te(l)>F?"too-many-bytes":null}function ee(l){return ne(l)===null}const Ce={class:"ogc-password-field"},ke={class:"ogc-password-field__toggle"},Pe=["id","checked"],Ae={key:0,class:"ogc-password-field__body"},Ee=["for"],Ie=["id","value"],xe={class:"ogc-password-field__hint"},Se={key:0,class:"ogc-password-field__hint ogc-password-field__hint--error"},Te=se({__name:"OgcPasswordField",props:{modelValue:{},enabled:{type:Boolean},idPrefix:{}},emits:["update:modelValue","update:enabled"],setup(l,{emit:_}){const g=l,y=_,P=m(!1),R=m(null),h=E(()=>g.enabled?ne(g.modelValue):null),T=E(()=>h.value==="too-short"?`Password must be at least ${L} characters.`:h.value==="too-many-bytes"?`Password must be at most ${F} bytes — this one is ${te(g.modelValue)}. Accented characters and emoji count as more than one byte.`:"");function C(f){const p=f.target.checked;y("update:enabled",p),p?B(()=>R.value?.focus()):(y("update:modelValue",""),P.value=!1)}function k(f){y("update:modelValue",f.target.value)}return O(()=>g.enabled,f=>{f||(P.value=!1)}),(f,p)=>(r(),d("div",Ce,[s("label",ke,[s("input",{id:`${l.idPrefix}SetPassword`,type:"checkbox",checked:l.enabled,onChange:C},null,40,Pe),p[1]||(p[1]=s("span",null,"Set the password myself",-1))]),p[2]||(p[2]=s("p",{class:"ogc-password-field__toggle-hint"}," Leave unchecked to have a strong password generated — the normal case. Set one only to keep an existing credential working, e.g. an office moving off GeoServer. ",-1)),l.enabled?(r(),d("div",Ae,[s("label",{for:`${l.idPrefix}Password`,class:"ogc-password-field__label"},"Password*",8,Ee),s("input",{id:`${l.idPrefix}Password`,ref_key:"inputEl",ref:R,type:"text",class:U(["ogc-password-field__input",{"ogc-password-field__input--invalid":P.value&&h.value!==null}]),autocomplete:"off",autocapitalize:"off",autocorrect:"off",spellcheck:"false",value:l.modelValue,onInput:k,onBlur:p[0]||(p[0]=o=>P.value=!0)},null,42,Ie),s("div",xe," At least "+i(q(L))+" characters, at most "+i(q(F))+" bytes. Shown in clear text so you can check it against the value you are copying. ",1),P.value&&h.value?(r(),d("div",Se,i(T.value),1)):v("",!0)])):v("",!0)]))}}),Re=Object.assign(ae(Te,[["__scopeId","data-v-07441f71"]]),{__name:"AdminOgcPasswordField"}),$e=/^[a-z0-9-]{3,64}$/;function Ve(l){return $e.test(l)}const Me={class:"admin-ogcclients"},De={class:"admin-ogcclients__base-url"},Ne={class:"admin-ogcclients__base-url-value"},Ge={key:0,class:"admin-ogcclients__loading"},Oe={key:1,class:"admin-ogcclients__access-error"},Ue={key:2,class:"admin-ogcclients__error"},Be={key:0,class:"admin-ogcclients__empty"},Le={key:1,class:"admin-ogcclients__table-wrapper"},Fe={class:"admin-ogcclients__table"},We={key:0,class:"admin-ogcclients__badge admin-ogcclients__badge--never"},ze={key:1},Ye={class:"admin-ogcclients__actions"},je=["disabled","onClick"],He=["disabled","onClick"],Ze={key:2,class:"admin-ogcclients__error"},qe={class:"admin-ogcclients__create-section"},Xe={key:0},Je={class:"admin-ogcclients__field"},Ke={class:"admin-ogcclients__field"},Qe={key:0,class:"admin-ogcclients__hint admin-ogcclients__hint--error"},es={class:"admin-ogcclients__field"},ss={class:"admin-ogcclients__form-footer"},as=["disabled"],ts={key:0,class:"admin-ogcclients__error"},ns={key:0},os={key:0,class:"admin-ogcclients__error"},ls={class:"admin-ogcclients__password-footer"},is=["disabled"],ds={key:0},rs={id:"ogcPasswordModalTitle",class:"admin-ogcclients__password-title"},cs={class:"admin-ogcclients__password-row"},us={key:0,role:"alert",class:"admin-ogcclients__copy-failed"},ms=se({__name:"ogcclients",setup(l){const _=fe(),{parseError:g,getErrorMessage:y}=we(),P=be(),R=E(()=>{const e=(P.value||"").replace(/\/+$/,"");return e.endsWith("/web")?`${e.slice(0,-4)}/ogc`:`${e}/ogc`}),h=m([]),T=m(!0),C=m(null);async function k(){T.value=!0,C.value=null;try{h.value=await _.admin.listGeoApiClients()}catch(t){const e=g(t);C.value={type:e.isAuthError?"auth":"generic",message:y(e)||"Failed to load OGC API clients. Please try again."}}finally{T.value=!1}}ve(k);
1function f(t){return t?new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"-"}const p=m(!1),o=G({name:"",username:"",setPassword:!1,password:""}),I=m(!1),$=m(!1),x=m(""),V=E(()=>Ve(o.username)),oe=E(()=>!o.setPassword||ee(o.password)),W=E(()=>o.name.trim().length>0&&V.value&&oe.value);function le(){p.value=!1,o.name="",o.username="",o.setPassword=!1,o.password="",I.value=!1,x.value=""}async function ie(){if(I.value=!0,!!W.value){$.value=!0,x.value="";try{const t=await _.admin.createGeoApiClient({name:o.name.trim(),username:o.username.trim(),...o.setPassword?{password:o.password}:{}});H("create",t),o.name="",o.username="",o.setPassword=!1,o.password="",I.value=!1,p.value=!1,await k()}catch(t){const e=g(t);e.statusCode===409?x.value="A client with this username already exists.":x.value=y(e)||"Failed to create client. Please try again."}finally{$.value=!1}}}const w=m(new Set),z=t=>w.value.has(t),S=m(""),M=m(null),a=G({open:!1,pkId:0,name:"",username:"",setPassword:!1,password:"",submitting:!1,error:""}),Y=E(()=>!a.setPassword||ee(a.password));function de(t){a.open=!0,a.pkId=t.pkId,a.name=t.name,a.username=t.username,a.setPassword=!1,a.password="",a.submitting=!1,a.error=""}function D(){M.value?.close(),a.open=!1,a.password="",a.setPassword=!1}function re(){a.open=!1,a.password="",a.setPassword=!1}async function ce(){if(!Y.value||a.submitting)return;const t=a.pkId,e=a.name;a.submitting=!0,a.error="",w.value=new Set(w.value).add(t);try{const u=await _.admin.resetGeoApiClientPassword(t,a.setPassword?{password:a.password}:void 0);D(),H("reset",u)}catch(u){const n=g(u);n.isNotFoundError?(D(),S.value=`${e} no longer exists — refreshing the list.`,await k()):a.error=y(n)||"Failed to reset password. Please try again."}finally{a.submitting=!1;const u=new Set(w.value);u.delete(t),w.value=u}}async function ue(t){w.value=new Set(w.value).add(t.pkId),S.value="";try{await _.admin.setGeoApiClientEnabled(t.pkId,{enabled:!t.enabled}),await k()}catch(e){const u=g(e);u.isNotFoundError?(S.value=`${t.name} no longer exists — refreshing the list.`,await k()):S.value=y(u)||"Failed to update client. Please try again."}finally{const e=new Set(w.value);e.delete(t.pkId),w.value=e}}const N=m(null),A=m("idle"),j=m(null),c=G({open:!1,mode:"create",name:"",username:"",password:""});function H(t,e){c.open=!0,c.mode=t,c.name=e.name,c.username=e.username,c.password=e.password,A.value="idle"}function Z(){N.value?.close(),c.open=!1,c.password=""}function me(t){t.preventDefault(),Z()}O(()=>c.open,async t=>{t&&(await B(),N.value?.showModal())}),O(()=>a.open,async t=>{t&&(await B(),M.value?.showModal())});async function pe(){if(c.password){A.value="idle";try{if(!navigator.clipboard?.writeText)throw new Error("Clipboard API unavailable");await navigator.clipboard.writeText(c.password),A.value="copied",setTimeout(()=>A.value="idle",2e3)}catch{A.value="failed",ge()}}}function ge(){const t=j.value;if(!t||typeof window>"u")return;const e=document.createRange();e.selectNodeContents(t);const u=window.getSelection();u?.removeAllRanges(),u?.addRange(e)}return(t,e)=>{const u=Re;return r(),d("div",Me,[e[22]||(e[22]=s("h1",{class:"admin-title"},"OGC API Clients",-1)),e[23]||(e[23]=s("p",{class:"admin-ogcclients__intro"}," Credentials Swiss administrative offices use against the OGC API – Features endpoint. This screen is the only way to provision them — losing a password means issuing a new one, not recovering the old one. ",-1)),s("div",De,[e[8]||(e[8]=s("span",{class:"admin-ogcclients__base-url-label"},"OGC base URL",-1)),s("code",Ne,i(R.value),1)]),T.value?(r(),d("div",Ge,"Loading clients…")):C.value&&C.value.type==="auth"?(r(),d("div",Oe," Manager access required. You do not have permission to view or manage OGC API clients. ")):C.value?(r(),d("div",Ue,[b(i(C.value.message)+" ",1),s("button",{type:"button",class:"admin-ogcclients__retry",onClick:k},"Retry")])):(r(),d(X,{key:3},[h.value.length===0?(r(),d("div",Be," No OGC API clients yet. ")):(r(),d("div",Le,[s("table",Fe,[e[9]||(e[9]=s("thead",null,[s("tr",null,[s("th",null,"Name"),s("th",null,"Username"),s("th",null,"Status"),s("th",null,"Created"),s("th",null,"Last access"),s("th")])],-1)),s("tbody",null,[(r(!0),d(X,null,ye(h.value,n=>(r(),d("tr",{key:n.pkId},[s("td",null,i(n.name),1),s("td",null,[s("code",null,i(n.username),1)]),s("td",null,[s("span",{class:U(["admin-ogcclients__badge",n.enabled?"admin-ogcclients__badge--enabled":"admin-ogcclients__badge--disabled"])},i(n.enabled?"Enabled":"Disabled"),3)]),s("td",null,i(f(n.createdOn)),1),s("td",null,[n.lastAccessOn?(r(),d("span",ze,i(f(n.lastAccessOn)),1)):(r(),d("span",We," Never "))]),s("td",Ye,[s("button",{type:"button",class:"admin-ogcclients__action-btn",disabled:z(n.pkId),onClick:_e=>de(n)}," Reset password ",8,je),s("button",{type:"button",class:"admin-ogcclients__action-btn",disabled:z(n.pkId),onClick:_e=>ue(n)},i(n.enabled?"Disable":"Enable"),9,He)])]))),128))])])])),S.value?(r(),d("div",Ze,i(S.value),1)):v("",!0),e[14]||(e[14]=s("hr",{class:"admin-ogcclients__divider"},null,-1)),s("div",qe,[p.value?(r(),d("form",{key:1,class:"admin-ogcclients__create-form",onSubmit:he(ie,["prevent"])},[e[13]||(e[13]=s("h3",{class:"admin-ogcclients__create-title"},"Create new client",-1)),s("div",Je,[e[10]||(e[10]=s("label",{for:"ogcClientName",class:"admin-ogcclients__label"},"Office name*",-1)),J(s("input",{id:"ogcClientName","onUpdate:modelValue":e[1]||(e[1]=n=>o.name=n),type:"text",class:"admin-ogcclients__input",placeholder:"e.g. Stadt Zürich",autocomplete:"off"},null,512),[[K,o.name]])]),s("div",Ke,[e[11]||(e[11]=s("label",{for:"ogcClientUsername",class:"admin-ogcclients__label"},"Username*",-1)),J(s("input",{id:"ogcClientUsername","onUpdate:modelValue":e[2]||(e[2]=n=>o.username=n),type:"text",class:U(["admin-ogcclients__input",{"admin-ogcclients__input--invalid":I.value&&!V.value}]),placeholder:"e.g. stadt-zuerich",autocomplete:"off",onBlur:e[3]||(e[3]=n=>I.value=!0)},null,34),[[K,o.username]]),e[12]||(e[12]=s("div",{class:"admin-ogcclients__hint"}," Lowercase letters, digits and hyphens only, 3–64 characters. ",-1)),I.value&&!V.value?(r(),d("div",Qe," Username must match [a-z0-9-]"+i("{3,64}")+". ")):v("",!0)]),s("div",es,[Q(u,{modelValue:o.password,"onUpdate:modelValue":e[4]||(e[4]=n=>o.password=n),enabled:o.setPassword,"onUpdate:enabled":e[5]||(e[5]=n=>o.setPassword=n),"id-prefix":"ogcCreate"},null,8,["modelValue","enabled"])]),s("div",ss,[s("button",{type:"submit",class:"admin-ogcclients__submit",disabled:!W.value||$.value},i($.value?"Creating…":"Create client"),9,as),s("button",{type:"button",class:"admin-ogcclients__cancel",onClick:le}," Cancel ")]),x.value?(r(),d("div",ts,i(x.value),1)):v("",!0)],32)):(r(),d("div",Xe,[s("button",{type:"button",class:"admin-ogcclients__create-toggle",onClick:e[0]||(e[0]=n=>p.value=!0)}," + Create new client ")]))])],64)),s("dialog",{ref_key:"resetDialog",ref:M,class:"admin-ogcclients__password-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ogcResetModalTitle","aria-describedby":"ogcResetModalWarning",onCancel:re},[a.open?(r(),d("div",ns,[e[17]||(e[17]=s("h2",{id:"ogcResetModalTitle",class:"admin-ogcclients__password-title"}," Reset password ",-1)),s("p",null,[s("strong",null,i(a.name),1),e[15]||(e[15]=b(" (",-1)),s("code",null,i(a.username),1),e[16]||(e[16]=b(") ",-1))]),e[18]||(e[18]=s("p",{id:"ogcResetModalWarning",class:"admin-ogcclients__password-warning"},[b(" The current password stops working "),s("strong",null,"immediately"),b(". The office cannot connect again until it has the new one. ")],-1)),Q(u,{modelValue:a.password,"onUpdate:modelValue":e[6]||(e[6]=n=>a.password=n),enabled:a.setPassword,"onUpdate:enabled":e[7]||(e[7]=n=>a.setPassword=n),"id-prefix":"ogcReset"},null,8,["modelValue","enabled"]),a.error?(r(),d("div",os,i(a.error),1)):v("",!0),s("div",ls,[s("button",{type:"button",class:"admin-ogcclients__acknowledge-btn",disabled:!Y.value||a.submitting,onClick:ce},i(a.submitting?"Resetting…":"Reset password"),9,is),s("button",{type:"button",class:"admin-ogcclients__cancel",onClick:D}," Cancel ")])])):v("",!0)],544),s("dialog",{ref_key:"passwordDialog",ref:N,class:"admin-ogcclients__password-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"ogcPasswordModalTitle","aria-describedby":"ogcPasswordModalWarning",onCancel:me},[c.open?(r(),d("div",ds,[s("h2",rs,i(c.mode==="create"?"Client created":"Password reset"),1),s("p",null,[s("strong",null,i(c.name),1),e[19]||(e[19]=b(" (",-1)),s("code",null,i(c.username),1),e[20]||(e[20]=b(") ",-1))]),e[21]||(e[21]=s("p",{id:"ogcPasswordModalWarning",class:"admin-ogcclients__password-warning"},[b(" This password is shown "),s("strong",null,"only once"),b(" and cannot be recovered afterwards. Copy it now — if you lose it, the only option is to issue a new one. ")],-1)),s("div",cs,[s("code",{ref_key:"passwordValueEl",ref:j,class:"admin-ogcclients__password-value"},i(c.password),513),s("button",{type:"button",class:"admin-ogcclients__copy-btn",onClick:pe},i(A.value==="copied"?"Copied!":"Copy"),1)]),A.value==="failed"?(r(),d("p",us," Could not copy automatically — the password is selected above, copy it manually before closing. ")):v("",!0),s("div",{class:"admin-ogcclients__password-footer"},[s("button",{type:"button",class:"admin-ogcclients__acknowledge-btn",autofocus:"",onClick:Z}
1," I've saved the password — Close ")])])):v("",!0)],544)])}}}),gs=ae(ms,[["__scopeId","data-v-50b6c5fc"]]);export{gs as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.