2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-08 12:06:51 +08:00
discourse/app/assets/javascripts/admin/components/dashboard-table.js.es6

21 lines
544 B
Text
Raw Normal View History

import { ajax } from "discourse/lib/ajax";
import AsyncReport from "admin/mixins/async-report";
export default Ember.Component.extend(AsyncReport, {
classNames: ["dashboard-table"],
fetchReport() {
this._super();
let payload = this.buildPayload(["total", "prev30Days"]);
2018-06-15 17:03:24 +02:00
return Ember.RSVP.Promise.all(
this.get("dataSources").map(dataSource => {
return ajax(dataSource, payload).then(response => {
this.get("reports").pushObject(this.loadReport(response.report));
});
2018-06-15 17:03:24 +02:00
})
);
}
});