nextcloud/dist/oauth2-settings-admin.mjs
nextcloud-command 77267c30db chore(assets): Recompile assets
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
2026-04-21 08:55:14 +00:00

2 lines
5.1 KiB
JavaScript

import{c as b,i as R}from"./index-DqG-5vGV.chunk.mjs";import{_ as V,g as x,l as $}from"./public-CvthP4YJ.chunk.mjs";import{P as O,a as q}from"./index-b06SCjVD.chunk.mjs";import{b as w,o as s,f,g as t,t as r,F as n,c as p,u as e,k as d,w as _,z,H as B,I as C,h as A,j as v,M as P,l as k,e as T}from"./preload-helper-D9xEqq8S.chunk.mjs";import{t as a}from"./translation-DoG5ZELJ-8aobdbPK.chunk.mjs";import{b as S}from"./index-Bp9-GhMo.chunk.mjs";import{N as M}from"./ArrowRight-YxbwZNEK.chunk.mjs";import{N as I}from"./mdi-B3j1XNhV.chunk.mjs";import{N as j}from"./ContentCopy-BThU2vZd.chunk.mjs";import{_ as g}from"./NcTextField.vue_vue_type_script_setup_true_lang-B-4HNjYH-zA0ct3s7.chunk.mjs";import{N as F}from"./NcPasswordField-BOLzDHBJ-BKSfVdzU.chunk.mjs";import{D as H}from"./TrashCanOutline-COIylzhj.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import"./util-Caafb9Jl.chunk.mjs";import"./NcDialog-nDc1gW50-BF3zId_C.chunk.mjs";import"./NcModal-kyWZ3UFC-DO8otox5.chunk.mjs";import"./Web-7MW_v0ET.chunk.mjs";import"./NcInputField-CPL-a_MM-BYLCq7JD.chunk.mjs";const E={key:1},G=w({__name:"OAuthItem",props:{client:{}},emits:["delete"],setup(c){return(u,h)=>(s(),f("tr",null,[t("td",null,r(c.client.name),1),t("td",null,[t("code",{class:n(u.$style.oAuthItem__code)},r(c.client.redirectUri),3)]),t("td",null,[t("code",{class:n(u.$style.oAuthItem__code)},r(c.client.clientId),3)]),t("td",null,[c.client.clientSecret?(s(),p(e(F),{key:0,class:n(u.$style.oAuthItem__clientSecret),"aria-label":e(a)("oauth2","Secret key"),asText:"",modelValue:c.client.clientSecret,showTrailingButton:""},null,8,["class","aria-label","modelValue"])):(s(),f("span",E,"*****"))]),t("td",null,[d(e(M),{"aria-label":e(a)("oauth2","Delete"),title:e(a)("oauth2","Delete"),variant:"error",onClick:h[0]||(h[0]=U=>u.$emit("delete"))},{icon:_(()=>[d(H,{size:20})]),_:1},8,["aria-label","title"])])]))}}),J="_oAuthItem__code_3r02l_2",K="_oAuthItem__clientSecret_3r02l_11",L={oAuthItem__code:J,oAuthItem__clientSecret:K},Q={$style:L},W=V(G,[["__cssModules",Q]]),X={class:"hidden-visually"},Y=w({__name:"AdminSettings",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(c){const u=z(c,"modelValue"),h=x().theming.name,U=$("oauth2","oauth2-doc-link"),y=k(!1),o=k({name:"",redirectUri:"",errorMsg:"",error:!1});async function N(l){await b.delete(S("apps/oauth2/clients/{id}",{id:l})),u.value=u.value.filter(i=>i.id!==l)}async function D(){o.value.error=!1;try{const{data:l}=await b.post(S("apps/oauth2/clients"),{name:o.value.name,redirectUri:o.value.redirectUri},{confirmPassword:O.Strict});u.value.push(l),y.value=!0,o.value.name="",o.value.redirectUri=""}catch(l){o.value.error=!0,R(l)&&l.response?o.value.errorMsg=l.response.data.message:o.value.errorMsg=a("oauth2","An unknown error occurred.")}}return(l,i)=>(s(),p(e(j),{name:e(a)("oauth2","OAuth 2.0 clients"),description:e(a)("oauth2","OAuth 2.0 allows external services to request access to {instanceName}.",{instanceName:e(h)}),docUrl:e(U)},{default:_(()=>[u.value.length>0?(s(),f("table",{key:0,class:n([l.$style.oauthApp__table,{[l.$style.oauthApp__table_withSecret]:y.value}])},[t("thead",null,[t("tr",null,[t("th",null,r(e(a)("oauth2","Name")),1),t("th",null,r(e(a)("oauth2","Redirection URI")),1),t("th",null,r(e(a)("oauth2","Client identifier")),1),t("th",null,r(e(a)("oauth2","Secret key")),1),t("th",null,[t("span",X,r(e(a)("oauth2","Delete client")),1)])])]),t("tbody",null,[(s(!0),f(B,null,C(u.value,m=>(s(),p(W,{key:m.id,client:m,onDelete:ie=>N(m.id)},null,8,["client","onDelete"]))),128))])],2)):A("",!0),y.value?(s(),p(e(I),{key:1,type:"warning"},{default:_(()=>[v(r(e(a)("oauth2","Make sure you store the secret key, it cannot be recovered.")),1)]),_:1})):A("",!0),i[2]||(i[2]=t("br",null,null,-1)),t("h3",null,r(e(a)("oauth2","Add client")),1),o.value.error?(s(),p(e(I),{key:2,type:"error"},{default:_(()=>[v(r(o.value.errorMsg),1)]),_:1})):A("",!0),t("form",{class:n(l.$style.oauthApp__form),onSubmit:P(D,["prevent"])},[d(e(g),{id:"name",modelValue:o.value.name,"onUpdate:modelValue":i[0]||(i[0]=m=>o.value.name=m),class:n(l.$style.oauthApp__form__input),name:"name",label:e(a)("oauth2","Name"),placeholder:e(a)("oauth2","Name")},null,8,["modelValue","class","label","placeholder"]),d(e(g),{id:"redirectUri",modelValue:o.value.redirectUri,"onUpdate:modelValue":i[1]||(i[1]=m=>o.value.redirectUri=m),type:"url",class:n(l.$style.oauthApp__form__input),name:"redirectUri",label:e(a)("oauth2","Redirection URI"),placeholder:e(a)("oauth2","Redirection URI")},null,8,["modelValue","class","label","placeholder"]),d(e(M),{type:"submit",class:n(l.$style.oauthApp__submitButton)},{default:_(()=>[v(r(e(a)("oauth2","Add")),1)]),_:1},8,["class"])],34)]),_:1},8,["name","description","docUrl"]))}}),Z="_oauthApp__form_10pnp_1",ee="_oauthApp__form__input_10pnp_6",te="_oauthApp__table_10pnp_11",ae="_oauthApp__table_withSecret_10pnp_38",le={oauthApp__form:Z,oauthApp__form__input:ee,oauthApp__table:te,oauthApp__table_withSecret:ae},oe={$style:le},re=V(Y,[["__cssModules",oe]]);q(b);const ue=$("oauth2","clients"),se=T(re,{modelValue:ue});se.mount("#oauth2");
//# sourceMappingURL=oauth2-settings-admin.mjs.map