Repository: qpid-dispatch
Updated Branches:
  refs/heads/master 9e446e2a5 -> ded25e5dc


DISPATCH-315: Don't load charts that are not in the current router network


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

Branch: refs/heads/master
Commit: ded25e5dc2feba47e12b5e025033d3a765c564de
Parents: 9e446e2
Author: Ernest Allen <[email protected]>
Authored: Mon May 16 14:52:01 2016 -0400
Committer: Ernest Allen <[email protected]>
Committed: Mon May 16 14:52:01 2016 -0400

----------------------------------------------------------------------
 .../main/webapp/plugin/js/qdrChartService.js    | 97 ++++++++++++++------
 console/stand-alone/plugin/css/site-base.css    | 23 ++++-
 .../stand-alone/plugin/js/qdrChartService.js    | 41 +++++----
 3 files changed, 113 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ded25e5d/console/hawtio/src/main/webapp/plugin/js/qdrChartService.js
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/js/qdrChartService.js 
b/console/hawtio/src/main/webapp/plugin/js/qdrChartService.js
index 560e656..6125061 100644
--- a/console/hawtio/src/main/webapp/plugin/js/qdrChartService.js
+++ b/console/hawtio/src/main/webapp/plugin/js/qdrChartService.js
@@ -410,6 +410,8 @@ var QDR = (function(QDR) {
 
                    // this is called when the response is received
                                var saveResponse = function (nodeId, entity, 
response) {
+                                       if (!response || 
!response.attributeNames)
+                                               return;
                        //QDR.log.debug("got chart results for " + nodeId + " " 
+ entity);
                        // records is an array that has data for all names
                        var records = response.results;
@@ -521,38 +523,73 @@ var QDR = (function(QDR) {
             loadCharts: function () {
                 var charts = angular.fromJson(localStorage["QDRCharts"]);
                 if (charts) {
+                    var nodeList = QDRService.nodeList().map( function (node) {
+                        return node.id;
+                    })
                     charts.forEach(function (chart) {
-                        if (!angular.isDefined(chart.instance)) {
-                            chart.instance = ++instance;
+                        if (nodeList.indexOf(chart.nodeId) >= 0) {
+                               if (!chart.interval)
+                                   chart.interval = 1000;
+                               if (!chart.duration)
+                                   chart.duration = 10;
+                               if (chart.nodeList)
+                                   chart.aggregate = true;
+                               var newChart = self.registerChart(chart.nodeId, 
chart.entity, chart.name, chart.attr, chart.interval, true, chart.aggregate);
+                               newChart.dashboard = true;  // we only save the 
dashboard charts
+                               newChart.type = chart.type;
+                               newChart.rateWindow = chart.rateWindow;
+                               newChart.areaColor = chart.areaColor ? 
chart.areaColor : "#c0e0ff";
+                               newChart.lineColor = chart.lineColor ? 
chart.lineColor : "#4682b4";
+                               newChart.duration(chart.duration);
+                               newChart.visibleDuration = 
chart.visibleDuration ? chart.visibleDuration : 10;
+                               if (chart.userTitle)
+                                   newChart.title(chart.userTitle);
                         }
-                        if (chart.instance >= instance)
-                            instance = chart.instance + 1;
-                        if (!chart.duration)
-                            chart.duration = 10;
-                        if (chart.nodeList)
-                            chart.aggregate = true;
-                        if (!chart.hdash)
-                            chart.hdash = false;
-                        if (!chart.dashboard)
-                            chart.dashboard = false;
-                        if (!chart.hdash && !chart.dashboard)
-                            chart.dashboard = true;
-                                               if (chart.hdash && 
chart.dashboard)
-                                                       chart.dashboard = false;
-                                               chart.forceCreate = true;
-                                               chart.use_instance = true;
-                        var newChart = self.registerChart(chart); 
//chart.nodeId, chart.entity, chart.name, chart.attr, chart.interval, true, 
chart.aggregate);
-                        newChart.dashboard = chart.dashboard;
-                        newChart.hdash = chart.hdash;
-                        newChart.hreq = false;
-                        newChart.type = chart.type;
-                        newChart.rateWindow = chart.rateWindow;
-                        newChart.areaColor = chart.areaColor ? chart.areaColor 
: "#cbe7f3";
-                        newChart.lineColor = chart.lineColor ? chart.lineColor 
: "#058dc7";
-                        newChart.duration(chart.duration);
-                        newChart.visibleDuration = chart.visibleDuration ? 
chart.visibleDuration : 10;
-                        if (chart.userTitle)
-                            newChart.title(chart.userTitle);
+                    })
+                }
+            },
+            loadCharts: function () {
+                var charts = angular.fromJson(localStorage["QDRCharts"]);
+                if (charts) {
+                                       // get array of known ids
+                    var nodeList = QDRService.nodeList().map( function (node) {
+                        return node.id;
+                    })
+                    charts.forEach(function (chart) {
+                        // if this chart is not in the current list of nodes, 
skip
+                        if (nodeList.indexOf(chart.nodeId) >= 0) {
+                               if (!angular.isDefined(chart.instance)) {
+                                   chart.instance = ++instance;
+                               }
+                               if (chart.instance >= instance)
+                                   instance = chart.instance + 1;
+                               if (!chart.duration)
+                                   chart.duration = 10;
+                               if (chart.nodeList)
+                                   chart.aggregate = true;
+                               if (!chart.hdash)
+                                   chart.hdash = false;
+                               if (!chart.dashboard)
+                                   chart.dashboard = false;
+                               if (!chart.hdash && !chart.dashboard)
+                                   chart.dashboard = true;
+                                                       if (chart.hdash && 
chart.dashboard)
+                                                               chart.dashboard 
= false;
+                                                       chart.forceCreate = 
true;
+                                                       chart.use_instance = 
true;
+                               var newChart = self.registerChart(chart); 
//chart.nodeId, chart.entity, chart.name, chart.attr, chart.interval, true, 
chart.aggregate);
+                               newChart.dashboard = chart.dashboard;
+                               newChart.hdash = chart.hdash;
+                               newChart.hreq = false;
+                               newChart.type = chart.type;
+                               newChart.rateWindow = chart.rateWindow;
+                               newChart.areaColor = chart.areaColor ? 
chart.areaColor : "#cbe7f3";
+                               newChart.lineColor = chart.lineColor ? 
chart.lineColor : "#058dc7";
+                               newChart.duration(chart.duration);
+                               newChart.visibleDuration = 
chart.visibleDuration ? chart.visibleDuration : 10;
+                               if (chart.userTitle)
+                                   newChart.title(chart.userTitle);
+                                               }
                     })
                 }
             },

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ded25e5d/console/stand-alone/plugin/css/site-base.css
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/css/site-base.css 
b/console/stand-alone/plugin/css/site-base.css
index 23141ec..6e05ddd 100644
--- a/console/stand-alone/plugin/css/site-base.css
+++ b/console/stand-alone/plugin/css/site-base.css
@@ -19,6 +19,10 @@ under the License.
 * {
   outline: none;
 }
+* {
+    font-family: OpenSans;
+}
+
 a:focus {
   outline: none;
 }
@@ -781,6 +785,13 @@ div#main div ul.nav li span {
   padding-bottom: 2px;
   padding-top: 2px;
 }
+div#main div ul.nav li a:not(.btn), div#main div ul.nav li span.a:not(.btn) {
+    border: 1px;
+    border-radius: 2px;
+    background: inherit;
+    color: #777777;
+    text-shadow: 0 1px 0 #FFFFFF;
+}
 
 div#main div ul.nav li a:hover {
   padding-bottom: 2px;
@@ -1991,7 +2002,7 @@ div#main div ul.nav li a.nav-primary .caret {
 }
 
 #main {
-  margin-top: 70px !important;
+  margin-top: 44px !important;
 }
 
 dd.file-list {
@@ -4480,3 +4491,13 @@ ul.nav select {
 .form-horizontal textarea + div + .help-block {
   margin-top: 10px;
 }
+
+div#main div ul.nav {
+    border-radius: 0 0 4px 4px;
+    border: 1px solid #d4d4d4;
+    border-top: 1px transparent;
+    background-color: #FAFAFA;
+    background-image: linear-gradient(to bottom, #ffffff, #f2f2f2);
+    background-repeat: repeat-x;
+    box-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/ded25e5d/console/stand-alone/plugin/js/qdrChartService.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrChartService.js 
b/console/stand-alone/plugin/js/qdrChartService.js
index 6535384..efc607d 100644
--- a/console/stand-alone/plugin/js/qdrChartService.js
+++ b/console/stand-alone/plugin/js/qdrChartService.js
@@ -358,7 +358,7 @@ var QDR = (function(QDR) {
 
                    // this is called when the response is received
                                var saveResponse = function (nodeId, entity, 
response) {
-                       //QDR.log.debug("got chart results for " + nodeId + " " 
+ entity);
+                       QDR.log.debug("got chart results for " + nodeId + " " + 
entity);
                        // records an array that has data for all names
                        var records = response.results;
                        if (!records)
@@ -397,8 +397,10 @@ var QDR = (function(QDR) {
                                }
                                if (request.aggregate) {
                                        var nodeList = QDRService.nodeIdList()
+                       QDR.log.debug("sent multiple chart request for " + 
nodeList + " " + request.entity, + " " + attrs + " " + request.nodeId);
                                        
QDRService.getMultipleNodeInfo(nodeList, request.entity, attrs, saveResponse, 
request.nodeId);
                                } else {
+                       QDR.log.debug("sent chart request for " + 
request.nodeId + " " + request.entity + " " + attrs);
                     QDRService.getNodeInfo(request.nodeId, request.entity, 
attrs, saveResponse);
                                }
                 // it is now safe to send another request
@@ -442,23 +444,28 @@ var QDR = (function(QDR) {
             loadCharts: function () {
                 var charts = angular.fromJson(localStorage["QDRCharts"]);
                 if (charts) {
+                    var nodeList = QDRService.nodeList().map( function (node) {
+                        return node.id;
+                    })
                     charts.forEach(function (chart) {
-                        if (!chart.interval)
-                            chart.interval = 1000;
-                        if (!chart.duration)
-                            chart.duration = 10;
-                        if (chart.nodeList)
-                            chart.aggregate = true;
-                        var newChart = self.registerChart(chart.nodeId, 
chart.entity, chart.name, chart.attr, chart.interval, true, chart.aggregate);
-                        newChart.dashboard = true;  // we only save the 
dashboard charts
-                        newChart.type = chart.type;
-                        newChart.rateWindow = chart.rateWindow;
-                        newChart.areaColor = chart.areaColor ? chart.areaColor 
: "#c0e0ff";
-                        newChart.lineColor = chart.lineColor ? chart.lineColor 
: "#4682b4";
-                        newChart.duration(chart.duration);
-                        newChart.visibleDuration = chart.visibleDuration ? 
chart.visibleDuration : 10;
-                        if (chart.userTitle)
-                            newChart.title(chart.userTitle);
+                        if (nodeList.indexOf(chart.nodeId) >= 0) {
+                               if (!chart.interval)
+                                   chart.interval = 1000;
+                               if (!chart.duration)
+                                   chart.duration = 10;
+                               if (chart.nodeList)
+                                   chart.aggregate = true;
+                               var newChart = self.registerChart(chart.nodeId, 
chart.entity, chart.name, chart.attr, chart.interval, true, chart.aggregate);
+                               newChart.dashboard = true;  // we only save the 
dashboard charts
+                               newChart.type = chart.type;
+                               newChart.rateWindow = chart.rateWindow;
+                               newChart.areaColor = chart.areaColor ? 
chart.areaColor : "#c0e0ff";
+                               newChart.lineColor = chart.lineColor ? 
chart.lineColor : "#4682b4";
+                               newChart.duration(chart.duration);
+                               newChart.visibleDuration = 
chart.visibleDuration ? chart.visibleDuration : 10;
+                               if (chart.userTitle)
+                                   newChart.title(chart.userTitle);
+                        }
                     })
                 }
             },


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to