Hide LLM Gateway / Connectors / Usage tabs in user settings

Client manages these centrally, so end users should not see them. Filter
the settings tab list in app/app/settings/layout.tsx (patchFile, string-
anchored + idempotent). The routes still exist but are no longer linked.
Verified the anchors against the v5.0.3 source.
This commit is contained in:
Jannic Debus 2026-11-11 18:39:18 +01:00
parent fa1f82767c
commit bc3dd56e00
2 changed files with 28 additions and 1 deletions

View file

@ -9,7 +9,7 @@
## Version of Onyx to deploy, default is latest (main built nightly).
## Craft uses this same tag for the sandbox image; do not set a separate
## sandbox image for normal deployments.
IMAGE_TAG=4.8.2
IMAGE_TAG=5.0.3
## Onyx Craft Configuration (off by default).
## When enabling Craft through install.sh --include-craft or by manually adding

View file

@ -404,6 +404,33 @@ await patchFile("views/SettingsPage.tsx", [
},
]);
// (a4) Whitelabel: hide the LLM Gateway, Connectors and Usage tabs in the user
// settings. The client manages these centrally, so end users should not see them.
// Filters the tab list; the routes still exist but are no longer linked.
await patchFile("app/app/settings/layout.tsx", [
{
desc: "rename the settings tab list so it can be filtered",
done: "const allTabs: SettingsTab[] = [",
find: ` const tabs: SettingsTab[] = [`,
replace: ` const allTabs: SettingsTab[] = [`,
},
{
desc: "hide the LLM Gateway, Connectors and Usage settings tabs",
done: "AIDO: hide the LLM Gateway, Connectors and Usage",
find: ` const activeTab = tabs.find((tab) => tab.href === pathname);`,
replace: ` // AIDO: hide the LLM Gateway, Connectors and Usage settings tabs.
const tabs = allTabs.filter(
(tab) =>
![
"/app/settings/llm-gateway",
"/app/settings/connectors",
"/app/settings/usage",
].includes(tab.href)
);
const activeTab = tabs.find((tab) => tab.href === pathname);`,
},
]);
// (b) Notifications: their text is generated by the backend (official image we do
// NOT rebuild), so rebrand/suppress it at render time. Generate a tiny runtime
// helper from config, then route the notifications list through it.