diff --git a/index.js b/index.js index 954b832..bf0a67b 100644 --- a/index.js +++ b/index.js @@ -237,9 +237,9 @@ app.post("/api/upload-video", authorized(), fileUpload({ limits: { fileSize: 2 * app.get("/api/video-queue", authorized(), (req, res) => { const userId = req.user.id; - const videos = videoQueue.filter(item => item.userId === userId); + const queue = videoQueue.filter(item => item.userId === userId); - return res.status(200).json({ ok: true, videos }); + return res.status(200).json({ ok: true, queue }); }); app.get("/api/video-info", async (req, res) => { diff --git a/public/helpers.js b/public/helpers.js new file mode 100644 index 0000000..9427a93 --- /dev/null +++ b/public/helpers.js @@ -0,0 +1,8 @@ +function error(message) { + const errorContainer = document.getElementById("mao-error"); + const errorElement = document.getElementById("mao-error-message"); + + errorElement.innerText = message || "unknown error"; + errorContainer.classList.remove("hidden"); +} + diff --git a/public/queue/index.html b/public/queue/index.html new file mode 100644 index 0000000..713e3f2 --- /dev/null +++ b/public/queue/index.html @@ -0,0 +1,31 @@ + + +
+ +Currently processing ${queue.length} video(s)
` + + `Uploaded ${uploadedTime} of ${totalTime} (${percentage}%)
+ + +