From feaf7b8abdc461b616b0be5a4432555012ceafb6 Mon Sep 17 00:00:00 2001 From: MacRimi Date: Tue, 17 Mar 2026 14:56:23 +0100 Subject: [PATCH] Update notification-settings.tsx --- AppImage/components/notification-settings.tsx | 122 ++++++++++-------- 1 file changed, 70 insertions(+), 52 deletions(-) diff --git a/AppImage/components/notification-settings.tsx b/AppImage/components/notification-settings.tsx index 4a4eafb3..a46340de 100644 --- a/AppImage/components/notification-settings.tsx +++ b/AppImage/components/notification-settings.tsx @@ -14,7 +14,7 @@ import { Bell, BellOff, Send, CheckCircle2, XCircle, Loader2, AlertTriangle, Info, Settings2, Zap, Eye, EyeOff, Trash2, ChevronDown, ChevronUp, ChevronRight, TestTube2, Mail, Webhook, - Copy, Server, Shield + Copy, Server, Shield, ExternalLink } from "lucide-react" interface ChannelConfig { @@ -110,37 +110,43 @@ const AI_PROVIDERS = [ value: "groq", label: "Groq", model: "llama-3.3-70b-versatile", - description: "Very fast, generous free tier (30 req/min). Ideal to start." + description: "Very fast, generous free tier (30 req/min). Ideal to start.", + keyUrl: "https://console.groq.com/keys" }, { value: "openai", label: "OpenAI", model: "gpt-4o-mini", - description: "Industry standard. Very accurate and widely used." + description: "Industry standard. Very accurate and widely used.", + keyUrl: "https://platform.openai.com/api-keys" }, { value: "anthropic", label: "Anthropic (Claude)", model: "claude-3-haiku-20240307", - description: "Excellent for writing and translation. Fast and economical." + description: "Excellent for writing and translation. Fast and economical.", + keyUrl: "https://console.anthropic.com/settings/keys" }, { value: "gemini", label: "Google Gemini", model: "gemini-1.5-flash", - description: "Free tier available, great quality/price ratio." + description: "Free tier available, great quality/price ratio.", + keyUrl: "https://aistudio.google.com/app/apikey" }, { value: "ollama", label: "Ollama (Local)", model: "llama3.2", - description: "100% local execution. No costs, total privacy, no internet required." + description: "100% local execution. No costs, total privacy, no internet required.", + keyUrl: "" }, { value: "openrouter", label: "OpenRouter", model: "meta-llama/llama-3.3-70b-instruct", - description: "Aggregator with access to 100+ models using a single API key. Maximum flexibility." + description: "Aggregator with access to 100+ models using a single API key. Maximum flexibility.", + keyUrl: "https://openrouter.ai/keys" }, ] @@ -1330,12 +1336,12 @@ export function NotificationSettings() { {config.ai_enabled && ( <> {/* Provider + Info button */} -
+
- + @@ -1345,7 +1351,7 @@ export function NotificationSettings() { onValueChange={v => updateConfig(p => ({ ...p, ai_provider: v }))} disabled={!editMode} > - + @@ -1358,10 +1364,10 @@ export function NotificationSettings() { {/* Ollama URL (conditional) */} {config.ai_provider === "ollama" && ( -
- +
+ updateConfig(p => ({ ...p, ai_ollama_url: e.target.value }))} @@ -1372,32 +1378,44 @@ export function NotificationSettings() { {/* API Key (not shown for Ollama) */} {config.ai_provider !== "ollama" && ( -
- -
+
+ +
updateConfig(p => ({ ...p, ai_api_key: e.target.value }))} disabled={!editMode} />
)} {/* Model (optional) */} -
- +
+ p.value === config.ai_provider)?.model || ""} value={config.ai_model} onChange={e => updateConfig(p => ({ ...p, ai_model: e.target.value }))} @@ -1406,14 +1424,14 @@ export function NotificationSettings() {
{/* Language selector */} -
- +
+ updateConfig(p => ({ @@ -1472,12 +1490,12 @@ export function NotificationSettings() { }))} disabled={!editMode} > - + {AI_DETAIL_LEVELS.map(l => ( - + {l.label} ))} @@ -1488,9 +1506,9 @@ export function NotificationSettings() {
-
- -

+

+ +

AI enhancement translates and formats notifications to your selected language. Each channel can have different detail levels. If the AI service is unavailable, standard templates are used as fallback.

@@ -1506,8 +1524,8 @@ export function NotificationSettings() { {/* ── Footer info ── */}
- -

+ +

{config.enabled ? "Notifications are active. Each channel sends events based on its own category and event selection." : "Enable notifications to receive alerts about system events, health status changes, and security incidents via Telegram, Gotify, Discord, or Email."} @@ -1520,24 +1538,24 @@ export function NotificationSettings() {

- AI Providers Information + AI Providers Information
{AI_PROVIDERS.map(provider => (
- {provider.label} + {provider.label} {provider.value === "ollama" && ( - Local + Local )}
-
- Default model: {provider.model} +
+ Default model: {provider.model}
-

+

{provider.description}