2024-11-19 08:01:10 -05:00
|
|
|
import Component from "@ember/component";
|
|
|
|
import { attributeBindings, classNames } from "@ember-decorators/component";
|
|
|
|
import getURL from "discourse-common/lib/get-url";
|
|
|
|
|
|
|
|
@classNames("admin-report-counters")
|
|
|
|
@attributeBindings("model.description:title")
|
|
|
|
export default class AdminReportEmotion extends Component {
|
2024-11-25 13:51:01 -05:00
|
|
|
get todayLink() {
|
|
|
|
let date = moment().format("YYYY-MM-DD");
|
|
|
|
return this._filterURL(date);
|
2024-11-19 17:16:21 -05:00
|
|
|
}
|
|
|
|
|
2024-11-25 13:51:01 -05:00
|
|
|
get yesterdayLink() {
|
|
|
|
let date = moment().subtract(1, "day").format("YYYY-MM-DD");
|
|
|
|
return this._filterURL(date);
|
2024-11-19 17:16:21 -05:00
|
|
|
}
|
|
|
|
|
2024-11-25 13:51:01 -05:00
|
|
|
get lastSevenDaysLink() {
|
|
|
|
let date = moment().subtract(1, "week").format("YYYY-MM-DD");
|
|
|
|
return this._filterURL(date);
|
2024-11-19 17:16:21 -05:00
|
|
|
}
|
|
|
|
|
2024-11-25 13:51:01 -05:00
|
|
|
get lastThirtyDaysLink() {
|
|
|
|
let date = moment().subtract(1, "month").format("YYYY-MM-DD");
|
|
|
|
return this._filterURL(date);
|
2024-11-19 17:16:21 -05:00
|
|
|
}
|
|
|
|
|
2024-11-25 13:51:01 -05:00
|
|
|
_baseFilter() {
|
|
|
|
return "/filter?q=activity-after%3A";
|
|
|
|
}
|
|
|
|
|
|
|
|
_model() {
|
|
|
|
return "%20order%3A" + this.model.type;
|
|
|
|
}
|
|
|
|
|
|
|
|
_filterURL(date) {
|
|
|
|
return getURL(`${this._baseFilter()}${date}${this._model()}`);
|
2024-11-19 08:01:10 -05:00
|
|
|
}
|
|
|
|
}
|