51 lines
1.7 KiB
Text
51 lines
1.7 KiB
Text
@page "/"
|
|
@inject IOllamaService OllamaService
|
|
@inject IProjectService ProjectService
|
|
@inject ISettingsService SettingsService
|
|
|
|
<PageTitle>@T("Dashboard - Author Buddy", "Dashboard - Author Buddy")</PageTitle>
|
|
|
|
<div class="tab-bar">
|
|
<div class="tab @GetTabClass("rag")" @onclick='() => activeTab = "rag"'>@T("Gefundene Fakten (RAG)", "Found facts (RAG)")</div>
|
|
<div class="tab @GetTabClass("style")" @onclick='() => activeTab = "style"'>@T("Stil-Analyse", "Style analysis")</div>
|
|
</div>
|
|
|
|
<div class="tab-content">
|
|
@if (activeTab == "rag")
|
|
{
|
|
@if (foundFacts.Count == 0)
|
|
{
|
|
<p style="color: var(--border-color);">@T("Keine Fakten gefunden. Öffne ein Projekt und scanne die Dateien.", "No facts found. Open a project and scan the files.")</p>
|
|
}
|
|
else
|
|
{
|
|
@foreach (var fact in foundFacts)
|
|
{
|
|
<div class="fact-card">@fact</div>
|
|
}
|
|
}
|
|
}
|
|
else if (activeTab == "style")
|
|
{
|
|
<textarea style="width: 100%; min-height: 300px; background: var(--editor-bg); color: var(--text-color); border: 1px solid var(--border-color); padding: 8px; font-family: Consolas;" readonly>@styleSuggestions</textarea>
|
|
}
|
|
</div>
|
|
|
|
@code {
|
|
private string _language = "de";
|
|
private string activeTab = "rag";
|
|
private List<string> 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" : "";
|
|
}
|
|
}
|