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