refactor admin navigation; update links to ingest pages and improve loading of data in parallel

This commit is contained in:
ImBenji
2026-04-24 00:08:52 +01:00
parent 16cd61fdf5
commit fc7ea464b3
17 changed files with 292 additions and 67 deletions
+7 -3
View File
@@ -24,9 +24,12 @@ async function loadSources() {
function getFilters() {
const sel = document.getElementById("f-source");
return {
keyword: document.getElementById("f-keyword").value.trim(),
source: document.getElementById("f-source").value,
// fall back to url when the dropdown hasn't populated yet —
// lets us fire loadArticles in parallel with loadSources on init
source: sel.value || queryGet("source"),
content_status: document.getElementById("f-status").value,
from: document.getElementById("f-from").value,
to: document.getElementById("f-to").value,
@@ -184,6 +187,7 @@ document.addEventListener("DOMContentLoaded", async () => {
}
};
await loadSources(); // wait for dropdown to render the saved source selection
loadArticles();
// both calls can run concurrently — loadArticles falls back to the
// url param for source until the dropdown finishes populating.
await Promise.all([loadSources(), loadArticles()]);
});