added better clear buttons

This commit is contained in:
DeSqBlocki committed 2025-12-06 19:06:06 +01:00
1 parent 81f8bc26e3
commit a951e6321d
4 files changed
+36 -40

No files matched your search

-11
View File
@@ -96,17 +96,6 @@ header h1 {
/* =============================== /* ===============================
BUTTONS BUTTONS
=============================== */ =============================== */
.btn-danger {
background-color: #8A190B; /* deeper red accent */
border: none;
color: white;
transition: background 0.3s ease;
}
.btn-danger:hover {
background-color: #A32012;
}
button, button,
.btn { .btn {
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
+10
View File
@@ -47,4 +47,14 @@ router.post("/clear-failed", async (req, res) => {
res.redirect("/status"); res.redirect("/status");
}); });
router.post("/clear-done", async (req, res) => {
const db = await getDb();
await db
.collection("done")
.deleteMany({}) //delete all
// Redirect to status, controller fetches everything
res.redirect("/status");
});
module.exports = router; module.exports = router;
-5
View File
@@ -17,8 +17,6 @@
<button class="btn btn-danger btn-sm">⚠ Clear CAPTCHA</button> <button class="btn btn-danger btn-sm">⚠ Clear CAPTCHA</button>
</form> </form>
</div> </div>
<div class="container-fluid py-4" style="max-width: 2000px;"> <div class="container-fluid py-4" style="max-width: 2000px;">
<!-- HEADER --> <!-- HEADER -->
<header class="d-flex justify-content-between align-items-center mb-4"> <header class="d-flex justify-content-between align-items-center mb-4">
@@ -26,9 +24,6 @@
<nav class="d-flex gap-2"> <nav class="d-flex gap-2">
<a class="btn btn-outline-light" href="/">Home</a> <a class="btn btn-outline-light" href="/">Home</a>
<a class="btn btn-outline-light" href="/status">Status</a> <a class="btn btn-outline-light" href="/status">Status</a>
<form id="clear-failed-form" action="/clear-failed" method="POST" class="d-inline ms-2">
<button class="btn btn-warning">🗑 Clear Failed</button>
</form>
</nav> </nav>
</header> </header>
+26 -24
View File
@@ -5,8 +5,10 @@
<!-- ======================= --> <!-- ======================= -->
<!-- QUEUED --> <!-- QUEUED -->
<!-- ======================= --> <!-- ======================= -->
<div class="col-md-3"> <div class="col-md-3 text-center">
<h3>Queued</h3> <div class="d-flex justify-content-center align-items-center mb-2">
<h3 class="mb-0">Queued</h3>
</div>
<ul class="list-group" id="queuedList"> <ul class="list-group" id="queuedList">
<% queued.forEach(job => { %> <% queued.forEach(job => { %>
<li class="list-group-item"> <li class="list-group-item">
@@ -24,21 +26,20 @@
<!-- ======================= --> <!-- ======================= -->
<!-- PROCESSING --> <!-- PROCESSING -->
<!-- ======================= --> <!-- ======================= -->
<div class="col-md-3"> <div class="col-md-3 text-center">
<h3 style="color:#58a6ff">Processing</h3> <div class="d-flex justify-content-center align-items-center mb-2">
<h3 class="mb-0" style="color:#58a6ff">Processing</h3>
</div>
<ul class="list-group" id="processingList"> <ul class="list-group" id="processingList">
<% processing.forEach(job => { %> <% processing.forEach(job => { %>
<li class="list-group-item"> <li class="list-group-item">
<strong style="color:#58a6ff"><%= job.filename %></strong> <strong style="color:#58a6ff"><%= job.filename %></strong>
<span class="spinner-border spinner-border-sm ms-2" style="color:#58a6ff"></span><br> <span class="spinner-border spinner-border-sm ms-2" style="color:#58a6ff"></span><br>
<small><%= job.url %></small><br> <small><%= job.url %></small><br>
<small>Started: <%= new Date(job.created_at).toLocaleString() %></small> <small>Started: <%= new Date(job.created_at).toLocaleString() %></small>
<% if (job.fileSize) { %> <% if (job.fileSize) { %>
<br><small>Downloaded: <%= job.fileSize %></small> <br><small>Downloaded: <%= job.fileSize %></small>
<% } %> <% } %>
<% if (job.output_log) { %> <% if (job.output_log) { %>
<details class="mt-2"> <details class="mt-2">
<summary class="text-light">Live Log</summary> <summary class="text-light">Live Log</summary>
@@ -49,30 +50,32 @@
<% } %> <% } %>
</li> </li>
<% }) %> <% }) %>
<% if (processing.length === 0) { %> <% if (processing.length === 0) { %>
<li class="list-group-item">Nothing processing</li> <li class="list-group-item">Nothing processing</li>
<% } %> <% } %>
</ul> </ul>
</div> </div>
<!-- ======================= --> <!-- ======================= -->
<!-- DONE --> <!-- DONE -->
<!-- ======================= --> <!-- ======================= -->
<div class="col-md-3"> <div class="col-md-3 text-center">
<h3 class="text-success">Done</h3> <div class="d-flex justify-content-center align-items-center mb-2">
<h3 class="text-success mb-0">Done</h3>
<form id="clear-done-form" action="/clear-done" method="POST" class="ms-2">
<button class="btn btn-success btn-sm shadow-sm rounded-pill">
🗑️
</button>
</form>
</div>
<ul class="list-group" id="doneList"> <ul class="list-group" id="doneList">
<% finished.forEach(job => { %> <% finished.forEach(job => { %>
<li class="list-group-item"> <li class="list-group-item">
<strong class="text-success"><%= job.filename %></strong><br /> <strong class="text-success"><%= job.filename %></strong><br />
<small><%= new Date(job.finished_at).toLocaleString() %></small><br> <small><%= new Date(job.finished_at).toLocaleString() %></small><br>
<% if (job.fileSize) { %> <% if (job.fileSize) { %>
<small>Size: <%= job.fileSize %></small><br> <small>Size: <%= job.fileSize %></small><br>
<% } %> <% } %>
<% if (job.output_log) { %> <% if (job.output_log) { %>
<details class="mt-2"> <details class="mt-2">
<summary class="text-light">Show Log</summary> <summary class="text-light">Show Log</summary>
@@ -81,29 +84,31 @@
</pre> </pre>
</details> </details>
<% } %> <% } %>
</li> </li>
<% }) %> <% }) %>
<% if (finished.length === 0) { %> <% if (finished.length === 0) { %>
<li class="list-group-item">No completed jobs</li> <li class="list-group-item">No completed jobs</li>
<% } %> <% } %>
</ul> </ul>
</div> </div>
<!-- ======================= --> <!-- ======================= -->
<!-- FAILED --> <!-- FAILED -->
<!-- ======================= --> <!-- ======================= -->
<div class="col-md-3"> <div class="col-md-3 text-center">
<h3 class="text-danger">Failed</h3> <div class="d-flex justify-content-center align-items-center mb-2">
<h3 class="text-danger mb-0">Failed</h3>
<form id="clear-failed-form" action="/clear-failed" method="POST" class="ms-2">
<button class="btn btn-danger btn-sm shadow-sm rounded-pill">
🗑️
</button>
</form>
</div>
<ul class="list-group" id="failedList"> <ul class="list-group" id="failedList">
<% failed.forEach(job => { %> <% failed.forEach(job => { %>
<li class="list-group-item"> <li class="list-group-item">
<strong class="text-danger"><%= job.filename %></strong><br /> <strong class="text-danger"><%= job.filename %></strong><br />
<small><%= new Date(job.failed_at).toLocaleString() %></small><br> <small><%= new Date(job.failed_at).toLocaleString() %></small><br>
<% if (job.output_log) { %> <% if (job.output_log) { %>
<details class="mt-2"> <details class="mt-2">
<summary class="text-danger">Show Error Log</summary> <summary class="text-danger">Show Error Log</summary>
@@ -112,14 +117,11 @@
</pre> </pre>
</details> </details>
<% } %> <% } %>
</li> </li>
<% }) %> <% }) %>
<% if (failed.length === 0) { %> <% if (failed.length === 0) { %>
<li class="list-group-item">No failed jobs</li> <li class="list-group-item">No failed jobs</li>
<% } %> <% } %>
</ul> </ul>
</div> </div>