Add file timeseries chart

This commit is contained in:
2023-05-25 23:07:17 +02:00
parent b29a1b2a97
commit 976a37f299
6 changed files with 204 additions and 33 deletions

View File

@@ -94,3 +94,17 @@ export const fs_search = async (bucket, path, term, limit = 10) => {
}
return resp.json()
}
export const fs_timeseries = async (bucket, path, start, end, interval = 60) => {
const resp = await fetch(
fs_path_url(bucket, path) +
"?timeseries" +
"&start=" + start.toISOString() +
"&end=" + end.toISOString() +
"&interval=" + interval
)
if (resp.status >= 400) {
throw await resp.text()
}
return resp.json()
}