2022-02-22 03:01:39 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
class SystemQueryClient {
|
|
|
|
constructor() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2022-02-24 03:08:21 +00:00
|
|
|
async status() {
|
|
|
|
return this.fetch_json(`/api/status`);
|
|
|
|
}
|
|
|
|
|
|
|
|
async fetch_json(path) {
|
|
|
|
let response = await fetch(path, {
|
|
|
|
headers: {
|
|
|
|
"accept": "application/json"
|
|
|
|
},
|
|
|
|
credentials: "same-origin"
|
|
|
|
});
|
|
|
|
console.log(`FETCH ${path} ${response.status} ${response.statusText}`);
|
|
|
|
return await response.json();
|
|
|
|
}
|
2022-02-22 03:01:39 +00:00
|
|
|
// TODO: Implement fetch-based client API for the UI logic to use here
|
|
|
|
}
|
|
|
|
|
|
|
|
export default SystemQueryClient;
|