You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2016/09/12 18:53:28 UTC

qpid-dispatch git commit: DISPATCH-427 Expand-all Collapse-All for Overview and Entities pages

Repository: qpid-dispatch
Updated Branches:
  refs/heads/master f388772d9 -> 62899c0b4


DISPATCH-427 Expand-all Collapse-All for Overview and Entities pages


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

Branch: refs/heads/master
Commit: 62899c0b476a98b0158cb066f46391d135926166
Parents: f388772
Author: Ernest Allen <ea...@redhat.com>
Authored: Mon Sep 12 14:48:53 2016 -0400
Committer: Ernest Allen <ea...@redhat.com>
Committed: Mon Sep 12 14:52:45 2016 -0400

----------------------------------------------------------------------
 .../main/webapp/plugin/html/tmplListTree.html   |  9 +--
 .../webapp/plugin/html/tmplOverviewTree.html    |  9 ++-
 console/stand-alone/plugin/css/dispatch.css     |  9 +++
 console/stand-alone/plugin/css/plugin.css       | 25 ++++++--
 console/stand-alone/plugin/css/site-base.css    |  2 +-
 .../stand-alone/plugin/html/tmplListTree.html   |  6 +-
 .../plugin/html/tmplOverviewTree.html           |  4 ++
 console/stand-alone/plugin/js/qdrList.js        | 65 ++++++++++++--------
 console/stand-alone/plugin/js/qdrOverview.js    | 13 +++-
 console/stand-alone/plugin/js/qdrService.js     |  5 +-
 10 files changed, 102 insertions(+), 45 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
deleted file mode 100644
index 5c855bf..0000000
--- a/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<hawtio-pane class="qdr-attributes" position="left" width="200">
-    <div class="treeContainer">
-        <div class="tree-header"><select ng-options="node as node.name for node in nodes" ng-model="currentNode" ng-change="selectNode(currentNode)"></select></div>
-        <div id="entityTree" onSelect="onTreeSelected" onRoot="onRootReady" hideRoot="true"></div>
-        <div ng-init="treeReady()"></div>
-    </div>
-</hawtio-pane>
-<div class="list-grid" ng-include="'listGrid.html'"></div>
diff --git a/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
new file mode 120000
index 0000000..618221c
--- /dev/null
+++ b/console/hawtio/src/main/webapp/plugin/html/tmplListTree.html
@@ -0,0 +1 @@
+../../../../../../stand-alone/plugin/html/tmplListTree.html
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
----------------------------------------------------------------------
diff --git a/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
index 2fb5929..d34fcf0 100644
--- a/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
+++ b/console/hawtio/src/main/webapp/plugin/html/tmplOverviewTree.html
@@ -1,4 +1,11 @@
-<hawtio-pane class="qdr-overview" position="left" width="300">
+<script type="text/ng-template" id="overviewheader.html">
+    <div class="expand-collapse" ng-controller="QDR.OverviewController">
+        <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
+        <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
+    </div>
+</script>
+
+<hawtio-pane class="qdr-overview" position="left" width="300" header="overviewheader.html">
     <div class="treeContainer">
         <div id="overtree"></div>
     </div>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/css/dispatch.css
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/css/dispatch.css b/console/stand-alone/plugin/css/dispatch.css
index 6b253a1..d2f4914 100644
--- a/console/stand-alone/plugin/css/dispatch.css
+++ b/console/stand-alone/plugin/css/dispatch.css
@@ -660,4 +660,13 @@ div.topoGrid .ui-grid-viewport {
     border-top-right-radius: 5px;
 	margin: 0 0 10px 0;
     padding-bottom: 4px;
+}
+
+.expand-collapse {
+	float: right;
+	margin-right: 0.5em;
+}
+
+.pane-viewport {
+	top: 24px !important;
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/css/plugin.css
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/css/plugin.css b/console/stand-alone/plugin/css/plugin.css
index a88bd50..a2122f3 100644
--- a/console/stand-alone/plugin/css/plugin.css
+++ b/console/stand-alone/plugin/css/plugin.css
@@ -256,10 +256,17 @@ div.chartContainer div.aChart {
     margin-top: 0.5em;
 }
 
-div.qdr-attributes .tree-header select {
-	width: 100%;
+#list-controller .tree-header {
+    position: absolute;
+    height: auto;
+}
+
+#list-controller select {
+	height: auto;
+	float: left;
 }
 
+
 div#main.qdr div ul.nav li.active a {
   background-color: #e0e0ff !important;
   color: #000000;
@@ -444,7 +451,7 @@ ul.qdrTopoModes {
 }
 
 .qdr-overview.pane.left, .qdr-attributes.pane.left {
-	top: 100px;
+	top: 104px;
 }
 .qdr-topology.pane.left {
 	top: 104px;
@@ -454,10 +461,14 @@ ul.qdrTopoModes {
 }
 
 .treeContainer {
-	width: 250px;
+	width: 100%;
 	float: left;
 }
 
+.pane-content {
+	overflow: auto;
+}
+
 #entityNames {
     width: 20em;
     float: left;
@@ -904,4 +915,8 @@ div#durationSlider, div#rateSlider {
 
 .list-grid {
 	padding-left: 10px;
-}
\ No newline at end of file
+}
+
+div#list-controller {
+    padding-left: 300px;
+}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/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 1a89758..9cf33da 100644
--- a/console/stand-alone/plugin/css/site-base.css
+++ b/console/stand-alone/plugin/css/site-base.css
@@ -4659,7 +4659,7 @@ div.treeContainer ul.dynatree-container {
 }
 .pane-viewport {
     position: absolute;
-    top: 0;
+    top: 24px;
     bottom: 0;
     left: 0;
     overflow: auto;

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/html/tmplListTree.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/html/tmplListTree.html b/console/stand-alone/plugin/html/tmplListTree.html
index 3cad6ee..c4d395a 100644
--- a/console/stand-alone/plugin/html/tmplListTree.html
+++ b/console/stand-alone/plugin/html/tmplListTree.html
@@ -1,11 +1,15 @@
 <div class="qdr-attributes pane left" position="left" width="300">
     <div class="pane-wrapper">
         <div class="pane-header-wrapper">
+            <div class="tree-header"><select ng-options="node as node.name for node in nodes" ng-model="currentNode" ng-change="selectNode(currentNode)"></select></div>
+            <div class="expand-collapse">
+                <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
+                <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
+            </div>
         </div>
         <div class="pane-viewport">
             <div class="pane-content">
                 <div class="treeContainer">
-                    <div class="tree-header"><select ng-options="node as node.name for node in nodes" ng-model="currentNode" ng-change="selectNode(currentNode)"></select></div>
                     <div id="entityTree" onSelect="onTreeSelected" onRoot="onRootReady" hideRoot="true"></div>
                     <div ng-init="treeReady()"></div>
                 </div>

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/html/tmplOverviewTree.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/html/tmplOverviewTree.html b/console/stand-alone/plugin/html/tmplOverviewTree.html
index 253c2b5..cadf3a9 100644
--- a/console/stand-alone/plugin/html/tmplOverviewTree.html
+++ b/console/stand-alone/plugin/html/tmplOverviewTree.html
@@ -1,6 +1,10 @@
 <div class="qdr-overview pane left" position="left" width="300">
     <div class="pane-wrapper">
         <div class="pane-header-wrapper">
+            <div class="expand-collapse">
+                <i class="icon-chevron-down clickable" title="Expand all nodes" ng-click="expandAll()"></i>
+                <i class="icon-chevron-up clickable" title="Unexpand all nodes" ng-click="contractAll()"></i>
+            </div>
         </div>
         <div class="pane-viewport">
             <div class="pane-content">

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/js/qdrList.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrList.js b/console/stand-alone/plugin/js/qdrList.js
index 6a9f413..9e88dba 100644
--- a/console/stand-alone/plugin/js/qdrList.js
+++ b/console/stand-alone/plugin/js/qdrList.js
@@ -28,8 +28,8 @@ var QDR = (function(QDR) {
    *
    * Controller for the main interface
    */
-	QDR.module.controller("QDR.ListController", ['$scope', '$location', '$dialog', '$filter', 'QDRService', 'QDRChartService',
-		function ($scope, $location, $dialog, $filter, QDRService, QDRChartService) {
+	QDR.module.controller("QDR.ListController", ['$scope', '$location', '$dialog', '$filter', '$timeout', 'QDRService', 'QDRChartService',
+		function ($scope, $location, $dialog, $filter, $timeout, QDRService, QDRChartService) {
 
 		var updateIntervalHandle = undefined;
 		var updateInterval = 5000;
@@ -120,6 +120,17 @@ var QDR = (function(QDR) {
 			return mode.isValid()
 		}
 
+		$scope.expandAll = function () {
+			$("#entityTree").dynatree("getRoot").visit(function(node){
+                node.expand(true);
+            });
+		}
+		$scope.contractAll = function () {
+			$("#entityTree").dynatree("getRoot").visit(function(node){
+                node.expand(false);
+            });
+		}
+
 		if (!QDRService.connected) {
 			// we are not connected. we probably got here from a bookmark or manual page reload
 			QDRService.redirectWhenConnected("list");
@@ -232,34 +243,36 @@ var QDR = (function(QDR) {
 			})
 			localStorage[ListExpandedKey] = JSON.stringify(list)
 
-			if (expanded)
-				onTreeSelected(node);
+			//if (expanded)
+		    //	onTreeSelected(node);
 		}
 		// a tree node was selected
 		var onTreeSelected = function (selectedNode) {
-			if ($scope.currentMode.id === 'operations')
-				$scope.currentMode = $scope.modes[0];
-			else if ($scope.currentMode.id === 'log')
-				$scope.selectMode($scope.currentMode)
-			else if ($scope.currentMode.id === 'delete') {
-				// clicked on a tree node while on the delete screen -> switch to attribute screen
-				$scope.currentMode = $scope.modes[0];
-			}
-			if (selectedNode.data.typeName === "entity") {
-				$scope.selectedEntity = selectedNode.data.key;
-				$scope.operations = lookupOperations()
-			} else if (selectedNode.data.typeName === 'attribute') {
-				$scope.selectedEntity = selectedNode.parent.data.key;
-				$scope.operations = lookupOperations()
-				$scope.selectedRecordName = selectedNode.data.key;
-				updateDetails(selectedNode.data.details);   // update the table on the right
-				$("#entityTree").dynatree("getRoot").visit(function(node){
-				   node.select(false);
-				});
-				selectedNode.select();
-			}
-			$scope.$apply();
+			$timeout( function () {
+				if ($scope.currentMode.id === 'operations')
+					$scope.currentMode = $scope.modes[0];
+				else if ($scope.currentMode.id === 'log')
+					$scope.selectMode($scope.currentMode)
+				else if ($scope.currentMode.id === 'delete') {
+					// clicked on a tree node while on the delete screen -> switch to attribute screen
+					$scope.currentMode = $scope.modes[0];
+				}
+				if (selectedNode.data.typeName === "entity") {
+					$scope.selectedEntity = selectedNode.data.key;
+					$scope.operations = lookupOperations()
+				} else if (selectedNode.data.typeName === 'attribute') {
+					$scope.selectedEntity = selectedNode.parent.data.key;
+					$scope.operations = lookupOperations()
+					$scope.selectedRecordName = selectedNode.data.key;
+					updateDetails(selectedNode.data.details);   // update the table on the right
+					$("#entityTree").dynatree("getRoot").visit(function(node){
+					   node.select(false);
+					});
+					selectedNode.select();
+				}
+			})
 		}
+
 		// fill in an empty results recoord based on the entities schema
 		var fromSchema = function (entityName) {
 			var row = {}

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/js/qdrOverview.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrOverview.js b/console/stand-alone/plugin/js/qdrOverview.js
index a187b9c..80b77d4 100644
--- a/console/stand-alone/plugin/js/qdrOverview.js
+++ b/console/stand-alone/plugin/js/qdrOverview.js
@@ -931,6 +931,16 @@ var QDR = (function (QDR) {
 			return row.entity.adminStatus === 'disabled' ? "Revive" : "Quiesce";
 		}
 
+		$scope.expandAll = function () {
+			$("#overtree").dynatree("getRoot").visit(function(node){
+                node.expand(true);
+            });
+		}
+		$scope.contractAll = function () {
+			$("#overtree").dynatree("getRoot").visit(function(node){
+                node.expand(false);
+            })
+		}
 		$scope.connectionFields = []
 		$scope.connectionGrid = {
 		    saveKey: 'connGrid',
@@ -1110,7 +1120,8 @@ var QDR = (function (QDR) {
 		var saveExpanded = function () {
 			var list = getExpandedList();
 			localStorage[OVERVIEWEXPANDEDKEY] = JSON.stringify(list)
-			expandedNodeList = list		}
+			expandedNodeList = list
+		}
 
 		// activated is called each time a tree node is clicked
 		// based on which node is clicked, load the correct data grid template and start getting the data

http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/62899c0b/console/stand-alone/plugin/js/qdrService.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrService.js b/console/stand-alone/plugin/js/qdrService.js
index ba0c347..c68d0bb 100644
--- a/console/stand-alone/plugin/js/qdrService.js
+++ b/console/stand-alone/plugin/js/qdrService.js
@@ -290,7 +290,7 @@ var QDR = (function(QDR) {
 		},
 		isConsole: function (d) {
 			// use connection properties if available
-			if (d.properties.console_identifier == 'Dispatch console')
+			if (d && d['properties'] && d['properties']['console_identifier'] == 'Dispatch console')
 				return true;
 			return false;
 		},
@@ -298,7 +298,8 @@ var QDR = (function(QDR) {
 		flatten: function (attributes, result) {
 			var flat = {}
 			attributes.forEach( function (attr, i) {
-				flat[attr] = result[i]
+				if (result && result.length > i)
+					flat[attr] = result[i]
 			})
 			return flat;
 		},


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org