diff --git a/js/dist/admin.js b/js/dist/admin.js index 52a4e50..9d1e8e4 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={175:t=>{"use strict";var e=/(?:https?:)?\/\/(?:(?:[\w-]+\.)+[\w/#@~.-]*)(?:\?(?:[\w&=.!,;$#%-]+)?)?/gi;t.exports=function(t){return(t||"").replace(e,(function(t){return''+t+""}))}}},e={};function o(r){var n=e[r];if(void 0!==n)return n.exports;var i=e[r]={exports:{}};return t[r](i,i.exports,o),i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},o.d=(t,e)=>{for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";const t=flarum.core.compat["admin/app"];var e=o.n(t);function r(t,e){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},r(t,e)}const n=flarum.core.compat["common/components/Alert"];var i=o.n(n);const s=flarum.core.compat["admin/components/ExtensionPage"];var a=o.n(s);const p=flarum.core.compat["common/helpers/humanTime"];var c=o.n(p);const l=flarum.core.compat["common/utils/extractText"];var f=o.n(l),u=o(175),g=o.n(u),d=function(t){var o,n;function s(){return t.apply(this,arguments)||this}n=t,(o=s).prototype=Object.create(n.prototype),o.prototype.constructor=o,r(o,n);var a=s.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e)},a.content=function(){var t=this.setting("fof-geoip.service")(),o=1e3*Number(e().data.settings["fof-geoip.services."+t+".last_error_time"]),r=e().data.settings["fof-geoip.services."+t+".error"];return r&&(r=g()(r)),[m("div",{className:"container"},m("div",{className:"geopage"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"select",setting:"fof-geoip.service",label:e().translator.trans("fof-geoip.admin.settings.service_label"),options:e().data["fof-geoip.services"].reduce((function(t,o){return t[o]=e().translator.trans("fof-geoip.admin.settings.service_"+o+"_label"),t}),{}),required:!0,help:t&&m.trust(g()(f()(e().translator.trans("fof-geoip.admin.settings.service_"+t+"_description"))))})),r?i().component({className:"Form-group",dismissible:!1},[m("b",{style:{textTransform:"uppercase",marginRight:"5px"}},c()(o)),m.trust(r)]):"",["ipdata","ipapi-pro","ipsevenex"].includes(t)?[this.buildSettingComponent({type:"string",setting:"fof-geoip.services."+t+".access_key",label:e().translator.trans("fof-geoip.admin.settings.access_key_label"),required:!0})]:[],"ipdata"===t?this.buildSettingComponent({type:"number",setting:"fof-geoip.services.ipdata.quota",label:e().translator.trans("fof-geoip.admin.settings.quota_label"),min:1500,placeholder:1500}):[],this.buildSettingComponent({setting:"fof-geoip.showFlag",type:"boolean",label:e().translator.trans("fof-geoip.admin.settings.show_flag_label"),help:e().translator.trans("fof-geoip.admin.settings.show_flag_help")}),this.submitButton()))]},s}(a());e().initializers.add("fof/geoip",(function(){e().extensionData.for("fof-geoip").registerPage(d)}))})(),module.exports={}})(); +(()=>{var e={175:e=>{"use strict";var t=/(?:https?:)?\/\/(?:(?:[\w-]+\.)+[\w/#@~.-]*)(?:\?(?:[\w&=.!,;$#%-]+)?)?/gi;e.exports=function(e){return(e||"").replace(t,(function(e){return''+e+""}))}}},t={};function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,o),i.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=flarum.core.compat["admin/app"];var t=o.n(e);function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}const n=flarum.core.compat["common/components/Alert"];var i=o.n(n);const s=flarum.core.compat["admin/components/ExtensionPage"];var a=o.n(s);const p=flarum.core.compat["common/helpers/humanTime"];var c=o.n(p);const l=flarum.core.compat["common/utils/extractText"];var f=o.n(l),u=o(175),g=o.n(u),d=function(e){var o,n;function s(){return e.apply(this,arguments)||this}n=e,(o=s).prototype=Object.create(n.prototype),o.prototype.constructor=o,r(o,n);var a=s.prototype;return a.oninit=function(t){e.prototype.oninit.call(this,t)},a.content=function(){var e=this.setting("fof-geoip.service")(),o=1e3*Number(t().data.settings["fof-geoip.services."+e+".last_error_time"]),r=t().data.settings["fof-geoip.services."+e+".error"];return r&&(r=g()(r)),[m("div",{className:"container"},m("div",{className:"geopage"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"select",setting:"fof-geoip.service",label:t().translator.trans("fof-geoip.admin.settings.service_label"),options:t().data["fof-geoip.services"].reduce((function(e,o){return e[o]=t().translator.trans("fof-geoip.admin.settings.service_"+o+"_label"),e}),{}),required:!0,help:e&&m.trust(g()(f()(t().translator.trans("fof-geoip.admin.settings.service_"+e+"_description"))))})),r?i().component({className:"Form-group",dismissible:!1},[m("b",{style:{textTransform:"uppercase",marginRight:"5px"}},c()(o)),m.trust(r)]):"",["ipdata","ipapi-pro","ipsevenex"].includes(e)?[this.buildSettingComponent({type:"string",setting:"fof-geoip.services."+e+".access_key",label:t().translator.trans("fof-geoip.admin.settings.access_key_label"),required:!0})]:[],"ipdata"===e?this.buildSettingComponent({type:"number",setting:"fof-geoip.services.ipdata.quota",label:t().translator.trans("fof-geoip.admin.settings.quota_label"),min:1500,placeholder:1500}):[],this.buildSettingComponent({setting:"fof-geoip.showFlag",type:"boolean",label:t().translator.trans("fof-geoip.admin.settings.show_flag_label"),help:t().translator.trans("fof-geoip.admin.settings.show_flag_help")}),this.submitButton()))]},s}(a());t().initializers.add("fof/geoip",(function(){t().extensionData.for("fof-geoip").registerPage(d).registerPermission({icon:"fas fa-globe",permission:"fof-geoip.canSeeCountry",label:t().translator.trans("fof-geoip.admin.permissions.see_country")},"moderate",50)}))})(),module.exports={}})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index e6b37fa..85631f1 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"kCAEA,IAAIA,EAAa,4EAEjBC,EAAOC,QAAU,SAASC,GACtB,OAAQA,GAAQ,IAAIC,QAAQJ,GAAY,SAASK,GAC7C,MAAO,YAAcA,EAAM,KAAOA,EAAM,MAC5C,GACJ,C,GCPIC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaP,QAGrB,IAAID,EAASK,EAAyBE,GAAY,CAGjDN,QAAS,CAAC,GAOX,OAHAS,EAAoBH,GAAUP,EAAQA,EAAOC,QAASK,GAG/CN,EAAOC,OACf,CCrBAK,EAAoBK,EAAKX,IACxB,IAAIY,EAASZ,GAAUA,EAAOa,WAC7B,IAAOb,EAAiB,QACxB,IAAM,EAEP,OADAM,EAAoBQ,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdN,EAAoBQ,EAAI,CAACb,EAASe,KACjC,IAAI,IAAIC,KAAOD,EACXV,EAAoBY,EAAEF,EAAYC,KAASX,EAAoBY,EAAEjB,EAASgB,IAC5EE,OAAOC,eAAenB,EAASgB,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDX,EAAoBY,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,G,mBCAlF,MAAM,EAA+BI,OAAOC,KAAKC,OAAO,a,aCAzC,SAASC,EAAgBb,EAAGc,GAKzC,OAJAD,EAAkBZ,OAAOc,eAAiBd,OAAOc,eAAeC,OAAS,SAAyBhB,EAAGc,GAEnG,OADAd,EAAEiB,UAAYH,EACPd,CACT,EACOa,EAAgBb,EAAGc,EAC5B,CCNA,MAAM,EAA+BJ,OA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YAAa,QAAUC,IAAUvB,IAAiBM,EAAEU,MAAMZ,KAErG,GAEH,CAAC,SAAU,YAAa,aAAaoB,SAAS3B,GAC3C,CACEC,KAAKU,sBAAsB,CACzBC,KAAM,SACNV,QAAS,sBAAsBF,EAAO,cACtCa,MAAOR,IAAAA,WAAeS,MAAM,6CAC5BG,UAAU,KAGd,GACS,WAAZjB,EACGC,KAAKU,sBAAsB,CACzBC,KAAM,SACNV,QAAS,kCACTW,MAAOR,IAAAA,WAAeS,MAAM,wCAC5Bc,IAAK,KACLC,YAAa,OAEf,GACH5B,KAAKU,sBAAsB,CAC1BT,QAAS,qBACTU,KAAM,UACNC,MAAOR,IAAAA,WAAeS,MAAM,4CAC5BI,KAAMb,IAAAA,WAAeS,MAAM,6CAE5Bb,KAAK6B,iBAId,EAAC1C,CAAA,CAnEmC,CAAS2C,KEJ/C1B,IAAAA,aAAiB2B,IAAI,aAAa,WAChC3B,IAAAA,cAAiB,IAAK,aAAa4B,aAAa7C,EAClD,G","sources":["webpack://@fof/geoip/./node_modules/linkify-lite/index.js","webpack://@fof/geoip/webpack/bootstrap","webpack://@fof/geoip/webpack/runtime/compat get default export","webpack://@fof/geoip/webpack/runtime/define property getters","webpack://@fof/geoip/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/geoip/external root \"flarum.core.compat['admin/app']\"","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/geoip/external root \"flarum.core.compat['common/components/Alert']\"","webpack://@fof/geoip/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@fof/geoip/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/geoip/./src/admin/components/ExtensionSettingsPage.js","webpack://@fof/geoip/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/geoip/./src/admin/index.js"],"sourcesContent":["'use strict';\n\nvar urlPattern = /(?:https?:)?\\/\\/(?:(?:[\\w-]+\\.)+[\\w/#@~.-]*)(?:\\?(?:[\\w&=.!,;$#%-]+)?)?/gi;\n\nmodule.exports = function(text) {\n return (text || '').replace(urlPattern, function(url) {\n return '' + url + '';\n });\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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))","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Alert'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","import app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport extractText from 'flarum/common/utils/extractText';\nimport linkify from 'linkify-lite';\n\nexport default class GeoipSettingsPage extends ExtensionPage {\n oninit(vnode) {\n super.oninit(vnode);\n }\n\n content() {\n const service = this.setting('fof-geoip.service')();\n const errorTime = Number(app.data.settings[`fof-geoip.services.${service}.last_error_time`]) * 1000;\n let error = app.data.settings[`fof-geoip.services.${service}.error`];\n\n if (error) error = linkify(error);\n\n return [\n