mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-27 21:50:39 +00:00
update notification service
This commit is contained in:
@@ -548,9 +548,9 @@ export function NotificationSettings() {
|
|||||||
ai_language: cfg.ai_language,
|
ai_language: cfg.ai_language,
|
||||||
ai_ollama_url: cfg.ai_ollama_url,
|
ai_ollama_url: cfg.ai_ollama_url,
|
||||||
ai_openai_base_url: cfg.ai_openai_base_url,
|
ai_openai_base_url: cfg.ai_openai_base_url,
|
||||||
ai_prompt_mode: cfg.ai_prompt_mode || "default",
|
ai_prompt_mode: cfg.ai_prompt_mode || "default",
|
||||||
ai_custom_prompt: cfg.ai_custom_prompt || "",
|
ai_custom_prompt: cfg.ai_custom_prompt || "",
|
||||||
ai_allow_suggestions: cfg.ai_allow_suggestions || "false",
|
ai_allow_suggestions: String(cfg.ai_allow_suggestions === "true" || cfg.ai_allow_suggestions === true),
|
||||||
hostname: cfg.hostname,
|
hostname: cfg.hostname,
|
||||||
webhook_secret: cfg.webhook_secret,
|
webhook_secret: cfg.webhook_secret,
|
||||||
webhook_allowed_ips: cfg.webhook_allowed_ips,
|
webhook_allowed_ips: cfg.webhook_allowed_ips,
|
||||||
@@ -1852,41 +1852,39 @@ export function NotificationSettings() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Experimental: AI Suggestions toggle */}
|
{/* Experimental: AI Suggestions toggle */}
|
||||||
<div className="mt-3 p-4 rounded-lg bg-muted/30 border border-border/50">
|
<div className="flex items-center justify-between pt-3 border-t border-border/50">
|
||||||
<div className="flex items-center justify-between">
|
<div className="flex items-start gap-3">
|
||||||
<div className="flex items-start gap-3">
|
<Lightbulb className="h-5 w-5 text-purple-400 mt-0.5 shrink-0" />
|
||||||
<Lightbulb className="h-5 w-5 text-yellow-400 mt-0.5 shrink-0" />
|
<div>
|
||||||
<div>
|
<div className="flex items-center gap-2">
|
||||||
<div className="flex items-center gap-2">
|
<span className="text-sm font-medium">AI Suggestions</span>
|
||||||
<span className="text-sm font-medium">AI Suggestions</span>
|
<span className="text-[10px] px-1.5 py-0.5 rounded bg-purple-500/20 text-purple-400 font-medium">BETA</span>
|
||||||
<span className="text-[10px] px-1.5 py-0.5 rounded bg-yellow-500/20 text-yellow-400 font-medium">BETA</span>
|
|
||||||
</div>
|
|
||||||
<p className="text-xs sm:text-sm text-muted-foreground mt-1">
|
|
||||||
Allow AI to add brief troubleshooting tips based on log context
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
<p className="text-xs sm:text-sm text-muted-foreground">
|
||||||
|
Allow AI to add brief troubleshooting tips based on log context
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<button
|
|
||||||
className={`relative w-9 h-[18px] rounded-full transition-colors ${
|
|
||||||
config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true
|
|
||||||
? "bg-blue-500"
|
|
||||||
: "bg-muted-foreground/30"
|
|
||||||
} ${!editMode ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`}
|
|
||||||
onClick={() => {
|
|
||||||
if (editMode) {
|
|
||||||
const newValue = config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true ? "false" : "true"
|
|
||||||
updateConfig(p => ({ ...p, ai_allow_suggestions: newValue }))
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
disabled={!editMode}
|
|
||||||
>
|
|
||||||
<span
|
|
||||||
className={`absolute top-0.5 left-0.5 h-3.5 w-3.5 rounded-full bg-white transition-transform ${
|
|
||||||
config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true ? "translate-x-[18px]" : ""
|
|
||||||
}`}
|
|
||||||
/>
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
<button
|
||||||
|
className={`relative w-9 h-[18px] rounded-full transition-colors ${
|
||||||
|
config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true
|
||||||
|
? "bg-purple-600"
|
||||||
|
: "bg-muted-foreground/20 border border-muted-foreground/40"
|
||||||
|
} ${!editMode ? "opacity-60 cursor-not-allowed" : "cursor-pointer"}`}
|
||||||
|
onClick={() => {
|
||||||
|
if (editMode) {
|
||||||
|
const newValue = config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true ? "false" : "true"
|
||||||
|
updateConfig(p => ({ ...p, ai_allow_suggestions: newValue }))
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
disabled={!editMode}
|
||||||
|
role="switch"
|
||||||
|
aria-checked={config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true}
|
||||||
|
>
|
||||||
|
<span className={`absolute top-[1px] left-[1px] h-4 w-4 rounded-full bg-white shadow transition-transform ${
|
||||||
|
config.ai_allow_suggestions === "true" || config.ai_allow_suggestions === true ? "translate-x-[18px]" : "translate-x-0"
|
||||||
|
}`} />
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1325,9 +1325,9 @@ class HealthPersistence:
|
|||||||
print(f"[HealthPersistence] Error recording UNKNOWN persistent: {e}")
|
print(f"[HealthPersistence] Error recording UNKNOWN persistent: {e}")
|
||||||
|
|
||||||
|
|
||||||
# ──────��─────────────────────────────────────────────────────────
|
|
||||||
# Disk Observations API
|
|
||||||
# ────────────────────────────────────────────────────────────────
|
# ────────────────────────────────────────────────────────────────
|
||||||
|
# Disk Observations API
|
||||||
|
# ──────────────────────���─────────────────────────────────────────
|
||||||
|
|
||||||
def register_disk(self, device_name: str, serial: Optional[str] = None,
|
def register_disk(self, device_name: str, serial: Optional[str] = None,
|
||||||
model: Optional[str] = None, size_bytes: Optional[int] = None):
|
model: Optional[str] = None, size_bytes: Optional[int] = None):
|
||||||
|
|||||||
Reference in New Issue
Block a user