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 2017/03/13 15:48:04 UTC
[4/4] qpid-dispatch git commit: DISPATCH-725 Use patternfly styles
for stand-alone console
DISPATCH-725 Use patternfly styles for stand-alone console
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/615d7b65
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/615d7b65
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/615d7b65
Branch: refs/heads/master
Commit: 615d7b65f446ff762b7b3a59c586fea57ea0bf53
Parents: 38c02ed
Author: Ernest Allen <ea...@redhat.com>
Authored: Mon Mar 13 11:47:23 2017 -0400
Committer: Ernest Allen <ea...@redhat.com>
Committed: Mon Mar 13 11:47:23 2017 -0400
----------------------------------------------------------------------
console/stand-alone/plugin/js/navbar.js | 43 ++++++----
console/stand-alone/plugin/js/qdrList.js | 13 ++-
console/stand-alone/plugin/js/qdrListChart.js | 12 +--
console/stand-alone/plugin/js/qdrNewNode.js | 10 +--
console/stand-alone/plugin/js/qdrOverview.js | 75 +++++++++++------
.../plugin/js/qdrOverviewLogsController.js | 4 +-
console/stand-alone/plugin/js/qdrSchema.js | 7 +-
console/stand-alone/plugin/js/qdrTopology.js | 88 +++++++++++---------
8 files changed, 154 insertions(+), 98 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/navbar.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/navbar.js b/console/stand-alone/plugin/js/navbar.js
index 5125748..0d7baf9 100644
--- a/console/stand-alone/plugin/js/navbar.js
+++ b/console/stand-alone/plugin/js/navbar.js
@@ -34,38 +34,44 @@ var QDR = (function (QDR) {
content: '<i class="icon-cogs"></i> Connect',
title: "Connect to a router",
isValid: function () { return true; },
- href: "#" + QDR.pluginRoot + "/connect"
+ href: "#!" + QDR.pluginRoot + "/connect",
+ name: "Connect"
},
{
- content: '<i class="icon-home"></i> Overview',
+ content: '<i class="pficon-home"></i> Overview',
title: "View router overview",
isValid: function (QDRService) { return QDRService.isConnected(); },
- href: "#" + QDR.pluginRoot + "/overview"
+ href: "#!" + QDR.pluginRoot + "/overview",
+ name: "Overview"
},
{
content: '<i class="icon-list "></i> Entities',
title: "View the attributes of the router entities",
isValid: function (QDRService) { return QDRService.isConnected(); },
- href: "#" + QDR.pluginRoot + "/list"
+ href: "#!" + QDR.pluginRoot + "/list",
+ name: "Entities"
},
{
content: '<i class="icon-star-empty"></i> Topology',
title: "View router network topology",
isValid: function (QDRService) { return QDRService.isConnected(); },
- href: "#" + QDR.pluginRoot + "/topology"
+ href: "#!" + QDR.pluginRoot + "/topology",
+ name: "Topology"
},
{
content: '<i class="icon-bar-chart"></i> Charts',
title: "View charts",
isValid: function (QDRService, $location) { return QDRService.isConnected() && QDR.isStandalone; },
- href: "#/charts"
+ href: "#!/charts",
+ name: "Charts"
},
{
content: '<i class="icon-align-left"></i> Schema',
title: "View dispatch schema",
isValid: function (QDRService) { return QDRService.isConnected(); },
- href: "#" + QDR.pluginRoot + "/schema",
- right: true
+ href: "#!" + QDR.pluginRoot + "/schema",
+ right: true,
+ name: "Schema"
}
];
/**
@@ -77,17 +83,22 @@ var QDR = (function (QDR) {
* The controller for this plugin's navigation bar
*
*/
- QDR.module.controller("QDR.NavBarController", ['$scope', 'QDRService', 'QDRChartService', '$routeParams', '$location', function($scope, QDRService, QDRChartService, $routeParams, $location) {
+ QDR.module.controller("QDR.NavBarController", ['$rootScope', '$scope', 'QDRService', 'QDRChartService', '$routeParams', '$location', function($rootScope, $scope, QDRService, QDRChartService, $routeParams, $location) {
$scope.breadcrumbs = QDR.breadcrumbs;
$scope.isValid = function(link) {
+ if ($scope.isActive(link.href))
+ $rootScope.$broadcast("setCrumb", {name: link.name, title: link.content})
return link.isValid(QDRService, $location);
};
$scope.isActive = function(href) {
- // highlight the connect tab if we are on the root page
- if (($location.path() === QDR.pluginRoot) && (href.split("#")[1] === QDR.pluginRoot + "/connect"))
- return true
- return href.split("#")[1] == $location.path();
+//QDR.log.info("isActive(" + href + ") location.path() is " + $location.path())
+ // highlight the connect tab if we are on the root page
+ if (($location.path() === QDR.pluginRoot) && (href.split("#")[1] === QDR.pluginRoot + "/connect")) {
+//QDR.log.info("isActive is returning true for connect page")
+ return true
+ }
+ return href.split("#")[1] === '!' + $location.path();
};
$scope.isRight = function (link) {
@@ -123,7 +134,7 @@ var QDR = (function (QDR) {
}]);
// controller for the edit/configure chart dialog
- QDR.module.controller("QDR.ChartDialogController", function($scope, QDRChartService, $location, dialog, chart, updateTick, dashboard, adding) {
+ QDR.module.controller("QDR.ChartDialogController", function($scope, QDRChartService, $location, $uibModalInstance, chart, updateTick, dashboard, adding) {
var dialogSvgChart = null;
$scope.svgDivId = "dialogEditChart"; // the div id for the svg chart
@@ -166,7 +177,7 @@ var QDR = (function (QDR) {
$scope.showChartsPage = function () {
cleanup();
- dialog.close(true);
+ $uibModalInstance.close(true);
$location.path(QDR.pluginRoot + "/charts");
};
@@ -180,7 +191,7 @@ var QDR = (function (QDR) {
}
$scope.okClick = function () {
cleanup();
- dialog.close(true);
+ $uibModalInstance.close(true);
};
var initRateSlider = function () {
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/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 ec2efb2..0e5ee8f 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', '$timeout', 'QDRService', 'QDRChartService',
- function ($scope, $location, $dialog, $filter, $timeout, QDRService, QDRChartService) {
+ QDR.module.controller("QDR.ListController", ['$scope', '$location', '$uibModal', '$filter', '$timeout', 'QDRService', 'QDRChartService',
+ function ($scope, $location, $uibModal, $filter, $timeout, QDRService, QDRChartService) {
var updateIntervalHandle = undefined;
var updateInterval = 5000;
@@ -675,7 +675,7 @@ var QDR = (function(QDR) {
}
function doDialog(tmpl, chart) {
- var d = $dialog.dialog({
+ var d = $uibModal.open({
backdrop: true,
keyboard: true,
backdropClick: true,
@@ -691,7 +691,7 @@ var QDR = (function(QDR) {
}
});
- d.open().then(function(result) { console.log("d.open().then"); });
+ d.result.then(function(result) { console.log("d.open().then"); });
};
@@ -744,6 +744,7 @@ var QDR = (function(QDR) {
var e = new Folder(entity)
e.typeName = "entity"
e.key = entity
+ e.isFolder = true
e.expand = (expandedList.indexOf(entity) > -1)
var placeHolder = new Folder("loading...")
placeHolder.addClass = "loading"
@@ -769,6 +770,10 @@ var QDR = (function(QDR) {
autoCollapse: $scope.largeNetwork,
activeVisible: !$scope.largeNetwork,
debugLevel: 0,
+ classNames: {
+ expander: 'fa-angle',
+ connector: 'dynatree-no-connector'
+ },
children: entityTreeChildren
})
restartUpdate()
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/qdrListChart.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrListChart.js b/console/stand-alone/plugin/js/qdrListChart.js
index 93391f1..3c14ebf 100644
--- a/console/stand-alone/plugin/js/qdrListChart.js
+++ b/console/stand-alone/plugin/js/qdrListChart.js
@@ -21,7 +21,7 @@ under the License.
*/
var QDR = (function(QDR) {
- QDR.module.controller('QDR.ListChartController', function ($scope, dialog, $dialog, $location, QDRChartService, chart, nodeName) {
+ QDR.module.controller('QDR.ListChartController', function ($scope, $uibModalInstance, $uibModal, $location, QDRChartService, chart, nodeName) {
$scope.chart = chart;
$scope.dialogSvgChart = null;
var updateTimer = null;
@@ -29,14 +29,14 @@ var QDR = (function(QDR) {
$scope.showChartsPage = function () {
cleanup();
- dialog.close(true);
+ $uibModalInstance.close(true);
$location.path(QDR.pluginRoot + "/charts");
};
$scope.addHChart = function () {
QDRChartService.addHDash($scope.chart);
cleanup();
- dialog.close(true);
+ $uibModalInstance.close(true);
}
$scope.addToDashboardLink = function () {
@@ -100,7 +100,7 @@ var QDR = (function(QDR) {
}
$scope.ok = function () {
cleanup();
- dialog.close(true);
+ $uibModalInstance.close(true);
};
$scope.editChart = function () {
@@ -109,7 +109,7 @@ var QDR = (function(QDR) {
function doDialog(template, chart) {
- $dialog.dialog({
+ var d = $uibModal.open({
backdrop: true,
keyboard: true,
backdropClick: true,
@@ -129,7 +129,7 @@ var QDR = (function(QDR) {
return true
}
}
- }).open().then(function(result) {
+ }).result.then(function(result) {
$scope.ok()
});
};
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/qdrNewNode.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrNewNode.js b/console/stand-alone/plugin/js/qdrNewNode.js
index f6d035a..48af70f 100644
--- a/console/stand-alone/plugin/js/qdrNewNode.js
+++ b/console/stand-alone/plugin/js/qdrNewNode.js
@@ -21,7 +21,7 @@ under the License.
*/
var QDR = (function(QDR) {
- QDR.module.controller("QDR.NodeDialogController", function($scope, QDRService, dialog, newname) {
+ QDR.module.controller("QDR.NodeDialogController", function($scope, QDRService, $uibModalInstance, newname) {
var schema = QDRService.schema;
var myEntities = ['router', 'log', 'listener'];
var typeMap = {
@@ -298,13 +298,13 @@ var QDR = (function(QDR) {
// handle the download button click
// copy the dialog's values to the original node
$scope.download = function() {
- dialog.close({
+ $uibModalInstance.close({
entities: $scope.entities,
annotations: annotations
});
}
$scope.cancel = function() {
- dialog.close()
+ $uibModalInstance.close()
};
$scope.selectAnnotationTab = function(tabName) {
@@ -327,7 +327,7 @@ var QDR = (function(QDR) {
});
- QDR.module.controller("QDR.DownloadDialogController", function($scope, QDRService, $templateCache, $window, dialog, results) {
+ QDR.module.controller("QDR.DownloadDialogController", function($scope, QDRService, $templateCache, $window, $uibModalInstance, results) {
var result = results.entities;
var annotations = results.annotations;
var annotationKeys = Object.keys(annotations);
@@ -437,7 +437,7 @@ var QDR = (function(QDR) {
}
$scope.done = function() {
- dialog.close();
+ $uibModalInstance.close();
}
});
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/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 f612847..303a91d 100644
--- a/console/stand-alone/plugin/js/qdrOverview.js
+++ b/console/stand-alone/plugin/js/qdrOverview.js
@@ -34,7 +34,7 @@ var QDR = (function (QDR) {
*
* Controller that handles the QDR overview page
*/
- QDR.module.controller("QDR.OverviewController", ['$scope', 'QDRService', '$location', '$timeout', '$dialog', function($scope, QDRService, $location, $timeout, $dialog) {
+ QDR.module.controller("QDR.OverviewController", ['$scope', 'QDRService', '$location', '$timeout', '$uibModal', function($scope, QDRService, $location, $timeout, $uibModal) {
console.log("QDR.OverviewControll started with location of " + $location.path() + " and connection of " + QDRService.connected);
var COLUMNSTATEKEY = 'QDRColumnKey.';
@@ -515,6 +515,16 @@ var QDR = (function (QDR) {
$scope.totalLinks = 0;
$scope.pagedLinkData = []
$scope.selectedLinks = []
+
+ var linkRowTmpl = `
+ <div ng-class="{linkDirIn: row.getProperty('linkDir') == 'in', linkDirOut: row.getProperty('linkDir') == 'out'}">
+ <div ng-style="{ 'cursor': row.cursor }" ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell {{col.cellClass}}">
+ <div class="ngVerticalBar" ng-style="{height: rowHeight}" ng-class="{ ngVerticalBarVisible: !$last }"> </div>
+ <div ng-cell></div>
+ </div>
+ </div>
+ `;
+
$scope.linksGrid = {
saveKey: 'linksGrid',
data: 'pagedLinkData',
@@ -591,8 +601,7 @@ var QDR = (function (QDR) {
enableColumnResize: true,
enableColumnReordering: true,
showColumnMenu: true,
- rowTemplate: 'linkRowTemplate.html',
- // aggregateTemplate: "linkAggTemplate.html",
+ rowTemplate: linkRowTmpl,
multiSelect: false,
selectedItems: $scope.selectedLinks,
plugins: [new ngGridFlexibleHeightPlugin()],
@@ -616,6 +625,7 @@ var QDR = (function (QDR) {
})
var loadColState = function (grid) {
+return;
if (!grid)
return;
var columns = localStorage.getItem(COLUMNSTATEKEY+grid.saveKey);
@@ -1236,29 +1246,32 @@ QDR.log.debug("setting linkFields to [] in selectMode")
}
function logDialog(row, col) {
- var d = $dialog.dialog({
- backdrop: false,
- keyboard: true,
- backdropClick: false,
- templateUrl: 'viewLogs.html',
- controller: "QDR.OverviewLogsController",
- resolve: {
- nodeName: function () {
- return row.entity.nodeName
- },
- module: function () {
- return row.entity.name
- },
- level: function () {
- return col.displayName
- },
- nodeId: function () {
- return row.entity.nodeId
- },
- }
- });
- d.open().then(function(result) { console.log("d.open().then"); });
- };
+ var d = $uibModal.open({
+ animation: true,
+ templateUrl: 'viewLogs.html',
+ controller: 'QDR.OverviewLogsController',
+ resolve: {
+ nodeName: function () {
+ return row.entity.nodeName
+ },
+ module: function () {
+ return row.entity.name
+ },
+ level: function () {
+ return col.displayName
+ },
+ nodeId: function () {
+ return row.entity.nodeId
+ },
+ }
+ });
+
+ d.result.then(function (result) {
+ console.log("d.open().then");
+ }, function () {
+ console.log('Modal dismissed at: ' + new Date());
+ });
+ };
var numberTemplate = '<div class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text>{{COL_FIELD | pretty}}</span></div>'
$scope.allLogFields = []
@@ -1524,6 +1537,7 @@ QDR.log.debug("setting linkFields to [] in selectMode")
})
$scope.template = template[0];
}
+ $scope.template = $scope.templates[0]
// 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
var activated = function (node) {
@@ -1608,6 +1622,7 @@ QDR.log.debug("newly created node needs to be activated")
routers.key = "Routers"
routers.parent = "Routers"
routers.addClass = "routers"
+ routers.isFolder = true
topLevelChildren.push(routers)
// called when the list of routers changes
var updateRouterTree = function (nodes) {
@@ -1636,6 +1651,7 @@ QDR.log.debug("newly created node needs to be activated")
addresses.key = "Addresses"
addresses.parent = "Addresses"
addresses.addClass = "addresses"
+ addresses.isFolder = true
topLevelChildren.push(addresses)
var updateAddressTree = function (addressFields) {
var worker = function (address) {
@@ -1677,6 +1693,7 @@ QDR.log.debug("newly created node needs to be activated")
links.key = "Links"
links.parent = "Links"
links.addClass = "links"
+ links.isFolder = true
topLevelChildren.push(links)
// called both before the tree is created and whenever a background update is done
@@ -1709,6 +1726,7 @@ QDR.log.debug("newly created node needs to be activated")
connections.key = "Connections"
connections.parent = "Connections"
connections.addClass = "connections"
+ connections.isFolder = true
topLevelChildren.push(connections)
updateConnectionTree = function (connectionFields) {
@@ -1756,6 +1774,7 @@ QDR.log.debug("newly created node needs to be activated")
logs.clickFolderMode = 1
logs.key = "Logs"
logs.parent = "Logs"
+ logs.isFolder = true
if (QDRService.versionCheck('0.8.0'))
topLevelChildren.push(logs)
var initTreeAndGrid = function () {
@@ -1773,6 +1792,10 @@ QDR.log.debug("newly created node needs to be activated")
activeVisible: !$scope.largeNetwork,
selectMode: 1,
debugLevel: 0,
+ classNames: {
+ expander: 'fa-angle',
+ connector: 'dynatree-no-connector'
+ },
children: topLevelChildren
})
treeRoot = $("#overtree").dynatree("getRoot");
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/qdrOverviewLogsController.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrOverviewLogsController.js b/console/stand-alone/plugin/js/qdrOverviewLogsController.js
index fed1e3d..832d8aa 100644
--- a/console/stand-alone/plugin/js/qdrOverviewLogsController.js
+++ b/console/stand-alone/plugin/js/qdrOverviewLogsController.js
@@ -21,7 +21,7 @@ under the License.
*/
var QDR = (function(QDR) {
- QDR.module.controller('QDR.OverviewLogsController', function ($scope, dialog, QDRService, $timeout, nodeName, nodeId, module, level) {
+ QDR.module.controller('QDR.OverviewLogsController', function ($scope, $uibModalInstance, QDRService, $timeout, nodeName, nodeId, module, level) {
var gotLogInfo = function (nodeId, entity, response, context) {
var statusCode = context.message.application_properties.statusCode;
@@ -58,7 +58,7 @@ var QDR = (function(QDR) {
$scope.nodeName = nodeName
$scope.logFields = []
$scope.ok = function () {
- dialog.close(true);
+ $uibModalInstance.close(true);
};
});
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/qdrSchema.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrSchema.js b/console/stand-alone/plugin/js/qdrSchema.js
index 656b159..d73e265 100644
--- a/console/stand-alone/plugin/js/qdrSchema.js
+++ b/console/stand-alone/plugin/js/qdrSchema.js
@@ -52,6 +52,7 @@ var QDR = (function (QDR) {
var tree = []
for (var key in QDRService.schema) {
var kid = {title: key}
+ kid.isFolder = true
var val = QDRService.schema[key]
if (val === Object(val))
keys2kids(kid, val)
@@ -62,7 +63,11 @@ var QDR = (function (QDR) {
}
$('#schema').dynatree({
minExpandLevel: 2,
- children: tree
+ classNames: {
+ expander: 'fa-angle',
+ connector: 'dynatree-no-connector'
+ },
+ children: tree
})
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/615d7b65/console/stand-alone/plugin/js/qdrTopology.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/qdrTopology.js b/console/stand-alone/plugin/js/qdrTopology.js
index 9899393..23da1bb 100644
--- a/console/stand-alone/plugin/js/qdrTopology.js
+++ b/console/stand-alone/plugin/js/qdrTopology.js
@@ -21,8 +21,9 @@ under the License.
*/
var QDR = (function(QDR) {
- QDR.module.controller('QDR.TopologyFormController', function($scope, QDRService) {
+ QDR.module.controller('QDR.TopologyFormController', function($scope, $rootScope, $timeout, QDRService) {
+ $scope.panelVisible = true // show/hide the panel on the left
$scope.attributes = []
var nameTemplate = '<div title="{{row.entity.description}}" class="ngCellText {{row.entity.cls}}"><span>{{row.entity.attributeName}}</span></div>';
var valueTemplate = '<div title="{{row.entity.attributeValue}}" class="ngCellText {{row.entity.cls}}"><span>{{row.entity.attributeValue}}</span></div>';
@@ -40,18 +41,18 @@ var QDR = (function(QDR) {
cellTemplate: valueTemplate
}]
};
- $scope.form = ''
+ $scope.form = 'router'
$scope.$on('showEntityForm', function(event, args) {
var attributes = args.attributes;
var entityTypes = QDRService.schema.entityTypes[args.entity].attributes;
attributes.forEach(function(attr) {
attr.cls = ''
-QDR.log.debug("attr.description " + attr.description)
if (attr.attributeName === 'Listening on')
attr.cls = 'listening-on'
if (entityTypes[attr.attributeName] && entityTypes[attr.attributeName].description) {
attr.description = entityTypes[attr.attributeName].description
}
+ //QDR.log.debug("attr.description " + attr.description)
})
$scope.attributes = attributes;
$scope.form = args.entity;
@@ -59,6 +60,41 @@ QDR.log.debug("attr.description " + attr.description)
$scope.$on('showAddForm', function(event) {
$scope.form = 'add';
})
+
+ $scope.hideLeftPane = function () {
+ d3.select(".qdr-topology-form")
+ .transition().duration(300).ease("sin-in")
+ .style("left" , "-309px")
+ .each("end", function () {
+ $timeout(function () {
+ QDR.log.debug("done with transition. setting scope ");
+ $scope.panelVisible = false
+ $rootScope.$broadcast('panel-resized')
+ })
+/*
+ d3.select(".qdr-topology-svg")
+ .transition().duration(300).ease("sin-in")
+ .style("margin-left", "30px")
+ .each("end", function () {
+ resize()
+ $timeout(function () {QDR.log.debug("done with transition. setting scope ");$scope.panelVisible = false})
+ })
+*/
+ })}
+
+ $scope.showLeftPane = function () {
+ d3.select(".qdr-topology-form")
+ .transition().duration(300).ease("sin-out")
+ .style("left" , "0px")
+
+ d3.select(".qdr-topology-svg")
+ .transition().duration(300).ease("sin-out")
+ .style("margin-left", "430px")
+ .each("end", function () {
+ resize()
+ $timeout(function () {QDR.log.debug("done with transition. setting scope ");$scope.panelVisible = true})
+ })
+ }
})
/**
@@ -66,41 +102,14 @@ QDR.log.debug("attr.description " + attr.description)
*
* Controller that handles the QDR topology page
*/
- QDR.module.controller("QDR.TopologyController", ['$scope', '$rootScope', 'QDRService', '$location', '$timeout', '$dialog',
- function($scope, $rootScope, QDRService, $location, $timeout, $dialog) {
+ QDR.module.controller("QDR.TopologyController", ['$scope', '$rootScope', 'QDRService', '$location', '$timeout', '$uibModal',
+ function($scope, $rootScope, QDRService, $location, $timeout, $uibModal) {
- $scope.panelVisible = true // show/hide the panel on the left
$scope.multiData = []
$scope.selectedClient = [];
$scope.quiesceState = {}
var dontHide = false;
- $scope.hideLeftPane = function () {
- d3.select(".qdr-topology.pane.left")
- .transition().duration(300).ease("sin-in")
- .style("left" , "-380px")
-
- d3.select(".panel-adjacent")
- .transition().duration(300).ease("sin-in")
- .style("margin-left", "30px")
- .each("end", function () {
- resize()
- $timeout(function () {QDR.log.debug("done with transition. setting scope ");$scope.panelVisible = false})
- })
- }
- $scope.showLeftPane = function () {
- d3.select(".qdr-topology.pane.left")
- .transition().duration(300).ease("sin-out")
- .style("left" , "0px")
-
- d3.select(".panel-adjacent")
- .transition().duration(300).ease("sin-out")
- .style("margin-left", "430px")
- .each("end", function () {
- resize()
- $timeout(function () {QDR.log.debug("done with transition. setting scope ");$scope.panelVisible = true})
- })
- }
$scope.quiesceConnection = function(row) {
var entity = row.entity;
var state = $scope.quiesceState[entity.connectionId].state;
@@ -335,7 +344,6 @@ QDR.log.debug("attr.description " + attr.description)
];
$scope.mode = "Diagram";
$scope.contextNode = null; // node that is associated with the current context menu
-
$scope.isModeActive = function(name) {
if ((name == 'Add Router' || name == 'Diagram') && $scope.addingNode.step > 0)
return true;
@@ -547,6 +555,10 @@ QDR.log.debug("attr.description " + attr.description)
force.size(sizes).resume();
}
}
+
+ $scope.$on('panel-resized', function () {
+ resize()
+ })
window.addEventListener('resize', resize);
var sizes = getSizes()
width = sizes[0]
@@ -990,7 +1002,7 @@ QDR.log.debug("attr.description " + attr.description)
});
}
}
- $scope.$broadcast('showEntityForm', {
+ $rootScope.$broadcast('showEntityForm', {
entity: entity,
attributes: attributes
})
@@ -2113,7 +2125,7 @@ QDR.log.debug("attr.description " + attr.description)
function doAddDialog(NewRouterName) {
QDRService.ensureAllEntities({entity: ".listener"}, function () {
- var d = $dialog.dialog({
+ var d = $uibModal.open({
dialogClass: "modal dlg-large",
backdrop: true,
keyboard: true,
@@ -2127,7 +2139,7 @@ QDR.log.debug("attr.description " + attr.description)
}
});
$timeout(function () {
- d.open().then(function(result) {
+ d.result.then(function(result) {
if (result)
doDownloadDialog(result);
});
@@ -2136,7 +2148,7 @@ QDR.log.debug("attr.description " + attr.description)
};
function doDownloadDialog(result) {
- d = $dialog.dialog({
+ d = $uibModal.open({
backdrop: true,
keyboard: true,
backdropClick: true,
@@ -2148,7 +2160,7 @@ QDR.log.debug("attr.description " + attr.description)
}
}
});
- d.open().then(function(result) {
+ d.result.then(function(result) {
//QDR.log.debug("download dialog done")
})
if (!$scope.$$phase) $scope.$apply()
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org