discourse/app/assets/javascripts/admin/components/dashboard-inline-table.js.es6

21 lines
551 B
Plaintext
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-inline-table"],
fetchReport() {
this._super();
let payload = this.buildPayload(["total", "prev30Days"]);
2018-06-15 23:03:24 +08: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 23:03:24 +08:00
})
);
}
});