import Page from 'flarum/components/Page'; import FieldSet from 'flarum/components/FieldSet'; import Select from 'flarum/components/Select'; import Button from 'flarum/components/Button'; import Alert from 'flarum/components/Alert'; import saveSettings from 'flarum/utils/saveSettings'; import ItemList from 'flarum/utils/ItemList'; import Switch from 'flarum/components/Switch'; export default class BasicsPage extends Page { init() { super.init(); this.loading = false; this.fields = [ 'forum_title', 'forum_description', 'default_locale', 'show_language_selector', 'default_route', 'welcome_title', 'welcome_message' ]; this.values = {}; const settings = app.data.settings; this.fields.forEach(key => this.values[key] = m.prop(settings[key] || false)); this.localeOptions = {}; const locales = app.data.locales; for (const i in locales) { this.localeOptions[i] = `${locales[i]} (${i})`; } if (typeof this.values.show_language_selector() !== "number") this.values.show_language_selector(1); } view() { return (