2023-10-01 17:13:49 +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:()=>u});const n=flarum.core.compat["common/extenders"];var o=t.n(n);function i(t,e){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},i(t,e)}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}const a=flarum.core.compat["common/Model"];var s=t.n(a),c=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return(e=t.call.apply(t,[this].concat(o))||this).client_id=s().attribute("client_id"),e.client_secret=s().attribute("client_secret"),e.redirect_uri=s().attribute("redirect_uri"),e.grant_types=s().attribute("grant_types"),e.scope=s().attribute("scope"),e.user_id=s().attribute("user_id"),e.client_name=s().attribute("client_name"),e.client_icon=s().attribute("client_icon"),e.client_desc=s().attribute("client_desc"),e.client_home=s().attribute("client_home"),e}return r(e,t),e}(s());const u=[(new(o().Store)).add("oauth-clients",c)],l=flarum.core.compat["admin/app"];var f=t.n(l);const h=flarum.core.compat["admin/components/ExtensionPage"];var p=t.n(h);const d=flarum.core.compat["common/components/Button"];var v=t.n(d);const g=flarum.core.compat["common/components/Page"];var y=t.n(g);const _=flarum.core.compat["common/components/FieldSet"];var k=t.n(_);const b=flarum.core.compat["admin/utils/saveSettings"];var x=t.n(b);const S=flarum.core.compat["common/utils/Stream"];var w=t.n(S);flarum.core.compat["common/components/Select"];const P=flarum.core.compat["common/components/Switch"];var N=t.n(P),B=function(t){function e(){return t.apply(this,arguments)||this}r(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=f().data.settings;this.fields.forEach((function(t){return n.values[t]=w()(o[t]||"")}));for(var i=1;i<this.fields.length;i++)this.values[this.fields[i]]="1"===o[this.fields[i]]},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;"}),N().component({state:this.values["foskym-oauth-center.allow_implicit"],onchange:function(e){return t.saveSingleSetting("foskym-oauth-center.allow_implicit",e)},loading:this.saving},f().translator.trans("foskym-oauth-center.admin.settings.allow_implicit"))]),k().component({},[m("div",{style:"height: 5px;"}),N().component({state:this.values["foskym-oauth-center.enforce_state"],onchange:function(e){return t.saveSingleSetting("foskym-oauth-center.enforce_state",e)},loading:this.saving},f().translator.trans("foskym-oauth-center.admin.settings.enforce_state"))]),k().component({},[m("div",{style:"height: 5px;"}),N().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},f().translator.trans("foskym-oauth-center.admin.settings.require_exact_redirect_uri"))]),m("hr",null),k().component({},[m("input",{className:"FormControl",bidi:this.values["foskym-oauth-center.access_lifetime"],placeholder:f().translator.trans("foskym-oauth-center.admin.settings.access_lifetime"),required:!0}),m("div",{className:"helpText"},f().translator.trans("foskym-oauth-center.admin.settings.access_lifetime")),v().component({type:"submit",className:"Button Button--primary",loading:this.saving},f().translator.trans("core.admin.settings.submit_button"))])))},n.saveSingle
|