Adds new REST API v2/

Addresses #5269
This commit is contained in:
Simone Mainardi 2021-07-08 09:57:46 +02:00
parent 1f24dec3e3
commit b117e8a23a
178 changed files with 6639 additions and 124 deletions

View file

@ -411,7 +411,7 @@ function attachStackedChartCallback(chart, schema_name, chart_id, zoom_reset_id,
var max_interval = findActualStep(step, params.epoch_begin) * 8;
var initial_interval = (params.epoch_end - params.epoch_begin);
var is_max_zoom = (initial_interval <= max_interval);
var url = http_prefix + "/lua/rest/v1/get/timeseries/ts.lua";
var url = http_prefix + "/lua/rest/v2/get/timeseries/ts.lua";
var first_load = true;
var first_time_loaded = true;
var manual_trigger_extra_series = {}; // keeps track of series manually shown/hidden by the user

View file

@ -73,7 +73,7 @@ class NtopUtils {
// resolve the hostname by doing a fetch request to the backend
try {
const request = await fetch(`${http_prefix}/lua/rest/v1/get/dns/resolve.lua?hostname=${hostname}`);
const request = await fetch(`${http_prefix}/lua/rest/v2/get/dns/resolve.lua?hostname=${hostname}`);
const response = await request.json();
return response;
}
@ -952,7 +952,7 @@ class NtopUtils {
}
static getPoolLink(poolType, poolId = 0) {
return `${http_prefix}/lua/rest/v1/get/${poolType}/pools.lua?pool=${poolId}`;
return `${http_prefix}/lua/rest/v2/get/${poolType}/pools.lua?pool=${poolId}`;
}
static async getPool(poolType, id = 0) {