mirror of
				https://github.com/ClusterCockpit/cc-backend
				synced 2025-11-04 01:25:06 +01:00 
			
		
		
		
	Fix unit load blocking systems and node views
This commit is contained in:
		web/frontend/src
@@ -55,7 +55,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    let metricUnits = {}
 | 
					    let metricUnits = {}
 | 
				
			||||||
    $: if ($nodesQuery.data) {
 | 
					    $: if ($nodesQuery.data) {
 | 
				
			||||||
        for (let metric of clusters.find(c => c.name == cluster).metricConfig) {
 | 
					        let thisCluster = clusters.find(c => c.name == cluster)
 | 
				
			||||||
 | 
					        if (thisCluster) {
 | 
				
			||||||
 | 
					            for (let metric of thisCluster.metricConfig) {
 | 
				
			||||||
                if (metric.unit.prefix || metric.unit.base) {
 | 
					                if (metric.unit.prefix || metric.unit.base) {
 | 
				
			||||||
                    metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
 | 
					                    metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
 | 
				
			||||||
                } else { // If no unit defined: Omit Unit Display
 | 
					                } else { // If no unit defined: Omit Unit Display
 | 
				
			||||||
@@ -63,6 +65,8 @@
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // $: console.log($nodesQuery?.data?.nodeMetrics[0].metrics)
 | 
					    // $: console.log($nodesQuery?.data?.nodeMetrics[0].metrics)
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -98,7 +102,7 @@
 | 
				
			|||||||
                let:width
 | 
					                let:width
 | 
				
			||||||
                itemsPerRow={ccconfig.plot_view_plotsPerRow}
 | 
					                itemsPerRow={ccconfig.plot_view_plotsPerRow}
 | 
				
			||||||
                items={$nodesQuery.data.nodeMetrics[0].metrics.sort((a, b) => a.name.localeCompare(b.name))}>
 | 
					                items={$nodesQuery.data.nodeMetrics[0].metrics.sort((a, b) => a.name.localeCompare(b.name))}>
 | 
				
			||||||
                <h4 style="text-align: center;">{item.name} {metricUnits[item.name]}</h4>
 | 
					                <h4 style="text-align: center; padding-top:15px;">{item.name} {metricUnits[item.name]}</h4>
 | 
				
			||||||
                <MetricPlot
 | 
					                <MetricPlot
 | 
				
			||||||
                    width={width} height={300} metric={item.name} timestep={item.metric.timestep}
 | 
					                    width={width} height={300} metric={item.name} timestep={item.metric.timestep}
 | 
				
			||||||
                    cluster={clusters.find(c => c.name == cluster)} subCluster={$nodesQuery.data.nodeMetrics[0].subCluster}
 | 
					                    cluster={clusters.find(c => c.name == cluster)} subCluster={$nodesQuery.data.nodeMetrics[0].subCluster}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -59,6 +59,7 @@
 | 
				
			|||||||
    let metricUnits = {}
 | 
					    let metricUnits = {}
 | 
				
			||||||
    $: if ($nodesQuery.data) {
 | 
					    $: if ($nodesQuery.data) {
 | 
				
			||||||
        let thisCluster = clusters.find(c => c.name == cluster)
 | 
					        let thisCluster = clusters.find(c => c.name == cluster)
 | 
				
			||||||
 | 
					        if (thisCluster) {
 | 
				
			||||||
            for (let metric of thisCluster.metricConfig) {
 | 
					            for (let metric of thisCluster.metricConfig) {
 | 
				
			||||||
                if (metric.unit.prefix || metric.unit.base) {
 | 
					                if (metric.unit.prefix || metric.unit.base) {
 | 
				
			||||||
                    metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
 | 
					                    metricUnits[metric.name] = '(' + (metric.unit.prefix ? metric.unit.prefix : '') + (metric.unit.base ? metric.unit.base : '') + ')'
 | 
				
			||||||
@@ -67,6 +68,7 @@
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user