mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-08-31 00:47:15 +02:00
fix(web): adapt metric plots to policy-based resample config
The backend resample config changed from {trigger, resolutions[]} to a
policy/targetPoints model, but several components still spread
resampleConfig.resolutions, throwing "resolutions is not iterable" and
breaking the job list render. Default the initial resolution to null (the
backend resolves it from the configured policy; zoom overrides it) and
drop the now-obsolete resolution selector and admin display fields.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 27516ce259fd
This commit is contained in:
@@ -70,8 +70,6 @@
|
||||
const ccconfig = $derived(thisInit ? getContext("cc-config") : null);
|
||||
const globalMetrics = $derived(thisInit ? getContext("globalMetrics") : null);
|
||||
const resampleConfig = $derived(thisInit ? getContext("resampling") : null);
|
||||
const resampleResolutions = $derived(resampleConfig ? [...resampleConfig.resolutions] : []);
|
||||
const resampleDefault = $derived(resampleConfig ? Math.max(...resampleConfig.resolutions) : 0);
|
||||
const displayNodeOverview = $derived((displayType === 'OVERVIEW'));
|
||||
|
||||
const systemMetrics = $derived(globalMetrics ? [...globalMetrics.filter((gm) => gm?.availability.find((av) => av.cluster == cluster))] : []);
|
||||
@@ -85,7 +83,8 @@
|
||||
return {...pendingUnits};
|
||||
});
|
||||
|
||||
let selectedResolution = $derived(resampleDefault);
|
||||
// null lets the backend resolve the resolution from the configured resample policy.
|
||||
let selectedResolution = $state(null);
|
||||
let to = $derived(presetTo ? presetTo : new Date(Date.now()));
|
||||
let from = $derived(presetFrom ? presetFrom : new Date(nowDate.setHours(nowDate.getHours() - 4)));
|
||||
|
||||
@@ -159,7 +158,7 @@
|
||||
</script>
|
||||
|
||||
<!-- ROW1: Tools-->
|
||||
<Row cols={{ xs: 2, lg: !displayNodeOverview ? (resampleConfig ? 6 : 5) : 5 }} class="mb-3">
|
||||
<Row cols={{ xs: 2, lg: 5 }} class="mb-3">
|
||||
{#if thisInit}
|
||||
<!-- List Metric Select Col-->
|
||||
{#if !displayNodeOverview}
|
||||
@@ -176,21 +175,6 @@
|
||||
</Button>
|
||||
</InputGroup>
|
||||
</Col>
|
||||
{#if resampleConfig}
|
||||
<Col>
|
||||
<InputGroup>
|
||||
<InputGroupText><Icon name="plus-slash-minus" /></InputGroupText>
|
||||
<InputGroupText>Resolution</InputGroupText>
|
||||
<Input type="select" bind:value={selectedResolution}>
|
||||
{#each resampleResolutions as res}
|
||||
<option value={res}
|
||||
>{res} sec</option
|
||||
>
|
||||
{/each}
|
||||
</Input>
|
||||
</InputGroup>
|
||||
</Col>
|
||||
{/if}
|
||||
{/if}
|
||||
<!-- Node Col-->
|
||||
<Col class="mt-2 mt-lg-0">
|
||||
|
||||
Reference in New Issue
Block a user