HUGE refactor. working towards web UI

This commit is contained in:
ari melody 2026-06-08 02:49:39 +01:00
parent dd54e8cc49
commit 1f94eecca9
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
29 changed files with 1669 additions and 162 deletions

26
public/script/vod.js Normal file
View file

@ -0,0 +1,26 @@
const uploadState = document.getElementById("upload-state");
console.log(uploadState);
function start() {
const source = new EventSource("/sse?" + new URLSearchParams({"vod": location.pathname.split("/vods")[1]}).toString());
source.addEventListener("message", event => {
const data = JSON.parse(event.data);
switch (data.state) {
case "none":
uploadState.textContent = "Yes";
source.close();
break;
case "processing":
uploadState.textContent = `Processing (${data.progress}%)`;
break;
case "uploading":
uploadState.textContent = `Uploading (${data.progress}%)`;
break;
case "complete":
uploadState.textContent = "Yes";
break;
}
});
}
start();