2015-11-20 20:27:06 -05:00
|
|
|
import Backup from "admin/models/backup";
|
2019-10-23 12:39:32 -04:00
|
|
|
import Route from "@ember/routing/route";
|
2022-11-30 10:49:51 -05:00
|
|
|
import { bind } from "discourse-common/utils/decorators";
|
2015-11-20 20:27:06 -05:00
|
|
|
|
2019-10-23 12:39:32 -04:00
|
|
|
export default Route.extend({
|
2018-01-31 06:05:06 -05:00
|
|
|
activate() {
|
2022-11-30 10:49:51 -05:00
|
|
|
this.messageBus.subscribe("/admin/backups", this.onMessage);
|
|
|
|
},
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
this.messageBus.unsubscribe("/admin/backups", this.onMessage);
|
2018-01-31 06:05:06 -05:00
|
|
|
},
|
|
|
|
|
2015-08-06 12:14:59 -04:00
|
|
|
model() {
|
2021-01-20 00:04:21 -05:00
|
|
|
return Backup.find().then((backups) =>
|
|
|
|
backups.map((backup) => Backup.create(backup))
|
|
|
|
);
|
2018-01-31 06:05:06 -05:00
|
|
|
},
|
|
|
|
|
2022-11-30 10:49:51 -05:00
|
|
|
@bind
|
|
|
|
onMessage(backups) {
|
|
|
|
this.controller.set(
|
|
|
|
"model",
|
|
|
|
backups.map((backup) => Backup.create(backup))
|
|
|
|
);
|
2015-08-06 12:14:59 -04:00
|
|
|
},
|
|
|
|
});
|