From 9b8ac0ef249d4e8a66c3b7b565054d40965bd9e8 Mon Sep 17 00:00:00 2001 From: Roland Date: Wed, 20 May 2026 07:27:41 +0200 Subject: [PATCH] - add language - prepare AI functions --- .../v18/DocumentLayout.backup.json | 280 ++++++++++-------- .../v18/DocumentLayout.json | 268 +++++++++-------- Components/Layout/MainLayout.razor | 73 ++--- Components/Pages/Editor.razor | 160 +++++----- Components/Pages/Error.razor | 17 +- Components/Pages/Home.razor | 18 +- Components/Pages/Models.razor | 35 ++- Components/Pages/NotFound.razor | 17 +- Components/Pages/OllamaAssistant.razor | 57 ++-- Components/Pages/Settings.razor | 86 +++--- Models/OllamaSettings.cs | 24 ++ Services/ISettingsService.cs | 4 + Services/SettingsService.cs | 31 +- wwwroot/app.css | 4 +- 14 files changed, 628 insertions(+), 446 deletions(-) diff --git a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json index 7a1ae68..64370d9 100644 --- a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json +++ b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.backup.json @@ -2,6 +2,30 @@ "Version": 1, "WorkspaceRootPath": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\", "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\ollamaassistant.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\ollamaassistant.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\layout\\mainlayout.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\layout\\mainlayout.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" @@ -14,10 +38,6 @@ "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:program.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\projectservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\projectservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -26,14 +46,6 @@ "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\filescannerservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\filescannerservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\project.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\project.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -58,14 +70,6 @@ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\AppDbContext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Data\\AppDbContext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" - }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\themeservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\themeservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -122,70 +126,32 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 7, + "SelectedChildIndex": 2, "Children": [ { "$type": "Bookmark", "Name": "ST:0:0:{aa2115a1-9712-457b-9047-dbb71ca2cdd2}" }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "Program.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", - "RelativeDocumentMoniker": "Program.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", - "RelativeToolTip": "Program.cs", - "ViewState": "AgIAAAMAAAAAAAAAAAApwBoAAAANAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-20T04:07:21.54Z", - "EditorCaption": "" - }, { "$type": "Bookmark", "Name": "RST:0:0:{b3f9f954-0ca5-0091-76b4-34a47f44c954}" }, { "$type": "Document", - "DocumentIndex": 1, - "Title": "ISettingsService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", - "RelativeDocumentMoniker": "Services\\ISettingsService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs*", - "RelativeToolTip": "Services\\ISettingsService.cs*", - "ViewState": "AgIAABoAAAAAAAAAAAA8wCYAAAAPAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T13:21:26.951Z", + "DocumentIndex": 0, + "Title": "OllamaAssistant.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\OllamaAssistant.razor", + "RelativeDocumentMoniker": "Components\\Pages\\OllamaAssistant.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\OllamaAssistant.razor", + "RelativeToolTip": "Components\\Pages\\OllamaAssistant.razor", + "ViewState": "AgIAAAkAAAAAAAAAAAAAABAAAAARAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-20T05:14:39.037Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 3, - "Title": "SettingsService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", - "RelativeDocumentMoniker": "Services\\SettingsService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", - "RelativeToolTip": "Services\\SettingsService.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAqwAYAAAAmAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T06:05:12.928Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 9, - "Title": "RagService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", - "RelativeDocumentMoniker": "Services\\RagService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", - "RelativeToolTip": "Services\\RagService.cs", - "ViewState": "AgIAABIAAAAAAAAAAAAxwBoAAAAIAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-18T15:40:05.413Z" - }, - { - "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 11, "Title": "Project.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\Project.cs", "RelativeDocumentMoniker": "Models\\Project.cs", @@ -197,33 +163,33 @@ }, { "$type": "Document", - "DocumentIndex": 0, + "DocumentIndex": 6, "Title": "MainLayout.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor*", - "RelativeToolTip": "Components\\Layout\\MainLayout.razor*", - "ViewState": "AgIAALUAAAAAAAAAAAApwM4AAABAAAAAAAAAAA==", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", + "RelativeToolTip": "Components\\Layout\\MainLayout.razor", + "ViewState": "AgIAALYAAAAAAAAAAAApwNMAAABAAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", "WhenOpened": "2026-05-15T16:04:36.444Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 3, "Title": "OllamaSettings.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\OllamaSettings.cs", "RelativeDocumentMoniker": "Models\\OllamaSettings.cs", "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\OllamaSettings.cs", "RelativeToolTip": "Models\\OllamaSettings.cs", - "ViewState": "AgIAAAIAAAAAAAAAAAAxwAUAAAA+AAAAAAAAAA==", + "ViewState": "AgIAAAYAAAAAAAAAAAAkwBQAAAASAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-05-16T13:39:46.179Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 13, + "DocumentIndex": 16, "Title": "AppDbContext.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\AppDbContext.cs", "RelativeDocumentMoniker": "Data\\AppDbContext.cs", @@ -234,7 +200,7 @@ }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 10, "Title": "FileScannerService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\FileScannerService.cs", "RelativeDocumentMoniker": "Services\\FileScannerService.cs", @@ -247,7 +213,97 @@ }, { "$type": "Document", - "DocumentIndex": 10, + "DocumentIndex": 4, + "Title": "IOllamaService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", + "RelativeDocumentMoniker": "Services\\IOllamaService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", + "RelativeToolTip": "Services\\IOllamaService.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAqwAkAAAAPAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T07:20:19.212Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "Settings.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", + "RelativeDocumentMoniker": "Components\\Pages\\Settings.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", + "RelativeToolTip": "Components\\Pages\\Settings.razor", + "ViewState": "AgIAAAwAAAAAAAAAAAAAAIYAAAAlAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-15T16:43:26.6Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 5, + "Title": "SettingsService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", + "RelativeDocumentMoniker": "Services\\SettingsService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", + "RelativeToolTip": "Services\\SettingsService.cs", + "ViewState": "AgIAAEUBAAAAAAAAAAAQwFwBAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T06:05:12.928Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "OllamaService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", + "RelativeDocumentMoniker": "Services\\OllamaService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", + "RelativeToolTip": "Services\\OllamaService.cs", + "ViewState": "AgIAAFkAAAAAAAAAAAAqwGsAAAAeAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T06:43:46.404Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 12, + "Title": "RagService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", + "RelativeDocumentMoniker": "Services\\RagService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", + "RelativeToolTip": "Services\\RagService.cs", + "ViewState": "AgIAABIAAAAAAAAAAAAxwBoAAAAIAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-18T15:40:05.413Z" + }, + { + "$type": "Document", + "DocumentIndex": 7, + "Title": "ISettingsService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", + "RelativeDocumentMoniker": "Services\\ISettingsService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", + "RelativeToolTip": "Services\\ISettingsService.cs", + "ViewState": "AgIAABoAAAAAAAAAAAA8wCoAAAAPAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T13:21:26.951Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 8, + "Title": "Program.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAMAAAAAAAAAAAApwBoAAAANAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-20T04:07:21.54Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 13, "Title": "IRagService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IRagService.cs", "RelativeDocumentMoniker": "Services\\IRagService.cs", @@ -259,7 +315,7 @@ }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 9, "Title": "ProjectService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ProjectService.cs", "RelativeDocumentMoniker": "Services\\ProjectService.cs", @@ -272,19 +328,7 @@ }, { "$type": "Document", - "DocumentIndex": 7, - "Title": "OllamaService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", - "RelativeDocumentMoniker": "Services\\OllamaService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", - "RelativeToolTip": "Services\\OllamaService.cs", - "ViewState": "AgIAAHoAAAAAAAAAAAAcwCoAAAAJAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T06:43:46.404Z" - }, - { - "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 15, "Title": "NavMenu.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\NavMenu.razor", "RelativeDocumentMoniker": "Components\\Layout\\NavMenu.razor", @@ -296,20 +340,20 @@ }, { "$type": "Document", - "DocumentIndex": 11, + "DocumentIndex": 14, "Title": "Editor.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Editor.razor", "RelativeDocumentMoniker": "Components\\Pages\\Editor.razor", "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Editor.razor", "RelativeToolTip": "Components\\Pages\\Editor.razor", - "ViewState": "AgIAAAoAAACA6NuCpTYvwJkAAAAcAAAAAAAAAA==", + "ViewState": "AgIAAAoAAACA6NuCpTYvwKAAAAAcAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", "WhenOpened": "2026-05-16T13:01:59.743Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 16, + "DocumentIndex": 17, "Title": "ThemeService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ThemeService.cs", "RelativeDocumentMoniker": "Services\\ThemeService.cs", @@ -321,31 +365,7 @@ }, { "$type": "Document", - "DocumentIndex": 15, - "Title": "Settings.razor", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", - "RelativeDocumentMoniker": "Components\\Pages\\Settings.razor", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", - "RelativeToolTip": "Components\\Pages\\Settings.razor", - "ViewState": "AgIAAHMAAAAAAAAAAADwv4UAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:43:26.6Z" - }, - { - "$type": "Document", - "DocumentIndex": 14, - "Title": "IOllamaService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", - "RelativeDocumentMoniker": "Services\\IOllamaService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", - "RelativeToolTip": "Services\\IOllamaService.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAqwAkAAAAPAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T07:20:19.212Z" - }, - { - "$type": "Document", - "DocumentIndex": 17, + "DocumentIndex": 18, "Title": "App.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\App.razor", "RelativeDocumentMoniker": "Components\\App.razor", @@ -357,7 +377,7 @@ }, { "$type": "Document", - "DocumentIndex": 20, + "DocumentIndex": 21, "Title": "Models.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Models.razor", "RelativeDocumentMoniker": "Components\\Pages\\Models.razor", @@ -369,7 +389,7 @@ }, { "$type": "Document", - "DocumentIndex": 18, + "DocumentIndex": 19, "Title": "LLM_Model.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\LLM_Model.cs", "RelativeDocumentMoniker": "Models\\LLM_Model.cs", @@ -381,7 +401,7 @@ }, { "$type": "Document", - "DocumentIndex": 19, + "DocumentIndex": 20, "Title": "ModelStatus.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\ModelStatus.cs", "RelativeDocumentMoniker": "Models\\ModelStatus.cs", @@ -393,7 +413,7 @@ }, { "$type": "Document", - "DocumentIndex": 23, + "DocumentIndex": 24, "Title": "MainLayout.razor.css", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor.css", "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor.css", @@ -405,7 +425,7 @@ }, { "$type": "Document", - "DocumentIndex": 21, + "DocumentIndex": 22, "Title": "IFileScannerService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IFileScannerService.cs", "RelativeDocumentMoniker": "Services\\IFileScannerService.cs", @@ -417,7 +437,7 @@ }, { "$type": "Document", - "DocumentIndex": 22, + "DocumentIndex": 23, "Title": "bootstrap-utilities.css", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\wwwroot\\lib\\bootstrap\\dist\\css\\bootstrap-utilities.css", "RelativeDocumentMoniker": "wwwroot\\lib\\bootstrap\\dist\\css\\bootstrap-utilities.css", @@ -429,7 +449,7 @@ }, { "$type": "Document", - "DocumentIndex": 25, + "DocumentIndex": 26, "Title": "ProjectEntity.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\ProjectEntity.cs", "RelativeDocumentMoniker": "Data\\ProjectEntity.cs", @@ -441,7 +461,7 @@ }, { "$type": "Document", - "DocumentIndex": 24, + "DocumentIndex": 25, "Title": "IProjectService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IProjectService.cs", "RelativeDocumentMoniker": "Services\\IProjectService.cs", @@ -453,7 +473,7 @@ }, { "$type": "Document", - "DocumentIndex": 26, + "DocumentIndex": 27, "Title": "AuthorBuddy.Web.csproj", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\AuthorBuddy.Web.csproj", "RelativeDocumentMoniker": "AuthorBuddy.Web.csproj", @@ -465,7 +485,7 @@ }, { "$type": "Document", - "DocumentIndex": 27, + "DocumentIndex": 28, "Title": "appsettings.json", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\appsettings.json", "RelativeDocumentMoniker": "appsettings.json", diff --git a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json index 4236a65..2b1d35d 100644 --- a/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json +++ b/.vs/AuthorBuddy.Web.slnx/v18/DocumentLayout.json @@ -3,13 +3,33 @@ "WorkspaceRootPath": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\ollamaassistant.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\ollamaassistant.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\layout\\mainlayout.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\layout\\mainlayout.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, + { + "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", + "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\settingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" + }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\isettingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\isettingsservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -26,14 +46,6 @@ "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\filescannerservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\filescannerservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\ollamasettings.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\ollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\models\\project.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:models\\project.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -58,14 +70,6 @@ "AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\AppDbContext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:Data\\AppDbContext.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\iollamaservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" - }, - { - "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}", - "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:components\\pages\\settings.razor||{40D31677-CBC0-4297-A9EF-89D907823A98}" - }, { "AbsoluteMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|e:\\ollama_net\\ollama\\authorbuddy.web\\services\\themeservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}", "RelativeMoniker": "D:0:0:{4F4697EF-EFFA-26AC-C8A1-C9859805D247}|AuthorBuddy.Web.csproj|solutionrelative:services\\themeservice.cs||{A6C744A8-0E4A-4FC6-886A-064283054674}" @@ -122,7 +126,7 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 4, + "SelectedChildIndex": 2, "Children": [ { "$type": "Bookmark", @@ -132,60 +136,22 @@ "$type": "Bookmark", "Name": "RST:0:0:{b3f9f954-0ca5-0091-76b4-34a47f44c954}" }, - { - "$type": "Document", - "DocumentIndex": 3, - "Title": "Program.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", - "RelativeDocumentMoniker": "Program.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", - "RelativeToolTip": "Program.cs", - "ViewState": "AgIAAAMAAAAAAAAAAAApwBoAAAANAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-20T04:07:21.54Z", - "EditorCaption": "" - }, - { - "$type": "Document", - "DocumentIndex": 2, - "Title": "ISettingsService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", - "RelativeDocumentMoniker": "Services\\ISettingsService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", - "RelativeToolTip": "Services\\ISettingsService.cs", - "ViewState": "AgIAABoAAAAAAAAAAAA8wCYAAAAPAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T13:21:26.951Z", - "EditorCaption": "" - }, { "$type": "Document", "DocumentIndex": 0, - "Title": "SettingsService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", - "RelativeDocumentMoniker": "Services\\SettingsService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", - "RelativeToolTip": "Services\\SettingsService.cs", - "ViewState": "AgIAADcBAAAAAAAAAAAQwEoBAAAIAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T06:05:12.928Z", + "Title": "OllamaAssistant.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\OllamaAssistant.razor", + "RelativeDocumentMoniker": "Components\\Pages\\OllamaAssistant.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\OllamaAssistant.razor*", + "RelativeToolTip": "Components\\Pages\\OllamaAssistant.razor*", + "ViewState": "AgIAAAkAAAAAAAAAAAAAABEAAABsAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-20T05:14:39.037Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 9, - "Title": "RagService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", - "RelativeDocumentMoniker": "Services\\RagService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", - "RelativeToolTip": "Services\\RagService.cs", - "ViewState": "AgIAABIAAAAAAAAAAAAxwBoAAAAIAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-18T15:40:05.413Z" - }, - { - "$type": "Document", - "DocumentIndex": 8, + "DocumentIndex": 11, "Title": "Project.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\Project.cs", "RelativeDocumentMoniker": "Models\\Project.cs", @@ -203,27 +169,27 @@ "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor", "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor", "RelativeToolTip": "Components\\Layout\\MainLayout.razor", - "ViewState": "AgIAALUAAAAAAAAAAAApwM4AAABAAAAAAAAAAA==", + "ViewState": "AgIAAH8AAAAAAAAAAAApwJMAAAAyAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", "WhenOpened": "2026-05-15T16:04:36.444Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 6, + "DocumentIndex": 4, "Title": "OllamaSettings.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\OllamaSettings.cs", "RelativeDocumentMoniker": "Models\\OllamaSettings.cs", "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\OllamaSettings.cs", "RelativeToolTip": "Models\\OllamaSettings.cs", - "ViewState": "AgIAAAIAAAAAAAAAAAAxwAUAAAA+AAAAAAAAAA==", + "ViewState": "AgIAAAYAAAAAAAAAAAAkwBQAAAASAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", "WhenOpened": "2026-05-16T13:39:46.179Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 13, + "DocumentIndex": 16, "Title": "AppDbContext.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\AppDbContext.cs", "RelativeDocumentMoniker": "Data\\AppDbContext.cs", @@ -234,7 +200,7 @@ }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 10, "Title": "FileScannerService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\FileScannerService.cs", "RelativeDocumentMoniker": "Services\\FileScannerService.cs", @@ -247,7 +213,97 @@ }, { "$type": "Document", - "DocumentIndex": 10, + "DocumentIndex": 5, + "Title": "IOllamaService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", + "RelativeDocumentMoniker": "Services\\IOllamaService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", + "RelativeToolTip": "Services\\IOllamaService.cs", + "ViewState": "AgIAAAAAAAAAAAAAAAAqwAkAAAAPAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T07:20:19.212Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 2, + "Title": "Settings.razor", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", + "RelativeDocumentMoniker": "Components\\Pages\\Settings.razor", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", + "RelativeToolTip": "Components\\Pages\\Settings.razor", + "ViewState": "AgIAAAwAAAAAAAAAAAAAAIYAAAAlAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", + "WhenOpened": "2026-05-15T16:43:26.6Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 6, + "Title": "SettingsService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", + "RelativeDocumentMoniker": "Services\\SettingsService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\SettingsService.cs", + "RelativeToolTip": "Services\\SettingsService.cs", + "ViewState": "AgIAAEUBAAAAAAAAAAAQwFwBAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T06:05:12.928Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 3, + "Title": "OllamaService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", + "RelativeDocumentMoniker": "Services\\OllamaService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", + "RelativeToolTip": "Services\\OllamaService.cs", + "ViewState": "AgIAAFkAAAAAAAAAAAAqwGsAAAAeAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T06:43:46.404Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 12, + "Title": "RagService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", + "RelativeDocumentMoniker": "Services\\RagService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\RagService.cs", + "RelativeToolTip": "Services\\RagService.cs", + "ViewState": "AgIAABIAAAAAAAAAAAAxwBoAAAAIAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-18T15:40:05.413Z" + }, + { + "$type": "Document", + "DocumentIndex": 7, + "Title": "ISettingsService.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", + "RelativeDocumentMoniker": "Services\\ISettingsService.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ISettingsService.cs", + "RelativeToolTip": "Services\\ISettingsService.cs", + "ViewState": "AgIAABoAAAAAAAAAAAA8wCoAAAAPAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-16T13:21:26.951Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 8, + "Title": "Program.cs", + "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", + "RelativeDocumentMoniker": "Program.cs", + "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Program.cs", + "RelativeToolTip": "Program.cs", + "ViewState": "AgIAAAMAAAAAAAAAAAApwBoAAAANAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", + "WhenOpened": "2026-05-20T04:07:21.54Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 13, "Title": "IRagService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IRagService.cs", "RelativeDocumentMoniker": "Services\\IRagService.cs", @@ -259,7 +315,7 @@ }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 9, "Title": "ProjectService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ProjectService.cs", "RelativeDocumentMoniker": "Services\\ProjectService.cs", @@ -272,19 +328,7 @@ }, { "$type": "Document", - "DocumentIndex": 7, - "Title": "OllamaService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", - "RelativeDocumentMoniker": "Services\\OllamaService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\OllamaService.cs", - "RelativeToolTip": "Services\\OllamaService.cs", - "ViewState": "AgIAAHoAAAAAAAAAAAAcwCoAAAAJAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T06:43:46.404Z" - }, - { - "$type": "Document", - "DocumentIndex": 12, + "DocumentIndex": 15, "Title": "NavMenu.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\NavMenu.razor", "RelativeDocumentMoniker": "Components\\Layout\\NavMenu.razor", @@ -296,20 +340,20 @@ }, { "$type": "Document", - "DocumentIndex": 11, + "DocumentIndex": 14, "Title": "Editor.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Editor.razor", "RelativeDocumentMoniker": "Components\\Pages\\Editor.razor", "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Editor.razor", "RelativeToolTip": "Components\\Pages\\Editor.razor", - "ViewState": "AgIAAAoAAACA6NuCpTYvwJkAAAAcAAAAAAAAAA==", + "ViewState": "AgIAAAoAAACA6NuCpTYvwKAAAAAcAAAAAAAAAA==", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", "WhenOpened": "2026-05-16T13:01:59.743Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 16, + "DocumentIndex": 17, "Title": "ThemeService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\ThemeService.cs", "RelativeDocumentMoniker": "Services\\ThemeService.cs", @@ -321,31 +365,7 @@ }, { "$type": "Document", - "DocumentIndex": 15, - "Title": "Settings.razor", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", - "RelativeDocumentMoniker": "Components\\Pages\\Settings.razor", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Settings.razor", - "RelativeToolTip": "Components\\Pages\\Settings.razor", - "ViewState": "AgIAAHMAAAAAAAAAAADwv4UAAAAAAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000759|", - "WhenOpened": "2026-05-15T16:43:26.6Z" - }, - { - "$type": "Document", - "DocumentIndex": 14, - "Title": "IOllamaService.cs", - "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", - "RelativeDocumentMoniker": "Services\\IOllamaService.cs", - "ToolTip": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IOllamaService.cs", - "RelativeToolTip": "Services\\IOllamaService.cs", - "ViewState": "AgIAAAAAAAAAAAAAAAAqwAkAAAAPAAAAAAAAAA==", - "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000738|", - "WhenOpened": "2026-05-16T07:20:19.212Z" - }, - { - "$type": "Document", - "DocumentIndex": 17, + "DocumentIndex": 18, "Title": "App.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\App.razor", "RelativeDocumentMoniker": "Components\\App.razor", @@ -357,7 +377,7 @@ }, { "$type": "Document", - "DocumentIndex": 20, + "DocumentIndex": 21, "Title": "Models.razor", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Pages\\Models.razor", "RelativeDocumentMoniker": "Components\\Pages\\Models.razor", @@ -369,7 +389,7 @@ }, { "$type": "Document", - "DocumentIndex": 18, + "DocumentIndex": 19, "Title": "LLM_Model.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\LLM_Model.cs", "RelativeDocumentMoniker": "Models\\LLM_Model.cs", @@ -381,7 +401,7 @@ }, { "$type": "Document", - "DocumentIndex": 19, + "DocumentIndex": 20, "Title": "ModelStatus.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Models\\ModelStatus.cs", "RelativeDocumentMoniker": "Models\\ModelStatus.cs", @@ -393,7 +413,7 @@ }, { "$type": "Document", - "DocumentIndex": 23, + "DocumentIndex": 24, "Title": "MainLayout.razor.css", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Components\\Layout\\MainLayout.razor.css", "RelativeDocumentMoniker": "Components\\Layout\\MainLayout.razor.css", @@ -405,7 +425,7 @@ }, { "$type": "Document", - "DocumentIndex": 21, + "DocumentIndex": 22, "Title": "IFileScannerService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IFileScannerService.cs", "RelativeDocumentMoniker": "Services\\IFileScannerService.cs", @@ -417,7 +437,7 @@ }, { "$type": "Document", - "DocumentIndex": 22, + "DocumentIndex": 23, "Title": "bootstrap-utilities.css", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\wwwroot\\lib\\bootstrap\\dist\\css\\bootstrap-utilities.css", "RelativeDocumentMoniker": "wwwroot\\lib\\bootstrap\\dist\\css\\bootstrap-utilities.css", @@ -429,7 +449,7 @@ }, { "$type": "Document", - "DocumentIndex": 25, + "DocumentIndex": 26, "Title": "ProjectEntity.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Data\\ProjectEntity.cs", "RelativeDocumentMoniker": "Data\\ProjectEntity.cs", @@ -441,7 +461,7 @@ }, { "$type": "Document", - "DocumentIndex": 24, + "DocumentIndex": 25, "Title": "IProjectService.cs", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\Services\\IProjectService.cs", "RelativeDocumentMoniker": "Services\\IProjectService.cs", @@ -453,7 +473,7 @@ }, { "$type": "Document", - "DocumentIndex": 26, + "DocumentIndex": 27, "Title": "AuthorBuddy.Web.csproj", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\AuthorBuddy.Web.csproj", "RelativeDocumentMoniker": "AuthorBuddy.Web.csproj", @@ -465,7 +485,7 @@ }, { "$type": "Document", - "DocumentIndex": 27, + "DocumentIndex": 28, "Title": "appsettings.json", "DocumentMoniker": "E:\\ollama_net\\ollama\\AuthorBuddy.Web\\appsettings.json", "RelativeDocumentMoniker": "appsettings.json", diff --git a/Components/Layout/MainLayout.razor b/Components/Layout/MainLayout.razor index 238a62d..e8c3fb5 100644 --- a/Components/Layout/MainLayout.razor +++ b/Components/Layout/MainLayout.razor @@ -11,54 +11,54 @@ @@ -78,9 +78,9 @@ { } } @@ -117,16 +117,16 @@ { @@ -136,16 +136,16 @@ { @@ -168,6 +168,7 @@ @code { + private string _language = "de"; private string? activeSection; private bool showProjectList; private List? projects; @@ -184,12 +185,16 @@ private string newFileName = string.Empty; private FileTreeItem? newFileParentDir; + private string T(string de, string en) => _language == "en" ? en : de; + [Inject] private NavigationManager Navigation { get; set; } = default!; protected override async Task OnInitializedAsync() { await SettingsService.InitializeAsync(); + _language = await SettingsService.GetLanguageAsync() ?? "de"; + statusText = T("Bereit", "Ready"); Navigation.LocationChanged += OnLocationChanged; await LoadProjects(); await LoadProjectContext(); @@ -341,7 +346,7 @@ var newPath = Path.Combine(dir, renameNewName); if (File.Exists(newPath)) { - statusText = "Datei existiert bereits."; + statusText = T("Datei existiert bereits.", "File already exists."); return; } File.Move(renameTarget.FullPath, newPath); @@ -349,11 +354,11 @@ if (currentFilePath == renameTarget.FullPath) SettingsService.CurrentFilePath = newPath; - statusText = $"Umbenannt zu: {renameNewName}"; + statusText = $"{T("Umbenannt zu:", "Renamed to:")} {renameNewName}"; } catch (Exception ex) { - statusText = $"Fehler: {ex.Message}"; + statusText = $"{T("Fehler:", "Error:")} {ex.Message}"; } finally { @@ -390,15 +395,15 @@ path += ".md"; if (File.Exists(path)) { - statusText = "Datei existiert bereits."; + statusText = T("Datei existiert bereits.", "File already exists."); return; } File.WriteAllText(path, $"# {Path.GetFileNameWithoutExtension(path)}\n\n"); - statusText = $"Erstellt: {Path.GetFileName(path)}"; + statusText = $"{T("Erstellt:", "Created:")} {Path.GetFileName(path)}"; } catch (Exception ex) { - statusText = $"Fehler: {ex.Message}"; + statusText = $"{T("Fehler:", "Error:")} {ex.Message}"; } finally { diff --git a/Components/Pages/Editor.razor b/Components/Pages/Editor.razor index 050f597..3ba41c1 100644 --- a/Components/Pages/Editor.razor +++ b/Components/Pages/Editor.razor @@ -11,10 +11,10 @@ @implements IDisposable @rendermode InteractiveServer -Editor - Author Buddy +@T("Editor - Author Buddy", "Editor - Author Buddy")
- +
@@ -24,37 +24,38 @@ { } - - - - - + + + + + +
@if (showVersionDialog) { }
- - - + +
@searchQuery
@@ -62,7 +63,7 @@ {
-

Rechtschreibprüfung - Änderungen:

+

@T("Rechtschreibpr\u00fcfung - \u00c4nderungen:", "Spell check - Changes:")

@@ -70,11 +71,11 @@ else if (ragResults != null && ragResults.Count > 0) {
-

Gefundene Fakten (RAG):

+

@T("Gefundene Fakten (RAG):", "Found facts (RAG):")

@foreach (var r in ragResults) {
-
Ähnlichkeit: @r.Similarity.ToString("P1")
+
@T("\u00c4hnlichkeit:", "Similarity:") @r.Similarity.ToString("P1")
@r.FilePath
@r.Text
@@ -84,7 +85,7 @@ else if (wikipediaResults != null && wikipediaResults.Count > 0) {
-

Wikipedia-Recherche:

+

@T("Wikipedia-Recherche:", "Wikipedia research:")

@foreach (var r in wikipediaResults) {
@@ -99,10 +100,12 @@ }
@@ -112,7 +115,7 @@ else if (!string.IsNullOrEmpty(analysisResult)) {
-

Ergebnis:

+

@T("Ergebnis:", "Result:")

@analysisResult
} @@ -122,26 +125,30 @@ { } @code { + private string _language = "de"; + + private string T(string de, string en) => _language == "en" ? en : de; + [Parameter] public string? Action { get; set; } @@ -150,7 +157,7 @@ private string editorContent = string.Empty; private string searchQuery = string.Empty; - private string statusText = "Bereit"; + private string statusText = string.Empty; private bool isChecking; private bool buttonDisabled; private double checkProgress; @@ -175,9 +182,21 @@ protected override async Task OnInitializedAsync() { + _language = await SettingsService.GetLanguageAsync() ?? "de"; + statusText = T("Bereit", "Ready"); + Navigation.LocationChanged += OnLocationChanged; + await LoadProjectContext(); + var pendingOutput = SettingsService.PendingAssistantOutput; + if (!string.IsNullOrEmpty(pendingOutput)) + { + SettingsService.PendingAssistantOutput = null; + editorContent = pendingOutput; + statusText = T("Text aus Assistent \u00fcbernommen.", "Text imported from assistant."); + } + if (string.Equals(Action, "newproject", StringComparison.OrdinalIgnoreCase)) { showCreateDialog = true; @@ -195,6 +214,12 @@ Navigation.LocationChanged -= OnLocationChanged; } + private void OpenAssistant() + { + SettingsService.PendingAssistantInput = editorContent; + Navigation.NavigateTo("/assistant"); + } + private void HandleSearchInput(ChangeEventArgs e) { searchQuery = e.Value?.ToString() ?? string.Empty; @@ -222,7 +247,7 @@ { currentFile = filePath; editorContent = await File.ReadAllTextAsync(filePath); - statusText = $"Geladen: {Path.GetFileName(filePath)}"; + statusText = $"{T("Geladen:", "Loaded:")} {Path.GetFileName(filePath)}"; RefreshLatestVersion(); } } @@ -232,7 +257,7 @@ if (string.IsNullOrWhiteSpace(editorContent)) return; isChecking = true; - statusText = "Ollama analysiert Stil..."; + statusText = T("Ollama analysiert Stil...", "Ollama analyzing style..."); checkProgress = 50; showSpellDiff = false; ragResults = null; @@ -240,15 +265,14 @@ try { - //analysisResult = await OllamaService.StreamStyleCheckAsync(editorContent); } catch (Exception ex) { - analysisResult = $"Fehler: {ex.Message}"; + analysisResult = $"{T("Fehler:", "Error:")} {ex.Message}"; } finally { - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); isChecking = false; checkProgress = 0; } @@ -259,7 +283,7 @@ if (string.IsNullOrWhiteSpace(editorContent)) return; isChecking = true; - statusText = "Ollama prüft Rechtschreibung..."; + statusText = T("Ollama pr\u00fcft Rechtschreibung...", "Ollama checking spelling..."); checkProgress = 50; showSpellDiff = false; ragResults = null; @@ -273,11 +297,11 @@ } catch (Exception ex) { - analysisResult = $"Fehler: {ex.Message}"; + analysisResult = $"{T("Fehler:", "Error:")} {ex.Message}"; } finally { - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); isChecking = false; checkProgress = 0; } @@ -288,7 +312,7 @@ if (string.IsNullOrWhiteSpace(searchQuery)) return; isChecking = true; - statusText = "Suche verwandte Fakten..."; + statusText = T("Suche verwandte Fakten...", "Searching related facts..."); showSpellDiff = false; analysisResult = string.Empty; ragResults = null; @@ -298,7 +322,7 @@ { if (currentProjectId == 0) { - analysisResult = "Kein Projekt geladen. Öffne zuerst ein Projekt über die Sidebar."; + analysisResult = T("Kein Projekt geladen. \u00d6ffne zuerst ein Projekt \u00fcber die Sidebar.", "No project loaded. Open a project via the sidebar first."); return; } @@ -306,16 +330,16 @@ if (ragResults.Count == 0) { - analysisResult = "Keine relevanten Fakten gefunden. Indexiere das Projekt ggf. über 'Projekt indexieren'."; + analysisResult = T("Keine relevanten Fakten gefunden. Indexiere das Projekt ggf. \u00fcber 'Projekt indexieren'.", "No relevant facts found. Index the project if needed via 'Index project'."); } } catch (Exception ex) { - analysisResult = $"RAG-Fehler: {ex.Message}"; + analysisResult = $"{T("RAG-Fehler:", "RAG error:")} {ex.Message}"; } finally { - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); isChecking = false; } } @@ -325,7 +349,7 @@ if (string.IsNullOrWhiteSpace(searchQuery)) return; isChecking = true; - statusText = "Suche auf Wikipedia..."; + statusText = T("Suche auf Wikipedia...", "Searching Wikipedia..."); showSpellDiff = false; analysisResult = string.Empty; ragResults = null; @@ -352,22 +376,22 @@ } if (wikipediaResults.Count == 0) - analysisResult = "Keine Wikipedia-Artikel gefunden."; + analysisResult = T("Keine Wikipedia-Artikel gefunden.", "No Wikipedia articles found."); } catch (Exception ex) { - analysisResult = $"Wikipedia-Fehler: {ex.Message}"; + analysisResult = $"{T("Wikipedia-Fehler:", "Wikipedia error:")} {ex.Message}"; } finally { - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); isChecking = false; } } private async Task LoadFullArticle(WikipediaResult result) { - statusText = $"Lade Artikel: {result.Title}..."; + statusText = $"{T("Lade Artikel:", "Loading article:")} {result.Title}..."; try { @@ -376,16 +400,16 @@ { result.Extract = fullText; loadedArticles[result.Url] = true; - statusText = "Artikel geladen."; + statusText = T("Artikel geladen.", "Article loaded."); } else { - statusText = "Konnte Artikel nicht laden."; + statusText = T("Konnte Artikel nicht laden.", "Could not load article."); } } catch (Exception ex) { - statusText = $"Fehler: {ex.Message}"; + statusText = $"{T("Fehler:", "Error:")} {ex.Message}"; } } @@ -393,7 +417,7 @@ { if (string.IsNullOrWhiteSpace(result.Extract) || currentProjectId == 0) return; - statusText = "Speichere als Fakt..."; + statusText = T("Speichere als Fakt...", "Saving as fact..."); try { @@ -401,7 +425,7 @@ var project = projects.FirstOrDefault(p => p.Id == currentProjectId); if (project == null) { - statusText = "Projekt nicht gefunden."; + statusText = T("Projekt nicht gefunden.", "Project not found."); return; } @@ -418,11 +442,11 @@ result.Extract; await File.WriteAllTextAsync(filePath, content); - statusText = $"Gespeichert als: {safeName}.md"; + statusText = $"{T("Gespeichert als:", "Saved as:")} {safeName}.md"; } catch (Exception ex) { - statusText = $"Fehler beim Speichern: {ex.Message}"; + statusText = $"{T("Fehler beim Speichern:", "Error saving:")} {ex.Message}"; } } @@ -444,7 +468,7 @@ if (string.IsNullOrWhiteSpace(newProjectName) || string.IsNullOrWhiteSpace(newProjectPath)) return; isChecking = true; - statusText = "Erstelle Projekt..."; + statusText = T("Erstelle Projekt...", "Creating project..."); try { @@ -457,12 +481,12 @@ } catch (Exception ex) { - analysisResult = $"Fehler beim Erstellen: {ex.Message}"; + analysisResult = $"{T("Fehler beim Erstellen:", "Error creating:")} {ex.Message}"; } finally { isChecking = false; - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); } } @@ -470,12 +494,12 @@ { if (currentProjectId == 0) { - analysisResult = "Kein Projekt geladen. Offne zuerst ein Projekt uber die Sidebar."; + analysisResult = T("Kein Projekt geladen. \u00d6ffne zuerst ein Projekt \u00fcber die Sidebar.", "No project loaded. Open a project via the sidebar first."); return; } isChecking = true; - statusText = "Indexiere Projekt..."; + statusText = T("Indexiere Projekt...", "Indexing project..."); analysisResult = string.Empty; ragResults = null; @@ -485,7 +509,7 @@ var project = projects.FirstOrDefault(p => p.Id == currentProjectId); if (project == null) { - analysisResult = "Projekt nicht gefunden."; + analysisResult = T("Projekt nicht gefunden.", "Project not found."); return; } @@ -496,15 +520,15 @@ }); await RagService.IndexProjectAsync(currentProjectId, project.RootPath, p); - analysisResult = "Projekt erfolgreich indexiert."; + analysisResult = T("Projekt erfolgreich indexiert.", "Project indexed successfully."); } catch (Exception ex) { - analysisResult = $"Indexierungsfehler: {ex.Message}"; + analysisResult = $"{T("Indexierungsfehler:", "Indexing error:")} {ex.Message}"; } finally { - statusText = "Bereit"; + statusText = T("Bereit", "Ready"); isChecking = false; } } @@ -513,7 +537,7 @@ { if (string.IsNullOrEmpty(currentFile)) return; await File.WriteAllTextAsync(currentFile, editorContent); - statusText = $"Gespeichert: {Path.GetFileName(currentFile)}"; + statusText = $"{T("Gespeichert:", "Saved:")} {Path.GetFileName(currentFile)}"; } private void ShowVersionDialog() @@ -540,7 +564,7 @@ var meta = $"Kommentar: {versionComment}"; await File.WriteAllTextAsync(versionPath + ".meta", meta); - statusText = $"Version gespeichert: {name}_{stamp}{ext}"; + statusText = $"{T("Version gespeichert:", "Version saved:")} {name}_{stamp}{ext}"; showVersionDialog = false; versionComment = string.Empty; RefreshLatestVersion(); @@ -588,11 +612,11 @@ try { editorContent = await File.ReadAllTextAsync(latestVersion.FilePath); - statusText = $"Version vom {latestVersion.Timestamp:dd.MM.yyyy HH:mm} geladen."; + statusText = $"{T("Version vom", "Version from")} {latestVersion.Timestamp:dd.MM.yyyy HH:mm} {T("geladen.", "loaded.")}"; } catch (Exception ex) { - statusText = $"Fehler: {ex.Message}"; + statusText = $"{T("Fehler:", "Error:")} {ex.Message}"; } } } diff --git a/Components/Pages/Error.razor b/Components/Pages/Error.razor index b1cb2b0..428e955 100644 --- a/Components/Pages/Error.razor +++ b/Components/Pages/Error.razor @@ -1,18 +1,25 @@ @page "/Error" +@inject ISettingsService SettingsService @rendermode InteractiveServer -Fehler +@T("Fehler", "Error") -

Ein Fehler ist aufgetreten

-

Entschuldigung, es ist ein unerwarteter Fehler aufgetreten.

-Zurück zur Startseite +

@T("Ein Fehler ist aufgetreten", "An error occurred")

+

@T("Entschuldigung, es ist ein unerwarteter Fehler aufgetreten.", "Sorry, an unexpected error occurred.")

+@T("Zurück zur Startseite", "Back to home") @code { + private string _language = "de"; + + private string T(string de, string en) => _language == "en" ? en : de; + [CascadingParameter] private HttpContext? HttpContext { get; set; } - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { + _language = await SettingsService.GetLanguageAsync() ?? "de"; + if (HttpContext is not null) { HttpContext.Response.StatusCode = StatusCodes.Status500InternalServerError; diff --git a/Components/Pages/Home.razor b/Components/Pages/Home.razor index b078288..4868f55 100644 --- a/Components/Pages/Home.razor +++ b/Components/Pages/Home.razor @@ -1,11 +1,13 @@ @page "/" @inject IOllamaService OllamaService @inject IProjectService ProjectService -Dashboard - Author Buddy +@inject ISettingsService SettingsService + +@T("Dashboard - Author Buddy", "Dashboard - Author Buddy")
-
Gefundene Fakten (RAG)
-
Stil-Analyse
+
@T("Gefundene Fakten (RAG)", "Found facts (RAG)")
+
@T("Stil-Analyse", "Style analysis")
@@ -13,7 +15,7 @@ { @if (foundFacts.Count == 0) { -

Keine Fakten gefunden. Öffne ein Projekt und scanne die Dateien.

+

@T("Keine Fakten gefunden. Öffne ein Projekt und scanne die Dateien.", "No facts found. Open a project and scan the files.")

} else { @@ -30,10 +32,18 @@
@code { + private string _language = "de"; private string activeTab = "rag"; private List foundFacts = new(); private string styleSuggestions = string.Empty; + private string T(string de, string en) => _language == "en" ? en : de; + + protected override async Task OnInitializedAsync() + { + _language = await SettingsService.GetLanguageAsync() ?? "de"; + } + private string GetTabClass(string tab) { return activeTab == tab ? "active" : ""; diff --git a/Components/Pages/Models.razor b/Components/Pages/Models.razor index 1525164..df53850 100644 --- a/Components/Pages/Models.razor +++ b/Components/Pages/Models.razor @@ -1,18 +1,19 @@ @page "/models" @inject IOllamaService OllamaService +@inject ISettingsService SettingsService @inject NavigationManager Navigation -Modelle - Author Buddy +@T("Modelle - Author Buddy", "Models - Author Buddy")
-

Ollama Modelle verwalten

- +

@T("Ollama Modelle verwalten", "Manage Ollama models")

+
@if (isLoading) { -

Lade Modelle...

+

@T("Lade Modelle...", "Loading models...")

} else if (!string.IsNullOrEmpty(errorMessage)) { @@ -26,8 +27,8 @@ else
@model.Name
- Größe: @FormatSize(model.Size) | - Geändert: @model.ModifiedAt?.ToString("g") + @T("Größe:", "Size:") @FormatSize(model.Size) | + @T("Geändert:", "Modified:") @model.ModifiedAt?.ToString("g")
} @@ -35,14 +36,14 @@ else }
-

Neues Modell herunterladen

+

@T("Neues Modell herunterladen", "Download new model")

- - + +
@if (isPulling) @@ -64,6 +65,7 @@ else } @code { + private string _language = "de"; private List localModels = new(); private bool isLoading; private string? errorMessage; @@ -74,8 +76,11 @@ else private string? pullResult; private string pullPercentDisplay => $"{pullProgress:F0}%"; + private string T(string de, string en) => _language == "en" ? en : de; + protected override async Task OnInitializedAsync() { + _language = await SettingsService.GetLanguageAsync() ?? "de"; await RefreshModels(); } @@ -91,7 +96,7 @@ else } catch (Exception ex) { - errorMessage = $"Fehler beim Laden der Modelle: {ex.Message}"; + errorMessage = $"{T("Fehler beim Laden der Modelle:", "Error loading models:")} {ex.Message}"; localModels = new(); } finally @@ -106,7 +111,7 @@ else isPulling = true; pullProgress = 0; - pullStatus = "Starte Download..."; + pullStatus = T("Starte Download...", "Starting download..."); pullResult = null; try @@ -118,13 +123,13 @@ else }); await OllamaService.PullModelAsync(modelToPull, progress); - pullResult = $"Modell '{modelToPull}' erfolgreich heruntergeladen."; + pullResult = $"{T("Modell", "Model")} '{modelToPull}' {T("erfolgreich heruntergeladen.", "downloaded successfully.")}"; modelToPull = string.Empty; await RefreshModels(); } catch (Exception ex) { - pullResult = $"Fehler: {ex.Message}"; + pullResult = $"{T("Fehler:", "Error:")} {ex.Message}"; } finally { @@ -134,7 +139,7 @@ else private static string FormatSize(long? bytes) { - if (!bytes.HasValue) return "Unbekannt"; + if (!bytes.HasValue) return "---"; if (bytes < 1024 * 1024) return $"{bytes / 1024.0:F1} KB"; if (bytes < 1024 * 1024 * 1024) return $"{bytes / (1024.0 * 1024):F1} MB"; return $"{bytes / (1024.0 * 1024 * 1024):F1} GB"; diff --git a/Components/Pages/NotFound.razor b/Components/Pages/NotFound.razor index 2cf46db..0815110 100644 --- a/Components/Pages/NotFound.razor +++ b/Components/Pages/NotFound.razor @@ -1,18 +1,25 @@ @page "/not-found" +@inject ISettingsService SettingsService @rendermode InteractiveServer -Seite nicht gefunden +@T("Seite nicht gefunden", "Page not found") -

404 - Seite nicht gefunden

-

Die angeforderte Seite existiert nicht.

-Zurück zur Startseite +

@T("404 - Seite nicht gefunden", "404 - Page not found")

+

@T("Die angeforderte Seite existiert nicht.", "The requested page does not exist.")

+@T("Zurück zur Startseite", "Back to home") @code { + private string _language = "de"; + + private string T(string de, string en) => _language == "en" ? en : de; + [CascadingParameter] private HttpContext? HttpContext { get; set; } - protected override void OnInitialized() + protected override async Task OnInitializedAsync() { + _language = await SettingsService.GetLanguageAsync() ?? "de"; + if (HttpContext is not null) { HttpContext.Response.StatusCode = StatusCodes.Status404NotFound; diff --git a/Components/Pages/OllamaAssistant.razor b/Components/Pages/OllamaAssistant.razor index 9b92693..c666553 100644 --- a/Components/Pages/OllamaAssistant.razor +++ b/Components/Pages/OllamaAssistant.razor @@ -5,16 +5,21 @@ @rendermode InteractiveServer -Assistent - Author Buddy +@T("Assistent - Author Buddy", "Assistant - Author Buddy")
- + + @if (!string.IsNullOrEmpty(outputText)) + { + + } @statusText @if (isRunning) { @@ -24,11 +29,11 @@
-

Eingabetext

- +

@T("Eingabetext", "Input text")

+
-

Ergebnis

+

@T("Ergebnis", "Result")

@if (!string.IsNullOrEmpty(outputText)) { @@ -40,7 +45,7 @@ } else { - Ergebnis erscheint hier nach der Ausführung. + @T("Ergebnis erscheint hier nach der Ausführung.", "Result appears here after execution.") }
@@ -48,17 +53,28 @@
@code { - private string selectedMode = "advocatus"; + private string _language = "de"; + private string selectedMode = "lektorat"; private string inputText = string.Empty; private string outputText = string.Empty; private string errorMessage = string.Empty; - private string statusText = "Bereit"; + private string statusText = string.Empty; private bool isRunning; private double progress; + private string T(string de, string en) => _language == "en" ? en : de; + protected override async Task OnInitializedAsync() { - await base.OnInitializedAsync(); + _language = await SettingsService.GetLanguageAsync() ?? "de"; + statusText = T("Bereit", "Ready"); + + var pending = SettingsService.PendingAssistantInput; + if (!string.IsNullOrEmpty(pending)) + { + inputText = pending; + SettingsService.PendingAssistantInput = null; + } } private async Task RunAssistant() @@ -69,12 +85,13 @@ progress = 50; outputText = string.Empty; errorMessage = string.Empty; - statusText = "Verarbeite..."; + statusText = T("Verarbeite...", "Processing..."); try { var systemPrompt = selectedMode switch { + "lektorat" => await SettingsService.GetLektorSystemPromptAsync() ?? string.Empty, "advocatus" => await SettingsService.GetAdvocatusDiaboliPromptAsync() ?? string.Empty, "hookfinder" => await SettingsService.GetHookFinderPromptAsync() ?? string.Empty, "eli5" => await SettingsService.GetEli5PromptAsync() ?? string.Empty, @@ -83,18 +100,18 @@ if (string.IsNullOrEmpty(systemPrompt)) { - errorMessage = "Kein System-Prompt für diesen Modus konfiguriert. Bitte in den Einstellungen hinterlegen."; + errorMessage = T("Kein System-Prompt für diesen Modus konfiguriert. Bitte in den Einstellungen hinterlegen.", "No system prompt configured for this mode. Please configure in settings."); return; } var model = await SettingsService.GetStyleModelAsync() ?? "llama3.2"; outputText = await OllamaService.Chat(model, inputText, systemPrompt); - statusText = "Fertig."; + statusText = T("Fertig.", "Done."); } catch (Exception ex) { - errorMessage = $"Fehler: {ex.Message}"; - statusText = "Fehler"; + errorMessage = $"{T("Fehler:", "Error:")} {ex.Message}"; + statusText = T("Fehler", "Error"); } finally { @@ -102,4 +119,10 @@ progress = 0; } } + + private void SendToEditor() + { + SettingsService.PendingAssistantOutput = outputText; + Navigation.NavigateTo("/editor"); + } } diff --git a/Components/Pages/Settings.razor b/Components/Pages/Settings.razor index c95a6ac..0033ac3 100644 --- a/Components/Pages/Settings.razor +++ b/Components/Pages/Settings.razor @@ -6,14 +6,14 @@ @inject IJSRuntime JSRuntime @inject IProjectService ProjectService -Einstellungen - Author Buddy +@T("Einstellungen", "Settings") - Author Buddy
-

Benutzer

+

@T("Benutzer", "User")

- +
- +
- - + +
-
+
-

Modelle

+

@T("Modelle", "Models")

- +
- +
- + -
Adresse des Ollama-Servers
+
@T("Adresse des Ollama-Servers", "Ollama server address")
-

Design

+

@T("Design", "Appearance")

- + +
+
+ +
+

@T("Sprache", "Language")

+
+ +
-
+
-

Lektor-System-Prompt

+

@T("Lektor-System-Prompt", "Editor system prompt")

-

Fact-Check-Vorlage

+

@T("Fact-Check-Vorlage", "Fact check template")

-

Rechtschreibprüfungs-Prompt

+

@T("Rechtschreibpr\u00fcfungs-Prompt", "Spell check prompt")

-
+
-

Advocatus Diaboli

+

@T("Advocatus Diaboli", "Advocatus Diaboli")

-

Hook-Finder

+

@T("Hook-Finder", "Hook finder")

-

ELI5-Vereinfachung

+

@T("ELI5-Vereinfachung", "ELI5-Simplification")

@@ -147,7 +158,7 @@
- + @if (!string.IsNullOrEmpty(statusMessage)) { @statusMessage @@ -168,6 +179,7 @@ private string advocatusDiaboliPrompt = string.Empty; private string hookFinderPrompt = string.Empty; private string eli5Prompt = string.Empty; + private string selectedLanguage = "de"; private string newProjectName = string.Empty; private string newUserName = string.Empty; private string statusMessage = string.Empty; @@ -175,6 +187,8 @@ private List users = new(); private int selectedUserId; + private string T(string de, string en) => selectedLanguage == "en" ? en : de; + protected override async Task OnInitializedAsync() { users = await SettingsService.GetUsersAsync(); @@ -207,6 +221,7 @@ advocatusDiaboliPrompt = await SettingsService.GetAdvocatusDiaboliPromptAsync() ?? string.Empty; hookFinderPrompt = await SettingsService.GetHookFinderPromptAsync() ?? string.Empty; eli5Prompt = await SettingsService.GetEli5PromptAsync() ?? string.Empty; + selectedLanguage = await SettingsService.GetLanguageAsync() ?? "de"; } private async Task SwitchUser(ChangeEventArgs e) @@ -225,7 +240,7 @@ var user = await SettingsService.CreateUserAsync(newUserName); users.Add(user); newUserName = string.Empty; - statusMessage = $"Benutzer '{user.Name}' erstellt."; + statusMessage = T($"Benutzer '{user.Name}' erstellt.", $"User '{user.Name}' created."); } private async Task SaveSettings() @@ -238,7 +253,9 @@ var ok = await OllamaService.TestEmbeddingAsync(ragModel); if (!ok) { - statusMessage = $"Modell '{ragModel}' unterstützt keine Embeddings. RAG-Modell nicht gespeichert."; + statusMessage = selectedLanguage == "en" + ? $"Model '{ragModel}' does not support embeddings. RAG model not saved." + : $"Modell '{ragModel}' unterstützt keine Embeddings. RAG-Modell nicht gespeichert."; return; } } @@ -252,8 +269,9 @@ await SettingsService.SaveAdvocatusDiaboliPromptAsync(advocatusDiaboliPrompt); await SettingsService.SaveHookFinderPromptAsync(hookFinderPrompt); await SettingsService.SaveEli5PromptAsync(eli5Prompt); + await SettingsService.SaveLanguageAsync(selectedLanguage); - statusMessage = "Einstellungen gespeichert."; + statusMessage = T("Einstellungen gespeichert.", "Settings saved."); await ThemeService.ApplyTheme(selectedTheme); } } diff --git a/Models/OllamaSettings.cs b/Models/OllamaSettings.cs index 8f66ebe..5807be1 100644 --- a/Models/OllamaSettings.cs +++ b/Models/OllamaSettings.cs @@ -7,6 +7,7 @@ public class OllamaSettings public string SpellingModel { get; set; } = "phi3:mini"; public string OllamaUrl { get; set; } = "http://localhost:11434"; public string Theme { get; set; } = "light"; + public string Language { get; set; } = "de"; public string LektorSystemPrompt { get; set; } = "Du bist ein erfahrener Lektor. Analysiere den Text des Autors. " + "Optimiere ihn auf einen lebendigen, anschaulichen und subjektiven Stil. " + @@ -26,6 +27,29 @@ public class OllamaSettings public string Eli5Prompt { get; set; } = "Wo ist der Text zu kompliziert geschrieben? Liefere mir konkrete Vorschläge, wie ich komplexe Absätze einfacher formulieren kann, ohne den Kern zu verlieren."; + public string LektorSystemPromptEn { get; } = "You are an experienced editor. Analyze the author's text. " + + "Optimize it for a vivid, descriptive, and subjective style. " + + "Use strong verbs, avoid unnecessary adjectives, and follow 'Show, don't tell'. " + + "Respond directly with the improved text or concrete suggestions."; + + public string FactCheckTemplateEn { get; } = "FACTS FROM DATABASE:\n{0}\n\n" + + "QUESTION / CONTEXT:\n{1}\n\n" + + "Based on the facts, write a short, vivid addition or correction."; + + public string SpellingPromptEn { get; } = "You are a spell checker. Correct ONLY errors (spelling/grammar). " + + "Do not change the style. Return only the corrected text."; + + public string AdvocatusDiaboliPromptEn { get; } = "Take a radical opposing position to my text. What weaknesses in my argumentation do you notice?"; + + public string HookFinderPromptEn { get; } = "Generate 5 emotional, captivating opening sentences (hooks) for this text that immediately grab the reader's attention."; + + public string Eli5PromptEn { get; } = "Where is the text too complicated? Give me concrete suggestions on how to simplify complex paragraphs without losing the core message."; + + public string GetDefaultPrompt(string dePrompt, string enPrompt, string currentLanguage) + { + return currentLanguage == "en" ? enPrompt : dePrompt; + } + public string GetFactCheckPrompt(string question, string facts) { return string.Format(FactCheckTemplate, question, facts); diff --git a/Services/ISettingsService.cs b/Services/ISettingsService.cs index 7feea40..d566953 100644 --- a/Services/ISettingsService.cs +++ b/Services/ISettingsService.cs @@ -28,6 +28,8 @@ public interface ISettingsService Task SaveAdvocatusDiaboliPromptAsync(string prompt); Task SaveHookFinderPromptAsync(string prompt); Task SaveEli5PromptAsync(string prompt); + Task GetLanguageAsync(); + Task SaveLanguageAsync(string language); Task> GetUsersAsync(); Task GetCurrentUserAsync(); @@ -36,6 +38,8 @@ public interface ISettingsService int? CurrentProjectId { get; set; } string? CurrentFilePath { get; set; } + string? PendingAssistantInput { get; set; } + string? PendingAssistantOutput { get; set; } Task GetLastProjectIdAsync(); Task SaveLastProjectIdAsync(int projectId); Task LoadProjectSettingsAsync(); diff --git a/Services/SettingsService.cs b/Services/SettingsService.cs index 7df40ec..5738344 100644 --- a/Services/SettingsService.cs +++ b/Services/SettingsService.cs @@ -17,6 +17,9 @@ public class SettingsService : ISettingsService private const string KeyAdvocatusDiaboli = "ollama_advocatus_diaboli"; private const string KeyHookFinder = "ollama_hook_finder"; private const string KeyEli5 = "ollama_eli5"; + private const string KeyLanguage = "language"; + + private const string KeyLastProjectId = "last_project_id"; private readonly ILiteDatabase _db; private readonly OllamaSettings _ollamaConfig; @@ -36,8 +39,8 @@ public class SettingsService : ISettingsService } public string? CurrentFilePath { get; set; } - - private const string KeyLastProjectId = "last_project_id"; + public string? PendingAssistantInput { get; set; } + public string? PendingAssistantOutput { get; set; } public Task GetLastProjectIdAsync() { @@ -125,6 +128,13 @@ public class SettingsService : ISettingsService public Task GetHookFinderPromptAsync() => Task.FromResult(Get(KeyHookFinder)); public Task GetEli5PromptAsync() => Task.FromResult(Get(KeyEli5)); public Task GetThemeAsync() => Task.FromResult(Get(KeyTheme)); + public Task GetLanguageAsync() => Task.FromResult(Get(KeyLanguage)); + public Task SaveLanguageAsync(string language) + { + Set(KeyLanguage, language); + _ollamaConfig.Language = language; + return Task.CompletedTask; + } public Task SaveOllamaUrlAsync(string url) { @@ -252,6 +262,7 @@ public class SettingsService : ISettingsService (KeyAdvocatusDiaboli, val => _ollamaConfig.AdvocatusDiaboliPrompt = val), (KeyHookFinder, val => _ollamaConfig.HookFinderPrompt = val), (KeyEli5, val => _ollamaConfig.Eli5Prompt = val), + (KeyLanguage, val => _ollamaConfig.Language = val), }; foreach (var entry in entries) @@ -281,6 +292,8 @@ public class SettingsService : ISettingsService _currentUserId = current?.Id ?? users.FindAll().First().Id; } + var lang = _ollamaConfig.Language; + var entries = new (string Key, string Default)[] { (KeyOllamaUrl, _ollamaConfig.OllamaUrl), @@ -288,12 +301,13 @@ public class SettingsService : ISettingsService (KeyStyleModel, _ollamaConfig.StyleModel), (KeySpellingModel, _ollamaConfig.SpellingModel), (KeyTheme, _ollamaConfig.Theme), - (KeyLektorPrompt, _ollamaConfig.LektorSystemPrompt), - (KeyFactCheckTemplate, _ollamaConfig.FactCheckTemplate), - (KeySpellingPrompt, _ollamaConfig.SpellingPrompt), - (KeyAdvocatusDiaboli, _ollamaConfig.AdvocatusDiaboliPrompt), - (KeyHookFinder, _ollamaConfig.HookFinderPrompt), - (KeyEli5, _ollamaConfig.Eli5Prompt), + (KeyLanguage, lang), + (KeyLektorPrompt, lang == "en" ? _ollamaConfig.LektorSystemPromptEn : _ollamaConfig.LektorSystemPrompt), + (KeyFactCheckTemplate, lang == "en" ? _ollamaConfig.FactCheckTemplateEn : _ollamaConfig.FactCheckTemplate), + (KeySpellingPrompt, lang == "en" ? _ollamaConfig.SpellingPromptEn : _ollamaConfig.SpellingPrompt), + (KeyAdvocatusDiaboli, lang == "en" ? _ollamaConfig.AdvocatusDiaboliPromptEn : _ollamaConfig.AdvocatusDiaboliPrompt), + (KeyHookFinder, lang == "en" ? _ollamaConfig.HookFinderPromptEn : _ollamaConfig.HookFinderPrompt), + (KeyEli5, lang == "en" ? _ollamaConfig.Eli5PromptEn : _ollamaConfig.Eli5Prompt), }; foreach (var entry in entries) @@ -309,6 +323,7 @@ public class SettingsService : ISettingsService else if (entry.Key == KeyStyleModel) _ollamaConfig.StyleModel = val; else if (entry.Key == KeySpellingModel) _ollamaConfig.SpellingModel = val; else if (entry.Key == KeyTheme) _ollamaConfig.Theme = val; + else if (entry.Key == KeyLanguage) _ollamaConfig.Language = val; else if (entry.Key == KeyLektorPrompt) _ollamaConfig.LektorSystemPrompt = val; else if (entry.Key == KeyFactCheckTemplate) _ollamaConfig.FactCheckTemplate = val; else if (entry.Key == KeySpellingPrompt) _ollamaConfig.SpellingPrompt = val; diff --git a/wwwroot/app.css b/wwwroot/app.css index 036b90d..5bd7eff 100644 --- a/wwwroot/app.css +++ b/wwwroot/app.css @@ -613,12 +613,12 @@ button.primary { /* Settings page */ .settings-page { - max-width: 960px; + width: 100%; } .settings-layout { display: grid; - grid-template-columns: 1fr 1fr 1fr; + grid-template-columns: 1fr 2fr 2fr; gap: 16px; }