mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 03:05:25 +08:00
20 lines
544 B
JavaScript
20 lines
544 B
JavaScript
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"]);
|
|
|
|
return Ember.RSVP.Promise.all(this.get("dataSources").map(dataSource => {
|
|
return ajax(dataSource, payload)
|
|
.then(response => {
|
|
this.get("reports").pushObject(this.loadReport(response.report));
|
|
});
|
|
}));
|
|
}
|
|
});
|