cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [6/7] git commit: updated refs/heads/4.5 to 2f250e2
Date Fri, 20 Nov 2015 06:17:45 GMT
CLOUDSTACK-9020: Metrics UI fixes

- Allow all users to see resource metrics
- Fix instance count issue on host metrics view
- Fix sorting issue

Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
(cherry picked from commit 53084c4c8a87ccbdb1a7017e0a4cc66dbc386220)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/ebee0f0c
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/ebee0f0c
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/ebee0f0c

Branch: refs/heads/4.5
Commit: ebee0f0c9de98d3fd0aaa6357dc87b753d557656
Parents: 0d73788
Author: Rohit Yadav <rohit.yadav@shapeblue.com>
Authored: Sat Nov 7 18:06:05 2015 +0530
Committer: Rohit Yadav <rohit.yadav@shapeblue.com>
Committed: Sun Nov 8 20:57:13 2015 +0530

----------------------------------------------------------------------
 ui/scripts/instances.js            |  3 ---
 ui/scripts/metrics.js              | 16 +++++++++-------
 ui/scripts/storage.js              |  3 ---
 ui/scripts/system.js               | 12 ------------
 ui/scripts/ui/widgets/dataTable.js | 11 ++++++++---
 5 files changed, 17 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebee0f0c/ui/scripts/instances.js
----------------------------------------------------------------------
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 68bf098..094957a 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -296,9 +296,6 @@
                     label: 'label.metrics',
                     isHeader: true,
                     addRow: false,
-                    preFilter: function(args) {
-                        return isAdmin();
-                    },
                     action: {
                         custom: cloudStack.uiCustom.metricsView({resource: 'vms'})
                     },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebee0f0c/ui/scripts/metrics.js
----------------------------------------------------------------------
diff --git a/ui/scripts/metrics.js b/ui/scripts/metrics.js
index 7704469..609022a 100644
--- a/ui/scripts/metrics.js
+++ b/ui/scripts/metrics.js
@@ -159,7 +159,7 @@
                                             items[idx].clusters += parseInt(json.listclustersresponse.count);
                                             $.each(json.listclustersresponse.cluster, function(i,
cluster) {
                                                 if (cluster.allocationstate == 'Enabled'
&& cluster.managedstate == 'Managed') {
-                                                    items[idx].clustersUp++;
+                                                    items[idx].clustersUp += 1;
                                                 }
                                                 $.ajax({
                                                     url: createURL('listHosts'),
@@ -714,12 +714,14 @@
                                     success: function(json) {
                                         if (json && json.listvirtualmachinesresponse
&& json.listvirtualmachinesresponse.virtualmachine) {
                                             var vms = json.listvirtualmachinesresponse.virtualmachine;
-                                            $.each(vms, function(idx, vm) {
-                                                items[idx].instances++;
-                                                if (vm.state == 'Running') {
-                                                    items[idx].instancesUp++;
-                                                }
-                                            });
+                                            if (vms) {
+                                                $.each(vms, function(_, vm) {
+                                                    items[idx].instances += 1;
+                                                    if (vm.state == 'Running') {
+                                                        items[idx].instancesUp += 1;
+                                                    }
+                                                });
+                                            }
                                         }
                                     },
                                     async: false

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebee0f0c/ui/scripts/storage.js
----------------------------------------------------------------------
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index ee913f5..78826a3 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -257,9 +257,6 @@
                             label: 'label.metrics',
                             isHeader: true,
                             addRow: false,
-                            preFilter: function(args) {
-                                return isAdmin();
-                            },
                             action: {
                                 custom: cloudStack.uiCustom.metricsView({resource: 'volumes'})
                             },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebee0f0c/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 8d097f4..3aafd8d 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -7710,9 +7710,6 @@
                                     label: 'label.metrics',
                                     isHeader: true,
                                     addRow: false,
-                                    preFilter: function(args) {
-                                        return isAdmin();
-                                    },
                                     action: {
                                         custom: cloudStack.uiCustom.metricsView({resource:
'zones'})
                                     },
@@ -14392,9 +14389,6 @@
                             label: 'label.metrics',
                             isHeader: true,
                             addRow: false,
-                            preFilter: function(args) {
-                                return isAdmin();
-                            },
                             action: {
                                 custom: cloudStack.uiCustom.metricsView({resource: 'clusters'})
                             },
@@ -15646,9 +15640,6 @@
                             label: 'label.metrics',
                             isHeader: true,
                             addRow: false,
-                            preFilter: function(args) {
-                                return isAdmin();
-                            },
                             action: {
                                 custom: cloudStack.uiCustom.metricsView({resource: 'hosts'})
                             },
@@ -17468,9 +17459,6 @@
                             label: 'label.metrics',
                             isHeader: true,
                             addRow: false,
-                            preFilter: function(args) {
-                                return isAdmin();
-                            },
                             action: {
                                 custom: cloudStack.uiCustom.metricsView({resource: 'storagepool'})
                             },

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/ebee0f0c/ui/scripts/ui/widgets/dataTable.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui/widgets/dataTable.js b/ui/scripts/ui/widgets/dataTable.js
index 22ddda6..4574052 100644
--- a/ui/scripts/ui/widgets/dataTable.js
+++ b/ui/scripts/ui/widgets/dataTable.js
@@ -177,14 +177,19 @@
             var sortData = [];
             var numericDataCount = 0;
             $elems.each(function() {
-                var text = $(this).html();
+                var text = $(this);
                 if (hasAllRowsSameValue) {
-                    if (firstElem !== text) {
+                    if (firstElem !== text.html()) {
                         hasAllRowsSameValue = false;
                     }
                 }
+                if (text.children()) {
+                    text = text.children().html();
+                } else {
+                    text = text.html();
+                }
                 if (isNumeric(text) || !text) {
-                    numericDataCount++;
+                    numericDataCount += 1;
                 }
                 sortData.push($(this));
             });


Mime
View raw message