nextcloud/dist/oauth2-oauth2.js

2 lines
16 KiB
JavaScript
Raw Normal View History

(()=>{"use strict";var e,n={12073:(e,n,i)=>{var r=i(85471),o=i(65043),a=i(11037);const l={name:"EyeOutlineIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var s=i(14486);const c=(0,s.A)(l,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon eye-outline-icon",attrs:{"aria-hidden":!t.title||null,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9M12,4.5C17,4.5 21.27,7.61 23,12C21.27,16.39 17,19.5 12,19.5C7,19.5 2.73,16.39 1,12C2.73,7.61 7,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C15.76,17.5 19.17,15.36 20.82,12C19.17,8.64 15.76,6.5 12,6.5C8.24,6.5 4.83,8.64 3.18,12Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports;var d=i(9518);const u={name:"OAuthItem",components:{Delete:a.A,NcButton:d.A,EyeOutline:c},props:{client:{type:Object,required:!0}},data(){return{id:this.client.id,name:this.client.name,redirectUri:this.client.redirectUri,clientId:this.client.clientId,clientSecret:this.client.clientSecret,renderSecret:!1}},computed:{renderedSecret(){return this.renderSecret?this.clientSecret:"****"},toggleAriaLabel(){return this.renderSecret?t("oauth2","Hide client secret"):t("oauth2","Show client secret")}},methods:{toggleSecret(){this.renderSecret=!this.renderSecret}}};var h=i(85072),p=i.n(h),A=i(97825),m=i.n(A),C=i(77659),v=i.n(C),f=i(55056),g=i.n(f),y=i(10540),b=i.n(y),x=i(41113),_=i.n(x),S=i(47992),w={};w.styleTagTransform=_(),w.setAttributes=g(),w.insert=v().bind(null,"head"),w.domAPI=m(),w.insertStyleElement=b(),p()(S.A,w),S.A&&S.A.locals&&S.A.locals;const N=(0,s.A)(u,(function(){var t=this,e=t._self._c;return e("tr",[e("td",[t._v(t._s(t.name))]),t._v(" "),e("td",[t._v(t._s(t.redirectUri))]),t._v(" "),e("td",[e("code",[t._v(t._s(t.clientId))])]),t._v(" "),e("td",[e("div",{staticClass:"action-secret"},[e("code",[t._v(t._s(t.renderedSecret))]),t._v(" "),e("NcButton",{attrs:{type:"tertiary-no-background","aria-label":t.toggleAriaLabel},on:{click:t.toggleSecret},scopedSlots:t._u([{key:"icon",fn:function(){return[e("EyeOutline",{attrs:{size:20}})]},proxy:!0}])})],1)]),t._v(" "),e("td",{staticClass:"action-column"},[e("NcButton",{attrs:{type:"tertiary-no-background","aria-label":t.t("oauth2","Delete")},on:{click:function(e){return t.$emit("delete",t.id)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("Delete",{attrs:{size:20,title:t.t("oauth2","Delete")}})]},proxy:!0}])})],1)])}),[],!1,null,"67505450",null).exports;var O=i(63814),k=i(87485),U=i(88837),B=i(32981),I=i(82182);const D={name:"App",components:{OAuthItem:N,NcSettingsSection:U.A,NcButton:d.A,NcTextField:I.A},props:{clients:{type:Array,required:!0}},data:()=>({newClient:{name:"",redirectUri:"",errorMsg:"",error:!1},oauthDocLink:(0,B.C)("oauth2","oauth2-doc-link")}),computed:{instanceName:()=>(0,k.F)().theming.name},methods:{deleteClient(t){o.Ay.delete((0,O.Jv)("apps/oauth2/clients/{id}",{id:t})).then((e=>{this.clients=this.clients.filter((e=>e.id!==t))}))},addClient(){this.newClient.error=!1,o.Ay.post((0,O.Jv)("apps/oauth2/clients"),{name:this.newClient.name,redirectUri:this.newClient.redirectUri}).then((t=>{this.clients.push(t.data),this.newClient.name="",this.newClient.redirectUri=""})).catch((t=>{this.newClient.error=!0,this.newClient.errorMsg=t.response.data.message}))}}};var T=i(2527),j={};j.styleTagTransform=_(),j.setAttributes=g(),j.insert=v().bind(null,"head"),j.domAPI=m(),j.insertStyleElement=b(),p()(T.A,j),T.A&&T.A.locals&&T.A.locals;const R=(0,s.A)(D,(function(){var t=this,e=t._self._c;return e("NcSettingsSection",{attrs:{name:t.t("oauth2","OAuth 2.0 clients"),description:t.t("oauth2","OAuth 2.0 allows external services to request access to {instanceName}.",{instanceName:t.instanceName}),"doc-url":t.oauthDocLink}},[t.clients.length>
//# sourceMappingURL=oauth2-oauth2.js.map?v=d9d71594b273751a78de