Show newest queue log lines first

This commit is contained in:
Dymas
2026-05-17 21:29:21 +02:00
parent d0af0258f2
commit 9e918a50ab
6 changed files with 12 additions and 4 deletions
+4
View File
@@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.32.2 - 2026-05-17
- Changed Search page queue log rendering to show the newest lines first instead of oldest-first.
## 0.32.1 - 2026-05-17 ## 0.32.1 - 2026-05-17
- Suppressed stdout request logging for routine polling endpoints such as `/api/queue` and `/api/watchlist/refresh-status`, reducing noisy access-log spam during normal browser use. - Suppressed stdout request logging for routine polling endpoints such as `/api/queue` and `/api/watchlist/refresh-status`, reducing noisy access-log spam during normal browser use.
+2 -1
View File
@@ -2,7 +2,7 @@
A local web UI for a system-wide `ani-cli` install. A local web UI for a system-wide `ani-cli` install.
Current version: `0.32.1` Current version: `0.32.2`
## Project Layout ## Project Layout
@@ -160,6 +160,7 @@ The app currently includes:
- Optional scheduled background watchlist refreshes with Config page controls for enable/disable and refresh period. - Optional scheduled background watchlist refreshes with Config page controls for enable/disable and refresh period.
- Scheduled background refresh runs now log queue, start, and completion status to stdout so container logs show whether they finished successfully, with errors, or failed. - Scheduled background refresh runs now log queue, start, and completion status to stdout so container logs show whether they finished successfully, with errors, or failed.
- Routine browser polling endpoints such as the search-page queue poll and watchlist refresh-status poll now stay quiet in stdout request logs to reduce log spam. - Routine browser polling endpoints such as the search-page queue poll and watchlist refresh-status poll now stay quiet in stdout request logs to reduce log spam.
- Queue job logs on the Search page now render newest lines first for easier at-a-glance progress checking.
- Search and Watchlist polling now use a shared serial browser polling helper so slow responses do not cause overlapping poll requests to pile up in the background. - Search and Watchlist polling now use a shared serial browser polling helper so slow responses do not cause overlapping poll requests to pile up in the background.
- That shared browser polling helper now also tears itself down on page unload and uses chained `setTimeout` scheduling instead of a bare repeating interval. - That shared browser polling helper now also tears itself down on page unload and uses chained `setTimeout` scheduling instead of a bare repeating interval.
- Controlled shutdown and runtime reset now cancel active download workers when waiting for teardown, reducing the chance of orphaned background downloads outliving the web process. - Controlled shutdown and runtime reset now cancel active download workers when waiting for teardown, reducing the chance of orphaned background downloads outliving the web process.
+1 -1
View File
@@ -1 +1 @@
0.32.1 0.32.2
+1 -1
View File
@@ -16,7 +16,7 @@ from uuid import uuid4
PROJECT_ROOT = Path(__file__).resolve().parent PROJECT_ROOT = Path(__file__).resolve().parent
ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli" ANI_CLI = os.environ.get("ANI_CLI_BIN") or shutil.which("ani-cli") or "ani-cli"
APP_NAME = "ani-cli-web" APP_NAME = "ani-cli-web"
VERSION = "0.32.1" VERSION = "0.32.2"
ALLANIME_BASE = "allanime.day" ALLANIME_BASE = "allanime.day"
ALLANIME_API = f"https://api.{ALLANIME_BASE}" ALLANIME_API = f"https://api.{ALLANIME_BASE}"
ALLANIME_REFERER = "https://allmanga.to" ALLANIME_REFERER = "https://allmanga.to"
+1 -1
View File
@@ -632,7 +632,7 @@ INDEX_HTML = r"""<!doctype html>
for (const job of jobs) { for (const job of jobs) {
const item = document.createElement("article"); const item = document.createElement("article");
item.className = "job"; item.className = "job";
const log = (job.log || []).slice(-28).join("\n"); const log = [...(job.log || [])].slice(-28).reverse().join("\n");
item.innerHTML = ` item.innerHTML = `
<div class="job-head"> <div class="job-head">
<div> <div>
+3
View File
@@ -1444,6 +1444,9 @@ class TemplateHelperTests(unittest.TestCase):
self.assertIn("queueRequestId", APP.INDEX_HTML) self.assertIn("queueRequestId", APP.INDEX_HTML)
self.assertIn("if (requestId !== state.queueRequestId) return data;", APP.INDEX_HTML) self.assertIn("if (requestId !== state.queueRequestId) return data;", APP.INDEX_HTML)
def test_search_page_renders_queue_logs_newest_first(self):
self.assertIn('[...(job.log || [])].slice(-28).reverse().join("\\n")', APP.INDEX_HTML)
def test_pages_share_browser_api_helper(self): def test_pages_share_browser_api_helper(self):
self.assertIn("async function api(path, options = {})", APP.INDEX_HTML) self.assertIn("async function api(path, options = {})", APP.INDEX_HTML)
self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML) self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML)