diff --git a/app/static/js/app.js b/app/static/js/app.js index 845d118..4d5f265 100644 --- a/app/static/js/app.js +++ b/app/static/js/app.js @@ -1352,12 +1352,21 @@ async function checkForAppUpdates() { // Check if remote update is available const updaterStatus = await fetch('/api/updater/status').then(r => r.json()).catch(() => ({ available: false })); + const updateLinkContainer = document.getElementById('updateLinkContainer'); + const newVersion = `${data.latest_date}+${data.latest_commit}`; + const githubUrl = data.github_url; if (updaterStatus.available) { - // Show "Update Now" link that opens modal - versionText.innerHTML = `${data.current_version} Update now`; + // Show "Update Now" link below version + if (updateLinkContainer) { + updateLinkContainer.innerHTML = ` Update now`; + updateLinkContainer.classList.remove('d-none'); + } } else { // Show link to GitHub (no remote update available) - versionText.innerHTML = `${data.current_version} Update available`; + if (updateLinkContainer) { + updateLinkContainer.innerHTML = ` Update available`; + updateLinkContainer.classList.remove('d-none'); + } } icon.className = 'bi bi-check-circle-fill text-success'; showNotification(`Update available: ${data.latest_date}+${data.latest_commit}`, 'success'); @@ -1396,7 +1405,7 @@ let pendingUpdateVersion = null; /** * Open update modal and prepare for remote update */ -function openUpdateModal(newVersion) { +function openUpdateModal(newVersion, githubUrl) { pendingUpdateVersion = newVersion; // Close offcanvas menu @@ -1412,6 +1421,14 @@ function openUpdateModal(newVersion) { document.getElementById('updateReloadBtn').classList.add('d-none'); document.getElementById('updateMessage').textContent = `New version available: ${newVersion}`; + // Set up "What's new" link + const whatsNewEl = document.getElementById('updateWhatsNew'); + if (whatsNewEl && githubUrl) { + const link = whatsNewEl.querySelector('a'); + if (link) link.href = githubUrl; + whatsNewEl.classList.remove('d-none'); + } + // Hide spinner, show message document.querySelector('#updateStatus .spinner-border').classList.add('d-none'); diff --git a/app/templates/base.html b/app/templates/base.html index 47d6f17..c8eb5f2 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -58,14 +58,17 @@