[pve-devel] [PATCH manager] gui: dc/Summary: improve dashboard storage calculation

Dominik Csapak d.csapak at proxmox.com
Wed Feb 12 11:16:59 CET 2020


if no storage is selected in 'My Settings' our calculatin was done as follows:
* for every node, count 'local',
* every other storage gets only counted *once*, even if it is a local storage

as we have the 'shared' flag available, we can count local storages
for every node where they are defined which results in a storage total
calculation:
sum of all local storages on all nodes + all shared storages once

should make a better overview of storage for a cluster with local storages

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/manager6/dc/Summary.js | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/www/manager6/dc/Summary.js b/www/manager6/dc/Summary.js
index 5e613eb1..ff7edaee 100644
--- a/www/manager6/dc/Summary.js
+++ b/www/manager6/dc/Summary.js
@@ -183,8 +183,7 @@ Ext.define('PVE.dc.Summary', {
 			    break;
 			}
 			if (!countedStorages[item.data.storage] ||
-			    (item.data.storage === 'local' &&
-			    !countedStorages[item.data.id])) {
+			    (!item.data.shared && !countedStorages[item.data.id])) {
 			    used += item.data.disk;
 			    total += item.data.maxdisk;
 
-- 
2.20.1




More information about the pve-devel mailing list