mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 03:13:16 +08:00
![David Taylor](/assets/img/avatar_default.png)
`discourse-common` was created in the past to share logic between the 'wizard' app and the main 'discourse' app. Since then, the wizard has been consolidated into the main app, so the separation of `discourse-common` is no longer useful. This commit moves `discourse-common/(lib|utils)/*` into `discourse/lib/*`, adds shims for the imports, and updates existing uses in core.
27 lines
628 B
JavaScript
27 lines
628 B
JavaScript
import Route from "@ember/routing/route";
|
|
import { bind } from "discourse/lib/decorators";
|
|
import Backup from "admin/models/backup";
|
|
|
|
export default class AdminBackupsIndexRoute extends Route {
|
|
activate() {
|
|
this.messageBus.subscribe("/admin/backups", this.onMessage);
|
|
}
|
|
|
|
deactivate() {
|
|
this.messageBus.unsubscribe("/admin/backups", this.onMessage);
|
|
}
|
|
|
|
async model() {
|
|
const backups = await Backup.find();
|
|
return backups.map((backup) => Backup.create(backup));
|
|
}
|
|
|
|
@bind
|
|
onMessage(backups) {
|
|
this.controller.set(
|
|
"model",
|
|
backups.map((backup) => Backup.create(backup))
|
|
);
|
|
}
|
|
}
|