diff --git a/docs/dashboard.md b/docs/dashboard.md index 0098c5484..266b77325 100644 --- a/docs/dashboard.md +++ b/docs/dashboard.md @@ -317,10 +317,32 @@ Next, you have to add the **custom** panel to your dashboard page in globalConfi } ``` -By default, the custom dashboard will be added as an additional tab under the overview section. +By default, the custom dashboard will be added as an additional tab under the overview section called `Custom`. ![img.png](images/custom_dashboard.png) +If you would like to change the tab name from **Custom** to any other value, you can do it in the `globalConfig.json`. +Global config, from UCC version **v5.47.0**, has an additional `settings` parameter for the dashboard section. To change the name of a custom tab, add the `custom_tab_name` attribute in the `settings`. + +```json +{ +... + "dashboard": { + "panels": [ + { + "name": "custom" + } + ], + "settings": { + "custom_tab_name": "My custom tab name" + } + }, +... +} +``` + +![img.png](images/dashboard_custom_tab_name.png) + It is possible to enable only a custom panel. To do this, remove the "default" element from globalConfig.json. ```json diff --git a/docs/images/dashboard_custom_tab_name.png b/docs/images/dashboard_custom_tab_name.png new file mode 100644 index 000000000..4f8eb7d3c Binary files /dev/null and b/docs/images/dashboard_custom_tab_name.png differ diff --git a/splunk_add_on_ucc_framework/schema/schema.json b/splunk_add_on_ucc_framework/schema/schema.json index 69c27cc2f..749c06f5f 100644 --- a/splunk_add_on_ucc_framework/schema/schema.json +++ b/splunk_add_on_ucc_framework/schema/schema.json @@ -324,6 +324,16 @@ "type": "string", "description": "Link to external TA documentation used for redirection on error dashboard page", "format": "uri" + }, + "settings": { + "type": "object", + "description": "Additional settings for monitoring dashboard.", + "properties": { + "custom_tab_name": { + "type": "string" + } + }, + "additionalProperties": false } }, "required": ["panels"], diff --git a/ui/src/pages/Dashboard/DashboardPage.tsx b/ui/src/pages/Dashboard/DashboardPage.tsx index a98346471..80edb979e 100644 --- a/ui/src/pages/Dashboard/DashboardPage.tsx +++ b/ui/src/pages/Dashboard/DashboardPage.tsx @@ -8,6 +8,7 @@ import { ResourceDashboard } from './Resource'; import { CustomDashboard } from './Custom'; import './dashboardStyle.css'; import { getBuildDirPath } from '../../util/script'; +import { getUnifiedConfigs } from '../../util/util'; /** * @@ -52,6 +53,8 @@ function DashboardPage() { }; }, []); + const globalConfig = getUnifiedConfigs(); + return (
@@ -84,7 +87,13 @@ function DashboardPage() { )} {customDef && ( - + )} diff --git a/ui/src/types/globalConfig/pages.ts b/ui/src/types/globalConfig/pages.ts index fa7aef429..230e074cb 100644 --- a/ui/src/types/globalConfig/pages.ts +++ b/ui/src/types/globalConfig/pages.ts @@ -159,6 +159,7 @@ export const pages = z.object({ .object({ panels: z.array(z.object({ name: z.string() })).min(1), troubleshooting_url: z.string().optional(), + settings: z.object({ custom_tab_name: z.string().optional() }).optional(), }) .optional(), });