2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2019-11-08 05:38:28 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2015-09-16 04:45:01 +08:00
|
|
|
|
2023-03-15 17:42:12 +08:00
|
|
|
export default class AdminReportsShowController extends Controller {
|
|
|
|
queryParams = ["start_date", "end_date", "filters", "chart_grouping", "mode"];
|
|
|
|
start_date = null;
|
|
|
|
end_date = null;
|
|
|
|
filters = null;
|
|
|
|
chart_grouping = null;
|
2016-02-03 10:29:51 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed("model.type")
|
2018-07-20 02:33:11 +08:00
|
|
|
reportOptions(type) {
|
2018-08-02 06:40:59 +08:00
|
|
|
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
|
2016-04-21 15:33:23 +08:00
|
|
|
|
2018-07-20 02:33:11 +08:00
|
|
|
if (type === "top_referred_topics") {
|
|
|
|
options.table.limit = 10;
|
|
|
|
}
|
|
|
|
|
2020-07-28 22:14:41 +08:00
|
|
|
options.chartGrouping = this.chart_grouping;
|
|
|
|
|
2018-07-20 02:33:11 +08:00
|
|
|
return options;
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
|
|
|
}
|