discourse/app/assets/javascripts/admin/controllers/admin-reports-show.js.es6

38 lines
859 B
Plaintext
Raw Normal View History

2018-06-15 23:03:24 +08:00
import computed from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend({
queryParams: ["start_date", "end_date", "category_id", "group_id"],
2018-06-15 23:03:24 +08:00
@computed("model.type")
reportOptions(type) {
let options = { table: { perPage: 50, limit: 50, formatNumbers: false } };
if (type === "top_referred_topics") {
options.table.limit = 10;
}
return options;
},
@computed("category_id", "group_id", "start_date", "end_date")
filters(categoryId, groupId, startDate, endDate) {
return {
categoryId,
groupId,
startDate,
endDate
};
},
actions: {
onParamsChange(params) {
this.setProperties({
start_date: params.startDate,
category_id: params.categoryId,
group_id: params.groupId,
end_date: params.endDate
});
2013-09-17 02:08:55 +08:00
}
}
});