2023-03-15 21:17:51 +08:00
|
|
|
import { action } from "@ember/object";
|
2019-10-22 21:46:10 +08:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2015-03-03 01:12:19 +08:00
|
|
|
import SiteSetting from "admin/models/site-setting";
|
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
export default class AdminSiteSettingsRoute extends DiscourseRoute {
|
|
|
|
queryParams = {
|
2017-03-22 04:13:19 +08:00
|
|
|
filter: { replace: true },
|
2023-03-15 21:17:51 +08:00
|
|
|
};
|
2017-03-22 04:13:19 +08:00
|
|
|
|
2015-03-03 01:12:19 +08:00
|
|
|
model() {
|
|
|
|
return SiteSetting.findAll();
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
2015-03-03 01:12:19 +08:00
|
|
|
|
|
|
|
afterModel(siteSettings) {
|
2018-12-11 08:59:59 +08:00
|
|
|
const controller = this.controllerFor("adminSiteSettings");
|
|
|
|
|
2018-12-11 23:48:12 +08:00
|
|
|
if (!controller.get("visibleSiteSettings")) {
|
|
|
|
controller.set("visibleSiteSettings", siteSettings);
|
2018-12-11 08:59:59 +08:00
|
|
|
}
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
2019-05-01 21:44:45 +08:00
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
@action
|
|
|
|
refreshAll() {
|
|
|
|
SiteSetting.findAll().then((settings) => {
|
|
|
|
this.controllerFor("adminSiteSettings").set("model", settings);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|