From b02857cf040052d03d62cc861a5b1883c191c929 Mon Sep 17 00:00:00 2001 From: Gmer4Lfe Date: Fri, 7 Aug 2026 09:49:41 -0400 Subject: [PATCH] Put the AI master switch on Settings, so the switch that hides the AI tab is reachable without it Turning AI off takes the AI tools and their conf gear off the Tools card with it, which left the raw master.conf editor as the only way back on. --- Plugin/unraid/pages/settings.php | 75 +++++++++++++++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/Plugin/unraid/pages/settings.php b/Plugin/unraid/pages/settings.php index 07a49c1..244db49 100644 --- a/Plugin/unraid/pages/settings.php +++ b/Plugin/unraid/pages/settings.php @@ -23,7 +23,7 @@ // Values are escaped on render and on write-back. // // RENDERS -// Storage mode selector, global toggles, general conf fields +// Storage mode selector, global toggles, AI master switch, general conf fields // // DEPENDS ON // api/confform.php conf read/write → include/confform.php @@ -42,6 +42,13 @@ $_enableLogging = ($_vars['ENABLE_LOGGING'] ?? 'false') === 'true'; $_discordKey = $_myId . '_DISCORD_WEBHOOK'; $_discordHook = $_vars[$_discordKey] ?? ''; +// AI. The card is drawn only on the host that can actually run it — elsewhere AI_ENABLED is a +// switch with nothing behind it, since the model and the index are HOST1's. vv_ai_ui_on() is +// not the test here: it folds the switch into the host check, and this card is how the switch +// gets turned back on. Fail-closed on anything but "true", matching the gate it feeds. +$_aiHost = vv_is_ai_host(); +$_aiEnabled = strtolower(trim($_vars['AI_ENABLED'] ?? 'false')) === 'true'; + ?>