diff options
| author | historia <historiavg@proton.me> | 2026-08-27 19:44:30 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-27 19:44:30 -0400 |
| commit | 4c3ba1b68107208fe32c223588576a7bdca19a12 (patch) | |
| tree | 96c63b4af9bf2835820fdf53d4d080eb9b316c31 /app/ui | |
| parent | 5611f709367677b77a482aa8e396fd3bc6a0ab26 (diff) | |
| download | tts-audiobook-generator-4c3ba1b68107208fe32c223588576a7bdca19a12.tar.gz | |
feat: nest start/stop server menu in configure backend menu
Diffstat (limited to 'app/ui')
| -rw-r--r-- | app/ui/hub.py | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py index e99a2e1..68417f7 100644 --- a/app/ui/hub.py +++ b/app/ui/hub.py @@ -120,19 +120,16 @@ class _Hub: statuses = detect_all() options = [("Configure Backends", "configure_backends")] # Converting works against an external (remote) server too, but - # configuring one and starting/stopping its servers need it on - # this machine. + # configuring one needs it on this machine. if any(st.installed or st.running for st in statuses): options.insert(0, ("Generate Audiobooks", "convert")) - if any(st.installed for st in statuses): - options.append(("Start/Stop Backend Servers", "server")) options.append(("Settings", "settings")) options.append(("Help", "help")) options.append(("Quit", "quit")) choice = tui.menu( self.stdscr, "tts-audiobook-generator", options, back_value=tui.Wizard.BACK, - table_title="Backend Status", table_rows=_status_rows(statuses), + table_rows=_status_rows(statuses), notice_lines=_notice_lines()) if choice is tui.Wizard.BACK or choice == "quit": return None @@ -140,8 +137,6 @@ class _Hub: return self.screen_convert if choice == "configure_backends": return self.screen_configure - if choice == "server": - return self.screen_server if choice == "help": return self.screen_help return self.screen_settings @@ -158,9 +153,9 @@ class _Hub: separated from the rest by a blank line. The remaining actions are populated from the detected statuses: configure each configurable backend (qwen offers its per-model weight (un)installer there), - install (backends with nothing on disk), update (every installed - backend refreshed to the latest upstream version in one task-view - run), and uninstall. + start/stop the installed backends' local servers, install (backends + with nothing on disk), update (every installed backend refreshed to + the latest upstream version in one task-view run), and uninstall. Selecting one pushes the next screen; Esc pops back to the main menu. The Build action downloads any missing models alongside the build (a split view), so it heals a configured-but-unbuilt backend @@ -206,6 +201,8 @@ class _Hub: options += [(f"Configure {info.label}", ("configure", info.key)) for info in installed if _configurable(info)] + if any(st.installed for st in statuses): + options.append(("Start/Stop Backend Servers", "server")) if any(_installable(info, by_key) for info in REGISTRY): options.append(("Install Backend", "install")) if any(_updatable(info, by_key) for info in REGISTRY): @@ -218,13 +215,14 @@ class _Hub: back_value=tui.Wizard.BACK, help_lines=["Install, update, configure, or remove a TTS " "backend."], - table_title="Backend Status", table_rows=_status_rows(statuses), notice_lines=_notice_lines()) if choice is tui.Wizard.BACK: return tui.Wizard.BACK if choice == "install": return self.screen_install + if choice == "server": + return self.screen_server if choice == "update": _update_backends_action(self.stdscr) invalidate_detect_cache() @@ -361,7 +359,6 @@ class _Hub: title = "Uninstall Backend" if installed_only else "Install Backend" key = tui.menu(self.stdscr, title, options, back_value=tui.Wizard.BACK, - table_title="Backend Status", table_rows=_status_rows(statuses), notice_lines=_notice_lines()) if key is tui.Wizard.BACK: @@ -527,8 +524,9 @@ class _Hub: return tui.Wizard.BACK spec = tui.menu(self.stdscr, "Start / Stop A Server", options, back_value=tui.Wizard.BACK, - help_lines=["Start/stop local servers manually."], - table_title="Server Status", + help_lines=["Start/stop local servers manually.", + "'Generate Audiobooks' handles this " + "automatically."], table_rows=rows, notice_lines=_notice_lines()) if spec is tui.Wizard.BACK: |
