+ client: handle time interval for statistics

This commit is contained in:
Ildar Kamalov 2019-08-08 13:43:06 +03:00
parent 7ff27dbb42
commit 011bc3e36b
11 changed files with 251 additions and 4 deletions
client/src/api

View file

@ -527,4 +527,22 @@ export default class Api {
};
return this.makeRequest(path, method, parameters);
}
// Settings for statistics
STATS_INFO = { path: 'stats_info', method: 'GET' };
STATS_CONFIG = { path: 'stats_config', method: 'POST' };
getStatsInfo() {
const { path, method } = this.STATS_INFO;
return this.makeRequest(path, method);
}
setStatsConfig(data) {
const { path, method } = this.STATS_CONFIG;
const config = {
data,
headers: { 'Content-Type': 'application/json' },
};
return this.makeRequest(path, method, config);
}
}