mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-11-04 09:35:07 +01:00 
			
		
		
		
	fix: omit resources prop from metricPlot, use series for legend instead
This commit is contained in:
		@@ -207,7 +207,6 @@
 | 
				
			|||||||
            cluster={clusters.find((c) => c.name == cluster)}
 | 
					            cluster={clusters.find((c) => c.name == cluster)}
 | 
				
			||||||
            subCluster={$nodeMetricsData.data.nodeMetrics[0].subCluster}
 | 
					            subCluster={$nodeMetricsData.data.nodeMetrics[0].subCluster}
 | 
				
			||||||
            series={item.metric.series}
 | 
					            series={item.metric.series}
 | 
				
			||||||
            resources={[{ hostname: hostname }]}
 | 
					 | 
				
			||||||
            forNode={true}
 | 
					            forNode={true}
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
        {:else if item.disabled === true && item.metric}
 | 
					        {:else if item.disabled === true && item.metric}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -206,7 +206,6 @@
 | 
				
			|||||||
            metric={item.data.name}
 | 
					            metric={item.data.name}
 | 
				
			||||||
            cluster={clusters.find((c) => c.name == cluster)}
 | 
					            cluster={clusters.find((c) => c.name == cluster)}
 | 
				
			||||||
            subCluster={item.subCluster}
 | 
					            subCluster={item.subCluster}
 | 
				
			||||||
            resources={[{ hostname: item.host }]}
 | 
					 | 
				
			||||||
            forNode={true}
 | 
					            forNode={true}
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
        {:else if item.disabled === true && item.data}
 | 
					        {:else if item.disabled === true && item.data}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -169,7 +169,6 @@
 | 
				
			|||||||
            {cluster}
 | 
					            {cluster}
 | 
				
			||||||
            subCluster={job.subCluster}
 | 
					            subCluster={job.subCluster}
 | 
				
			||||||
            isShared={job.exclusive != 1}
 | 
					            isShared={job.exclusive != 1}
 | 
				
			||||||
            resources={job.resources}
 | 
					 | 
				
			||||||
            numhwthreads={job.numHWThreads}
 | 
					            numhwthreads={job.numHWThreads}
 | 
				
			||||||
            numaccs={job.numAcc}
 | 
					            numaccs={job.numAcc}
 | 
				
			||||||
          />
 | 
					          />
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,6 @@
 | 
				
			|||||||
    Properties:
 | 
					    Properties:
 | 
				
			||||||
    - `metric String`: The metric name
 | 
					    - `metric String`: The metric name
 | 
				
			||||||
    - `scope String?`: Scope of the displayed data [Default: node]
 | 
					    - `scope String?`: Scope of the displayed data [Default: node]
 | 
				
			||||||
    - `resources [GraphQL.Resource]`: List of resources used for parent job
 | 
					 | 
				
			||||||
    - `width Number`: The plot width
 | 
					    - `width Number`: The plot width
 | 
				
			||||||
    - `height Number`: The plot height
 | 
					    - `height Number`: The plot height
 | 
				
			||||||
    - `timestep Number`: The timestep used for X-axis rendering
 | 
					    - `timestep Number`: The timestep used for X-axis rendering
 | 
				
			||||||
@@ -16,7 +15,7 @@
 | 
				
			|||||||
    - `cluster GraphQL.Cluster`: Cluster Object of the parent job
 | 
					    - `cluster GraphQL.Cluster`: Cluster Object of the parent job
 | 
				
			||||||
    - `subCluster String`: Name of the subCluster of the parent job
 | 
					    - `subCluster String`: Name of the subCluster of the parent job
 | 
				
			||||||
    - `isShared Bool?`: If this job used shared resources; will adapt threshold indicators accordingly [Default: false]
 | 
					    - `isShared Bool?`: If this job used shared resources; will adapt threshold indicators accordingly [Default: false]
 | 
				
			||||||
    - `forNode Bool?`: If this plot is used for node data display; will render x-axis as negative time with $now as maximum [Default: false]
 | 
					    - `forNode Bool?`: If this plot is used for node data display; will ren[data, err := metricdata.LoadNodeData(cluster, metrics, nodes, scopes, from, to, ctx)](https://github.com/ClusterCockpit/cc-backend/blob/9fe7cdca9215220a19930779a60c8afc910276a3/internal/graph/schema.resolvers.go#L391-L392)der x-axis as negative time with $now as maximum [Default: false]
 | 
				
			||||||
    - `numhwthreads Number?`: Number of job HWThreads [Default: 0]
 | 
					    - `numhwthreads Number?`: Number of job HWThreads [Default: 0]
 | 
				
			||||||
    - `numaccs Number?`: Number of job Accelerators [Default: 0]
 | 
					    - `numaccs Number?`: Number of job Accelerators [Default: 0]
 | 
				
			||||||
 -->
 | 
					 -->
 | 
				
			||||||
@@ -118,7 +117,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  export let metric;
 | 
					  export let metric;
 | 
				
			||||||
  export let scope = "node";
 | 
					  export let scope = "node";
 | 
				
			||||||
  export let resources = [];
 | 
					 | 
				
			||||||
  export let width;
 | 
					  export let width;
 | 
				
			||||||
  export let height;
 | 
					  export let height;
 | 
				
			||||||
  export let timestep;
 | 
					  export let timestep;
 | 
				
			||||||
@@ -363,9 +361,8 @@
 | 
				
			|||||||
      plotSeries.push({
 | 
					      plotSeries.push({
 | 
				
			||||||
        label:
 | 
					        label:
 | 
				
			||||||
          scope === "node"
 | 
					          scope === "node"
 | 
				
			||||||
            ? resources[i].hostname
 | 
					            ? series[i].hostname
 | 
				
			||||||
            : // scope === 'accelerator' ? resources[0].accelerators[i] :
 | 
					            : scope + " #" + (i + 1),
 | 
				
			||||||
              scope + " #" + (i + 1),
 | 
					 | 
				
			||||||
        scale: "y",
 | 
					        scale: "y",
 | 
				
			||||||
        width: lineWidth,
 | 
					        width: lineWidth,
 | 
				
			||||||
        stroke: lineColor(i, series.length),
 | 
					        stroke: lineColor(i, series.length),
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -151,11 +151,6 @@
 | 
				
			|||||||
  $: series = data?.series?.filter(
 | 
					  $: series = data?.series?.filter(
 | 
				
			||||||
    (series) => selectedHost == null || series.hostname == selectedHost,
 | 
					    (series) => selectedHost == null || series.hostname == selectedHost,
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					 | 
				
			||||||
  $: resources = job?.resources?.filter(
 | 
					 | 
				
			||||||
    (resource) => selectedHost == null || resource.hostname == selectedHost,
 | 
					 | 
				
			||||||
  );
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<InputGroup>
 | 
					<InputGroup>
 | 
				
			||||||
@@ -204,7 +199,6 @@
 | 
				
			|||||||
      metric={metricName}
 | 
					      metric={metricName}
 | 
				
			||||||
      {series}
 | 
					      {series}
 | 
				
			||||||
      {isShared}
 | 
					      {isShared}
 | 
				
			||||||
      {resources}
 | 
					 | 
				
			||||||
    />
 | 
					    />
 | 
				
			||||||
  {:else if statsSeries[selectedScopeIndex] != null && patternMatches}
 | 
					  {:else if statsSeries[selectedScopeIndex] != null && patternMatches}
 | 
				
			||||||
    <Timeseries
 | 
					    <Timeseries
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user