mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-22 01:01:49 +08:00
Followup 14b436923c
On the standalone Site Traffic report page, we also need
to hide the 'other' and 'crawler' pageviews by default
like we do on the admin dashboard.
29 lines
788 B
JavaScript
Vendored
29 lines
788 B
JavaScript
Vendored
import Controller from "@ember/controller";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
|
|
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;
|
|
|
|
@discourseComputed("model.type")
|
|
reportOptions(type) {
|
|
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
|
|
|
|
if (type === "top_referred_topics") {
|
|
options.table.limit = 10;
|
|
}
|
|
|
|
if (type === "site_traffic") {
|
|
options.stackedChart = {
|
|
hiddenLabels: ["page_view_other", "page_view_crawler"],
|
|
};
|
|
}
|
|
|
|
options.chartGrouping = this.chart_grouping;
|
|
|
|
return options;
|
|
}
|
|
}
|