forum-oauth-center/js/dist/admin.js

2 lines
10 KiB
JavaScript
Raw Normal View History

2023-10-01 19:53:59 +08:00
(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{extend:()=>l});const n=flarum.core.compat["common/extenders"];var o=t.n(n);function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function a(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)}const r=flarum.core.compat["common/Model"];var i=t.n(r),c=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))||this).client_id=i().attribute("client_id"),e.client_secret=i().attribute("client_secret"),e.redirect_uri=i().attribute("redirect_uri"),e.grant_types=i().attribute("grant_types"),e.scope=i().attribute("scope"),e.user_id=i().attribute("user_id"),e.client_name=i().attribute("client_name"),e.client_icon=i().attribute("client_icon"),e.client_desc=i().attribute("client_desc"),e.client_home=i().attribute("client_home"),e}return a(e,t),e}(i()),u=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))||this).scope=i().attribute("scope"),e.resource_path=i().attribute("resource_path"),e.method=i().attribute("method"),e.is_default=i().attribute("is_default",(function(t){return 1===t})),e.scope_name=i().attribute("scope_name"),e.scope_icon=i().attribute("scope_icon"),e.scope_desc=i().attribute("scope_desc"),e}return a(e,t),e}(i());const l=[(new(o().Store)).add("oauth-clients",c).add("oauth-scopes",u)],f=flarum.core.compat["admin/app"];var p=t.n(f);const h=flarum.core.compat["admin/components/ExtensionPage"];var d=t.n(h);const v=flarum.core.compat["common/components/Button"];var g=t.n(v);const _=flarum.core.compat["common/components/Page"];var y=t.n(_);const b=flarum.core.compat["common/components/FieldSet"];var k=t.n(b);const S=flarum.core.compat["admin/utils/saveSettings"];var x=t.n(S);const P=flarum.core.compat["common/utils/Stream"];var w=t.n(P);const B=flarum.core.compat["common/components/Select"];var O=t.n(B);const N=flarum.core.compat["common/components/Switch"];var C=t.n(N),T=function(t){function e(){return t.apply(this,arguments)||this}a(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.saving=!1,this.fields=["foskym-oauth-center.access_lifetime","foskym-oauth-center.allow_implicit","foskym-oauth-center.enforce_state","foskym-oauth-center.require_exact_redirect_uri"],this.values={};var o=p().data.settings;this.fields.forEach((function(t){return n.values[t]=w()(o[t]||"")}));for(var s=1;s<this.fields.length;s++)this.values[this.fields[s]]="1"===o[this.fields[s]]},n.view=function(){var t=this;return m("div",null,m("form",{onsubmit:this.onsubmit.bind(this),className:"BasicsPage"},k().component({},[m("div",{style:"height: 5px;"}),C().component({state:this.values["foskym-oauth-center.allow_implicit"],onchange:function(e){return t.saveSingleSetting("foskym-oauth-center.allow_implicit",e)},loading:this.saving},p().translator.trans("foskym-oauth-center.admin.settings.allow_implicit"))]),k().component({},[m("div",{style:"height: 5px;"}),C().component({state:this.values["foskym-oauth-center.enforce_state"],onchange:function(e){return t.saveSingleSetting("foskym-oauth-center.enforce_state",e)},loading:this.saving},p().translator.trans("foskym-oauth-center.admin.settings.enforce_state"))]),k().component({},[m("div",{style:"height: 5px;"}),C().component({state:this.values["foskym-oauth-center.require_exact_redirect_uri"],onchange:function(e){return t.saveSingleSetting("foskym-oauth-center.require_exact_redirect_uri",e)},loading:this.saving},p().translator.trans("foskym-oauth-center.admin.settings.requi
2023-09-28 17:47:09 +08:00
//# sourceMappingURL=admin.js.map