diff --git a/tubearchivist/home/templates/home/settings.html b/tubearchivist/home/templates/home/settings.html index 634bfda2..f88a2631 100644 --- a/tubearchivist/home/templates/home/settings.html +++ b/tubearchivist/home/templates/home/settings.html @@ -98,6 +98,7 @@

Note:

@@ -228,10 +229,25 @@

Restore from backup

Danger Zone: This will replace your existing index with the backup.

-

Add the backup zip file to the cache/backup folder.

-
- -
+

Restore from available backup files from cache/backup.

+ {% if available_backups %} +
+ + Timestamp + Source + Filename +
+ {% for backup in available_backups %} +
+ + {{ backup.timestamp }} + {{ backup.reason }} + {{ backup.filename }} +
+ {% endfor %} + {% else %} +

No backups found.

+ {% endif %}

Rescan filesystem

diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css index 2c764873..768a8b51 100644 --- a/tubearchivist/static/css/style.css +++ b/tubearchivist/static/css/style.css @@ -62,7 +62,7 @@ ul { margin-left: 20px; } -td, span, label { +td, th, span, label { font-family: Sen-Regular, sans-serif; color: var(--main-font); } @@ -866,6 +866,19 @@ button:hover { padding: 3px; } +.backup-grid-row { + display: grid; + grid-template-columns: 10% 10% 10% auto; + align-items: center; + padding: 5px 10px; + border-bottom: solid 1px; + border-color: var(--main-font); +} + +.backup-grid-row > span { + margin-left: 10px; +} + /* about */ .about-section { padding: 20px 0; diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index 5ef8c5ee..6da19c3b 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -195,13 +195,14 @@ function dbBackup() { toReplace.appendChild(message); } -function dbRestore() { - var payload = JSON.stringify({'db-restore': true}); +function dbRestore(button) { + var fileName = button.getAttribute("data-id"); + var payload = JSON.stringify({'db-restore': fileName}); sendPost(payload); - // clear button + // clear backup row var message = document.createElement('p'); message.innerText = 'restoring from backup'; - var toReplace = document.getElementById('db-restore'); + var toReplace = document.getElementById(fileName); toReplace.innerHTML = ''; toReplace.appendChild(message); }