From 6c4e8808a8bd317a39c4faeb4a87643a5cee5dc3 Mon Sep 17 00:00:00 2001 From: Magdalena Majta Date: Thu, 5 Mar 2026 15:38:27 +0100 Subject: [PATCH 1/9] Add settings UI for InferPage Introduce a browser-based settings experience and improve model path resolution. Adds a Settings panel (Settings.razor) with styles and JS (settings.css, settings.js) and services to persist settings and API keys (SettingsService, InferPageSettings, SettingsStateService). Wire the settings UX into NavBar and Home to request/show/save settings and apply them at runtime via Utils.ApplySettings; Program.cs now distinguishes CLI-provided config vs browser configuration (Utils.NeedsConfiguration). Update Utils to support manual capability overrides and sanitize model paths, and tweak app CSS and script includes. Improve LLMService local model resolution and path handling (fallback GenericLocalModel, ResolvePath) so unregistered or absolute model paths load correctly. --- src/MaIN.InferPage/Components/App.razor | 1 + .../Components/Layout/MainLayout.razor | 4 +- .../Components/Layout/NavBar.razor | 24 + .../Components/Pages/Home.razor | 166 ++++++- .../Components/Pages/Settings.razor | 422 ++++++++++++++++++ src/MaIN.InferPage/Components/_Imports.razor | 4 +- src/MaIN.InferPage/Program.cs | 103 +++-- .../Services/InferPageSettings.cs | 12 + .../Services/SettingsService.cs | 68 +++ .../Services/SettingsStateService.cs | 21 + src/MaIN.InferPage/Utils.cs | 94 +++- src/MaIN.InferPage/wwwroot/app.css | 23 +- src/MaIN.InferPage/wwwroot/settings.css | 116 +++++ src/MaIN.InferPage/wwwroot/settings.js | 20 + .../Services/LLMService/LLMService.cs | 58 ++- 15 files changed, 1056 insertions(+), 80 deletions(-) create mode 100644 src/MaIN.InferPage/Components/Pages/Settings.razor create mode 100644 src/MaIN.InferPage/Services/InferPageSettings.cs create mode 100644 src/MaIN.InferPage/Services/SettingsService.cs create mode 100644 src/MaIN.InferPage/Services/SettingsStateService.cs create mode 100644 src/MaIN.InferPage/wwwroot/settings.css create mode 100644 src/MaIN.InferPage/wwwroot/settings.js diff --git a/src/MaIN.InferPage/Components/App.razor b/src/MaIN.InferPage/Components/App.razor index 889b8ac3..1150b373 100644 --- a/src/MaIN.InferPage/Components/App.razor +++ b/src/MaIN.InferPage/Components/App.razor @@ -27,6 +27,7 @@ +