mirror of
https://github.com/nextcloud/server.git
synced 2026-10-31 18:15:57 +01:00
Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
3 lines
5.3 KiB
JavaScript
3 lines
5.3 KiB
JavaScript
import{c as b,i as R}from"./index-DHyMMYTN.chunk.mjs";import{c as $,l as w,a as k}from"./star-outline-BpDZzOb8.chunk.mjs";import{P as q,a as x}from"./index-BMlZKoNj.chunk.mjs";import{e as g,o as s,f as y,l as t,t as r,n,k as m,u as e,p as d,w as _,E as O,G as z,H as B,h as A,z as v,y as C,q as S,a as P}from"./PencilOutline-C4ZkKkas.chunk.mjs";import{d as T}from"./livePhotoUtils-CVUhgL4S.chunk.mjs";import{t as a}from"./translations-pLZlvQeM.chunk.mjs";import{N}from"./Link-CUdpEe-t.chunk.mjs";import{N as I}from"./cancel-DDzvQ-HX.chunk.mjs";import{N as E}from"./NcSettingsSection-DeN6Lle1.chunk.mjs";import{_ as V}from"./NcHighlight.vue_vue_type_script_lang-CT7Xx-zK.chunk.mjs";import{N as G}from"./NcPasswordField-DgVaELPd.chunk.mjs";import{D as H}from"./File-xDTWu8L0.chunk.mjs";import"./modulepreload-polyfill-BxzAKjcf.chunk.mjs";import"./index-D6fZh9CR.chunk.mjs";import"./AlertCircleOutline-jA3ki2Uu.chunk.mjs";import"./TrayArrowDown-vMg8Cl05.chunk.mjs";import"./Web-BMG0zIln.chunk.mjs";import"./_l10n-CK24vgHE.chunk.mjs";import"./ArrowRight-COu6qSN5.chunk.mjs";import"./Check-CEU1oy_I.chunk.mjs";import"./NcModal-BxLzaUZK.chunk.mjs";import"./formatRelative-uuSCBZ1C.chunk.mjs";import"./MapMarkerOutline-Ip3bQdll.chunk.mjs";import"./NcInputField-wKF2DDSn.chunk.mjs";const j={key:1},F=g({__name:"OAuthItem",props:{client:{}},emits:["delete"],setup(c){return(u,h)=>(s(),y("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(),m(e(G),{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(),y("span",j,"*****"))]),t("td",null,[d(e(N),{"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=$(F,[["__cssModules",Q]]),X={class:"hidden-visually"},Y=g({__name:"AdminSettings",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(c){const u=O(c,"modelValue"),h=T().theming.name,U=w("oauth2","oauth2-doc-link"),f=S(!1),o=S({name:"",redirectUri:"",errorMsg:"",error:!1});async function M(l){await b.delete(k("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(k("apps/oauth2/clients"),{name:o.value.name,redirectUri:o.value.redirectUri},{confirmPassword:q.Strict});u.value.push(l),f.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(),m(e(E),{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)},{escape:!1}),docUrl:e(U)},{default:_(()=>[u.value.length>0?(s(),y("table",{key:0,class:n([l.$style.oauthApp__table,{[l.$style.oauthApp__table_withSecret]:f.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),y(z,null,B(u.value,p=>(s(),m(W,{key:p.id,client:p,onDelete:ie=>M(p.id)},null,8,["client","onDelete"]))),128))])],2)):A("",!0),f.value?(s(),m(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(),m(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:C(D,["prevent"])},[d(e(V),{id:"name",modelValue:o.value.name,"onUpdate:modelValue":i[0]||(i[0]=p=>o.value.name=p),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(V),{id:"redirectUri",modelValue:o.value.redirectUri,"onUpdate:modelValue":i[1]||(i[1]=p=>o.value.redirectUri=p),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(N),{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=$(Y,[["__cssModules",oe]]);x(b);const ue=w("oauth2","clients"),se=P(re,{modelValue:ue});se.mount("#oauth2");
|
|
//# sourceMappingURL=oauth2-settings-admin.mjs.map
|