2024-01-18 20:06:42 +08:00
|
|
|
import { computed } from "@ember/object";
|
2023-10-11 02:38:59 +08:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2024-01-18 20:06:42 +08:00
|
|
|
import AdminDashboardTabController from "./admin-dashboard-tab";
|
2023-09-29 17:14:17 +08:00
|
|
|
|
2024-01-18 20:06:42 +08:00
|
|
|
export default class AdminDashboardModerationController extends AdminDashboardTabController {
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed
|
2018-07-20 02:33:11 +08:00
|
|
|
flagsStatusOptions() {
|
|
|
|
return {
|
|
|
|
table: {
|
|
|
|
total: false,
|
|
|
|
perPage: 10,
|
|
|
|
},
|
|
|
|
};
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
2018-07-20 02:33:11 +08:00
|
|
|
|
2023-03-15 17:42:12 +08:00
|
|
|
@computed("siteSettings.dashboard_hidden_reports")
|
|
|
|
get isModeratorsActivityVisible() {
|
|
|
|
return !(this.siteSettings.dashboard_hidden_reports || "")
|
|
|
|
.split("|")
|
|
|
|
.filter(Boolean)
|
|
|
|
.includes("moderators_activity");
|
|
|
|
}
|
2020-04-30 23:31:04 +08:00
|
|
|
|
2019-11-08 05:38:28 +08:00
|
|
|
@discourseComputed
|
2018-11-13 05:23:10 +08:00
|
|
|
userFlaggingRatioOptions() {
|
2018-10-26 21:59:04 +08:00
|
|
|
return {
|
|
|
|
table: {
|
|
|
|
total: false,
|
|
|
|
perPage: 10,
|
|
|
|
},
|
|
|
|
};
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
2018-10-26 21:59:04 +08:00
|
|
|
|
2024-01-18 20:06:42 +08:00
|
|
|
@computed("startDate", "endDate")
|
|
|
|
get filters() {
|
|
|
|
return { startDate: this.startDate, endDate: this.endDate };
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|
2018-07-27 13:22:00 +08:00
|
|
|
|
2024-01-18 20:06:42 +08:00
|
|
|
@discourseComputed("endDate")
|
|
|
|
lastWeekFilters(endDate) {
|
|
|
|
const lastWeek = moment()
|
|
|
|
.locale("en")
|
|
|
|
.utc()
|
|
|
|
.endOf("day")
|
|
|
|
.subtract(1, "week");
|
2023-09-29 17:14:17 +08:00
|
|
|
|
2024-01-18 20:06:42 +08:00
|
|
|
return { lastWeek, endDate };
|
2023-09-29 17:14:17 +08:00
|
|
|
}
|
2023-03-15 17:42:12 +08:00
|
|
|
}
|