2023-02-08 07:15:37 -06:00
|
|
|
import { t } from 'app/core/internationalization';
|
|
|
|
|
2022-01-30 20:41:58 -06:00
|
|
|
// Maps the ID of the nav item to a translated phrase to later pass to <Trans />
|
|
|
|
// Because the navigation content is dynamic (defined in the backend), we can not use
|
|
|
|
// the normal inline message definition method.
|
2022-07-20 10:26:52 -05:00
|
|
|
|
2023-02-08 07:15:37 -06:00
|
|
|
// see pkg/api/index.go
|
2022-10-11 05:45:58 -05:00
|
|
|
export function getNavTitle(navId: string | undefined) {
|
2023-02-07 10:10:43 -06:00
|
|
|
// the switch cases must match the ID of the navigation item, as defined in the backend nav model
|
2022-10-06 10:34:04 -05:00
|
|
|
switch (navId) {
|
|
|
|
case 'home':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.home.title', 'Home');
|
2023-01-13 08:33:42 -06:00
|
|
|
case 'new':
|
|
|
|
return t('nav.new.title', 'New');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'create':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.create.title', 'Create');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'create-dashboard':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.create-dashboard.title', 'Dashboard');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'folder':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.create-folder.title', 'Folder');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'import':
|
2023-03-30 04:34:16 -05:00
|
|
|
return t('nav.create-import.title', 'Import dashboard');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'alert':
|
2023-02-07 10:10:43 -06:00
|
|
|
return t('nav.create-alert.title', 'Create alert rule');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'starred':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.starred.title', 'Starred');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'starred-empty':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.starred-empty.title', 'Your starred dashboards will appear here');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.dashboards.title', 'Dashboards');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/browse':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t('nav.dashboards.title', 'Dashboards');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/playlists':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.playlists.title', 'Playlists');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/snapshots':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.snapshots.title', 'Snapshots');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/library-panels':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.library-panels.title', 'Library panels');
|
2023-07-11 09:10:50 -05:00
|
|
|
case 'reports':
|
|
|
|
return t('nav.reporting.title', 'Reporting');
|
2023-02-08 07:15:37 -06:00
|
|
|
case 'dashboards/public':
|
|
|
|
return t('nav.public.title', 'Public dashboards');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/new':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.new-dashboard.title', 'New dashboard');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'dashboards/folder/new':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.new-folder.title', 'New folder');
|
2023-01-13 08:33:42 -06:00
|
|
|
case 'dashboards/import':
|
2023-03-30 04:34:16 -05:00
|
|
|
return t('nav.create-import.title', 'Import dashboard');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'scenes':
|
|
|
|
return t('nav.scenes.title', 'Scenes');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'explore':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.explore.title', 'Explore');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'alerting':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting.title', 'Alerting');
|
2023-07-11 09:10:50 -05:00
|
|
|
case 'plugin-page-grafana-oncall-app':
|
|
|
|
return t('nav.oncall.title', 'OnCall');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'alerting-legacy':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-legacy.title', 'Alerting (legacy)');
|
2022-12-20 09:21:56 -06:00
|
|
|
case 'alert-home':
|
|
|
|
return t('nav.alerting-home.title', 'Home');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'alert-list':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-list.title', 'Alert rules');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'receivers':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-receivers.title', 'Contact points');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'am-routes':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-am-routes.title', 'Notification policies');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'channels':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-channels.title', 'Notification channels');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'silences':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-silences.title', 'Silences');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'groups':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-groups.title', 'Groups');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'alerting-admin':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.alerting-admin.title', 'Admin');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'cfg':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t('nav.config.title', 'Administration');
|
2023-10-11 08:37:36 -05:00
|
|
|
case 'cfg/general':
|
|
|
|
return t('nav.config-general.title', 'General');
|
|
|
|
case 'cfg/plugins':
|
|
|
|
return t('nav.config-plugins.title', 'Plugins and data');
|
|
|
|
case 'cfg/access':
|
|
|
|
return t('nav.config-access.title', 'Users and access');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'datasources':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.datasources.title', 'Data sources');
|
2023-07-11 09:10:50 -05:00
|
|
|
case 'authentication':
|
|
|
|
return t('nav.authentication.title', 'Authentication');
|
|
|
|
case 'licensing':
|
|
|
|
return t('nav.statistics-and-licensing.title', 'Statistics and licensing');
|
|
|
|
case 'recordedQueries':
|
|
|
|
return t('nav.recorded-queries.title', 'Recorded queries');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'correlations':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.correlations.title', 'Correlations');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'users':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.users.title', 'Users');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'teams':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.teams.title', 'Teams');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'plugins':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.plugins.title', 'Plugins');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'org-settings':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t('nav.org-settings.title', 'Default preferences');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'apikeys':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.api-keys.title', 'API keys');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'serviceaccounts':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.service-accounts.title', 'Service accounts');
|
|
|
|
case 'admin':
|
|
|
|
return t('nav.admin.title', 'Server admin');
|
2022-12-20 04:13:37 -06:00
|
|
|
case 'support-bundles':
|
2023-01-06 04:53:08 -06:00
|
|
|
return t('nav.support-bundles.title', 'Support bundles');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'global-users':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t('nav.global-users.title', 'Users');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'global-orgs':
|
|
|
|
return t('nav.global-orgs.title', 'Organizations');
|
|
|
|
case 'server-settings':
|
|
|
|
return t('nav.server-settings.title', 'Settings');
|
|
|
|
case 'storage':
|
|
|
|
return t('nav.storage.title', 'Storage');
|
|
|
|
case 'upgrading':
|
|
|
|
return t('nav.upgrading.title', 'Stats and license');
|
|
|
|
case 'monitoring':
|
2023-04-21 02:39:49 -05:00
|
|
|
return t('nav.monitoring.title', 'Observability');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'apps':
|
|
|
|
return t('nav.apps.title', 'Apps');
|
|
|
|
case 'alerts-and-incidents':
|
2023-03-31 03:40:06 -05:00
|
|
|
return t('nav.alerts-and-incidents.title', 'Alerts & IRM');
|
2023-07-11 08:13:46 -05:00
|
|
|
case 'plugin-page-grafana-incident-app':
|
|
|
|
return t('nav.incidents.title', 'Incidents');
|
|
|
|
case 'plugin-page-grafana-ml-app':
|
|
|
|
return t('nav.machine-learning.title', 'Machine learning');
|
|
|
|
case 'plugin-page-grafana-slo-app':
|
|
|
|
return t('nav.slo.title', 'SLO');
|
|
|
|
case 'plugin-page-k6-app':
|
|
|
|
return t('nav.performance-testing.title', 'Performance testing');
|
|
|
|
case 'monitoring':
|
|
|
|
return t('nav.observability.title', 'Observability');
|
|
|
|
case 'plugin-page-grafana-k8s-app':
|
|
|
|
return t('nav.kubernetes.title', 'Kubernetes');
|
|
|
|
case 'plugin-page-grafana-app-observability-app':
|
|
|
|
return t('nav.application.title', 'Application (preview)');
|
|
|
|
case 'plugin-page-grafana-pyroscope-app':
|
2023-08-16 03:38:26 -05:00
|
|
|
return t('nav.profiles.title', 'Profiles');
|
2023-07-11 08:13:46 -05:00
|
|
|
case 'plugin-page-grafana-kowalski-app':
|
|
|
|
return t('nav.frontend.title', 'Frontend');
|
|
|
|
case 'plugin-page-grafana-synthetic-monitoring-app':
|
|
|
|
return t('nav.synthetics.title', 'Synthetics');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'help':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.help.title', 'Help');
|
|
|
|
case 'profile/settings':
|
2023-01-24 02:32:49 -06:00
|
|
|
return t('nav.profile/settings.title', 'Profile');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'profile/notifications':
|
|
|
|
return t('nav.profile/notifications.title', 'Notification history');
|
|
|
|
case 'profile/password':
|
|
|
|
return t('nav.profile/password.title', 'Change password');
|
2022-10-06 10:34:04 -05:00
|
|
|
case 'sign-out':
|
2022-10-11 05:45:58 -05:00
|
|
|
return t('nav.sign-out.title', 'Sign out');
|
2022-11-16 06:02:29 -06:00
|
|
|
case 'search':
|
|
|
|
return t('nav.search-dashboards.title', 'Search dashboards');
|
2023-06-30 05:27:19 -05:00
|
|
|
case 'connections':
|
|
|
|
return t('nav.connections.title', 'Connections');
|
|
|
|
case 'connections-add-new-connection':
|
|
|
|
return t('nav.add-new-connections.title', 'Add new connection');
|
|
|
|
case 'connections-datasources':
|
|
|
|
return t('nav.data-sources.title', 'Data sources');
|
2023-07-11 08:13:46 -05:00
|
|
|
case 'standalone-plugin-page-/connections/infrastructure':
|
2023-10-02 01:25:46 -05:00
|
|
|
return t('nav.infrastructure.title', 'Integrations');
|
2023-07-11 08:13:46 -05:00
|
|
|
case 'standalone-plugin-page-/connections/connect-data':
|
|
|
|
return t('nav.connect-data.title', 'Connect data');
|
|
|
|
case 'plugin-page-grafana-detect-app':
|
|
|
|
return t('nav.detect.title', 'Detect');
|
|
|
|
case 'plugin-page-grafana-quaderno-app':
|
|
|
|
return t('nav.grafana-quaderno.title', 'Grafana Quaderno');
|
2022-10-11 05:45:58 -05:00
|
|
|
default:
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getNavSubTitle(navId: string | undefined) {
|
|
|
|
switch (navId) {
|
|
|
|
case 'dashboards':
|
|
|
|
return t('nav.dashboards.subtitle', 'Create and manage dashboards to visualize your data');
|
|
|
|
case 'dashboards/browse':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t('nav.dashboards.subtitle', 'Create and manage dashboards to visualize your data');
|
2023-02-23 04:46:07 -06:00
|
|
|
case 'manage-folder':
|
|
|
|
return t('nav.manage-folder.subtitle', 'Manage folder dashboards and permissions');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'dashboards/playlists':
|
|
|
|
return t('nav.playlists.subtitle', 'Groups of dashboards that are displayed in a sequence');
|
|
|
|
case 'dashboards/snapshots':
|
|
|
|
return t(
|
|
|
|
'nav.snapshots.subtitle',
|
|
|
|
'Interactive, publically available, point-in-time representations of dashboards'
|
|
|
|
);
|
|
|
|
case 'dashboards/library-panels':
|
|
|
|
return t('nav.library-panels.subtitle', 'Reusable panels that can be added to multiple dashboards');
|
|
|
|
case 'alerting':
|
|
|
|
return t('nav.alerting.subtitle', 'Learn about problems in your systems moments after they occur');
|
|
|
|
case 'alert-list':
|
|
|
|
return t('nav.alerting-list.subtitle', 'Rules that determine whether an alert will fire');
|
|
|
|
case 'receivers':
|
2023-01-30 09:26:21 -06:00
|
|
|
return t(
|
|
|
|
'nav.alerting-receivers.subtitle',
|
|
|
|
'Choose how to notify your contact points when an alert instance fires'
|
|
|
|
);
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'am-routes':
|
|
|
|
return t('nav.alerting-am-routes.subtitle', 'Determine how alerts are routed to contact points');
|
|
|
|
case 'silences':
|
|
|
|
return t('nav.alerting-silences.subtitle', 'Stop notifications from one or more alerting rules');
|
|
|
|
case 'groups':
|
|
|
|
return t('nav.alerting-groups.subtitle', 'See grouped alerts from an Alertmanager instance');
|
|
|
|
case 'datasources':
|
|
|
|
return t('nav.datasources.subtitle', 'Add and configure data sources');
|
|
|
|
case 'correlations':
|
|
|
|
return t('nav.correlations.subtitle', 'Add and configure correlations');
|
|
|
|
case 'users':
|
|
|
|
return t('nav.users.subtitle', 'Invite and assign roles to users');
|
|
|
|
case 'teams':
|
|
|
|
return t('nav.teams.subtitle', 'Groups of users that have common dashboard and permission needs');
|
|
|
|
case 'plugins':
|
|
|
|
return t('nav.plugins.subtitle', 'Extend the Grafana experience with plugins');
|
|
|
|
case 'org-settings':
|
|
|
|
return t('nav.org-settings.subtitle', 'Manage preferences across an organization');
|
|
|
|
case 'apikeys':
|
|
|
|
return t('nav.api-keys.subtitle', 'Manage and create API keys that are used to interact with Grafana HTTP APIs');
|
|
|
|
case 'serviceaccounts':
|
|
|
|
return t('nav.service-accounts.subtitle', 'Use service accounts to run automated workloads in Grafana');
|
|
|
|
case 'global-users':
|
2022-11-30 07:24:53 -06:00
|
|
|
return t('nav.global-users.subtitle', 'Manage users in Grafana');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'global-orgs':
|
|
|
|
return t('nav.global-orgs.subtitle', 'Isolated instances of Grafana running on the same server');
|
|
|
|
case 'server-settings':
|
|
|
|
return t('nav.server-settings.subtitle', 'View the settings defined in your Grafana config');
|
|
|
|
case 'storage':
|
|
|
|
return t('nav.storage.subtitle', 'Manage file storage');
|
2022-12-20 04:13:37 -06:00
|
|
|
case 'support-bundles':
|
|
|
|
return t('nav.support-bundles.subtitle', 'Download support bundles');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'admin':
|
2023-04-14 03:43:11 -05:00
|
|
|
return t(
|
|
|
|
'nav.admin.subtitle',
|
|
|
|
'Manage server-wide settings and access to resources such as organizations, users, and licenses'
|
|
|
|
);
|
2023-10-11 08:37:36 -05:00
|
|
|
case 'cfg/general':
|
|
|
|
return t('nav.config-general.subtitle', 'Manage default preferences and settings across Grafana');
|
|
|
|
case 'cfg/plugins':
|
|
|
|
return t('nav.config-plugins.subtitle', 'Install plugins and define the relationships between data');
|
|
|
|
case 'cfg/access':
|
|
|
|
return t('nav.config-access.subtitle', 'Configure access for individual users, teams, and service accounts');
|
2022-10-11 05:45:58 -05:00
|
|
|
case 'apps':
|
|
|
|
return t('nav.apps.subtitle', 'App plugins that extend the Grafana experience');
|
|
|
|
case 'monitoring':
|
|
|
|
return t('nav.monitoring.subtitle', 'Monitoring and infrastructure apps');
|
|
|
|
case 'alerts-and-incidents':
|
|
|
|
return t('nav.alerts-and-incidents.subtitle', 'Alerting and incident management apps');
|
2023-06-30 05:27:19 -05:00
|
|
|
case 'connections-add-new-connection':
|
|
|
|
return t('nav.connections.subtitle', 'Browse and create new connections');
|
|
|
|
case 'connections-datasources':
|
|
|
|
return t('nav.data-sources.subtitle', 'View and manage your connected data source connections');
|
2022-10-06 10:34:04 -05:00
|
|
|
default:
|
|
|
|
return undefined;
|
|
|
|
}
|
|
|
|
}
|