open-vault/ui/app/adapters/metrics/activity.js
Chelsea Shaw 2e462991a1
Ui/pricing metrics api hookup (#10196)
* Update language to reflect that current namespace includes all children as well

* Update metrics config value to correct ones

* Handle 204 no data from activity endpoint

* Wrap metrics date inputs in form so it handles keyboard events like Enter

* Pass default span and retention months from config

* remove stray space
2020-10-21 11:35:36 -05:00

18 lines
521 B
JavaScript

import Application from '../application';
export default Application.extend({
pathForType() {
return 'internal/counters/activity';
},
queryRecord(store, type, query) {
const url = this.urlForQuery(null, type);
// API accepts start and end as query params
return this.ajax(url, 'GET', { data: query }).then(resp => {
let response = resp || {};
// if the response is a 204 it has no request id
response.id = response.request_id || 'no-data';
return response;
});
},
});