Merge pull request #16759 from roidelapluie/add-info-warning-graph
buf.build / lint and publish (push) Has been cancelled Details
CI / Go tests (push) Has been cancelled Details
CI / More Go tests (push) Has been cancelled Details
CI / Go tests with previous Go version (push) Has been cancelled Details
CI / UI tests (push) Has been cancelled Details
CI / Go tests on Windows (push) Has been cancelled Details
CI / Mixins tests (push) Has been cancelled Details
CI / Build Prometheus for common architectures (0) (push) Has been cancelled Details
CI / Build Prometheus for common architectures (1) (push) Has been cancelled Details
CI / Build Prometheus for common architectures (2) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (0) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (1) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (10) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (11) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (2) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (3) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (4) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (5) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (6) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (7) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (8) (push) Has been cancelled Details
CI / Build Prometheus for all architectures (9) (push) Has been cancelled Details
CI / Check generated parser (push) Has been cancelled Details
CI / golangci-lint (push) Has been cancelled Details
CI / fuzzing (push) Has been cancelled Details
CI / codeql (push) Has been cancelled Details
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled Details
CI / Report status of build Prometheus for all architectures (push) Has been cancelled Details
CI / Publish main branch artifacts (push) Has been cancelled Details
CI / Publish release artefacts (push) Has been cancelled Details
CI / Publish UI on npm Registry (push) Has been cancelled Details

mantine-ui: add query info warnings display to graph view
This commit is contained in:
Julius Volz 2025-06-21 09:49:07 +02:00 committed by GitHub
commit d668382608
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 27 additions and 13 deletions

View File

@ -85,17 +85,31 @@ const Graph: FC<GraphProps> = ({
} | null>(null); } | null>(null);
// Helper function to render warnings. // Helper function to render warnings.
const renderWarnings = (warnings?: string[]) => { const renderAlerts = (warnings?: string[], infos?: string[]) => {
return warnings?.map((w, idx) => ( return (
<Alert <>
key={idx} {warnings?.map((w, idx) => (
color="red" <Alert
title="Query warning" key={idx}
icon={<IconAlertTriangle />} color="red"
> title="Query warning"
{w} icon={<IconAlertTriangle />}
</Alert> >
)); {w}
</Alert>
))}
{infos?.map((w, idx) => (
<Alert
key={idx}
color="yellow"
title="Query notice"
icon={<IconInfoCircle />}
>
{w}
</Alert>
))}
</>
);
}; };
useEffect(() => { useEffect(() => {
@ -166,7 +180,7 @@ const Graph: FC<GraphProps> = ({
<Alert title="Empty query result" icon={<IconInfoCircle />}> <Alert title="Empty query result" icon={<IconInfoCircle />}>
This query returned no data. This query returned no data.
</Alert> </Alert>
{renderWarnings(dataAndRange.data.warnings)} {renderAlerts(dataAndRange.data.warnings)}
</Stack> </Stack>
); );
} }
@ -183,7 +197,7 @@ const Graph: FC<GraphProps> = ({
graphing the equivalent instant vector selector instead. graphing the equivalent instant vector selector instead.
</Alert> </Alert>
)} )}
{renderWarnings(dataAndRange.data.warnings)} {renderAlerts(dataAndRange.data.warnings, dataAndRange.data.infos)}
<Box pos="relative" ref={ref} className={classes.chartWrapper}> <Box pos="relative" ref={ref} className={classes.chartWrapper}>
<LoadingOverlay <LoadingOverlay
visible={isFetching} visible={isFetching}