systemquery/src/static/js/SystemQueryClient.mjs

26 lines
500 B
JavaScript
Raw Normal View History

"use strict";
class SystemQueryClient {
constructor() {
}
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();
}
// TODO: Implement fetch-based client API for the UI logic to use here
}
export default SystemQueryClient;