diff --git a/js/dist/admin.js b/js/dist/admin.js index 224b05f..a76f094 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={n:o=>{var a=o&&o.__esModule?()=>o.default:()=>o;return t.d(a,{a}),a},d:(o,a)=>{for(var n in a)t.o(a,n)&&!t.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:a[n]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o),t.d(o,{extend:()=>B});const a=flarum.core.compat["common/app"];t.n(a)().initializers.add("ianm/twofactor",(function(){}));const n=flarum.core.compat["admin/app"];var r=t.n(n);const e=flarum.core.compat["common/extend"],s=flarum.core.compat["admin/components/UserListPage"];var i=t.n(s);const c=flarum.core.compat["common/helpers/icon"];var l=t.n(c);const u=flarum.core.compat["admin/components/EditGroupModal"];var p=t.n(u);const d=flarum.core.compat["common/components/Switch"];var f=t.n(d);const g=flarum.core.compat["common/utils/Stream"];var _=t.n(g);const b=flarum.core.compat["common/models/Group"];var h=t.n(b);function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function v(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}const y=flarum.core.compat["admin/components/ExtensionPage"];var F=t.n(y);const N=flarum.core.compat["admin/components/UploadImageButton"];var q=t.n(N);const x=flarum.core.compat["common/Component"];var P=t.n(x);const S=flarum.core.compat["common/components/GroupBadge"];var O=t.n(S),A=function(t){function o(){return t.apply(this,arguments)||this}return v(o,t),o.prototype.view=function(){return m("div",{className:"PermissionsPage-groups"},r().store.all("groups").filter((function(t){return-1===[h().GUEST_ID,h().MEMBER_ID].indexOf(t.id())})).map((function(t){return m("button",{className:"Button Group",onclick:function(){return r().modal.show(p(),{group:t})}},m(O(),{group:t,className:"Group-icon",label:null}),m("span",{className:"Group-name"},t.namePlural()))})),m("button",{className:"Button Group Group--add",onclick:function(){return r().modal.show(p())}},l()("fas fa-plus",{className:"Group-icon"}),m("span",{className:"Group-name"},r().translator.trans("core.admin.permissions.new_group_button"))))},o}(P()),G=function(t){function o(){return t.apply(this,arguments)||this}return v(o,t),o.prototype.content=function(){return m("div",{className:"container"},m("div",{className:"TwoFactorSettingsPage"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("h3",null,r().translator.trans("ianm-twofactor.admin.settings.groups.title")),m("p",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.settings.groups.help")),m(A,null)),this.buildSettingComponent({setting:"ianm-twofactor.admin.settings.forum_logo_qr",type:"boolean",label:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr"),help:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_help")}),m("div",{className:"Form-group"},m("label",null,r().translator.trans("ianm-twofactor.admin.settings.logo_qr")),m("div",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.settings.logo_qr_help")),m(q(),{name:"ianm_twofactor_logo"})),this.buildSettingComponent({setting:"ianm-twofactor.admin.settings.forum_logo_qr_width",type:"number",label:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_width"),help:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_width_help"),max:200}),this.submitButton())))},o}(F());const T=flarum.core.compat["common/extenders"];var M=t.n(T);const E=flarum.core.compat["common/models/User"];var j=t.n(E);const D=[new(M().Model)(j()).attribute("twoFactorEnabled").attribute("canDisable2FA").attribute("mustEnable2FA").attribute("backupCodesRemaining"),new(M().Model)(h()).attribute("requires2FA")],B=[].concat(D);r().initializers.add("ianm/twofactor",(function(){r().extensionData.for("ianm-twofactor").registerPage(G).registerPermission({icon:"fas fa-shield-alt",label:r().translator.trans("ianm-twofactor.admin.permissions.see_two_factor_status_label"),permission:"ianm-twofactor.seeTwoFactorStatus"},"moderate",65).registerPermission({icon:"fas fa-shield-alt",label:r().translator.trans("ianm-twofactor.admin.permissions.manage_others_label"),permission:"ianm-twofactor.manageOthers"},"moderate",60),(0,e.extend)(i().prototype,"columns",(function(t){t.add("2fa",{name:"2FA",content:function(t){return t.twoFactorEnabled()?m("p",null,l()("fas fa-shield-alt")):m("p",null)}},82)})),(0,e.extend)(p().prototype,"oninit",(function(t){this.requires2FA=_()(this.group.requires2FA()||!1)})),(0,e.extend)(p().prototype,"fields",(function(t){t.add("2fa",m("div",{className:"Form-group"},this.group.id()===h().ADMINISTRATOR_ID?m("p",null,r().translator.trans("ianm-twofactor.admin.edit_group.admin_2fa_help",{adminName:this.group.nameSingular()})):m(f(),{state:this.requires2FA(),onchange:this.requires2FA},r().translator.trans("ianm-twofactor.admin.edit_group.2fa_label")),m("p",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.edit_group.2fa_help"))),10)})),(0,e.extend)(p().prototype,"submitData",(function(t){return t.requires2FA=this.requires2FA(),t}))}))})(),module.exports=o})(); +(()=>{var t={n:o=>{var a=o&&o.__esModule?()=>o.default:()=>o;return t.d(a,{a}),a},d:(o,a)=>{for(var n in a)t.o(a,n)&&!t.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:a[n]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o),t.d(o,{extend:()=>B});const a=flarum.core.compat["common/app"];t.n(a)().initializers.add("ianm/twofactor",(function(){}));const n=flarum.core.compat["admin/app"];var r=t.n(n);const e=flarum.core.compat["common/extend"],s=flarum.core.compat["admin/components/UserListPage"];var i=t.n(s);const c=flarum.core.compat["common/helpers/icon"];var l=t.n(c);const u=flarum.core.compat["admin/components/EditGroupModal"];var p=t.n(u);const d=flarum.core.compat["common/components/Switch"];var f=t.n(d);const g=flarum.core.compat["common/utils/Stream"];var _=t.n(g);const b=flarum.core.compat["common/models/Group"];var h=t.n(b);function w(t,o){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},w(t,o)}function v(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,w(t,o)}const y=flarum.core.compat["admin/components/ExtensionPage"];var F=t.n(y);const N=flarum.core.compat["admin/components/UploadImageButton"];var q=t.n(N);const x=flarum.core.compat["common/Component"];var P=t.n(x);const S=flarum.core.compat["common/components/GroupBadge"];var O=t.n(S),A=function(t){function o(){return t.apply(this,arguments)||this}return v(o,t),o.prototype.view=function(){return m("div",{className:"PermissionsPage-groups"},r().store.all("groups").filter((function(t){return-1===[h().GUEST_ID,h().MEMBER_ID].indexOf(t.id())})).map((function(t){return m("button",{className:"Button Group",onclick:function(){return r().modal.show(p(),{group:t})}},m(O(),{group:t,className:"Group-icon",label:null}),m("span",{className:"Group-name"},t.namePlural()))})),m("button",{className:"Button Group Group--add",onclick:function(){return r().modal.show(p())}},l()("fas fa-plus",{className:"Group-icon"}),m("span",{className:"Group-name"},r().translator.trans("core.admin.permissions.new_group_button"))))},o}(P()),G=function(t){function o(){return t.apply(this,arguments)||this}return v(o,t),o.prototype.content=function(){return m("div",{className:"container"},m("div",{className:"TwoFactorSettingsPage"},m("div",{className:"Form"},m("div",{className:"Form-group"},m("h3",null,r().translator.trans("ianm-twofactor.admin.settings.groups.title")),m("p",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.settings.groups.help")),m(A,null)),this.buildSettingComponent({setting:"ianm-twofactor.admin.settings.forum_logo_qr",type:"boolean",label:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr"),help:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_help")}),m("div",{className:"Form-group"},m("label",null,r().translator.trans("ianm-twofactor.admin.settings.logo_qr")),m("div",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.settings.logo_qr_help")),m(q(),{name:"ianm_twofactor_logo"})),this.buildSettingComponent({setting:"ianm-twofactor.admin.settings.forum_logo_qr_width",type:"number",label:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_width"),help:r().translator.trans("ianm-twofactor.admin.settings.forum_logo_qr_width_help"),max:200}),this.submitButton())))},o}(F());const T=flarum.core.compat["common/extenders"];var M=t.n(T);const E=flarum.core.compat["common/models/User"];var j=t.n(E);const D=[new(M().Model)(j()).attribute("twoFactorEnabled").attribute("canDisable2FA").attribute("mustEnable2FA").attribute("backupCodesRemaining"),new(M().Model)(h()).attribute("requires2FA")],B=[].concat(D);r().initializers.add("ianm/twofactor",(function(){r().extensionData.for("ianm-twofactor").registerPage(G).registerPermission({icon:"fas fa-shield-alt",label:r().translator.trans("ianm-twofactor.admin.permissions.see_two_factor_status_label"),permission:"ianm-twofactor.seeTwoFactorStatus"},"moderate",65).registerPermission({icon:"fas fa-shield-alt",label:r().translator.trans("ianm-twofactor.admin.permissions.manage_others_label"),permission:"ianm-twofactor.manageOthers"},"moderate",60),(0,e.extend)(i().prototype,"columns",(function(t){t.add("2fa",{name:"2FA",content:function(t){return t.twoFactorEnabled()?m("p",null,l()("fas fa-shield-alt")):m("p",null)}},82)})),(0,e.extend)(p().prototype,"oninit",(function(t){this.requires2FA=_()(this.group.requires2FA()||!1)})),(0,e.extend)(p().prototype,"fields",(function(t){var o=this.group.id()===h().ADMINISTRATOR_ID;t.add("2fa",m("div",{className:"Form-group"},o?m("p",null,r().translator.trans("ianm-twofactor.admin.edit_group.admin_2fa_help",{adminName:this.group.nameSingular()})):m(f(),{state:this.requires2FA(),onchange:this.requires2FA},r().translator.trans("ianm-twofactor.admin.edit_group.2fa_label")),!o&&m("p",{className:"helpText"},r().translator.trans("ianm-twofactor.admin.edit_group.2fa_help"))),10)})),(0,e.extend)(p().prototype,"submitData",(function(t){return t.requires2FA=this.requires2FA(),t}))}))})(),module.exports=o})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/adm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,oBACNF,MAAO9B,IAAAA,WAAeiC,MAAM,wDAC5BsB,WAAY,+BAEd,WACA,KCRJC,EAAAA,EAAAA,QAAOC,IAAAA,UAAwB,WAAW,SAAUC,GAClDA,EAAQzD,IACN,MACA,CACE2C,KAAM,MACNP,QAAS,SAACsB,GACR,OAAOA,EAAKC,mBAAqB3C,EAAA,SAAIe,IAAK,sBAA4Bf,EAAA,SACxE,GAEF,GAEJ,KCtBAuC,EAAAA,EAAAA,QAAO5B,IAAAA,UAA0B,UAAU,SAAUiC,GACnDvB,KAAKwB,YAAcC,IAAOzB,KAAKjB,MAAMyC,gBAAiB,EACxD,KAEAN,EAAAA,EAAAA,QAAO5B,IAAAA,UAA0B,UAAU,SAAUoC,GACnDA,EAAM/D,IACJ,MACAgB,EAAA,OAAKC,UAAU,cACZoB,KAAKjB,MAAMG,OAASF,IAAAA,iBACnBL,EAAA,SACGjB,IAAAA,WAAeiC,MAAM,iDAAkD,CACtEgC,UAAW3B,KAAKjB,MAAM6C,kBAI1BjD,EAACkD,IAAM,CAACC,MAAO9B,KAAKwB,cAAeO,SAAU/B,KAAKwB,aAC/C9D,IAAAA,WAAeiC,MAAM,8CAG1BhB,EAAA,KAAGC,UAAU,YAAYlB,IAAAA,WAAeiC,MAAM,8CAEhD,GAEJ,KAEAuB,EAAAA,EAAAA,QAAO5B,IAAAA,UAA0B,cAAc,SAAU0C,GAGvD,OAFAA,EAAKR,YAAcxB,KAAKwB,cAEjBQ,CACT,GFLF,G","sources":["webpack://@ianm/twofactor/webpack/bootstrap","webpack://@ianm/twofactor/webpack/runtime/compat get default export","webpack://@ianm/twofactor/webpack/runtime/define property getters","webpack://@ianm/twofactor/webpack/runtime/hasOwnProperty shorthand","webpack://@ianm/twofactor/webpack/runtime/make namespace object","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/app']\"","webpack://@ianm/twofactor/./src/common/index.ts","webpack://@ianm/twofactor/external root \"flarum.core.compat['admin/app']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extend']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['admin/components/UserListPage']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['admin/components/EditGroupModal']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/Group']\"","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@ianm/twofactor/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@ianm/twofactor/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['admin/components/UploadImageButton']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/Component']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/components/GroupBadge']\"","webpack://@ianm/twofactor/./src/admin/components/ExtractedGroupBar.tsx","webpack://@ianm/twofactor/./src/admin/components/SettingsPage.tsx","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/extenders']\"","webpack://@ianm/twofactor/external root \"flarum.core.compat['common/models/User']\"","webpack://@ianm/twofactor/./src/common/extend.ts","webpack://@ianm/twofactor/./src/admin/extend.ts","webpack://@ianm/twofactor/./src/admin/index.ts","webpack://@ianm/twofactor/./src/admin/extendUserListPage.tsx","webpack://@ianm/twofactor/./src/admin/extendEditGroupModal.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/app'];","import app from 'flarum/common/app';\n\napp.initializers.add('ianm/twofactor', () => {});\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UserListPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/EditGroupModal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/UploadImageButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/GroupBadge'];","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport GroupBadge from 'flarum/common/components/GroupBadge';\nimport EditGroupModal from 'flarum/admin/components/EditGroupModal';\nimport Group from 'flarum/common/models/Group';\nimport icon from 'flarum/common/helpers/icon';\n\n/**\n * This is just the group bar from the permissions page, extracted into its own component so it can be used again.\n */\nexport default class ExtractedGroupBar extends Component {\n view() {\n return (\n
{app.translator.trans('ianm-twofactor.admin.settings.groups.help')}
\n{icon('fas fa-shield-alt')}
: ;\n },\n },\n 82\n );\n });\n}\n","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport EditGroupModal from 'flarum/admin/components/EditGroupModal';\nimport Switch from 'flarum/common/components/Switch';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\nexport default function extendEditGroupModal() {\n extend(EditGroupModal.prototype, 'oninit', function (vnode) {\n this.requires2FA = Stream(this.group.requires2FA() || false);\n });\n\n extend(EditGroupModal.prototype, 'fields', function (items) {\n items.add(\n '2fa',\n\n {app.translator.trans('ianm-twofactor.admin.edit_group.admin_2fa_help', {\n adminName: this.group.nameSingular(),\n })}\n
\n ) : (\n{app.translator.trans('ianm-twofactor.admin.edit_group.2fa_help')}
\n{app.translator.trans('ianm-twofactor.admin.settings.groups.help')}
\n{icon('fas fa-shield-alt')}
: ;\n },\n },\n 82\n );\n });\n}\n","import app from 'flarum/admin/app';\nimport { extend } from 'flarum/common/extend';\nimport EditGroupModal from 'flarum/admin/components/EditGroupModal';\nimport Switch from 'flarum/common/components/Switch';\nimport Stream from 'flarum/common/utils/Stream';\nimport Group from 'flarum/common/models/Group';\n\nexport default function extendEditGroupModal() {\n extend(EditGroupModal.prototype, 'oninit', function (vnode) {\n this.requires2FA = Stream(this.group.requires2FA() || false);\n });\n\n extend(EditGroupModal.prototype, 'fields', function (items) {\n const isAdmin = this.group.id() === Group.ADMINISTRATOR_ID;\n items.add(\n '2fa',\n\n {app.translator.trans('ianm-twofactor.admin.edit_group.admin_2fa_help', {\n adminName: this.group.nameSingular(),\n })}\n
\n ) : (\n{app.translator.trans('ianm-twofactor.admin.edit_group.2fa_help')}
}\n