mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2025-05-01 05:31:38 +03:00
+ client: handle time interval for statistics
This commit is contained in:
parent
7ff27dbb42
commit
011bc3e36b
11 changed files with 251 additions and 4 deletions
client/src/api
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue