mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 00:43:24 +08:00
28 lines
634 B
JavaScript
28 lines
634 B
JavaScript
import Backup from "admin/models/backup";
|
|
import Route from "@ember/routing/route";
|
|
import { bind } from "discourse-common/utils/decorators";
|
|
|
|
export default class AdminBackupsIndexRoute extends Route {
|
|
activate() {
|
|
this.messageBus.subscribe("/admin/backups", this.onMessage);
|
|
}
|
|
|
|
deactivate() {
|
|
this.messageBus.unsubscribe("/admin/backups", this.onMessage);
|
|
}
|
|
|
|
model() {
|
|
return Backup.find().then((backups) =>
|
|
backups.map((backup) => Backup.create(backup))
|
|
);
|
|
}
|
|
|
|
@bind
|
|
onMessage(backups) {
|
|
this.controller.set(
|
|
"model",
|
|
backups.map((backup) => Backup.create(backup))
|
|
);
|
|
}
|
|
}
|