mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 14:26:41 +08:00
ba00cc8ec4
* DEV: Move `Discourse.getURL` and related functions to a module * DEV: Remove `Discourse.getURL` and `Discourse.getURLWithCDN` * FIX: `get-url` is required for server side code * DEV: Deprecate `BaseUri` too.
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
import getURL from "discourse-common/lib/get-url";
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
|
import Controller from "@ember/controller";
|
|
import PeriodComputationMixin from "admin/mixins/period-computation";
|
|
import { computed } from "@ember/object";
|
|
|
|
export default Controller.extend(PeriodComputationMixin, {
|
|
@discourseComputed
|
|
flagsStatusOptions() {
|
|
return {
|
|
table: {
|
|
total: false,
|
|
perPage: 10
|
|
}
|
|
};
|
|
},
|
|
|
|
isModeratorsActivityVisible: computed(
|
|
"siteSettings.dashboard_hidden_reports",
|
|
function() {
|
|
return !(this.siteSettings.dashboard_hidden_reports || "")
|
|
.split("|")
|
|
.filter(Boolean)
|
|
.includes("moderators_activity");
|
|
}
|
|
),
|
|
|
|
@discourseComputed
|
|
userFlaggingRatioOptions() {
|
|
return {
|
|
table: {
|
|
total: false,
|
|
perPage: 10
|
|
}
|
|
};
|
|
},
|
|
|
|
@discourseComputed("startDate", "endDate")
|
|
filters(startDate, endDate) {
|
|
return { startDate, endDate };
|
|
},
|
|
|
|
@discourseComputed("lastWeek", "endDate")
|
|
lastWeekfilters(startDate, endDate) {
|
|
return { startDate, endDate };
|
|
},
|
|
|
|
_reportsForPeriodURL(period) {
|
|
return getURL(`/admin/dashboard/moderation?period=${period}`);
|
|
}
|
|
});
|