Skip to content

Commit

Permalink
feat(www): use storage locked/unlocked events to update the UI
Browse files Browse the repository at this point in the history
Signed-off-by: Cedric Hombourger <[email protected]>
  • Loading branch information
chombourger committed Dec 19, 2023
1 parent 92f1055 commit 9417dfd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mtda/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
});

socket.on("video-info", function (info) {
if (info.format == 'VNC') {
if (info.format == 'VNC') {
vnc_load()
}
else {
Expand Down Expand Up @@ -188,7 +188,13 @@
});

socket.on("storage-event", (data) => {
switch(data.event) {
data = data.event.split(" ")
event = data[0]
data = data.splice(1).join(" ")
if (event == 'UNLOCKED') {
event = data
}
switch(event) {
case 'HOST':
storage_status.innerHTML = "save";
storage_status.title = "switch storage to target"
Expand All @@ -197,6 +203,10 @@
storage_status.innerHTML = "eject";
storage_status.title = "switch storage to host"
break;
case 'LOCKED':
storage_status.innerHTML = "no_sim";
storage_status.title = data
break;
default:
storage_status.innerHTML = "unknown_document"
storage_status.title = "storage status unknown"
Expand Down

0 comments on commit 9417dfd

Please sign in to comment.