Preserve live log expansion state

This commit is contained in:
Mikei386
2026-06-14 22:23:20 +02:00
parent 12bd339198
commit 4ce90c6db9
7 changed files with 21 additions and 10 deletions
-1
View File
@@ -1 +0,0 @@
0442a269efe056ffdc47ec64d14bf0df898a020426a0a203efd8ac73fd0ced30 backupper-2026.06.14.9.8-x86_64-1.txz
+1
View File
@@ -0,0 +1 @@
992ab86a0e90287a9f828943e2c3c01d88361f0b7c98c848c64ef9394139bc8f backupper-2026.06.14.9.9-x86_64-1.txz
+5 -2
View File
@@ -2,13 +2,16 @@
<!DOCTYPE PLUGIN [ <!DOCTYPE PLUGIN [
<!ENTITY name "backupper"> <!ENTITY name "backupper">
<!ENTITY author "Michael Roll"> <!ENTITY author "Michael Roll">
<!ENTITY version "2026.06.14.9.8"> <!ENTITY version "2026.06.14.9.9">
<!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg"> <!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg">
<!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz"> <!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz">
<!ENTITY packageSHA256 "0442a269efe056ffdc47ec64d14bf0df898a020426a0a203efd8ac73fd0ced30"> <!ENTITY packageSHA256 "992ab86a0e90287a9f828943e2c3c01d88361f0b7c98c848c64ef9394139bc8f">
]> ]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png"> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png">
<CHANGES> <CHANGES>
### 2026.06.14.9.9
- Preserve the user's open or closed live-log state across automatic progress updates.
### 2026.06.14.9.8 ### 2026.06.14.9.8
- Add a Clear history action that removes completed activity entries and saved run logs while preserving active and queued tasks. - Add a Clear history action that removes completed activity entries and saved run logs while preserving active and queued tasks.
+4 -1
View File
@@ -2,13 +2,16 @@
<!DOCTYPE PLUGIN [ <!DOCTYPE PLUGIN [
<!ENTITY name "backupper"> <!ENTITY name "backupper">
<!ENTITY author "Michael Roll"> <!ENTITY author "Michael Roll">
<!ENTITY version "2026.06.14.9.8"> <!ENTITY version "2026.06.14.9.9">
<!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg"> <!ENTITY pluginURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper.plg">
<!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz"> <!ENTITY packageURL "https://git.casaderoll.de/michael/BackUpper/raw/branch/main/dist/backupper-&version;-x86_64-1.txz">
<!ENTITY packageSHA256 "REPLACE_DURING_RELEASE"> <!ENTITY packageSHA256 "REPLACE_DURING_RELEASE">
]> ]>
<PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png"> <PLUGIN name="&name;" author="&author;" version="&version;" pluginURL="&pluginURL;" min="7.0.0" support="https://git.casaderoll.de/michael/BackUpper/issues" icon="backupper.png">
<CHANGES> <CHANGES>
### 2026.06.14.9.9
- Preserve the user's open or closed live-log state across automatic progress updates.
### 2026.06.14.9.8 ### 2026.06.14.9.8
- Add a Clear history action that removes completed activity entries and saved run logs while preserving active and queued tasks. - Add a Clear history action that removes completed activity entries and saved run logs while preserving active and queued tasks.
+4 -4
View File
@@ -9,12 +9,12 @@ Tag="URBM Unraid Restic Backup Manager backup snapshots restore"
<?php <?php
$pluginRoot = '/plugins/backupper'; $pluginRoot = '/plugins/backupper';
?> ?>
<link rel="stylesheet" href="<?= $pluginRoot ?>/assets/backupper.css?v=2026061498"> <link rel="stylesheet" href="<?= $pluginRoot ?>/assets/backupper.css?v=2026061499">
<div id="backupper-app" data-api="<?= $pluginRoot ?>/api.php"> <div id="backupper-app" data-api="<?= $pluginRoot ?>/api.php">
<header class="bu-header"> <header class="bu-header">
<div class="bu-brand"> <div class="bu-brand">
<img class="bu-logo" src="<?= $pluginRoot ?>/images/backupper.png?v=2026061498" alt="URBM logo"> <img class="bu-logo" src="<?= $pluginRoot ?>/images/backupper.png?v=2026061499" alt="URBM logo">
<div><h1>URBM <span class="bu-version">2026.06.14.9.8</span></h1><p>Restic Backup Manager for Unraid</p></div> <div><h1>URBM <span class="bu-version">2026.06.14.9.9</span></h1><p>Restic Backup Manager for Unraid</p></div>
</div> </div>
<div id="bu-health" class="bu-health" tabindex="0" data-tooltip="Zeigt, ob die URBM-Hintergrundkomponente erreichbar ist. Beispiel: 'Daemon online' bedeutet, dass Jobs gestartet werden können.">Connecting...</div> <div id="bu-health" class="bu-health" tabindex="0" data-tooltip="Zeigt, ob die URBM-Hintergrundkomponente erreichbar ist. Beispiel: 'Daemon online' bedeutet, dass Jobs gestartet werden können.">Connecting...</div>
</header> </header>
@@ -32,4 +32,4 @@ $pluginRoot = '/plugins/backupper';
<div id="bu-tooltip" role="tooltip" aria-hidden="true"></div> <div id="bu-tooltip" role="tooltip" aria-hidden="true"></div>
</div> </div>
<script>window.BACKUPPER_CSRF = <?= json_encode($var['csrf_token'] ?? '') ?>;</script> <script>window.BACKUPPER_CSRF = <?= json_encode($var['csrf_token'] ?? '') ?>;</script>
<script src="<?= $pluginRoot ?>/assets/backupper-2026.06.14.9.8.js"></script> <script src="<?= $pluginRoot ?>/assets/backupper-2026.06.14.9.9.js"></script>
+7 -2
View File
@@ -8,7 +8,7 @@
const tooltip = document.getElementById('bu-tooltip'); const tooltip = document.getElementById('bu-tooltip');
const sourceRoots = ['/mnt/user','/mnt/disks','/mnt/remotes','/boot'].map(path=>({name:path,path})); const sourceRoots = ['/mnt/user','/mnt/disks','/mnt/remotes','/boot'].map(path=>({name:path,path}));
const repositoryRoots = ['/mnt/user','/mnt/disks','/mnt/remotes'].map(path=>({name:path,path})); const repositoryRoots = ['/mnt/user','/mnt/disks','/mnt/remotes'].map(path=>({name:path,path}));
const state = { config: null, runs: [], view: 'dashboard', snapshots: [], selectedSnapshot: null, snapshotRepo: null, files: [], browserPath: '/', restoreIncludes: [], backupSelections: [], workloadSelections: [], workloads: [], workloadAvailable: true, workloadError: '', sourceBrowserPath: '/', sourceDirectories: sourceRoots, sourceBrowserError: '', repositoryBrowserPath: '/', repositoryDirectories: repositoryRoots, repositoryBrowserError: '' }; const state = { config: null, runs: [], view: 'dashboard', snapshots: [], selectedSnapshot: null, snapshotRepo: null, files: [], browserPath: '/', restoreIncludes: [], backupSelections: [], workloadSelections: [], workloads: [], workloadAvailable: true, workloadError: '', sourceBrowserPath: '/', sourceDirectories: sourceRoots, sourceBrowserError: '', repositoryBrowserPath: '/', repositoryDirectories: repositoryRoots, repositoryBrowserError: '', liveLogOpen: {} };
const fieldHelp = { const fieldHelp = {
name: 'Frei wählbarer Anzeigename. Beispiel: Appdata täglich oder VM Home Assistant.', name: 'Frei wählbarer Anzeigename. Beispiel: Appdata täglich oder VM Home Assistant.',
@@ -472,7 +472,8 @@
} }
function liveLogView(run) { function liveLogView(run) {
if(!(run.liveLog||[]).length) return ''; if(!(run.liveLog||[]).length) return '';
return `<details class="bu-live-log" ${run.status==='running'?'open':''}><summary>${run.status==='running'?'Live log':'Run log'} (${run.liveLog.length})</summary><pre>${esc(run.liveLog.join('\n'))}</pre></details>`; const open=Object.prototype.hasOwnProperty.call(state.liveLogOpen,run.id)?state.liveLogOpen[run.id]:run.status==='running';
return `<details class="bu-live-log" data-run-id="${esc(run.id)}" ${open?'open':''}><summary>${run.status==='running'?'Live log':'Run log'} (${run.liveLog.length})</summary><pre>${esc(run.liveLog.join('\n'))}</pre></details>`;
} }
function runsTable(runs) { function runsTable(runs) {
if(!runs.length) return '<div class="bu-empty">No activity recorded.</div>'; if(!runs.length) return '<div class="bu-empty">No activity recorded.</div>';
@@ -607,6 +608,10 @@
const action = form.id === 'bu-repo-form' ? 'submit-repo' : form.id === 'bu-job-form' ? 'submit-job' : form.id === 'bu-restore-form' ? 'submit-restore' : form.id === 'bu-settings-form' ? 'submit-settings' : form.id === 'bu-unraid-notify-form' ? 'submit-unraid-notify' : form.id === 'bu-gotify-notify-form' ? 'submit-gotify-notify' : ''; const action = form.id === 'bu-repo-form' ? 'submit-repo' : form.id === 'bu-job-form' ? 'submit-job' : form.id === 'bu-restore-form' ? 'submit-restore' : form.id === 'bu-settings-form' ? 'submit-settings' : form.id === 'bu-unraid-notify-form' ? 'submit-unraid-notify' : form.id === 'bu-gotify-notify-form' ? 'submit-gotify-notify' : '';
if (action) handle(action); if (action) handle(action);
}); });
content.addEventListener('toggle', e => {
const details=e.target.closest?.('.bu-live-log[data-run-id]');
if(details) state.liveLogOpen[details.dataset.runId]=details.open;
}, true);
root.addEventListener('mouseover', e => { root.addEventListener('mouseover', e => {
const target = e.target.closest('[data-tooltip]'); const target = e.target.closest('[data-tooltip]');
if (!target || target.contains(e.relatedTarget)) return; if (!target || target.contains(e.relatedTarget)) return;