diff --git a/app/routes/backups.py b/app/routes/backups.py index 1687f2b..b3d5b4f 100644 --- a/app/routes/backups.py +++ b/app/routes/backups.py @@ -19,32 +19,33 @@ def backups_page(): for path in list_backups(): size_mb = path.stat().st_size / 1024 / 1024 backup_name = html.escape(path.name) - backup_path = html.escape(str(path)) + backup_path = html.escape(str(path), quote=True) restore_cmd = html.escape( - f"sudo /home/jiri/workspace/appfactory-tools/scripts/restore-appfactory.sh --force {path}" + f"sudo /home/jiri/workspace/appfactory-tools/scripts/restore-appfactory.sh --force {path}", + quote=True, ) rows += f""" - + {backup_name}
{size_mb:.2f} MB -
- - +
+ +
-
- - +
+ +
Restore is dangerous and must be run manually over SSH.
- +
diff --git a/app/static/portal.js b/app/static/portal.js index bbc0671..58fd50e 100644 --- a/app/static/portal.js +++ b/app/static/portal.js @@ -4,3 +4,14 @@ function copyValue(id) { el.setSelectionRange(0, 99999); navigator.clipboard.writeText(el.value); } + +function copyText(button) { + const value = button.dataset.copyValue || ""; + navigator.clipboard.writeText(value); + + const label = button.textContent; + button.textContent = "Copied"; + window.setTimeout(() => { + button.textContent = label; + }, 1200); +} diff --git a/app/static/styles.css b/app/static/styles.css index d6c2790..58ec36e 100644 --- a/app/static/styles.css +++ b/app/static/styles.css @@ -101,6 +101,7 @@ button, border: 0; border-radius: 8px; padding: 8px 12px; + min-height: 34px; background: var(--primary); color: white; font-weight: 700; @@ -158,6 +159,33 @@ input[readonly] { margin: 8px 0 14px; } +.copy-row { + display: grid; + grid-template-columns: minmax(260px, 1fr) 82px; + gap: 8px; + align-items: start; + margin: 0 0 10px; +} + +.copy-row input { + min-height: 34px; +} + +.copy-button, +.actions-cell button { + width: 82px; + text-align: center; +} + +.actions-cell { + width: 110px; + white-space: nowrap; +} + +.backup-row td { + vertical-align: middle; +} + details summary { cursor: pointer; font-weight: 700;