discourse/app/assets/javascripts/admin/routes/admin-logs-search-logs.js.es6
Arpit Jalan e3925278e2 FEATURE: support search click through tracking for user, category and tags
https://meta.discourse.org/t/search-logs-page/73281/11?u=techapj

This commit adds following features:

- support for tracking click through to user, tag and category
- new filter for search type (header, full page)

This commit also removes "most viewed topic" field from search logs page because we are now tracking multiple click through entities, so topic is not a special entity anymore. This also improves query perf. The query now takes `20.5ms` to runs, as opposed to `655.9ms` previously.
2017-12-01 12:04:55 +05:30

25 lines
717 B
JavaScript

import { ajax } from 'discourse/lib/ajax';
export default Discourse.Route.extend({
renderTemplate() {
this.render('admin/templates/logs/search-logs', {into: 'adminLogs'});
},
queryParams: {
period: { refreshModel: true },
searchType: { refreshModel: true }
},
model(params) {
this._params = params;
return ajax('/admin/logs/search_logs.json', { data: { period: params.period, search_type: params.searchType } }).then(search_logs => {
return search_logs.map(sl => Ember.Object.create(sl));
});
},
setupController(controller, model) {
const params = this._params;
controller.setProperties({ model, period: params.period, searchType: params.searchType });
}
});