diff --git a/extend.php b/extend.php index 48564dc..ee25804 100644 --- a/extend.php +++ b/extend.php @@ -28,6 +28,7 @@ (new Extend\Frontend('admin')) ->js(__DIR__.'/js/dist/admin.js') + ->css(__DIR__.'/resources/less/admin.less') ->content(function (Document $document) { $document->payload['fof-geoip.services'] = array_keys(GeoIP::$services); }), diff --git a/js/admin.js b/js/admin.ts similarity index 100% rename from js/admin.js rename to js/admin.ts diff --git a/js/forum.js b/js/forum.ts similarity index 100% rename from js/forum.js rename to js/forum.ts diff --git a/js/package.json b/js/package.json index 31d2a6a..e94a2cf 100644 --- a/js/package.json +++ b/js/package.json @@ -9,7 +9,7 @@ "external-load": "^1.0.0", "flarum-tsconfig": "^1.0.2", "flarum-webpack-config": "^2.0.0", - "linkify-lite": "^1.0.0", + "linkify-lite": "^2.0.0", "twemoji-basename": "^1.0.0", "webpack": "^5.94.0" }, diff --git a/js/src/admin/components/ExtensionSettingsPage.js b/js/src/admin/components/ExtensionSettingsPage.js deleted file mode 100644 index 732cacd..0000000 --- a/js/src/admin/components/ExtensionSettingsPage.js +++ /dev/null @@ -1,76 +0,0 @@ -import app from 'flarum/admin/app'; -import Alert from 'flarum/common/components/Alert'; -import ExtensionPage from 'flarum/admin/components/ExtensionPage'; -import humanTime from 'flarum/common/helpers/humanTime'; -import extractText from 'flarum/common/utils/extractText'; -import linkify from 'linkify-lite'; - -export default class GeoipSettingsPage extends ExtensionPage { - oninit(vnode) { - super.oninit(vnode); - } - - content() { - const service = this.setting('fof-geoip.service')(); - const errorTime = Number(app.data.settings[`fof-geoip.services.${service}.last_error_time`]) * 1000; - let error = app.data.settings[`fof-geoip.services.${service}.error`]; - - if (error) error = linkify(error); - - return [ -
{app.translator.trans('fof-geoip.admin.settings.general.help')}
+ {this.generalItems().toArray()} +{app.translator.trans('fof-geoip.admin.settings.providers.help')}
+ {this.providerItems().toArray()} +