mirror of
https://github.com/harvester/harvester-ui-extension.git
synced 2025-12-13 13:11:43 +00:00
filter golden image volume count in dashboard (#332)
Signed-off-by: Andy Lee <andy.lee@suse.com>
This commit is contained in:
parent
32ebdc3acd
commit
d4d3774c3b
@ -132,6 +132,7 @@ export default {
|
||||
|
||||
const hash = {
|
||||
vms: this.fetchClusterResources(HCI.VM),
|
||||
pvcs: this.fetchClusterResources(PVC),
|
||||
nodes: this.fetchClusterResources(NODE),
|
||||
events: this.fetchClusterResources(EVENT),
|
||||
metricNodes: this.fetchClusterResources(METRIC.NODE),
|
||||
@ -221,6 +222,7 @@ export default {
|
||||
nodes: [],
|
||||
metricNodes: [],
|
||||
vms: [],
|
||||
pvcs: [],
|
||||
monitoring: {},
|
||||
VM_DASHBOARD_METRICS_URL,
|
||||
CLUSTER_METRICS_SUMMARY_URL,
|
||||
@ -285,6 +287,14 @@ export default {
|
||||
out[resource.type].name = this.t(`typeLabel."${ resource.spoofed.name }"`, { count: out[resource.type].total });
|
||||
}
|
||||
|
||||
if (resource.type === PVC) {
|
||||
// filter out the golden image volumes
|
||||
const goldenImageVolumeCount = (this.pvcs || []).filter((pvc) => pvc.isGoldenImageVolume).length;
|
||||
|
||||
out[resource.type].useful = out[resource.type].useful - goldenImageVolumeCount;
|
||||
out[resource.type].total = out[resource.type].total - goldenImageVolumeCount;
|
||||
}
|
||||
|
||||
if (resource.type === HCI.BLOCK_DEVICE) {
|
||||
let total = 0;
|
||||
let errorCount = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user