diff --git a/web/ui/mantine-ui/src/pages/query/ResolutionInput.tsx b/web/ui/mantine-ui/src/pages/query/ResolutionInput.tsx index 7ca1ca44d..8d19deb19 100644 --- a/web/ui/mantine-ui/src/pages/query/ResolutionInput.tsx +++ b/web/ui/mantine-ui/src/pages/query/ResolutionInput.tsx @@ -27,7 +27,7 @@ const ResolutionInput: FC = ({ const onChangeCustomResolutionInput = (resText: string): void => { const newResolution = parsePrometheusDuration(resText); - if (resolution.type === "custom" && newResolution === resolution.value) { + if (resolution.type === "custom" && newResolution === resolution.step) { // Nothing changed. return; } @@ -37,7 +37,7 @@ const ResolutionInput: FC = ({ formatPrometheusDuration(getEffectiveResolution(resolution, range)) ); } else { - onChangeResolution({ type: "custom", value: newResolution }); + onChangeResolution({ type: "custom", step: newResolution }); } }; @@ -77,7 +77,7 @@ const ResolutionInput: FC = ({ resolution.type === "auto" ? resolution.density : resolution.type === "fixed" - ? resolution.value.toString() + ? resolution.step.toString() : "custom" } onChange={(_value, option) => { @@ -97,7 +97,7 @@ const ResolutionInput: FC = ({ ); onChangeResolution({ type: "custom", - value: effectiveResolution, + step: effectiveResolution, }); setCustomResolutionInput( formatPrometheusDuration(effectiveResolution) @@ -109,7 +109,7 @@ const ResolutionInput: FC = ({ if (!isNaN(value)) { onChangeResolution({ type: "fixed", - value, + step: value, }); } else { throw new Error("Invalid resolution value"); diff --git a/web/ui/mantine-ui/src/state/queryPageSlice.ts b/web/ui/mantine-ui/src/state/queryPageSlice.ts index 785a9abca..0de75807f 100644 --- a/web/ui/mantine-ui/src/state/queryPageSlice.ts +++ b/web/ui/mantine-ui/src/state/queryPageSlice.ts @@ -15,11 +15,11 @@ export type GraphResolution = } | { type: "fixed"; - value: number; // Resolution step in milliseconds. + step: number; // Resolution step in milliseconds. } | { type: "custom"; - value: number; // Resolution step in milliseconds. + step: number; // Resolution step in milliseconds. }; // From the UI settings, compute the effective resolution @@ -39,9 +39,9 @@ export const getEffectiveResolution = ( return Math.max(Math.floor(range / factor / 1000) * 1000, 1000); } case "fixed": - return resolution.value; + return resolution.step; case "custom": - return resolution.value; + return resolution.step; } };