Split queue into dedicated page

This commit is contained in:
Dymas
2026-05-22 23:17:00 +02:00
parent 9d4baea057
commit fe094a7112
11 changed files with 522 additions and 211 deletions
+11 -9
View File
@@ -1610,6 +1610,7 @@ class TemplateHelperTests(unittest.TestCase):
def test_page_links_marks_active_page(self):
markup = APP.render_page_links("config")
self.assertIn('class="page-link active" href="/config"', markup)
self.assertIn('class="page-link" href="/queue"', markup)
self.assertIn('class="page-link" href="/watchlist"', markup)
def test_sidebar_brand_can_attach_optional_badge_id(self):
@@ -1617,25 +1618,26 @@ class TemplateHelperTests(unittest.TestCase):
self.assertIn('id="serverBadge"', markup)
self.assertIn("Shared note", markup)
def test_search_page_queue_loader_guards_against_stale_responses(self):
self.assertIn("queueRequestId", APP.INDEX_HTML)
self.assertIn("if (requestId !== state.queueRequestId) return data;", APP.INDEX_HTML)
def test_queue_page_queue_loader_guards_against_stale_responses(self):
self.assertIn("queueRequestId", APP.QUEUE_HTML)
self.assertIn("if (requestId !== state.queueRequestId) return data;", APP.QUEUE_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_queue_page_renders_queue_logs_newest_first(self):
self.assertIn('[...(job.log || [])].slice(-28).reverse().join("\\n")', APP.QUEUE_HTML)
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.QUEUE_HTML)
self.assertIn("async function api(path, options = {})", APP.CONFIG_HTML)
self.assertIn("async function api(path, options = {})", APP.WATCHLIST_HTML)
def test_pages_share_serial_polling_helper(self):
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.INDEX_HTML)
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.QUEUE_HTML)
self.assertIn("function startSerialPoll(callback, intervalMs)", APP.WATCHLIST_HTML)
self.assertIn("startSerialPoll(() => loadQueue(), 2500)", APP.INDEX_HTML)
self.assertIn("startSerialPoll(() => loadQueue(), 2500)", APP.QUEUE_HTML)
self.assertIn("startSerialPoll(async () => {", APP.WATCHLIST_HTML)
self.assertIn("window.clearTimeout(timer);", APP.INDEX_HTML)
self.assertIn('window.addEventListener("pagehide", stop, { once: true });', APP.INDEX_HTML)
self.assertIn("window.clearTimeout(timer);", APP.QUEUE_HTML)
self.assertIn('window.addEventListener("pagehide", stop, { once: true });', APP.QUEUE_HTML)
self.assertIn('window.addEventListener("beforeunload", stop, { once: true });', APP.WATCHLIST_HTML)
def test_watchlist_page_polls_when_queued_items_exist(self):