Chore: Clean up NavModel interface (#66548)

* clean up navmodel interface

* remove concept of sections from NavModel interface

* clean up applinks
This commit is contained in:
Ashley Harrison
2023-04-17 16:01:32 +01:00
committed by GitHub
parent 8485deb2c0
commit ab08b4f7f2
16 changed files with 61 additions and 581 deletions
@@ -7,17 +7,13 @@ export interface NavLinkDTO {
id?: string;
text: string;
description?: string;
section?: NavSection;
subTitle?: string;
icon?: IconName;
img?: string;
url?: string;
target?: LinkTarget;
sortWeight?: number;
divider?: boolean;
hideFromMenu?: boolean;
hideFromTabs?: boolean;
showIconInNavbar?: boolean;
roundIcon?: boolean;
/**
* This is true for some sections that have no children (but is still a section)
@@ -47,12 +43,6 @@ export interface NavModelItem extends NavLinkDTO {
emptyMessage?: string;
}
export enum NavSection {
Core = 'core',
Plugin = 'plugin',
Config = 'config',
}
export enum NavMenuItemType {
Section = 'section',
Item = 'item',
+19 -29
View File
@@ -17,23 +17,17 @@ const (
WeightDashboard
WeightExplore
WeightAlerting
WeightPlugin
WeightConfig
WeightAlertsAndIncidents
WeightMonitoring
WeightDataConnections
WeightApps
WeightPlugin
WeightConfig
WeightAdmin
WeightProfile
WeightHelp
)
const (
NavSectionCore string = "core"
NavSectionPlugin string = "plugin"
NavSectionConfig string = "config"
)
const (
NavIDRoot = "root"
NavIDDashboards = "dashboards"
@@ -49,27 +43,23 @@ const (
)
type NavLink struct {
Id string `json:"id,omitempty"`
Text string `json:"text"`
Section string `json:"section,omitempty"`
SubTitle string `json:"subTitle,omitempty"`
Icon string `json:"icon,omitempty"` // Available icons can be browsed in Storybook: https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview
Img string `json:"img,omitempty"`
Url string `json:"url,omitempty"`
Target string `json:"target,omitempty"`
SortWeight int64 `json:"sortWeight,omitempty"`
Divider bool `json:"divider,omitempty"`
HideFromMenu bool `json:"hideFromMenu,omitempty"`
HideFromTabs bool `json:"hideFromTabs,omitempty"`
ShowIconInNavbar bool `json:"showIconInNavbar,omitempty"`
RoundIcon bool `json:"roundIcon,omitempty"`
IsSection bool `json:"isSection,omitempty"`
Children []*NavLink `json:"children,omitempty"`
HighlightText string `json:"highlightText,omitempty"`
HighlightID string `json:"highlightId,omitempty"`
EmptyMessageId string `json:"emptyMessageId,omitempty"`
PluginID string `json:"pluginId,omitempty"` // (Optional) The ID of the plugin that registered nav link (e.g. as a standalone plugin page)
IsCreateAction bool `json:"isCreateAction,omitempty"`
Id string `json:"id,omitempty"`
Text string `json:"text"`
SubTitle string `json:"subTitle,omitempty"`
Icon string `json:"icon,omitempty"` // Available icons can be browsed in Storybook: https://developers.grafana.com/ui/latest/index.html?path=/story/docs-overview-icon--icons-overview
Img string `json:"img,omitempty"`
Url string `json:"url,omitempty"`
Target string `json:"target,omitempty"`
SortWeight int64 `json:"sortWeight,omitempty"`
HideFromTabs bool `json:"hideFromTabs,omitempty"`
RoundIcon bool `json:"roundIcon,omitempty"`
IsSection bool `json:"isSection,omitempty"`
Children []*NavLink `json:"children,omitempty"`
HighlightText string `json:"highlightText,omitempty"`
HighlightID string `json:"highlightId,omitempty"`
EmptyMessageId string `json:"emptyMessageId,omitempty"`
PluginID string `json:"pluginId,omitempty"` // (Optional) The ID of the plugin that registered nav link (e.g. as a standalone plugin page)
IsCreateAction bool `json:"isCreateAction,omitempty"`
}
func (node *NavLink) Sort() {
@@ -96,7 +96,6 @@ func (s *ServiceImpl) getOrgAdminNode(c *contextmodel.ReqContext) (*navtree.NavL
Text: "Configuration",
SubTitle: "Organization: " + c.OrgName,
Icon: "cog",
Section: navtree.NavSectionConfig,
SortWeight: navtree.WeightConfig,
Children: configNodes,
}
@@ -161,7 +160,6 @@ func (s *ServiceImpl) getServerAdminNode(c *contextmodel.ReqContext) *navtree.Na
Id: navtree.NavIDAdmin,
Icon: "shield",
SortWeight: navtree.WeightAdmin,
Section: navtree.NavSectionConfig,
Children: adminNavLinks,
}
@@ -71,7 +71,6 @@ func (s *ServiceImpl) processAppPlugin(plugin plugins.PluginDTO, c *contextmodel
Id: "plugin-page-" + plugin.ID,
Img: plugin.Info.Logos.Small,
SubTitle: plugin.Info.Description,
Section: navtree.NavSectionPlugin,
SortWeight: navtree.WeightPlugin,
IsSection: true,
PluginID: plugin.ID,
@@ -201,7 +200,6 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n
SubTitle: "App plugins that extend the Grafana experience",
Id: navtree.NavIDApps,
Children: []*navtree.NavLink{appLink},
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightApps,
Url: s.cfg.AppSubURL + "/apps",
})
@@ -211,7 +209,6 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n
Id: navtree.NavIDMonitoring,
SubTitle: "Monitoring and infrastructure apps",
Icon: "heart-rate",
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightMonitoring,
Children: []*navtree.NavLink{appLink},
Url: s.cfg.AppSubURL + "/monitoring",
@@ -228,7 +225,6 @@ func (s *ServiceImpl) addPluginToSection(c *contextmodel.ReqContext, treeRoot *n
Id: navtree.NavIDAlertsAndIncidents,
SubTitle: "Alerting and incident management apps",
Icon: "bell",
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightAlertsAndIncidents,
Children: alertsAndIncidentsChildren,
Url: s.cfg.AppSubURL + "/alerts-and-incidents",
+3 -13
View File
@@ -89,7 +89,6 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, hasEditPerm bool, p
Id: "starred",
Icon: "star",
SortWeight: navtree.WeightSavedItems,
Section: navtree.NavSectionCore,
Children: starredItemsLinks,
EmptyMessageId: "starred-empty",
Url: s.cfg.AppSubURL + "/dashboards?starred",
@@ -106,7 +105,6 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, hasEditPerm bool, p
Icon: "apps",
Url: s.cfg.AppSubURL + "/dashboards",
SortWeight: navtree.WeightDashboard,
Section: navtree.NavSectionCore,
Children: dashboardChildLinks,
}
@@ -124,7 +122,6 @@ func (s *ServiceImpl) GetNavTree(c *contextmodel.ReqContext, hasEditPerm bool, p
SubTitle: "Explore your data",
Icon: "compass",
SortWeight: navtree.WeightExplore,
Section: navtree.NavSectionCore,
Url: s.cfg.AppSubURL + "/explore",
})
}
@@ -192,7 +189,6 @@ func (s *ServiceImpl) getHomeNode(c *contextmodel.ReqContext, prefs *pref.Prefer
Id: "home",
Url: homeUrl,
Icon: "home-alt",
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightHome,
}
return homeNode
@@ -216,7 +212,6 @@ func (s *ServiceImpl) addHelpLinks(treeRoot *navtree.NavTreeRoot, c *contextmode
Url: "#",
Icon: "question-circle",
SortWeight: navtree.WeightHelp,
Section: navtree.NavSectionConfig,
Children: []*navtree.NavLink{},
}
@@ -234,7 +229,6 @@ func (s *ServiceImpl) addHelpLinks(treeRoot *navtree.NavTreeRoot, c *contextmode
Id: "support-bundles",
Url: "/support-bundles",
Icon: "wrench",
Section: navtree.NavSectionConfig,
SortWeight: navtree.WeightHelp,
}
@@ -286,7 +280,6 @@ func (s *ServiceImpl) getProfileNode(c *contextmodel.ReqContext) *navtree.NavLin
Id: "profile",
Img: gravatarURL,
Url: s.cfg.AppSubURL + "/profile",
Section: navtree.NavSectionConfig,
SortWeight: navtree.WeightProfile,
Children: children,
RoundIcon: true,
@@ -387,12 +380,12 @@ func (s *ServiceImpl) buildDashboardNavLinks(c *contextmodel.ReqContext, hasEdit
if hasEditPerm {
if hasAccess(hasEditPermInAnyFolder, ac.EvalPermission(dashboards.ActionDashboardsCreate)) {
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
Text: "New dashboard", Icon: "plus", Url: s.cfg.AppSubURL + "/dashboard/new", HideFromTabs: true, Id: "dashboards/new", ShowIconInNavbar: true, IsCreateAction: true,
Text: "New dashboard", Icon: "plus", Url: s.cfg.AppSubURL + "/dashboard/new", HideFromTabs: true, Id: "dashboards/new", IsCreateAction: true,
})
dashboardChildNavs = append(dashboardChildNavs, &navtree.NavLink{
Text: "Import dashboard", SubTitle: "Import dashboard from file or Grafana.com", Id: "dashboards/import", Icon: "plus",
Url: s.cfg.AppSubURL + "/dashboard/import", HideFromTabs: true, ShowIconInNavbar: true, IsCreateAction: true,
Url: s.cfg.AppSubURL + "/dashboard/import", HideFromTabs: true, IsCreateAction: true,
})
}
}
@@ -419,7 +412,6 @@ func (s *ServiceImpl) buildLegacyAlertNavLinks(c *contextmodel.ReqContext) *navt
Id: "alerting-legacy",
Icon: "bell",
Children: alertChildNavs,
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightAlerting,
Url: s.cfg.AppSubURL + "/alerting",
}
@@ -462,7 +454,7 @@ func (s *ServiceImpl) buildAlertNavLinks(c *contextmodel.ReqContext, hasEditPerm
if hasAccess(fallbackHasEditPerm, ac.EvalAny(ac.EvalPermission(ac.ActionAlertingRuleCreate), ac.EvalPermission(ac.ActionAlertingRuleExternalWrite))) {
alertChildNavs = append(alertChildNavs, &navtree.NavLink{
Text: "Create alert rule", SubTitle: "Create an alert rule", Id: "alert",
Icon: "plus", Url: s.cfg.AppSubURL + "/alerting/new", HideFromTabs: true, ShowIconInNavbar: true, IsCreateAction: true,
Icon: "plus", Url: s.cfg.AppSubURL + "/alerting/new", HideFromTabs: true, IsCreateAction: true,
})
}
@@ -473,7 +465,6 @@ func (s *ServiceImpl) buildAlertNavLinks(c *contextmodel.ReqContext, hasEditPerm
Id: navtree.NavIDAlerting,
Icon: "bell",
Children: alertChildNavs,
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightAlerting,
Url: s.cfg.AppSubURL + "/alerting",
}
@@ -527,7 +518,6 @@ func (s *ServiceImpl) buildDataConnectionsNavLink(c *contextmodel.ReqContext) *n
Id: "connections",
Url: baseUrl,
Children: children,
Section: navtree.NavSectionCore,
SortWeight: navtree.WeightDataConnections,
}
@@ -3,7 +3,7 @@ import React from 'react';
import { Router } from 'react-router-dom';
import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock';
import { NavModelItem, NavSection } from '@grafana/data';
import { NavModelItem } from '@grafana/data';
import { locationService } from '@grafana/runtime';
import { TestProvider } from '../../../../../test/helpers/TestProvider';
@@ -14,7 +14,6 @@ const setup = () => {
const navBarTree: NavModelItem[] = [
{
text: 'Section name',
section: NavSection.Core,
id: 'section',
url: 'section',
children: [
@@ -25,7 +24,6 @@ const setup = () => {
{
text: 'Profile',
id: 'profile',
section: NavSection.Config,
url: 'profile',
},
];
@@ -3,12 +3,12 @@ import { cloneDeep } from 'lodash';
import React from 'react';
import { useLocation } from 'react-router-dom';
import { GrafanaTheme2, NavSection } from '@grafana/data';
import { GrafanaTheme2 } from '@grafana/data';
import { useTheme2 } from '@grafana/ui';
import { useSelector } from 'app/types';
import { NavBarMenu } from './NavBarMenu';
import { enrichConfigItems, enrichWithInteractionTracking, getActiveItem } from './utils';
import { enrichWithInteractionTracking, getActiveItem } from './utils';
export interface Props {
onClose: () => void;
@@ -23,15 +23,10 @@ export const MegaMenu = React.memo<Props>(({ onClose, searchBarHidden }) => {
const navTree = cloneDeep(navBarTree);
const coreItems = navTree
.filter((item) => item.section === NavSection.Core || item.section === NavSection.Plugin)
// Remove profile + help from tree
const navItems = navTree
.filter((item) => item.id !== 'profile' && item.id !== 'help')
.map((item) => enrichWithInteractionTracking(item, true));
const configItems = enrichConfigItems(
navTree.filter((item) => item.section === NavSection.Config && item && item.id !== 'help' && item.id !== 'profile'),
location
).map((item) => enrichWithInteractionTracking(item, true));
const navItems = [...coreItems, ...configItems];
const activeItem = getActiveItem(navItems, location.pathname);
@@ -2,7 +2,7 @@ import { css } from '@emotion/css';
import React from 'react';
import { GrafanaTheme2, NavModelItem } from '@grafana/data';
import { toIconName, useStyles2 } from '@grafana/ui';
import { useStyles2 } from '@grafana/ui';
import { NavBarMenuItem } from './NavBarMenuItem';
import { NavBarMenuSection } from './NavBarMenuSection';
@@ -34,14 +34,12 @@ export function NavBarMenuItemWrapper({
{linkHasChildren(link) && (
<ul className={styles.children}>
{link.children.map((childLink) => {
const icon = childLink.icon ? toIconName(childLink.icon) : undefined;
return (
!childLink.isCreateAction && (
<NavBarMenuItem
key={`${link.text}-${childLink.text}`}
isActive={isMatchOrChildMatch(childLink, activeItem)}
isChild
icon={childLink.showIconInNavbar ? icon : undefined}
onClick={() => {
childLink.onClick?.();
onClose();
@@ -1,43 +1,26 @@
import { Location } from 'history';
import { GrafanaConfig, locationUtil, NavModelItem } from '@grafana/data';
import { ContextSrv, setContextSrv } from 'app/core/services/context_srv';
import { enrichConfigItems, getActiveItem, isMatchOrChildMatch } from './utils';
import { enrichHelpItem, getActiveItem, isMatchOrChildMatch } from './utils';
jest.mock('../../../app_events', () => ({
publish: jest.fn(),
}));
describe('enrichConfigItems', () => {
let mockItems: NavModelItem[];
const mockLocation: Location<unknown> = {
hash: '',
pathname: '/',
search: '',
state: '',
};
let mockHelpNode: NavModelItem;
beforeEach(() => {
mockItems = [
{
id: 'profile',
text: 'Profile',
hideFromMenu: true,
},
{
id: 'help',
text: 'Help',
hideFromMenu: true,
},
];
mockHelpNode = {
id: 'help',
text: 'Help',
};
});
it('enhances the help node with extra child links', () => {
const contextSrv = new ContextSrv();
setContextSrv(contextSrv);
const enrichedConfigItems = enrichConfigItems(mockItems, mockLocation);
const helpNode = enrichedConfigItems.find((item) => item.id === 'help');
const helpNode = enrichHelpItem(mockHelpNode);
expect(helpNode!.children).toContainEqual(
expect.objectContaining({
text: 'Documentation',
@@ -1,5 +1,3 @@
import { Location } from 'history';
import { locationUtil, NavModelItem } from '@grafana/data';
import { config, reportInteraction } from '@grafana/runtime';
import { t } from 'app/core/internationalization';
@@ -9,29 +7,27 @@ import appEvents from '../../../app_events';
import { getFooterLinks } from '../../Footer/Footer';
import { HelpModal } from '../../help/HelpModal';
export const enrichConfigItems = (items: NavModelItem[], location: Location<unknown>) => {
export const enrichHelpItem = (helpItem: NavModelItem) => {
const onOpenShortcuts = () => {
appEvents.publish(new ShowModalReactEvent({ component: HelpModal }));
};
items.forEach((link) => {
let menuItems = link.children || [];
let menuItems = helpItem.children || [];
if (link.id === 'help') {
link.children = [
...menuItems,
...getFooterLinks(),
...getEditionAndUpdateLinks(),
{
id: 'keyboard-shortcuts',
text: t('nav.help/keyboard-shortcuts', 'Keyboard shortcuts'),
icon: 'keyboard',
onClick: onOpenShortcuts,
},
];
}
});
return items;
if (helpItem.id === 'help') {
helpItem.children = [
...menuItems,
...getFooterLinks(),
...getEditionAndUpdateLinks(),
{
id: 'keyboard-shortcuts',
text: t('nav.help/keyboard-shortcuts', 'Keyboard shortcuts'),
icon: 'keyboard',
onClick: onOpenShortcuts,
},
];
}
return helpItem;
};
export const enrichWithInteractionTracking = (item: NavModelItem, expandedState: boolean) => {
@@ -3,7 +3,7 @@ import userEvent from '@testing-library/user-event';
import React from 'react';
import { TestProvider } from 'test/helpers/TestProvider';
import { NavModelItem, NavSection } from '@grafana/data';
import { NavModelItem } from '@grafana/data';
import { reportInteraction } from '@grafana/runtime';
import { QuickAdd } from './QuickAdd';
@@ -19,7 +19,6 @@ const setup = () => {
const navBarTree: NavModelItem[] = [
{
text: 'Section 1',
section: NavSection.Core,
id: 'section1',
url: 'section1',
children: [
@@ -30,7 +29,6 @@ const setup = () => {
{
text: 'Section 2',
id: 'section2',
section: NavSection.Config,
url: 'section2',
children: [{ text: 'New child 3', id: 'child3', url: 'section2/child3', isCreateAction: true }],
},
@@ -1,12 +1,11 @@
import { css } from '@emotion/css';
import { cloneDeep } from 'lodash';
import React from 'react';
import { useLocation } from 'react-router-dom';
import { GrafanaTheme2, NavModelItem } from '@grafana/data';
import { Menu, MenuItem, useStyles2 } from '@grafana/ui';
import { enrichConfigItems, enrichWithInteractionTracking } from '../MegaMenu/utils';
import { enrichWithInteractionTracking } from '../MegaMenu/utils';
export interface TopNavBarMenuProps {
node: NavModelItem;
@@ -14,9 +13,7 @@ export interface TopNavBarMenuProps {
export function TopNavBarMenu({ node: nodePlain }: TopNavBarMenuProps) {
const styles = useStyles2(getStyles);
const location = useLocation();
const enriched = enrichConfigItems([cloneDeep(nodePlain)], location);
const node = enrichWithInteractionTracking(enriched[0], false);
const node = enrichWithInteractionTracking(cloneDeep(nodePlain), false);
if (!node) {
return null;
@@ -1,4 +1,5 @@
import { css } from '@emotion/css';
import { cloneDeep } from 'lodash';
import React from 'react';
import { useLocation } from 'react-router-dom';
@@ -9,6 +10,7 @@ import { contextSrv } from 'app/core/core';
import { useSelector } from 'app/types';
import { Branding } from '../../Branding/Branding';
import { enrichHelpItem } from '../MegaMenu/utils';
import { NewsContainer } from '../News/NewsContainer';
import { OrganizationSwitcher } from '../OrganizationSwitcher/OrganizationSwitcher';
import { QuickAdd } from '../QuickAdd/QuickAdd';
@@ -24,7 +26,7 @@ export const TopSearchBar = React.memo(function TopSearchBar() {
const navIndex = useSelector((state) => state.navIndex);
const location = useLocation();
const helpNode = navIndex['help'];
const helpNode = enrichHelpItem(cloneDeep(navIndex['help']));
const profileNode = navIndex['profile'];
let homeUrl = config.appSubUrl || '/';
@@ -1,10 +1,9 @@
import { NavIndex, NavSection } from '@grafana/data';
import { NavIndex } from '@grafana/data';
export const navIndex: NavIndex = {
home: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -12,14 +11,12 @@ export const navIndex: NavIndex = {
starred: {
id: 'starred',
text: 'Starred',
section: NavSection.Core,
icon: 'star',
sortWeight: -1900,
emptyMessageId: 'starred-empty',
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -28,7 +25,6 @@ export const navIndex: NavIndex = {
'dashboards/browse': {
id: 'dashboards/browse',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Create and manage dashboards to visualize your data',
icon: 'apps',
url: '/dashboards',
@@ -59,7 +55,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -99,7 +94,6 @@ export const navIndex: NavIndex = {
explore: {
id: 'explore',
text: 'Explore',
section: NavSection.Core,
subTitle: 'Explore your data',
icon: 'compass',
url: '/explore',
@@ -107,7 +101,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -116,7 +109,6 @@ export const navIndex: NavIndex = {
alerting: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Learn about problems in your systems moments after they occur',
icon: 'bell',
url: '/alerting',
@@ -163,12 +155,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -176,13 +162,11 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -236,12 +220,10 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
connections: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1300,
@@ -276,7 +258,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -323,7 +304,6 @@ export const navIndex: NavIndex = {
cfg: {
id: 'cfg',
text: 'Administration',
section: NavSection.Config,
subTitle: 'Organization: Main Org. 123',
icon: 'cog',
url: '/admin',
@@ -381,7 +361,6 @@ export const navIndex: NavIndex = {
{
id: 'admin',
text: 'Server admin',
section: NavSection.Config,
subTitle: 'Manage server-wide settings and access to resources such as organizations, users, and licenses',
icon: 'shield',
url: '/admin/server',
@@ -419,7 +398,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -477,7 +455,6 @@ export const navIndex: NavIndex = {
admin: {
id: 'admin',
text: 'Server admin',
section: NavSection.Config,
subTitle: 'Manage server-wide settings and access to resources such as organizations, users, and licenses',
icon: 'shield',
url: '/admin/server',
@@ -541,7 +518,6 @@ export const navIndex: NavIndex = {
monitoring: {
id: 'monitoring',
text: 'Monitoring',
section: NavSection.Core,
subTitle: 'Monitoring and infrastructure apps',
icon: 'heart-rate',
url: '/monitoring',
@@ -550,7 +526,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-synthetic-monitoring-app',
text: 'Synthetic Monitoring',
section: NavSection.Plugin,
img: 'public/plugins/grafana-synthetic-monitoring-app/img/logo.svg',
url: '/a/grafana-synthetic-monitoring-app/home',
sortWeight: 2,
@@ -588,7 +563,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -597,7 +571,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-synthetic-monitoring-app': {
id: 'plugin-page-grafana-synthetic-monitoring-app',
text: 'Synthetic Monitoring',
section: NavSection.Plugin,
img: 'public/plugins/grafana-synthetic-monitoring-app/img/logo.svg',
url: '/a/grafana-synthetic-monitoring-app/home',
sortWeight: 2,
@@ -639,7 +612,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'plugin-page-redis-explorer-app',
text: 'Redis Explorer',
section: NavSection.Plugin,
img: 'public/plugins/redis-explorer-app/img/logo.svg',
url: '/a/redis-explorer-app/',
sortWeight: -1200,
@@ -674,7 +646,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'apps',
text: 'Apps',
section: NavSection.Core,
subTitle: 'App plugins that extend the Grafana experience',
icon: 'apps',
url: '/apps',
@@ -683,7 +654,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-cloudflare-app',
text: 'Cloudflare Grafana App',
section: NavSection.Plugin,
img: 'public/plugins/cloudflare-app/img/cf_icon.png',
url: '/a/cloudflare-app',
sortWeight: -1200,
@@ -705,7 +675,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-easystart-app',
text: 'Integrations and Connections',
section: NavSection.Plugin,
img: 'public/plugins/grafana-easystart-app/img/logo.svg',
url: '/a/grafana-easystart-app',
sortWeight: -1200,
@@ -722,7 +691,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-k6-app',
text: 'k6 Cloud App',
section: NavSection.Plugin,
img: 'public/plugins/grafana-k6-app/img/logo.svg',
url: '/a/grafana-k6-app',
sortWeight: -1200,
@@ -732,7 +700,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-myorg-app-basic',
text: 'Basic App',
section: NavSection.Plugin,
img: 'public/plugins/myorg-app-basic/img/logo.svg',
url: '/a/myorg-app-basic/one',
sortWeight: -1200,
@@ -766,7 +733,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -777,7 +743,6 @@ export const navIndex: NavIndex = {
apps: {
id: 'apps',
text: 'Apps',
section: NavSection.Core,
subTitle: 'App plugins that extend the Grafana experience',
icon: 'apps',
url: '/apps',
@@ -786,7 +751,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-cloudflare-app',
text: 'Cloudflare Grafana App',
section: NavSection.Plugin,
img: 'public/plugins/cloudflare-app/img/cf_icon.png',
url: '/a/cloudflare-app',
sortWeight: -1200,
@@ -808,7 +772,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-easystart-app',
text: 'Integrations and Connections',
section: NavSection.Plugin,
img: 'public/plugins/grafana-easystart-app/img/logo.svg',
url: '/a/grafana-easystart-app',
sortWeight: -1200,
@@ -825,7 +788,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-k6-app',
text: 'k6 Cloud App',
section: NavSection.Plugin,
img: 'public/plugins/grafana-k6-app/img/logo.svg',
url: '/a/grafana-k6-app',
sortWeight: -1200,
@@ -835,7 +797,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-myorg-app-basic',
text: 'Basic App',
section: NavSection.Plugin,
img: 'public/plugins/myorg-app-basic/img/logo.svg',
url: '/a/myorg-app-basic/one',
sortWeight: -1200,
@@ -869,7 +830,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -878,7 +838,6 @@ export const navIndex: NavIndex = {
'plugin-page-cloudflare-app': {
id: 'plugin-page-cloudflare-app',
text: 'Cloudflare Grafana App',
section: NavSection.Plugin,
img: 'public/plugins/cloudflare-app/img/cf_icon.png',
url: '/a/cloudflare-app',
sortWeight: -1200,
@@ -900,7 +859,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-easystart-app': {
id: 'plugin-page-grafana-easystart-app',
text: 'Integrations and Connections',
section: NavSection.Plugin,
img: 'public/plugins/grafana-easystart-app/img/logo.svg',
url: '/a/grafana-easystart-app',
sortWeight: -1200,
@@ -917,7 +875,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-k6-app': {
id: 'plugin-page-grafana-k6-app',
text: 'k6 Cloud App',
section: NavSection.Plugin,
img: 'public/plugins/grafana-k6-app/img/logo.svg',
url: '/a/grafana-k6-app',
sortWeight: -1200,
@@ -927,7 +884,6 @@ export const navIndex: NavIndex = {
'plugin-page-myorg-app-basic': {
id: 'plugin-page-myorg-app-basic',
text: 'Basic App',
section: NavSection.Plugin,
img: 'public/plugins/myorg-app-basic/img/logo.svg',
url: '/a/myorg-app-basic/one',
sortWeight: -1200,
@@ -960,7 +916,6 @@ export const navIndex: NavIndex = {
'plugin-page-redis-explorer-app': {
id: 'plugin-page-redis-explorer-app',
text: 'Redis Explorer',
section: NavSection.Plugin,
img: 'public/plugins/redis-explorer-app/img/logo.svg',
url: '/a/redis-explorer-app/',
sortWeight: -1200,
@@ -995,7 +950,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'apps',
text: 'Apps',
section: NavSection.Core,
subTitle: 'App plugins that extend the Grafana experience',
icon: 'apps',
url: '/apps',
@@ -1004,7 +958,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-cloudflare-app',
text: 'Cloudflare Grafana App',
section: NavSection.Plugin,
img: 'public/plugins/cloudflare-app/img/cf_icon.png',
url: '/a/cloudflare-app',
sortWeight: -1200,
@@ -1026,7 +979,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-easystart-app',
text: 'Integrations and Connections',
section: NavSection.Plugin,
img: 'public/plugins/grafana-easystart-app/img/logo.svg',
url: '/a/grafana-easystart-app',
sortWeight: -1200,
@@ -1043,7 +995,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-grafana-k6-app',
text: 'k6 Cloud App',
section: NavSection.Plugin,
img: 'public/plugins/grafana-k6-app/img/logo.svg',
url: '/a/grafana-k6-app',
sortWeight: -1200,
@@ -1053,7 +1004,6 @@ export const navIndex: NavIndex = {
{
id: 'plugin-page-myorg-app-basic',
text: 'Basic App',
section: NavSection.Plugin,
img: 'public/plugins/myorg-app-basic/img/logo.svg',
url: '/a/myorg-app-basic/one',
sortWeight: -1200,
@@ -1087,7 +1037,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -1097,7 +1046,6 @@ export const navIndex: NavIndex = {
profile: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -600,
@@ -1133,7 +1081,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -1168,7 +1115,6 @@ export const navIndex: NavIndex = {
help: {
id: 'help',
text: 'Help',
section: NavSection.Config,
subTitle: 'Grafana v9.4.0-pre (8f5dc47e87)',
icon: 'question-circle',
url: '#',
@@ -1176,7 +1122,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
sortWeight: -2000,
@@ -1,10 +1,9 @@
import { NavSection, NavIndex } from '@grafana/data';
import { NavIndex } from '@grafana/data';
export const navIndex: NavIndex = {
dashboards: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -34,19 +33,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -55,7 +47,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -64,7 +55,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -76,7 +66,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -106,19 +95,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -127,7 +109,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -136,7 +117,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -149,7 +129,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -179,19 +158,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -200,7 +172,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -209,7 +180,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -222,7 +192,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -252,19 +221,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -273,7 +235,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -282,7 +243,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -295,7 +255,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -325,19 +284,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -346,7 +298,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -355,75 +306,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
},
divider: {
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
sortWeight: -1600,
children: [
{
id: 'alert-list',
text: 'Alert rules',
icon: 'list-ul',
url: '/alerting/list',
},
{
id: 'receivers',
text: 'Contact points',
icon: 'comment-alt-share',
url: '/alerting/notifications',
},
{
id: 'am-routes',
text: 'Notification policies',
icon: 'sitemap',
url: '/alerting/routes',
},
{
id: 'silences',
text: 'Silences',
icon: 'bell-slash',
url: '/alerting/silences',
},
{
id: 'groups',
text: 'Alert groups',
icon: 'layer-group',
url: '/alerting/groups',
},
{
id: 'alerting-admin',
text: 'Admin',
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
subTitle: 'Create an alert rule',
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -434,11 +316,9 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -468,19 +348,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -489,7 +362,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -498,7 +370,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -510,11 +381,9 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -544,19 +413,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -565,7 +427,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -574,7 +435,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -586,11 +446,9 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -620,19 +478,12 @@ export const navIndex: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'new-folder',
@@ -641,7 +492,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
showIconInNavbar: true,
},
{
id: 'import',
@@ -650,7 +500,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -663,7 +512,6 @@ export const navIndex: NavIndex = {
explore: {
id: 'explore',
text: 'Explore',
section: NavSection.Core,
subTitle: 'Explore your data',
icon: 'compass',
url: '/explore',
@@ -672,7 +520,6 @@ export const navIndex: NavIndex = {
alerting: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -714,12 +561,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -727,7 +568,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -739,7 +579,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -781,12 +620,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -794,7 +627,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -807,7 +639,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -849,12 +680,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -862,7 +687,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -875,7 +699,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -917,12 +740,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -930,7 +747,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -943,7 +759,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -985,12 +800,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -998,7 +807,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -1011,7 +819,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -1053,12 +860,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -1066,7 +867,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -1079,7 +879,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -1121,12 +920,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -1134,7 +927,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -1146,11 +938,9 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -1192,12 +982,6 @@ export const navIndex: NavIndex = {
icon: 'cog',
url: '/alerting/admin',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'alert',
text: 'Create alert rule',
@@ -1205,7 +989,6 @@ export const navIndex: NavIndex = {
icon: 'plus',
url: '/alerting/new',
hideFromTabs: true,
showIconInNavbar: true,
},
],
},
@@ -1213,7 +996,6 @@ export const navIndex: NavIndex = {
connections: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1500,
@@ -1257,7 +1039,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1500,
@@ -1302,7 +1083,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1500,
@@ -1347,7 +1127,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1500,
@@ -1392,7 +1171,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'connections',
text: 'Connections',
section: NavSection.Core,
icon: 'link',
url: '/connections',
sortWeight: -1500,
@@ -1431,7 +1209,6 @@ export const navIndex: NavIndex = {
'plugin-page-basic-app': {
id: 'plugin-page-basic-app',
text: 'Basic App',
section: NavSection.Plugin,
img: 'public/plugins/basic-app/img/logo.svg',
url: '/a/basic-app/one',
sortWeight: -1400,
@@ -1465,7 +1242,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'plugin-page-grafana-synthetic-monitoring-app',
text: 'Synthetic Monitoring',
section: NavSection.Plugin,
img: 'public/plugins/grafana-synthetic-monitoring-app/img/logo.svg',
url: '/a/grafana-synthetic-monitoring-app/home',
sortWeight: -1400,
@@ -1500,7 +1276,6 @@ export const navIndex: NavIndex = {
'plugin-page-cloudflare-app': {
id: 'plugin-page-cloudflare-app',
text: 'Cloudflare Grafana App',
section: NavSection.Plugin,
img: 'public/plugins/cloudflare-app/img/cf_icon.png',
sortWeight: -1400,
children: [
@@ -1517,7 +1292,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-easystart-app': {
id: 'plugin-page-grafana-easystart-app',
text: 'Integrations and Connections',
section: NavSection.Plugin,
img: 'public/plugins/grafana-easystart-app/img/logo.svg',
url: '/a/grafana-easystart-app',
sortWeight: -1400,
@@ -1525,7 +1299,6 @@ export const navIndex: NavIndex = {
'plugin-page-redis-explorer-app': {
id: 'plugin-page-redis-explorer-app',
text: 'Redis Explorer',
section: NavSection.Plugin,
img: 'public/plugins/redis-explorer-app/img/logo.svg',
url: '/a/redis-explorer-app/',
sortWeight: -1400,
@@ -1565,7 +1338,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-synthetic-monitoring-app': {
id: 'plugin-page-grafana-synthetic-monitoring-app',
text: 'Synthetic Monitoring',
section: NavSection.Plugin,
img: 'public/plugins/grafana-synthetic-monitoring-app/img/logo.svg',
url: '/a/grafana-synthetic-monitoring-app/home',
sortWeight: -1400,
@@ -1599,7 +1371,6 @@ export const navIndex: NavIndex = {
'plugin-page-grafana-k6-app': {
id: 'plugin-page-grafana-k6-app',
text: 'k6 Cloud App',
section: NavSection.Plugin,
img: 'public/plugins/grafana-k6-app/img/logo.svg',
url: '/a/grafana-k6-app',
sortWeight: -1400,
@@ -1607,7 +1378,6 @@ export const navIndex: NavIndex = {
cfg: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -1673,7 +1443,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -1740,7 +1509,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -1807,7 +1575,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -1874,7 +1641,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -1941,7 +1707,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -2008,7 +1773,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -2075,7 +1839,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org.',
icon: 'cog',
url: '/datasources',
@@ -2136,7 +1899,6 @@ export const navIndex: NavIndex = {
admin: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2183,7 +1945,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2231,7 +1992,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2279,7 +2039,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2327,7 +2086,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2375,7 +2133,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -2418,7 +2175,6 @@ export const navIndex: NavIndex = {
profile: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -1100,
@@ -2459,7 +2215,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -1100,
@@ -2501,7 +2256,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -1100,
@@ -2543,7 +2297,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -1100,
@@ -2587,7 +2340,6 @@ export const navIndex: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
sortWeight: -1100,
@@ -2624,7 +2376,6 @@ export const navIndex: NavIndex = {
help: {
id: 'help',
text: 'Help',
section: NavSection.Config,
subTitle: 'Grafana v9.0.0-pre (cd35366222)',
icon: 'question-circle',
url: '#',
+1 -148
View File
@@ -1,17 +1,15 @@
import { NavIndex, NavSection } from '@grafana/data';
import { NavIndex } from '@grafana/data';
export const mockNavModel: NavIndex = {
home: {
id: 'home',
text: 'Home',
section: NavSection.Core,
icon: 'home-alt',
url: '/',
},
dashboards: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -40,12 +38,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -79,7 +71,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -108,12 +99,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -148,7 +133,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -177,12 +161,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -217,7 +195,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -246,12 +223,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -286,7 +257,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -315,81 +285,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
icon: 'plus',
url: '/dashboard/new',
hideFromTabs: true,
},
{
id: 'new-folder',
text: 'New folder',
subTitle: 'Create a new folder to organize your dashboards',
icon: 'plus',
url: '/dashboards/folder/new',
hideFromTabs: true,
},
{
id: 'import',
text: 'Import',
subTitle: 'Import dashboard from file or Grafana.com',
icon: 'plus',
url: '/dashboard/import',
hideFromTabs: true,
},
],
},
},
divider: {
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
children: [
{
id: 'manage-dashboards',
text: 'Browse',
icon: 'sitemap',
url: '/dashboards',
},
{
id: 'playlists',
text: 'Playlists',
icon: 'presentation-play',
url: '/playlists',
},
{
id: 'snapshots',
text: 'Snapshots',
icon: 'camera',
url: '/dashboard/snapshots',
},
{
id: 'library-panels',
text: 'Library panels',
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -425,7 +320,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -454,12 +348,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -496,7 +384,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -525,12 +412,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -567,7 +448,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'dashboards',
text: 'Dashboards',
section: NavSection.Core,
subTitle: 'Manage dashboards and folders',
icon: 'apps',
url: '/dashboards',
@@ -596,12 +476,6 @@ export const mockNavModel: NavIndex = {
icon: 'library-panel',
url: '/library-panels',
},
{
id: 'divider',
text: 'Divider',
divider: true,
hideFromTabs: true,
},
{
id: 'new-dashboard',
text: 'New dashboard',
@@ -636,7 +510,6 @@ export const mockNavModel: NavIndex = {
explore: {
id: 'explore',
text: 'Explore',
section: NavSection.Core,
subTitle: 'Explore your data',
icon: 'compass',
url: '/explore',
@@ -644,7 +517,6 @@ export const mockNavModel: NavIndex = {
alerting: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -671,7 +543,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -699,7 +570,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'alerting',
text: 'Alerting',
section: NavSection.Core,
subTitle: 'Alert rules and notifications',
icon: 'bell',
url: '/alerting/list',
@@ -722,7 +592,6 @@ export const mockNavModel: NavIndex = {
cfg: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -773,7 +642,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -825,7 +693,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -877,7 +744,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -929,7 +795,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -981,7 +846,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -1033,7 +897,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'cfg',
text: 'Configuration',
section: NavSection.Config,
subTitle: 'Organization: Main Org',
icon: 'cog',
url: '/datasources',
@@ -1080,7 +943,6 @@ export const mockNavModel: NavIndex = {
admin: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -1120,7 +982,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -1161,7 +1022,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -1208,7 +1068,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -1249,7 +1108,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'admin',
text: 'Server Admin',
section: NavSection.Config,
subTitle: 'Manage all users and orgs',
icon: 'shield',
url: '/admin/users',
@@ -1285,7 +1143,6 @@ export const mockNavModel: NavIndex = {
profile: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
children: [
@@ -1319,7 +1176,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
children: [
@@ -1354,7 +1210,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
children: [
@@ -1391,7 +1246,6 @@ export const mockNavModel: NavIndex = {
parentItem: {
id: 'profile',
text: 'admin',
section: NavSection.Config,
img: '/avatar/46d229b033af06a191ff2267bca9ae56',
url: '/profile',
children: [
@@ -1421,7 +1275,6 @@ export const mockNavModel: NavIndex = {
help: {
id: 'help',
text: 'Help',
section: NavSection.Config,
subTitle: 'Grafana v8.5.0-pre (f1c4da095b)',
icon: 'question-circle',
url: '#',