mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
UX: improve new dashboard
- top referred topics - limit search logs to 8 results
This commit is contained in:
@ -8,12 +8,31 @@ export default Ember.Component.extend(AsyncReport, {
|
||||
help: null,
|
||||
helpPage: null,
|
||||
|
||||
loadReport(report_json) {
|
||||
this._setPropertiesFromReport(Report.create(report_json));
|
||||
},
|
||||
|
||||
fetchReport() {
|
||||
this.set("isLoading", true);
|
||||
|
||||
ajax(this.get("dataSource"))
|
||||
let payload = { data: { async: true } };
|
||||
|
||||
if (this.get("startDate")) {
|
||||
payload.data.start_date = this.get("startDate").format("YYYY-MM-DD[T]HH:mm:ss.SSSZZ");
|
||||
}
|
||||
|
||||
if (this.get("endDate")) {
|
||||
payload.data.end_date = this.get("endDate").format("YYYY-MM-DD[T]HH:mm:ss.SSSZZ");
|
||||
}
|
||||
|
||||
if (this.get("limit")) {
|
||||
payload.data.limit = this.get("limit");
|
||||
}
|
||||
|
||||
ajax(this.get("dataSource"), payload)
|
||||
.then((response) => {
|
||||
this._setPropertiesFromReport(Report.create(response.report));
|
||||
this.set('reportKey', response.report.report_key);
|
||||
this.loadReport(response.report);
|
||||
}).finally(() => {
|
||||
if (!Ember.isEmpty(this.get("report.data"))) {
|
||||
this.set("isLoading", false);
|
||||
|
Reference in New Issue
Block a user