Fix dynamic version display and update button issues
- Updated footer version to dynamically display current running version - Fixed update button disappearing when refreshing status - Added version tracking to prevent update button from hiding - Updated About modal to show current version and added v2.0.10 to version history - Fixed error handling in update check process 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
c0a7362226
commit
3ff0a50553
@ -545,7 +545,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<p>Transmission RSS Manager v2.0.6</p>
|
<p>Transmission RSS Manager <span id="footer-version">v2.0.10</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 text-right">
|
<div class="col-md-6 text-right">
|
||||||
<p><a href="https://git.powerdata.dk/masterdraco/transmission-rss-manager" target="_blank" rel="noopener noreferrer">GitHub</a> | <a href="#" id="show-about-modal">About</a></p>
|
<p><a href="https://git.powerdata.dk/masterdraco/transmission-rss-manager" target="_blank" rel="noopener noreferrer">GitHub</a> | <a href="#" id="show-about-modal">About</a></p>
|
||||||
@ -592,6 +592,26 @@
|
|||||||
|
|
||||||
<h4>Version History</h4>
|
<h4>Version History</h4>
|
||||||
<div class="version-history">
|
<div class="version-history">
|
||||||
|
<div class="version">
|
||||||
|
<h5>v2.0.10 - March 2025</h5>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Fixed</strong>: fs.existsSync error in update check</li>
|
||||||
|
<li><strong>Fixed</strong>: Update button now stays visible when update is available</li>
|
||||||
|
<li><strong>Fixed</strong>: Footer version now shows correct running version</li>
|
||||||
|
<li><strong>Improved</strong>: Better error handling for git repository checks</li>
|
||||||
|
<li><strong>Improved</strong>: More robust file system operations for update detection</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="version">
|
||||||
|
<h5>v2.0.9 - March 2025</h5>
|
||||||
|
<ul>
|
||||||
|
<li><strong>Fixed</strong>: Update button now appears properly on dashboard</li>
|
||||||
|
<li><strong>Fixed</strong>: Remote Transmission connection issues resolved</li>
|
||||||
|
<li><strong>Fixed</strong>: Improved connection test with better error handling</li>
|
||||||
|
<li><strong>Added</strong>: System status and update endpoints for version checking</li>
|
||||||
|
<li><strong>Improved</strong>: Update detection and notification on dashboard</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
<div class="version">
|
<div class="version">
|
||||||
<h5>v2.0.6 - March 2025</h5>
|
<h5>v2.0.6 - March 2025</h5>
|
||||||
<ul>
|
<ul>
|
||||||
@ -638,7 +658,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center mt-4">
|
<div class="text-center mt-4">
|
||||||
<p><strong>Transmission RSS Manager v2.0.0</strong></p>
|
<p><strong>Transmission RSS Manager v2.0.10</strong></p>
|
||||||
<p>© 2025 PowerData.dk - All Rights Reserved</p>
|
<p>© 2025 PowerData.dk - All Rights Reserved</p>
|
||||||
<p><a href="https://powerdata.dk" target="_blank">Visit PowerData.dk</a></p>
|
<p><a href="https://powerdata.dk" target="_blank">Visit PowerData.dk</a></p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,9 +22,22 @@ function initSystemStatus() {
|
|||||||
.then(handleResponse)
|
.then(handleResponse)
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
|
// Update version display
|
||||||
versionElement.textContent = data.data.version;
|
versionElement.textContent = data.data.version;
|
||||||
uptimeElement.textContent = data.data.uptime;
|
uptimeElement.textContent = data.data.uptime;
|
||||||
|
|
||||||
|
// Also update footer version
|
||||||
|
const footerVersion = document.getElementById('footer-version');
|
||||||
|
if (footerVersion) {
|
||||||
|
footerVersion.textContent = 'v' + data.data.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update version in about modal too if it exists
|
||||||
|
const aboutVersionElement = document.querySelector('.text-center.mt-4 strong');
|
||||||
|
if (aboutVersionElement && aboutVersionElement.textContent.includes('Transmission RSS Manager v')) {
|
||||||
|
aboutVersionElement.textContent = 'Transmission RSS Manager v' + data.data.version;
|
||||||
|
}
|
||||||
|
|
||||||
// Update transmission status with icon
|
// Update transmission status with icon
|
||||||
if (data.data.transmissionStatus === 'Connected') {
|
if (data.data.transmissionStatus === 'Connected') {
|
||||||
transmissionStatusElement.innerHTML = '<i class="fas fa-check-circle text-success"></i> Connected';
|
transmissionStatusElement.innerHTML = '<i class="fas fa-check-circle text-success"></i> Connected';
|
||||||
@ -41,10 +54,19 @@ function initSystemStatus() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Track update check status
|
||||||
|
let updateAvailable = false;
|
||||||
|
let updateCheckInProgress = false;
|
||||||
|
|
||||||
// Check for updates
|
// Check for updates
|
||||||
function checkForUpdates() {
|
function checkForUpdates() {
|
||||||
|
// Don't hide update button if an update is available and we're just refreshing
|
||||||
|
if (!updateAvailable) {
|
||||||
|
updateAvailableDiv.classList.add('d-none');
|
||||||
|
}
|
||||||
|
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-circle-notch fa-spin"></i> Checking...';
|
updateStatusElement.innerHTML = '<i class="fas fa-circle-notch fa-spin"></i> Checking...';
|
||||||
updateAvailableDiv.classList.add('d-none');
|
updateCheckInProgress = true;
|
||||||
|
|
||||||
// Add test=true parameter to force update availability for testing
|
// Add test=true parameter to force update availability for testing
|
||||||
const testMode = localStorage.getItem('showUpdateButton') === 'true';
|
const testMode = localStorage.getItem('showUpdateButton') === 'true';
|
||||||
@ -53,6 +75,7 @@ function initSystemStatus() {
|
|||||||
// Set a timeout to detect network issues
|
// Set a timeout to detect network issues
|
||||||
const timeoutId = setTimeout(() => {
|
const timeoutId = setTimeout(() => {
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check timed out';
|
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check timed out';
|
||||||
|
updateCheckInProgress = false;
|
||||||
showNotification('Update check timed out. Please try again later.', 'warning');
|
showNotification('Update check timed out. Please try again later.', 'warning');
|
||||||
}, 10000); // 10 second timeout
|
}, 10000); // 10 second timeout
|
||||||
|
|
||||||
@ -77,22 +100,29 @@ function initSystemStatus() {
|
|||||||
return response.json();
|
return response.json();
|
||||||
})
|
})
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
updateCheckInProgress = false;
|
||||||
|
clearTimeout(timeoutId);
|
||||||
|
|
||||||
if (data.status === 'success') {
|
if (data.status === 'success') {
|
||||||
if (data.data && data.data.updateAvailable) {
|
if (data.data && data.data.updateAvailable) {
|
||||||
|
updateAvailable = true;
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-exclamation-circle text-warning"></i> Update available';
|
updateStatusElement.innerHTML = '<i class="fas fa-exclamation-circle text-warning"></i> Update available';
|
||||||
updateAvailableDiv.classList.remove('d-none');
|
updateAvailableDiv.classList.remove('d-none');
|
||||||
updateAvailableDiv.querySelector('span').textContent =
|
updateAvailableDiv.querySelector('span').textContent =
|
||||||
`A new version is available: ${data.data.currentVersion} → ${data.data.remoteVersion}`;
|
`A new version is available: ${data.data.currentVersion} → ${data.data.remoteVersion}`;
|
||||||
} else {
|
} else {
|
||||||
|
updateAvailable = false;
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-check-circle text-success"></i> Up to date';
|
updateStatusElement.innerHTML = '<i class="fas fa-check-circle text-success"></i> Up to date';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Error status but with a response
|
// Error status but with a response
|
||||||
|
updateAvailable = false;
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check failed';
|
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check failed';
|
||||||
showNotification(data.message || 'Failed to check for updates', 'danger');
|
showNotification(data.message || 'Failed to check for updates', 'danger');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
updateCheckInProgress = false;
|
||||||
clearTimeout(timeoutId);
|
clearTimeout(timeoutId);
|
||||||
console.error('Error checking for updates:', error);
|
console.error('Error checking for updates:', error);
|
||||||
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check failed';
|
updateStatusElement.innerHTML = '<i class="fas fa-times-circle text-danger"></i> Check failed';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user