feat(studio): hub maintenance panel with reset action (v0.45.0)
Some checks are pending
Security / Security check (push) Waiting to run

UI parity with the platform CLI: `fai reset` (v0.10.93) is now
reachable from Settings. The panel shows the reset blurb plus
two checkboxes mirroring the CLI flags (Keep modules / Keep
audit log + saved flows), then a destructive-styled "Reset hub
state" button. Click goes through a confirm dialog before
SystemActions.faiReset is invoked.

After the CLI returns, Studio bounces its gRPC channel against
the same endpoint (the daemon restarts on the same channel +
port, so no Settings change needed) and reloads every panel:
channel status, system AI, MCP clients, n8n endpoints, registry
token. Output (success or failure) is shown in a copyable error
box so any unexpected stderr lands somewhere the operator can
paste from.

Sits at the bottom of the dialog under "HUB MAINTENANCE",
separated from the everyday config so a destructive button
doesn't crowd the day-to-day controls.

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-05-09 18:52:19 +02:00
parent 9944a7ac8a
commit 3db7db7330
8 changed files with 358 additions and 1 deletions

View file

@ -2042,6 +2042,72 @@ abstract class AppLocalizations {
/// **'Could not save: {error}'**
String registryTokenSaveFailedToast(String error);
/// No description provided for @maintenanceHeader.
///
/// In en, this message translates to:
/// **'HUB MAINTENANCE'**
String get maintenanceHeader;
/// No description provided for @maintenanceResetBlurb.
///
/// In en, this message translates to:
/// **'Wipe operator state and start over with a clean hub. Stops every running daemon, atomically backs ~/.fai/ up, then recreates it with the binary, channel state, MCP / n8n / system-AI config, and registry token preserved. Restore by moving the backup directory back.'**
String get maintenanceResetBlurb;
/// No description provided for @maintenanceKeepModulesTitle.
///
/// In en, this message translates to:
/// **'Keep installed modules'**
String get maintenanceKeepModulesTitle;
/// No description provided for @maintenanceKeepModulesSubtitle.
///
/// In en, this message translates to:
/// **'Default behaviour wipes ~/.fai/modules/ so a fresh install can verify the module-fetch path end-to-end.'**
String get maintenanceKeepModulesSubtitle;
/// No description provided for @maintenanceKeepDataTitle.
///
/// In en, this message translates to:
/// **'Keep audit log + saved flows'**
String get maintenanceKeepDataTitle;
/// No description provided for @maintenanceKeepDataSubtitle.
///
/// In en, this message translates to:
/// **'Default behaviour wipes ~/.fai/data/ so the audit chain restarts from a fresh genesis and the bundled sample flows re-import on first daemon start.'**
String get maintenanceKeepDataSubtitle;
/// No description provided for @maintenanceResetButton.
///
/// In en, this message translates to:
/// **'Reset hub state'**
String get maintenanceResetButton;
/// No description provided for @maintenanceResetInProgress.
///
/// In en, this message translates to:
/// **'Resetting…'**
String get maintenanceResetInProgress;
/// No description provided for @maintenanceResetConfirmTitle.
///
/// In en, this message translates to:
/// **'Reset hub state?'**
String get maintenanceResetConfirmTitle;
/// No description provided for @maintenanceResetConfirmBody.
///
/// In en, this message translates to:
/// **'This stops every daemon, moves ~/.fai/ to a timestamped backup, and starts fresh. The backup is fully restorable. Continue?'**
String get maintenanceResetConfirmBody;
/// No description provided for @maintenanceResetConfirmButton.
///
/// In en, this message translates to:
/// **'Reset'**
String get maintenanceResetConfirmButton;
/// No description provided for @welcomeChecklistAllSetTitle.
///
/// In en, this message translates to: