Improve: Recategorize page error display and provider detection
Add error message alert for failed proposal applications. Derive AI provider name from model prefix instead of separate config key. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,13 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
@if (!string.IsNullOrEmpty(Model.ErrorMessage))
|
||||
{
|
||||
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||
@Model.ErrorMessage
|
||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-4">
|
||||
|
||||
@@ -26,11 +26,24 @@ namespace MoneyMap.Pages
|
||||
}
|
||||
|
||||
public RecategorizeStats Stats { get; set; } = new();
|
||||
public string AIProvider => _config["AI:CategorizationProvider"] ?? "OpenAI";
|
||||
public string AIProvider
|
||||
{
|
||||
get
|
||||
{
|
||||
var model = _config["AI:ReceiptParsingModel"] ?? "gpt-4o-mini";
|
||||
if (model.StartsWith("llamacpp:", StringComparison.OrdinalIgnoreCase)) return "LlamaCpp";
|
||||
if (model.StartsWith("ollama:", StringComparison.OrdinalIgnoreCase)) return "Ollama";
|
||||
if (model.StartsWith("claude-", StringComparison.OrdinalIgnoreCase)) return "Anthropic";
|
||||
return "OpenAI";
|
||||
}
|
||||
}
|
||||
|
||||
[TempData]
|
||||
public string? SuccessMessage { get; set; }
|
||||
|
||||
[TempData]
|
||||
public string? ErrorMessage { get; set; }
|
||||
|
||||
public async Task OnGetAsync()
|
||||
{
|
||||
await LoadStatsAsync();
|
||||
|
||||
Reference in New Issue
Block a user