web app, fleshed out delete sessions, updated sessions dialog to use selection and buttons for joining/deletion

This commit is contained in:
Blake J. Harnden 2018-05-18 12:39:45 -07:00
parent aa55daf2e8
commit 98e8e2d627
4 changed files with 63 additions and 18 deletions

View file

@ -36,6 +36,11 @@ async function putJson(url, data) {
return await sendJson(url, data, 'PUT');
}
async function deleteJson(url, data) {
console.log('DELETE: ', url);
return await sendJson(url, data, 'DELETE');
}
class CoreRest {
constructor() {
this.currentSession = null;
@ -65,6 +70,10 @@ class CoreRest {
return await putJson(`/sessions/${this.currentSession}/state`, {state});
}
async deleteSession(sessionId) {
return await deleteJson(`/sessions/${sessionId}`);
}
async getEmaneModels() {
return await $.getJSON(`/sessions/${this.currentSession}/emane/models`);
}