mirror of
https://github.com/grafana/grafana.git
synced 2025-02-12 00:25:46 -06:00
23 lines
537 B
TypeScript
23 lines
537 B
TypeScript
import { NavModel, NavModelItem } from '@grafana/data';
|
|
|
|
export function getExceptionNav(error: unknown): NavModel {
|
|
console.error(error);
|
|
return getWarningNav('Exception thrown', 'See console for details');
|
|
}
|
|
|
|
export function getNotFoundNav(): NavModel {
|
|
return getWarningNav('Page not found', '404 Error');
|
|
}
|
|
|
|
export function getWarningNav(text: string, subTitle?: string): NavModel {
|
|
const node: NavModelItem = {
|
|
text,
|
|
subTitle,
|
|
icon: 'exclamation-triangle',
|
|
};
|
|
return {
|
|
node: node,
|
|
main: node,
|
|
};
|
|
}
|