phase 1 rework

This commit is contained in:
admin_rb committed 2026-10-23 16:38:55 +02:00
1 parent 211bfd174d
commit 20054198f3
38 files changed
+5001 -1019

No files matched your search

+15 -18
View File
@@ -101,9 +101,6 @@
<div class="section-header">
<h3 class="status-title" style="color:#58a6ff;">Processing</h3>
<form action="/clear-processing" method="POST">
<button class="btn btn-outline-primary btn-sm rounded-pill">🗑️</button>
</form>
</div>
<ul class="list-group" id="processingList">
@@ -116,7 +113,7 @@
<strong style="color:#58a6ff"><%= job.filename %></strong>
<span class="spinner-border spinner-border-sm ms-1" style="color:#58a6ff"></span><br>
<small><%= job.url %></small><br>
<small>Started: <%= new Date(job.created_at).toLocaleString() %></small><br>
<small><%= job.started_at ? 'Started' : 'Queued' %>: <%= new Date(job.started_at || job.created_at).toLocaleString() %></small><br>
<% if (job.fileSize) { %>
<small>Downloaded: <%= job.fileSize %></small>
@@ -125,7 +122,7 @@
<% if (job.output_log) { %>
<details data-id="processing-<%= job._id %>">
<summary class="text-light">Live Log</summary>
<pre class="log-box"><%- job.output_log %></pre>
<pre class="log-box"><%= job.output_log %></pre>
</details>
<% } %>
</li>
@@ -166,7 +163,7 @@
<% if (job.output_log) { %>
<details data-id="done-<%= job._id %>">
<summary class="text-light">Show Log</summary>
<pre class="log-box-light"><%- job.output_log %></pre>
<pre class="log-box-light"><%= job.output_log %></pre>
</details>
<% } %>
@@ -204,7 +201,7 @@
<% if (job.output_log) { %>
<details data-id="failed-<%= job._id %>">
<summary class="text-danger">Show Error Log</summary>
<pre class="log-box-error"><%- job.output_log %></pre>
<pre class="log-box-error"><%= job.output_log %></pre>
</details>
<% } %>
@@ -244,20 +241,20 @@ async function refreshStatus() {
/* Renderer helpers */
const q = job => `
<li class="list-group-item">
<strong>${job.filename}</strong><br>
<small>${job.url}</small><br>
<strong>${escapeHtml(job.filename)}</strong><br>
<small>${escapeHtml(job.url)}</small><br>
<small>${new Date(job.created_at).toLocaleString()}</small>
</li>`;
const p = job => `
<li class="list-group-item">
<strong style="color:#58a6ff">${job.filename}</strong>
<strong style="color:#58a6ff">${escapeHtml(job.filename)}</strong>
<span class="spinner-border spinner-border-sm ms-1" style="color:#58a6ff"></span><br>
<small>${job.url}</small><br>
<small>Started: ${new Date(job.created_at).toLocaleString()}</small><br>
<small>${escapeHtml(job.url)}</small><br>
<small>${job.started_at ? 'Started' : 'Queued'}: ${new Date(job.started_at || job.created_at).toLocaleString()}</small><br>
<small>Downloaded: ${formatBytes(job.fileSize || 0)}</small>
${job.output_log ? `
<details data-id="processing-${job._id}">
<details data-id="processing-${escapeHtml(job._id)}">
<summary class="text-light">Live Log</summary>
<pre class="log-box">${escapeHtml(job.output_log)}</pre>
</details>` : ""}
@@ -265,11 +262,11 @@ async function refreshStatus() {
const d = job => `
<li class="list-group-item">
<strong class="text-success">${job.filename}</strong><br>
<strong class="text-success">${escapeHtml(job.filename)}</strong><br>
<small>${new Date(job.finished_at).toLocaleString()}</small><br>
<small>Size: ${formatBytes(job.fileSize || 0)}</small>
${job.output_log ? `
<details data-id="done-${job._id}">
<details data-id="done-${escapeHtml(job._id)}">
<summary class="text-light">Show Log</summary>
<pre class="log-box-light">${escapeHtml(job.output_log)}</pre>
</details>` : ""}
@@ -277,10 +274,10 @@ async function refreshStatus() {
const f = job => `
<li class="list-group-item">
<strong class="text-danger">${job.filename}</strong><br>
<strong class="text-danger">${escapeHtml(job.filename)}</strong><br>
<small>${new Date(job.failed_at).toLocaleString()}</small><br>
${job.output_log ? `
<details data-id="failed-${job._id}">
<details data-id="failed-${escapeHtml(job._id)}">
<summary class="text-danger">Show Error Log</summary>
<pre class="log-box-error">${escapeHtml(job.output_log)}</pre>
</details>` : ""}
@@ -305,7 +302,7 @@ async function refreshStatus() {
}
function escapeHtml(text) {
return text.replace(/[&<>"']/g, c =>
return String(text ?? "").replace(/[&<>"']/g, c =>
({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#039;" }[c])
);
}