mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-15 12:27:30 +01:00
add nullsafes to frontend
This commit is contained in:
@@ -175,13 +175,13 @@
|
||||
{:else if item?.data}
|
||||
<!-- "Empty Series"-Warning included in MetricPlot-Component -->
|
||||
<!-- #key: X-axis keeps last selected timerange otherwise -->
|
||||
{#key item.data[0].metric.series[0].data.length}
|
||||
{#key item?.data[0]?.metric?.series[0]?.data?.length}
|
||||
<MetricPlot
|
||||
timestep={item.data[0].metric.timestep}
|
||||
series={item.data[0].metric.series}
|
||||
metric={item.data[0].name}
|
||||
timestep={item?.data[0]?.metric?.timestep || 60}
|
||||
series={item?.data[0]?.metric?.series || []}
|
||||
metric={item?.data[0]?.name || 'unknown'}
|
||||
{cluster}
|
||||
subCluster={item.subCluster}
|
||||
subCluster={item?.subCluster || 'unknown'}
|
||||
forNode
|
||||
enableFlip
|
||||
/>
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
<Button class="flex-grow-1" color="warning" disabled>
|
||||
Missing Metric
|
||||
</Button>
|
||||
{:else if nodeJobsData.jobs.count == 1 && nodeJobsData.jobs.items[0].shared == "none"}
|
||||
{:else if nodeJobsData.jobs.count == 1 && nodeJobsData?.jobs?.items[0]?.shared == "none"}
|
||||
<InputGroupText class="flex-grow-1 flex-lg-grow-0">
|
||||
<Icon name="circle-fill" style="padding-right: 0.5rem;"/>
|
||||
<span>Jobs</span>
|
||||
@@ -117,7 +117,7 @@
|
||||
<Button class="flex-grow-1" color="success" disabled>
|
||||
Exclusive
|
||||
</Button>
|
||||
{:else if nodeJobsData.jobs.count >= 1 && !(nodeJobsData.jobs.items[0].shared == "none")}
|
||||
{:else if nodeJobsData.jobs.count >= 1 && !(nodeJobsData?.jobs?.items[0]?.shared == "none")}
|
||||
<InputGroupText class="flex-grow-1 flex-lg-grow-0">
|
||||
<Icon name="circle-half" style="padding-right: 0.5rem;"/>
|
||||
<span>Jobs</span>
|
||||
|
||||
Reference in New Issue
Block a user