mirror of
https://github.com/DeNNiiInc/UltyScan.git
synced 2026-04-17 20:35:59 +00:00
Fix Update button to git pull and refresh UI
This commit is contained in:
@@ -398,8 +398,13 @@
|
||||
<script>
|
||||
// Additional inline functions
|
||||
async function updateScanner() {
|
||||
if (!confirm('Update UltyScan? This may take a while.')) return;
|
||||
showNotification('Starting update...', 'info');
|
||||
if (!confirm('Update UltyScan to latest version from GitHub?')) return;
|
||||
|
||||
const btn = event.target;
|
||||
btn.disabled = true;
|
||||
btn.textContent = 'Updating...';
|
||||
|
||||
showNotification('Pulling latest changes from GitHub...', 'info');
|
||||
try {
|
||||
const response = await fetch('execute.php', {
|
||||
method: 'POST',
|
||||
@@ -410,10 +415,17 @@
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.success) {
|
||||
showNotification('Update started. Check console for progress.', 'success');
|
||||
showNotification('Updated to commit #' + result.commit + '. Refreshing page...', 'success');
|
||||
setTimeout(() => window.location.reload(), 2000);
|
||||
} else {
|
||||
showNotification('Update failed: ' + (result.error || 'Unknown error'), 'error');
|
||||
btn.disabled = false;
|
||||
btn.textContent = 'Update UltyScan';
|
||||
}
|
||||
} catch (e) {
|
||||
showNotification('Update failed.', 'error');
|
||||
showNotification('Update failed: ' + e.message, 'error');
|
||||
btn.disabled = false;
|
||||
btn.textContent = 'Update UltyScan';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user