From 13598963a15baedef10506ea60864f13917904c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Tue, 6 Jan 2026 16:53:08 +0100 Subject: [PATCH 01/10] Add a feature flag for the terminal. --- backend/beets_flask/config/schema.py | 1 + .../beets_flask/server/websocket/__init__.py | 13 ++++++-- docker/entrypoints/entrypoint_dev.sh | 4 +-- docs/configuration.md | 5 +++ frontend/src/components/frontpage/navbar.tsx | 18 +++++++---- .../src/components/frontpage/terminal.tsx | 31 ++++++++++++++++++- .../inbox/settings/actionButtonSettings.tsx | 19 +++++++++--- frontend/src/pythonTypes.ts | 1 + frontend/src/routes/inbox/index.tsx | 20 ++++++------ 9 files changed, 87 insertions(+), 25 deletions(-) diff --git a/backend/beets_flask/config/schema.py b/backend/beets_flask/config/schema.py index 045035b7..1892bc01 100644 --- a/backend/beets_flask/config/schema.py +++ b/backend/beets_flask/config/schema.py @@ -124,4 +124,5 @@ class LibrarySectionSchema: @dataclass class TerminalSectionSchema: + enable: bool = True start_path: str = "/repo" diff --git a/backend/beets_flask/server/websocket/__init__.py b/backend/beets_flask/server/websocket/__init__.py index fcc63027..ffe3362b 100644 --- a/backend/beets_flask/server/websocket/__init__.py +++ b/backend/beets_flask/server/websocket/__init__.py @@ -4,6 +4,8 @@ import socketio +from beets_flask.config import get_config + old_on = socketio.AsyncServer.on @@ -33,8 +35,13 @@ def register_socketio(app): app.asgi_app = socketio.ASGIApp(sio, app.asgi_app, socketio_path="/socket.io") # Register all socketio namespaces + # fmt: off from .status import register_status - from .terminal import register_tmux - - register_tmux() register_status() + # fmt: on + + if get_config().data.gui.terminal.enable: + # fmt: off + from .terminal import register_tmux + register_tmux() + # fmt: on diff --git a/docker/entrypoints/entrypoint_dev.sh b/docker/entrypoints/entrypoint_dev.sh index cb1ffea5..8e0f8d77 100755 --- a/docker/entrypoints/entrypoint_dev.sh +++ b/docker/entrypoints/entrypoint_dev.sh @@ -62,7 +62,7 @@ redis-cli FLUSHALL python ./generate_types.py # we need to run with one worker for socketio to work (but need at least threads for SSEs) -# sufficient timout for the interactive import sessions, which may take a couple of minutes +# sufficient timeout for the interactive import sessions, which may take a couple of minutes # gunicorn --worker-class eventlet -w 1 --threads 32 --timeout 300 --bind 0.0.0.0:5001 --reload 'main:create_app()' @@ -77,5 +77,5 @@ uvicorn beets_flask.server.app:create_app --port 5001 \ -# if we need to debug the continaer without running the webserver: +# if we need to debug the container without running the webserver: # tail -f /dev/null diff --git a/docs/configuration.md b/docs/configuration.md index 8c6e304e..55abf25a 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -134,6 +134,11 @@ The default is `[";", ",", "&"]`. ## Terminal +### `gui.terminal.enable` + +A boolean to enable or disable the terminal in the web interface. +By default, the terminal is enabled. + ### `gui.terminal.start_path` Specifies the path that is used when starting the terminal in the web interface. diff --git a/frontend/src/components/frontpage/navbar.tsx b/frontend/src/components/frontpage/navbar.tsx index 04b3ffdb..052b317f 100644 --- a/frontend/src/components/frontpage/navbar.tsx +++ b/frontend/src/components/frontpage/navbar.tsx @@ -5,6 +5,7 @@ import { styled } from '@mui/material/styles'; import Tab, { tabClasses, TabProps } from '@mui/material/Tab'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import { createLink, LinkProps, useRouterState } from '@tanstack/react-router'; +import { useConfig } from "@/api/config.ts"; export const NAVBAR_HEIGHT = { desktop: '48px', @@ -142,7 +143,9 @@ function NavItem({ label, ...props }: StyledTabProps) { function NavTabs() { const theme = useTheme(); - const location = useRouterState({ select: (s) => s.location }); + const config = useConfig(); + + const location = useRouterState({select: (s) => s.location}); let basePath = location.pathname.split('/')[1]; // only needed temporarily until search gets an icon in the toolbar! @@ -154,14 +157,17 @@ function NavTabs() { { label: 'Home', icon: , to: '/' as const }, { label: 'Inbox', icon: , to: '/inbox' as const }, //{ label: "Session", icon: , to: "/sessiondraft" as const }, - { label: 'Library', icon: , to: '/library/browse' as const }, - { label: 'Search', icon: , to: '/library/search' as const }, - { + {label: 'Library', icon: , to: '/library/browse' as const}, + {label: 'Search', icon: , to: '/library/search' as const}, + ]; + + if (config.gui.terminal.enable) { + navItems.push({ label: '', icon: , to: '/terminal' as const, - }, - ]; + }); + } const currentIdx = navItems.findIndex((item) => item.to === '/' + basePath); const ref = useRef(null); diff --git a/frontend/src/components/frontpage/terminal.tsx b/frontend/src/components/frontpage/terminal.tsx index 9ac8d8d9..668f365c 100644 --- a/frontend/src/components/frontpage/terminal.tsx +++ b/frontend/src/components/frontpage/terminal.tsx @@ -14,6 +14,7 @@ import { Terminal as xTerminal } from '@xterm/xterm'; import useSocket from '@/components/common/websocket/useSocket'; import 'node_modules/@xterm/xterm/css/xterm.css'; +import { useConfig } from "@/api/config.ts"; import { Socket } from 'socket.io-client'; // match our style - this is somewhat redundant with main.css @@ -139,8 +140,36 @@ export function TerminalContextProvider({ }: { children: React.ReactNode; }) { - const { socket, isConnected } = useSocket('terminal'); + const config = useConfig(); + + if (!config.gui.terminal.enable) { + const noop = () => { + }; + + return ( + + {children} + + ); + } + return {children}; +} + +function InitTerminalContext({ + children, + }: { + children: React.ReactNode; +}) { + const { socket, isConnected } = useSocket('terminal'); const [open, setOpen] = useState(false); const [term, setTerm] = useState(); diff --git a/frontend/src/components/inbox/settings/actionButtonSettings.tsx b/frontend/src/components/inbox/settings/actionButtonSettings.tsx index ddddc0a6..5f980021 100644 --- a/frontend/src/components/inbox/settings/actionButtonSettings.tsx +++ b/frontend/src/components/inbox/settings/actionButtonSettings.tsx @@ -47,7 +47,7 @@ import { Action, ACTIONS, DEFAULT_INBOX_FOLDER_FRONTEND_CONFIG, - InboxFolderFrontendConfig, + InboxFolderFrontendConfig, useConfig, } from '@/api/config'; import { Dialog } from '@/components/common/dialogs'; @@ -775,11 +775,22 @@ function AddActionButton({ onAdd: (action: Action) => void; } & ButtonProps) { const theme = useTheme(); + const config = useConfig(); const [open, setOpen] = useState(false); - const defaultActions: Array = Object.entries(ACTIONS).map( - ([_, a]) => a - ); + function isEnabled([actionName, _action]: [string, Action]) { + switch (actionName) { + case 'import_terminal': + return config.gui.terminal.enable; + default: + return true; + } + } + + const defaultActions: Array = Object.entries(ACTIONS) + .filter(isEnabled) + .map(([_, a]) => a); + const [action, setAction] = useState(defaultActions[0]); return ( diff --git a/frontend/src/pythonTypes.ts b/frontend/src/pythonTypes.ts index af88c66b..d8a11395 100644 --- a/frontend/src/pythonTypes.ts +++ b/frontend/src/pythonTypes.ts @@ -103,6 +103,7 @@ export interface BeetsSchema { } export interface TerminalSectionSchema { + enable: boolean; start_path: string; } diff --git a/frontend/src/routes/inbox/index.tsx b/frontend/src/routes/inbox/index.tsx index 3e243f8f..58e3a80f 100644 --- a/frontend/src/routes/inbox/index.tsx +++ b/frontend/src/routes/inbox/index.tsx @@ -11,7 +11,7 @@ import { import { useSuspenseQuery } from '@tanstack/react-query'; import { createFileRoute } from '@tanstack/react-router'; -import { Action } from '@/api/config'; +import { Action, useConfig } from '@/api/config'; import { inboxQueryOptions } from '@/api/inbox'; import { MatchChip, StyledChip } from '@/components/common/chips'; import { Dialog } from '@/components/common/dialogs'; @@ -158,6 +158,8 @@ function PageHeader({ inboxes, ...props }: { inboxes: Folder[] } & BoxProps) { /** Description of the inbox page, shown as modal on click */ function InfoDescription() { const theme = useTheme(); + const config = useConfig(); + const [open, setOpen] = useState(false); const { data } = useSuspenseQuery(inboxQueryOptions()); @@ -254,14 +256,14 @@ function InfoDescription() { }} component="p" > - - - - - - - - + + + + {config.gui.terminal.enable ?? } + + + + {/* Tree view */} From 8c3fac28f88d8717db68c33579ac2aa2893aabd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Tue, 6 Jan 2026 17:58:58 +0100 Subject: [PATCH 02/10] Fix tsc inferring restrictive type for navItems. --- frontend/src/components/frontpage/navbar.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/components/frontpage/navbar.tsx b/frontend/src/components/frontpage/navbar.tsx index 052b317f..4a553e06 100644 --- a/frontend/src/components/frontpage/navbar.tsx +++ b/frontend/src/components/frontpage/navbar.tsx @@ -153,19 +153,19 @@ function NavTabs() { basePath += '/' + location.pathname.split('/')[2]; } - const navItems = [ - { label: 'Home', icon: , to: '/' as const }, - { label: 'Inbox', icon: , to: '/inbox' as const }, - //{ label: "Session", icon: , to: "/sessiondraft" as const }, - {label: 'Library', icon: , to: '/library/browse' as const}, - {label: 'Search', icon: , to: '/library/search' as const}, + const navItems: StyledTabProps[] = [ + { label: 'Home', icon: , to: '/' }, + { label: 'Inbox', icon: , to: '/inbox'}, + //{ label: "Session", icon: , to: '/sessiondraft'}, + {label: 'Library', icon: , to: '/library/browse'}, + {label: 'Search', icon: , to: '/library/search'}, ]; if (config.gui.terminal.enable) { navItems.push({ label: '', icon: , - to: '/terminal' as const, + to: '/terminal', }); } From dbe426aa42a7f9f8a271d107a47a388bda9aad79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Tue, 6 Jan 2026 18:03:33 +0100 Subject: [PATCH 03/10] Apply prettier.json --- frontend/src/components/frontpage/navbar.tsx | 10 +++--- .../src/components/frontpage/terminal.tsx | 31 +++++++++---------- .../inbox/settings/actionButtonSettings.tsx | 3 +- frontend/src/routes/inbox/index.tsx | 18 ++++++----- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/frontend/src/components/frontpage/navbar.tsx b/frontend/src/components/frontpage/navbar.tsx index 4a553e06..855116d5 100644 --- a/frontend/src/components/frontpage/navbar.tsx +++ b/frontend/src/components/frontpage/navbar.tsx @@ -5,7 +5,7 @@ import { styled } from '@mui/material/styles'; import Tab, { tabClasses, TabProps } from '@mui/material/Tab'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import { createLink, LinkProps, useRouterState } from '@tanstack/react-router'; -import { useConfig } from "@/api/config.ts"; +import { useConfig } from '@/api/config.ts'; export const NAVBAR_HEIGHT = { desktop: '48px', @@ -145,7 +145,7 @@ function NavTabs() { const theme = useTheme(); const config = useConfig(); - const location = useRouterState({select: (s) => s.location}); + const location = useRouterState({ select: (s) => s.location }); let basePath = location.pathname.split('/')[1]; // only needed temporarily until search gets an icon in the toolbar! @@ -155,10 +155,10 @@ function NavTabs() { const navItems: StyledTabProps[] = [ { label: 'Home', icon: , to: '/' }, - { label: 'Inbox', icon: , to: '/inbox'}, + { label: 'Inbox', icon: , to: '/inbox' }, //{ label: "Session", icon: , to: '/sessiondraft'}, - {label: 'Library', icon: , to: '/library/browse'}, - {label: 'Search', icon: , to: '/library/search'}, + { label: 'Library', icon: , to: '/library/browse' }, + { label: 'Search', icon: , to: '/library/search' }, ]; if (config.gui.terminal.enable) { diff --git a/frontend/src/components/frontpage/terminal.tsx b/frontend/src/components/frontpage/terminal.tsx index 668f365c..6f66f01a 100644 --- a/frontend/src/components/frontpage/terminal.tsx +++ b/frontend/src/components/frontpage/terminal.tsx @@ -14,7 +14,7 @@ import { Terminal as xTerminal } from '@xterm/xterm'; import useSocket from '@/components/common/websocket/useSocket'; import 'node_modules/@xterm/xterm/css/xterm.css'; -import { useConfig } from "@/api/config.ts"; +import { useConfig } from '@/api/config.ts'; import { Socket } from 'socket.io-client'; // match our style - this is somewhat redundant with main.css @@ -143,19 +143,20 @@ export function TerminalContextProvider({ const config = useConfig(); if (!config.gui.terminal.enable) { - const noop = () => { - }; + const noop = () => {}; return ( - + {children} ); @@ -164,11 +165,7 @@ export function TerminalContextProvider({ return {children}; } -function InitTerminalContext({ - children, - }: { - children: React.ReactNode; -}) { +function InitTerminalContext({ children }: { children: React.ReactNode }) { const { socket, isConnected } = useSocket('terminal'); const [open, setOpen] = useState(false); const [term, setTerm] = useState(); diff --git a/frontend/src/components/inbox/settings/actionButtonSettings.tsx b/frontend/src/components/inbox/settings/actionButtonSettings.tsx index 5f980021..df7bd562 100644 --- a/frontend/src/components/inbox/settings/actionButtonSettings.tsx +++ b/frontend/src/components/inbox/settings/actionButtonSettings.tsx @@ -47,7 +47,8 @@ import { Action, ACTIONS, DEFAULT_INBOX_FOLDER_FRONTEND_CONFIG, - InboxFolderFrontendConfig, useConfig, + InboxFolderFrontendConfig, + useConfig, } from '@/api/config'; import { Dialog } from '@/components/common/dialogs'; diff --git a/frontend/src/routes/inbox/index.tsx b/frontend/src/routes/inbox/index.tsx index 58e3a80f..59d81999 100644 --- a/frontend/src/routes/inbox/index.tsx +++ b/frontend/src/routes/inbox/index.tsx @@ -256,14 +256,16 @@ function InfoDescription() { }} component="p" > - - - - {config.gui.terminal.enable ?? } - - - - + + + + {config.gui.terminal.enable ?? ( + + )} + + + + {/* Tree view */} From 08c59b24fed6176c55aabbfc404823c3220a6dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Tue, 6 Jan 2026 18:21:52 +0100 Subject: [PATCH 04/10] Fixing ESLint unhappy with imports --- frontend/src/components/frontpage/navbar.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/components/frontpage/navbar.tsx b/frontend/src/components/frontpage/navbar.tsx index 855116d5..61dea6bc 100644 --- a/frontend/src/components/frontpage/navbar.tsx +++ b/frontend/src/components/frontpage/navbar.tsx @@ -5,6 +5,7 @@ import { styled } from '@mui/material/styles'; import Tab, { tabClasses, TabProps } from '@mui/material/Tab'; import Tabs, { tabsClasses } from '@mui/material/Tabs'; import { createLink, LinkProps, useRouterState } from '@tanstack/react-router'; + import { useConfig } from '@/api/config.ts'; export const NAVBAR_HEIGHT = { From 2fbb8ac17d47bacebbb73b7e17c538671208bb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Tue, 6 Jan 2026 21:51:25 +0100 Subject: [PATCH 05/10] Show a placeholder at /terminal when disabled. Log a warning if a terminal method is somehow invoked (should not be possible). --- frontend/src/components/frontpage/terminal.tsx | 6 +++++- frontend/src/routes/terminal/index.tsx | 13 +++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/frontpage/terminal.tsx b/frontend/src/components/frontpage/terminal.tsx index 6f66f01a..f9d8d6aa 100644 --- a/frontend/src/components/frontpage/terminal.tsx +++ b/frontend/src/components/frontpage/terminal.tsx @@ -143,7 +143,11 @@ export function TerminalContextProvider({ const config = useConfig(); if (!config.gui.terminal.enable) { - const noop = () => {}; + const noop = () => { + console.warn( + 'Terminal is not available (disabled in server config).' + ); + }; return ( + + The terminal is not enabled in the server configuration. + + + ); + } + return ( Date: Sat, 10 Jan 2026 13:59:46 +0100 Subject: [PATCH 06/10] Show a placeholder at /terminal when disabled. --- frontend/src/routes/terminal/index.tsx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/routes/terminal/index.tsx b/frontend/src/routes/terminal/index.tsx index 2f3cb2d9..97bed53d 100644 --- a/frontend/src/routes/terminal/index.tsx +++ b/frontend/src/routes/terminal/index.tsx @@ -1,4 +1,4 @@ -import { Stack, Typography } from '@mui/material'; +import { Alert, AlertTitle, Box } from '@mui/material'; import { createFileRoute } from '@tanstack/react-router'; import { useConfig } from '@/api/config'; @@ -13,11 +13,19 @@ function TerminalPage() { const config = useConfig(); if (!config.gui.terminal.enable) { return ( - - - The terminal is not enabled in the server configuration. - - + + + Terminal Disabled + + The terminal is not enabled in the server configuration. + + + ); } From 634228bff2dc999ea9c14b89afad63b18b9f2856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Sat, 10 Jan 2026 14:26:07 +0100 Subject: [PATCH 07/10] Don't crash the backend for configuration errors during init. --- backend/beets_flask/config/beets_config.py | 2 +- backend/beets_flask/server/websocket/__init__.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/beets_flask/config/beets_config.py b/backend/beets_flask/config/beets_config.py index 706565f6..76e150b2 100644 --- a/backend/beets_flask/config/beets_config.py +++ b/backend/beets_flask/config/beets_config.py @@ -52,7 +52,7 @@ def reload(self, extra_yaml_path: str | Path | None = None) -> Self: This loads the user config from yaml files after resetting to defaults. - The `extra_yaml_path` argument is mainly for testing puproses, to add a last + The `extra_yaml_path` argument is mainly for testing purposes, to add a last yaml layer with high priority. """ log.debug("Resetting/Reloading config") diff --git a/backend/beets_flask/server/websocket/__init__.py b/backend/beets_flask/server/websocket/__init__.py index ffe3362b..f0b982cf 100644 --- a/backend/beets_flask/server/websocket/__init__.py +++ b/backend/beets_flask/server/websocket/__init__.py @@ -3,6 +3,7 @@ from typing import cast import socketio +from eyconf.validation import ConfigurationError, MultiConfigurationError from beets_flask.config import get_config @@ -40,7 +41,15 @@ def register_socketio(app): register_status() # fmt: on - if get_config().data.gui.terminal.enable: + terminal_enabled = True + try: + terminal_enabled = get_config().data.gui.terminal.enabled + except (MultiConfigurationError, ConfigurationError): + # We don't want to let the exception propagate here as it won't reach the frontend. + # It will get triggered again on the next call to get_config(). + pass + + if terminal_enabled: # fmt: off from .terminal import register_tmux register_tmux() From 0964ec5d9d6a0fb14c50e3993acc728d3c8864e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dardenne?= Date: Sun, 11 Jan 2026 01:39:18 +0100 Subject: [PATCH 08/10] Fix typo --- backend/beets_flask/server/websocket/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/beets_flask/server/websocket/__init__.py b/backend/beets_flask/server/websocket/__init__.py index f0b982cf..1348b1dc 100644 --- a/backend/beets_flask/server/websocket/__init__.py +++ b/backend/beets_flask/server/websocket/__init__.py @@ -43,7 +43,7 @@ def register_socketio(app): terminal_enabled = True try: - terminal_enabled = get_config().data.gui.terminal.enabled + terminal_enabled = get_config().data.gui.terminal.enable except (MultiConfigurationError, ConfigurationError): # We don't want to let the exception propagate here as it won't reach the frontend. # It will get triggered again on the next call to get_config(). From 1477d250251600c660c63213f85c6224147057ce Mon Sep 17 00:00:00 2001 From: pSpitzner Date: Mon, 12 Jan 2026 22:32:56 +0100 Subject: [PATCH 09/10] Renamed config option from `enable` to `enabled` for consistency with other projects, added some logging. --- backend/beets_flask/config/schema.py | 2 +- backend/beets_flask/server/websocket/__init__.py | 15 ++++++++------- frontend/src/pythonTypes.ts | 2 +- frontend/src/routes/terminal/index.tsx | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/backend/beets_flask/config/schema.py b/backend/beets_flask/config/schema.py index 1892bc01..8093645b 100644 --- a/backend/beets_flask/config/schema.py +++ b/backend/beets_flask/config/schema.py @@ -124,5 +124,5 @@ class LibrarySectionSchema: @dataclass class TerminalSectionSchema: - enable: bool = True + enabled: bool = True start_path: str = "/repo" diff --git a/backend/beets_flask/server/websocket/__init__.py b/backend/beets_flask/server/websocket/__init__.py index 1348b1dc..d458ba18 100644 --- a/backend/beets_flask/server/websocket/__init__.py +++ b/backend/beets_flask/server/websocket/__init__.py @@ -6,6 +6,7 @@ from eyconf.validation import ConfigurationError, MultiConfigurationError from beets_flask.config import get_config +from beets_flask.logger import log old_on = socketio.AsyncServer.on @@ -36,21 +37,21 @@ def register_socketio(app): app.asgi_app = socketio.ASGIApp(sio, app.asgi_app, socketio_path="/socket.io") # Register all socketio namespaces - # fmt: off from .status import register_status + register_status() - # fmt: on terminal_enabled = True try: - terminal_enabled = get_config().data.gui.terminal.enable + terminal_enabled = get_config().data.gui.terminal.enabled except (MultiConfigurationError, ConfigurationError): # We don't want to let the exception propagate here as it won't reach the frontend. - # It will get triggered again on the next call to get_config(). - pass + log.debug("Encountered config error. Will raise on next call to get_config()") if terminal_enabled: - # fmt: off + log.info("Setting up Web-Terminal") from .terminal import register_tmux + register_tmux() - # fmt: on + else: + log.info("Web-Terminal is disabled, skipping setup") diff --git a/frontend/src/pythonTypes.ts b/frontend/src/pythonTypes.ts index d8a11395..ca67838a 100644 --- a/frontend/src/pythonTypes.ts +++ b/frontend/src/pythonTypes.ts @@ -103,7 +103,7 @@ export interface BeetsSchema { } export interface TerminalSectionSchema { - enable: boolean; + enabled: boolean; start_path: string; } diff --git a/frontend/src/routes/terminal/index.tsx b/frontend/src/routes/terminal/index.tsx index 97bed53d..346da474 100644 --- a/frontend/src/routes/terminal/index.tsx +++ b/frontend/src/routes/terminal/index.tsx @@ -11,7 +11,7 @@ export const Route = createFileRoute('/terminal/')({ function TerminalPage() { const config = useConfig(); - if (!config.gui.terminal.enable) { + if (!config.gui.terminal.enabled) { return ( Date: Mon, 12 Jan 2026 22:41:15 +0100 Subject: [PATCH 10/10] Renamed Option in frontend, added Changelog entry --- CHANGELOG.md | 1 + docs/configuration.md | 8 ++++---- frontend/src/components/frontpage/navbar.tsx | 2 +- frontend/src/components/frontpage/terminal.tsx | 2 +- .../components/inbox/settings/actionButtonSettings.tsx | 2 +- frontend/src/routes/inbox/index.tsx | 2 +- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 576b6cad..f3430794 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Config validation. When loading config files we now check that specified options will work. If not, the frontend will show an error message with details on what's wrong. This applies to `gui` settings (i.e. our own ones, `beets-flask/config.yaml`) and very select ones from native beets (only those which we use directly). Hopefully, this will eventually cover all config options of beets native, but this is more of an upsream task. [#224](https://github.com/pSpitzner/beets-flask/pull/224). - Upload Files via the WebUI. You can now drag-and-drop single files into an inbox. To upload whole albums, zip them on your host first (uploading of folders directly is not implemented, as it would require a secure context). +- New config option `gui.terminal.enabled` (default: true) [#254](https://github.com/pSpitzner/beets-flask/pull/224) ### Other (dev) diff --git a/docs/configuration.md b/docs/configuration.md index 55abf25a..5324fc1d 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -134,10 +134,10 @@ The default is `[";", ",", "&"]`. ## Terminal -### `gui.terminal.enable` +### `gui.terminal.enabled` A boolean to enable or disable the terminal in the web interface. -By default, the terminal is enabled. +By default, the terminal is enabled. ### `gui.terminal.start_path` @@ -160,8 +160,8 @@ However, the import itself is always done sequentially. This is to ensure that the import process is not interrupted by other operations. ``` -### `gui.inbox.temp_dir` -Specifies the temporary directory that is used to store files during the upload process. +### `gui.inbox.temp_dir` +Specifies the temporary directory that is used to store files during the upload process. This is useful to ensure that files are uploaded to a filesystem that is fast and has enough space. The default value is `/tmp/beets-flask/upload`. diff --git a/frontend/src/components/frontpage/navbar.tsx b/frontend/src/components/frontpage/navbar.tsx index 61dea6bc..582dab04 100644 --- a/frontend/src/components/frontpage/navbar.tsx +++ b/frontend/src/components/frontpage/navbar.tsx @@ -162,7 +162,7 @@ function NavTabs() { { label: 'Search', icon: , to: '/library/search' }, ]; - if (config.gui.terminal.enable) { + if (config.gui.terminal.enabled) { navItems.push({ label: '', icon: , diff --git a/frontend/src/components/frontpage/terminal.tsx b/frontend/src/components/frontpage/terminal.tsx index f9d8d6aa..bfa90004 100644 --- a/frontend/src/components/frontpage/terminal.tsx +++ b/frontend/src/components/frontpage/terminal.tsx @@ -142,7 +142,7 @@ export function TerminalContextProvider({ }) { const config = useConfig(); - if (!config.gui.terminal.enable) { + if (!config.gui.terminal.enabled) { const noop = () => { console.warn( 'Terminal is not available (disabled in server config).' diff --git a/frontend/src/components/inbox/settings/actionButtonSettings.tsx b/frontend/src/components/inbox/settings/actionButtonSettings.tsx index df7bd562..4771d775 100644 --- a/frontend/src/components/inbox/settings/actionButtonSettings.tsx +++ b/frontend/src/components/inbox/settings/actionButtonSettings.tsx @@ -782,7 +782,7 @@ function AddActionButton({ function isEnabled([actionName, _action]: [string, Action]) { switch (actionName) { case 'import_terminal': - return config.gui.terminal.enable; + return config.gui.terminal.enabled; default: return true; } diff --git a/frontend/src/routes/inbox/index.tsx b/frontend/src/routes/inbox/index.tsx index 59d81999..080710a8 100644 --- a/frontend/src/routes/inbox/index.tsx +++ b/frontend/src/routes/inbox/index.tsx @@ -259,7 +259,7 @@ function InfoDescription() { - {config.gui.terminal.enable ?? ( + {config.gui.terminal.enabled ?? ( )}