Commit Graph

78 Commits

Author SHA1 Message Date
shuki
5b4bf33520 Add tree-based file browser for snapshot contents
Replace flat file list with a Tree widget that shows directory
structure. Strips remote path prefix to show relative paths only.
Folders shown in bold with trailing /, sorted dirs-first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:11:53 +02:00
shuki
98fc263a40 Fix snapshot selection using row key instead of get_cell
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:09:49 +02:00
shuki
e73f38df53 Add Browse Files button to snapshots screen
Select a snapshot and click Browse Files to see all files in that
snapshot on the remote. Also adds 'gniza snapshots browse' CLI command.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:08:45 +02:00
shuki
d6032d2547 Remove Retention from main menu
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:06:36 +02:00
shuki
152ef61734 Fix menu separator for older Textual versions
Use None separator instead of Separator class which isn't available
in older Textual.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:04:30 +02:00
shuki
3ac1d77e47 Add separator after Restore in main menu
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:03:53 +02:00
shuki
eb88077e42 Center GNIZA text under logo
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:02:11 +02:00
shuki
b0465c0877 Uppercase GNIZA in logo and app title
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:01:28 +02:00
shuki
c5f6e8be5c Reorder menu: move Snapshots after Schedules, before Logs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 05:00:51 +02:00
shuki
68b348e1b7 Fix MySQL restore switch visibility with explicit sizing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:57:26 +02:00
shuki
eeee87b063 Add 'Restore MySQL' toggle switch to restore screen
Shows a switch to include/skip MySQL restore when the selected target
has MySQL enabled. Hidden for targets without MySQL. Passes --skip-mysql
to CLI when toggled off.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:56:30 +02:00
shuki
c1d00108ba Add MySQL grants backup and MySQL restore support
- mysql_dump_grants(): backs up user grants via SHOW CREATE USER + SHOW GRANTS,
  skipping system users (root, mysql.sys, etc.)
- mysql_restore_databases(): restores .sql.gz dumps and grants.sql from snapshot
- Backup flow: grants dumped alongside database dumps into _mysql/
- Restore flow: automatically restores MySQL databases and grants when _mysql/
  exists in snapshot and target has MySQL enabled
- CLI: --skip-mysql flag to opt out of MySQL restore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:53:41 +02:00
shuki
75fd25e559 Show spinner only for backup and restore operations
Other OperationLog dialogs (crontab show, remote test, retention) no
longer display the spinner since they complete quickly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:49:22 +02:00
shuki
fa891bbf7b Sync crontab after adding or editing a schedule
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:47:16 +02:00
shuki
07bc23a7a1 Stop spinner after show crontab completes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:46:16 +02:00
shuki
48bd0ab1d4 Move schedule form to separate edit screen and fix crontab sync
- Extract schedule add/edit form into ScheduleEditScreen (follows target_edit pattern)
- Fix toggle active: now properly installs/removes crontab entries with error reporting
- Delete also syncs crontab to remove deleted schedule entries
- Handle case where all schedules deactivated (calls remove instead of install)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:45:27 +02:00
shuki
1425c416eb Add per-schedule active toggle with crontab sync
Each schedule has SCHEDULE_ACTIVE field (yes/no). Table shows active
status with checkmark/cross. Toggle Active button flips state and
reinstalls crontab with only active schedules. Inactive schedules
are skipped during crontab install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:38:51 +02:00
shuki
a8d67160a5 Replace Install/Remove crontab buttons with Active toggle switch
Switch checks current crontab status on mount. Toggling ON runs
schedule install, toggling OFF runs schedule remove. Show crontab
button remains for inspection.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:35:59 +02:00
shuki
8fc0e5a04d Add Edit button to schedule screen
Select a schedule in the table, click Edit to load its config into
the form. The Add button now works as Save (creates or updates).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:34:20 +02:00
shuki
691e268dd0 Use arrow3 spinner with 'Running...' text for better visibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:31:12 +02:00
shuki
e32e226c10 Make spinner same height as Close button
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:30:06 +02:00
shuki
255d43fcea Move spinner next to Close button in OperationLog footer
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:29:25 +02:00
shuki
d596a747a4 Add animated spinner to OperationLog using Rich Spinner
Uses rich.spinner.Spinner with set_interval refresh instead of
Textual's LoadingIndicator which caused rendering failures.
Spinner shows dots animation while running, changes to checkmark on finish.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:28:08 +02:00
shuki
ced2e9a889 Revert OperationLog and all screens to pre-spinner working state
Reverts all spinner/loading indicator changes and debug code.
Restores the exact code from commit 0e02ba6 which was confirmed working.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:25:57 +02:00
shuki
75259c9d34 DEBUG: minimal OperationLog - no RichLog, just Static + Button 2026-03-06 04:23:54 +02:00
shuki
9d51a39282 DEBUG: file-based logging to /tmp/gniza_debug.log 2026-03-06 04:22:38 +02:00
shuki
bc2cb8c4ba DEBUG: skip ConfirmDialog, go straight to OperationLog 2026-03-06 04:19:13 +02:00
shuki
c348bb2289 Add debug to ConfirmDialog button handler 2026-03-06 04:17:47 +02:00
shuki
47c93d1208 Add debug notifications to backup flow 2026-03-06 04:13:45 +02:00
shuki
4d4b55047b Fix OperationLog not rendering by removing LoadingIndicator
LoadingIndicator was causing OperationLog ModalScreen to fail silently
during compose. Replaced with a simple Static emoji spinner ().
Reverted screen push patterns back to simple callback approach.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 04:11:16 +02:00
shuki
f70ce53dc5 Fix operation log not showing by awaiting screen mount before CLI
Add wait_ready() to OperationLog and await it in all callers before
starting CLI commands. Ensures the modal with spinner is fully rendered
before streaming begins.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:25:25 +02:00
shuki
f9981831fa Add loading spinner to operation log during running tasks
Shows an animated spinner next to the title while backup, restore,
retention, remote test, and schedule operations are running. Spinner
hides when the operation completes via finish().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:19:57 +02:00
shuki
0e02ba6876 Hide time field for hourly schedules
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:13:46 +02:00
shuki
313d1fe873 Replace free-text day inputs with proper dropdowns per schedule type
- Daily: multi-select checkboxes for days of week (empty = every day)
- Weekly: single dropdown for day of week
- Monthly: dropdown with 1st/7th/14th/21st/28th of the month
- Cron generation supports daily with specific days via SCHEDULE_DAY

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:11:49 +02:00
shuki
a1c280ee3c Add hourly interval dropdown and toggle schedule fields by type
Show "Schedule Hours" dropdown (1/2/3/4/6/8/12h) only for hourly type.
Show time field for hourly/daily/weekly/monthly. Show day field only
for weekly/monthly. Show cron field only for custom type.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:10:22 +02:00
shuki
1d9d32c15f Replace schedule targets/remotes inputs with selection lists
Show checkable lists of existing targets and remotes instead of
free-text comma-separated inputs. Selected items are joined with
commas on save, empty selection means "all".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:08:41 +02:00
shuki
b3c055c9be Add configurable WORK_DIR instead of /tmp for temp files
Default: /usr/local/gniza/workdir (root) or ~/.local/state/gniza/workdir
(user). MySQL dumps and rclone temp configs now use WORK_DIR. Configurable
via gniza.conf or TUI Settings screen. Created during install.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 03:00:21 +02:00
shuki
791584aa60 Fix MySQL dump remote path to use _mysql/ instead of full temp path
Add optional dest_name parameter to transfer_folder to override the
remote subpath. MySQL dumps now land in _mysql/ inside the snapshot
instead of tmp/gniza-mysql-xxx/_mysql/.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:56:37 +02:00
shuki
fa01f1c3ea Toggle MySQL fields visibility by enabled/mode selection
Hide all MySQL fields when MySQL is disabled. When enabled, show
databases input only for mode=select and exclude input only for
mode=all.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:54:11 +02:00
shuki
e6aa828111 Toggle SSH key/password fields by auth method and add key file browser
Show only the SSH key path input (with Browse button) when auth method
is "key", and only the password input when auth method is "password".
Adds a FilePicker widget for browsing SSH key files, defaulting to
~/.ssh directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:53:31 +02:00
shuki
733bb5de62 Add MySQL database backup support
Dump MySQL/MariaDB databases as part of backup snapshots. Each database
is dumped to a separate gzipped file under _mysql/ in the snapshot.
Supports all-databases mode with exclude list, or explicit database
selection. Includes TUI form fields for full configuration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:48:47 +02:00
shuki
121a615e67 Remove legacy gum TUI and clean up install script
- Delete all lib/ui_*.sh files (gum-based TUI)
- Remove gum download from install script
- Remove gum fallback and show_logo from bin/gniza
- Update README to reference Textual TUI and web GUI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:15:52 +02:00
shuki
5ecb9537b7 Add 'Create Folder' to folder picker dialog
Adds an input field and button to create a new folder inside the
currently selected directory, then refreshes the tree.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:13:36 +02:00
shuki
4bd9df3b5e Fix Select.BLANK checks across all screens
Replace `is Select.BLANK` / `is not Select.BLANK` with isinstance
checks, as the sentinel identity varies across Textual versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:12:58 +02:00
shuki
e6b6d7684a Fix logo/menu vertical alignment on main screen
Remove leading blank line from logo markup and add top margin
to menu so both start at the same visual row.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 02:03:28 +02:00
shuki
3d5a9cdfdd Remove verify feature and align main menu layout
Remove verify screen, CLI subcommand, and all related functions.
Fix logo/menu height alignment on main menu screen.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:57:55 +02:00
shuki
8149976170 Add Browse button for restore destination directory
Opens FolderPicker to select the destination path instead of
requiring manual typing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:48:47 +02:00
shuki
8098cb90cf Auto-load snapshots when target and remote are selected
Remove the Load Snapshots button. Snapshots are fetched
automatically when both target and remote have values,
triggered by Select.Changed events.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:47:59 +02:00
shuki
7793f02aa2 Fix NoMatches crash: buffer writes until OperationLog is mounted
The worker starts streaming output before the modal screen finishes
composing. Buffer writes until on_mount fires, then flush.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:44:37 +02:00
shuki
75f00f6521 Fix Rich markup rendering in operation log
Use Text.from_markup() for strings containing Rich tags
so [red]...[/red] renders as colored text instead of raw tags.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 01:31:15 +02:00