mirror of
https://github.com/hashicorp/vault.git
synced 2025-09-13 09:51:07 +02:00
* adds serializer * removes all 1.11 related work to monthly/new client counting * move from new-init-activity to activity * merge setup changes add monthly model/adapter * delete new-init-activity files * add graph to current month view
31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
import Application from '../application';
|
|
|
|
export default Application.extend({
|
|
queryRecord(store, type, query) {
|
|
let url = `${this.buildURL()}/internal/counters/activity`;
|
|
// Query has startTime defined. The API will return the endTime if none is provided.
|
|
return this.ajax(url, 'GET', { data: query }).then((resp) => {
|
|
let response = resp || {};
|
|
// if the response is a 204 it has no request id (ARG TODO test that it returns a 204)
|
|
response.id = response.request_id || 'no-data';
|
|
return response;
|
|
});
|
|
},
|
|
// called from components
|
|
queryClientActivity(start_time, end_time) {
|
|
// do not query without start_time. Otherwise returns last year data, which is not reflective of billing data.
|
|
if (start_time) {
|
|
let url = `${this.buildURL()}/internal/counters/activity`;
|
|
let queryParams = {};
|
|
if (!end_time) {
|
|
queryParams = { data: { start_time } };
|
|
} else {
|
|
queryParams = { data: { start_time, end_time } };
|
|
}
|
|
return this.ajax(url, 'GET', queryParams).then((resp) => {
|
|
return resp;
|
|
});
|
|
}
|
|
},
|
|
});
|