mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-12-19 05:36:17 +01:00
fix color overflow, add info if no status data
This commit is contained in:
@@ -182,6 +182,15 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function legendColor(targetIdx) {
|
||||
// Reuses first color if targetIdx overflows
|
||||
if (cbmode) {
|
||||
return cbColors[(colors.length + targetIdx) % colors.length]
|
||||
} else {
|
||||
return colors[(colors.length + targetIdx) % colors.length]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{#if $initq.data}
|
||||
@@ -235,7 +244,7 @@
|
||||
</tr>
|
||||
{#each $topUserQuery.data.topUser as tu, i}
|
||||
<tr>
|
||||
<td><Icon name="circle-fill" style="color: {cbmode ? cbColors[i] : colors[i]};" /></td>
|
||||
<td><Icon name="circle-fill" style="color: {legendColor(i)};" /></td>
|
||||
<th scope="col" id="topName-{tu.id}"
|
||||
><a
|
||||
href="/monitoring/user/{tu.id}?cluster={cluster}&state=running"
|
||||
@@ -302,7 +311,7 @@
|
||||
</tr>
|
||||
{#each $topProjectQuery.data.topProjects as tp, i}
|
||||
<tr>
|
||||
<td><Icon name="circle-fill" style="color: {cbmode ? cbColors[i] : colors[i]};" /></td>
|
||||
<td><Icon name="circle-fill" style="color: {legendColor(i)};" /></td>
|
||||
<th scope="col"
|
||||
><a
|
||||
href="/monitoring/jobs/?cluster={cluster}&state=running&project={tp.id}&projectMatch=eq"
|
||||
|
||||
Reference in New Issue
Block a user