2023-03-15 21:17:51 +08:00
|
|
|
import { action } from "@ember/object";
|
2019-10-24 00:39:32 +08:00
|
|
|
import Route from "@ember/routing/route";
|
2023-07-19 03:52:55 +08:00
|
|
|
import { inject as service } from "@ember/service";
|
2023-03-15 21:17:51 +08:00
|
|
|
|
|
|
|
export default class AdminPluginsRoute extends Route {
|
2023-07-19 03:52:55 +08:00
|
|
|
@service router;
|
|
|
|
|
2015-02-07 06:32:59 +08:00
|
|
|
model() {
|
2015-02-11 01:14:23 +08:00
|
|
|
return this.store.findAll("plugin");
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
2015-02-07 06:32:59 +08:00
|
|
|
|
2023-03-15 21:17:51 +08:00
|
|
|
@action
|
|
|
|
showSettings(plugin) {
|
|
|
|
const controller = this.controllerFor("adminSiteSettings");
|
2023-07-19 03:52:55 +08:00
|
|
|
this.router
|
|
|
|
.transitionTo("adminSiteSettingsCategory", "plugins")
|
|
|
|
.then(() => {
|
|
|
|
if (plugin) {
|
|
|
|
// filterContent() is normally on a debounce from typing.
|
|
|
|
// Because we don't want the default of "All Results", we tell it
|
|
|
|
// to skip the next debounce.
|
|
|
|
controller.set("filter", `plugin:${plugin.id}`);
|
|
|
|
controller.set("_skipBounce", true);
|
|
|
|
controller.filterContentNow("plugins");
|
|
|
|
}
|
|
|
|
});
|
2023-03-15 21:17:51 +08:00
|
|
|
}
|
|
|
|
}
|