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/11/30 21:03:45 UTC
qpid-dispatch git commit: DISPATCH-576 Show log event counts
Repository: qpid-dispatch
Updated Branches:
refs/heads/master 606b34c13 -> 5ec550b67
DISPATCH-576 Show log event counts
Project: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/commit/5ec550b6
Tree: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/tree/5ec550b6
Diff: http://git-wip-us.apache.org/repos/asf/qpid-dispatch/diff/5ec550b6
Branch: refs/heads/master
Commit: 5ec550b673692c044ffa973650715802fa140c37
Parents: 606b34c
Author: Ernest Allen <ea...@redhat.com>
Authored: Wed Nov 30 16:03:26 2016 -0500
Committer: Ernest Allen <ea...@redhat.com>
Committed: Wed Nov 30 16:03:26 2016 -0500
----------------------------------------------------------------------
console/stand-alone/index.html | 1 +
console/stand-alone/plugin/css/plugin.css | 8 +
.../stand-alone/plugin/html/qdrOverview.html | 38 ++-
console/stand-alone/plugin/js/dispatchPlugin.js | 213 +++++++-------
console/stand-alone/plugin/js/qdrOverview.js | 277 +++++++++++++++++--
console/stand-alone/plugin/js/qdrService.js | 19 +-
6 files changed, 429 insertions(+), 127 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/console/stand-alone/index.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/index.html b/console/stand-alone/index.html
index 8f998ff..1b08af7 100644
--- a/console/stand-alone/index.html
+++ b/console/stand-alone/index.html
@@ -97,6 +97,7 @@ under the License.
<script type="text/javascript" src="plugin/js/dispatchPlugin.js"></script>
<script type="text/javascript" src="plugin/js/qdrOverview.js"></script>
+ <script type="text/javascript" src="plugin/js/qdrOverviewLogsController.js"></script>
<script type="text/javascript" src="plugin/js/navbar.js"></script>
<script type="text/javascript" src="plugin/js/qdrList.js"></script>
<script type="text/javascript" src="plugin/js/qdrListChart.js"></script>
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/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 fcc4842..ca8839e 100644
--- a/console/stand-alone/plugin/css/plugin.css
+++ b/console/stand-alone/plugin/css/plugin.css
@@ -451,6 +451,14 @@ ul.qdrTopoModes {
background:#e0e0ff;
}
+.overview-cell .ngCell:hover {
+ background:#e0e0ff;
+}
+.overview-cell .ngCell.col0:hover, .overview-cell .ngCell.col1:hover {
+ background: initial;
+}
+
+
.qdr-overview.pane.left, .qdr-attributes.pane.left {
top: 104px;
}
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/console/stand-alone/plugin/html/qdrOverview.html
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/html/qdrOverview.html b/console/stand-alone/plugin/html/qdrOverview.html
index fb10f31..993a4d5 100644
--- a/console/stand-alone/plugin/html/qdrOverview.html
+++ b/console/stand-alone/plugin/html/qdrOverview.html
@@ -122,12 +122,20 @@ under the License.
</script>
<script type="text/ng-template" id="logs.html">
<div class="row-fluid">
- <h3>Recent log entries</h3>
+ <h3>Recent log events</h3>
<div class="overview">
<div class="gridStyle" ng-grid="allLogGrid"></div>
</div>
</div>
</script>
+<script type="text/ng-template" id="logModule.html">
+ <div class="row-fluid">
+ <h3>{{logModule.module}} events</h3>
+ <div class="overview-cell">
+ <div class="gridStyle" ng-grid="logModuleGrid"></div>
+ </div>
+ </div>
+</script>
<script type="text/ng-template" id="log.html">
<div class="row-fluid">
<h3>{{log.data.title}}</h3>
@@ -168,3 +176,31 @@ under the License.
<div ng-class="{true: 'ngAggArrowCollapsed', false: 'ngAggArrowExpanded'}[row.collapsed]"></div>
</div>
</script>
+
+<script type="text/ng-template" id="viewLogs.html">
+ <div class="modal-header">
+ <h3 class="modal-title">Logs for {{nodeName}} {{module}}:{{level | humanify}}</h3>
+ </div>
+ <div class="modal-body">
+ <div class="log-details" ng-if="logFields.length > 0">
+ <table class="log-entry" ng-repeat="entry in logFields track by $index">
+ <tr>
+ <td>Router</td><td>{{entry.nodeId}}</td>
+ </tr>
+ <tr>
+ <td align="left" colspan="2">{{entry.time}}</td>
+ </tr>
+ <tr>
+ <td>Source</td><td>{{entry.source}}:{{entry.line}}</td>
+ </tr>
+ <tr>
+ <td valign="middle">Message</td><td valign="middle"><pre>{{entry.message}}</pre></td>
+ </tr>
+ </table>
+ </div>
+ <div ng-if="logFields.length == 0">No log entries</div>
+ </div>
+ <div class="modal-footer">
+ <button class="btn btn-primary" type="button" ng-click="ok()">Close</button>
+ </div>
+</script>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/console/stand-alone/plugin/js/dispatchPlugin.js
----------------------------------------------------------------------
diff --git a/console/stand-alone/plugin/js/dispatchPlugin.js b/console/stand-alone/plugin/js/dispatchPlugin.js
index 9127d1b..5bc52b7 100644
--- a/console/stand-alone/plugin/js/dispatchPlugin.js
+++ b/console/stand-alone/plugin/js/dispatchPlugin.js
@@ -69,7 +69,7 @@ var QDR = (function(QDR) {
QDR.module = angular.module(QDR.pluginName, ['ngResource', 'ngGrid', 'ui.bootstrap', 'ui.slider'/*, 'minicolors' */]);
Core = {
- notification: function (severity, msg) {
+ notification: function (severity, msg) {
$.notify(msg, severity);
}
}
@@ -103,88 +103,97 @@ var QDR = (function(QDR) {
})
});
- QDR.module.config(function ($compileProvider) {
- var cur = $compileProvider.urlSanitizationWhitelist();
- $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|blob):/);
- cur = $compileProvider.urlSanitizationWhitelist();
- })
+ QDR.module.config(function ($compileProvider) {
+ var cur = $compileProvider.urlSanitizationWhitelist();
+ $compileProvider.urlSanitizationWhitelist(/^\s*(https?|ftp|mailto|file|blob):/);
+ cur = $compileProvider.urlSanitizationWhitelist();
+ })
- QDR.module.filter('to_trusted', ['$sce', function($sce){
+ QDR.module.filter('to_trusted', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
- QDR.module.filter('humanify', function (QDRService) {
- return function (input) {
- return QDRService.humanify(input);
- };
- });
+ QDR.module.filter('humanify', function (QDRService) {
+ return function (input) {
+ return QDRService.humanify(input);
+ };
+ });
- QDR.module.filter('Pascalcase', function () {
- return function (str) {
- if (!str)
- return "";
- return str.replace(/(\w)(\w*)/g,
- function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();});
- }
- })
+ QDR.module.filter('Pascalcase', function () {
+ return function (str) {
+ if (!str)
+ return "";
+ return str.replace(/(\w)(\w*)/g,
+ function(g0,g1,g2){return g1.toUpperCase() + g2.toLowerCase();});
+ }
+ })
- QDR.module.filter('safePlural', function () {
- return function (str) {
- var es = ['x', 'ch', 'ss', 'sh']
- for (var i=0; i<es.length; ++i) {
- if (str.endsWith(es[i]))
- return str + 'es'
- }
- if (str.endsWith('y'))
- return str.substr(0, str.length-2) + 'ies'
- if (str.endsWith('s'))
- return str;
- return str + 's'
- }
- })
+ QDR.module.filter('safePlural', function () {
+ return function (str) {
+ var es = ['x', 'ch', 'ss', 'sh']
+ for (var i=0; i<es.length; ++i) {
+ if (str.endsWith(es[i]))
+ return str + 'es'
+ }
+ if (str.endsWith('y'))
+ return str.substr(0, str.length-2) + 'ies'
+ if (str.endsWith('s'))
+ return str;
+ return str + 's'
+ }
+ })
- QDR.logger = function ($log) {
- var log = $log;
+ QDR.module.filter('pretty', function () {
+ return function (str) {
+ var formatComma = d3.format(",");
+ if (!isNaN(parseFloat(str)) && isFinite(str))
+ return formatComma(str);
+ return str;
+ }
+ })
- this.debug = function (msg) { msg = "QDR: " + msg; log.debug(msg)};
- this.error = function (msg) {msg = "QDR: " + msg; log.error(msg)}
- this.info = function (msg) {msg = "QDR: " + msg; log.info(msg)}
- this.warn = function (msg) {msg = "QDR: " + msg; log.warn(msg)}
+ QDR.logger = function ($log) {
+ var log = $log;
- return this;
- }
+ this.debug = function (msg) { msg = "QDR: " + msg; log.debug(msg)};
+ this.error = function (msg) {msg = "QDR: " + msg; log.error(msg)}
+ this.info = function (msg) {msg = "QDR: " + msg; log.info(msg)}
+ this.warn = function (msg) {msg = "QDR: " + msg; log.warn(msg)}
+
+ return this;
+ }
// one-time initialization happens in the run function
// of our module
- QDR.module.run( ["$rootScope", '$route', '$timeout', "$location", "$log", "QDRService", "QDRChartService", function ($rootScope, $route, $timeout, $location, $log, QDRService, QDRChartService) {
- QDR.log = new QDR.logger($log);
- QDR.log.info("*************creating Dispatch Console************");
- var curPath = $location.path()
- var org = curPath.substr(1)
- if (org && org.length > 0 && org !== "connect") {
- $location.search('org', org)
- } else {
- $location.search('org', null)
- }
+ QDR.module.run( ["$rootScope", '$route', '$timeout', "$location", "$log", "QDRService", "QDRChartService", function ($rootScope, $route, $timeout, $location, $log, QDRService, QDRChartService) {
+ QDR.log = new QDR.logger($log);
+ QDR.log.info("*************creating Dispatch Console************");
+ var curPath = $location.path()
+ var org = curPath.substr(1)
+ if (org && org.length > 0 && org !== "connect") {
+ $location.search('org', org)
+ } else {
+ $location.search('org', null)
+ }
QDR.queue = d3.queue;
- QDRService.initProton();
- var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]);
- QDRService.addUpdatedAction("initChartService", function() {
+ QDRService.initProton();
+ var settings = angular.fromJson(localStorage[QDR.SETTINGS_KEY]);
+ QDRService.addUpdatedAction("initChartService", function() {
QDRService.delUpdatedAction("initChartService")
- QDRChartService.init(); // initialize charting service after we are connected
- });
- if (settings && settings.autostart) {
- QDRService.addDisconnectAction( function () {
- $timeout(function () {
- var lastLocation = localStorage[QDR.LAST_LOCATION] || "/overview";
- org = lastLocation.substr(1)
- $location.path("/connect");
- $location.search('org', org)
- })
- })
- QDRService.addConnectAction(function() {
+ QDRChartService.init(); // initialize charting service after we are connected
+ });
+ if (settings && settings.autostart) {
+ QDRService.addDisconnectAction( function () {
+ $timeout(function () {
+ var lastLocation = localStorage[QDR.LAST_LOCATION] || "/overview";
+ org = lastLocation.substr(1)
+ $location.path("/connect");
+ $location.search('org', org)
+ })
+ })
+ QDRService.addConnectAction(function() {
QDRService.getSchema(function () {
QDR.log.debug("got schema after connection")
QDRService.addUpdatedAction("initialized", function () {
@@ -206,53 +215,53 @@ var QDR = (function(QDR) {
QDRService.setUpdateEntities([])
QDRService.topology.get()
})
- });
- QDRService.connect(settings);
+ });
+ QDRService.connect(settings);
} else {
$timeout(function () {
- $location.path('/connect')
- $location.search('org', org)
+ $location.path('/connect')
+ $location.search('org', org)
})
}
$rootScope.$on('$routeChangeSuccess', function() {
var path = $location.path();
- if (path !== "/connect") {
- localStorage[QDR.LAST_LOCATION] = path;
- }
+ if (path !== "/connect") {
+ localStorage[QDR.LAST_LOCATION] = path;
+ }
});
- }]);
+ }]);
- QDR.module.controller ("QDR.MainController", ['$scope', '$location', function ($scope, $location) {
- QDR.log.debug("started QDR.MainController with location.url: " + $location.url());
- QDR.log.debug("started QDR.MainController with window.location.pathname : " + window.location.pathname);
- $scope.topLevelTabs = [];
- $scope.topLevelTabs.push({
- id: "qdr",
- content: "Qpid Dispatch Router Console",
- title: "Dispatch Router Console",
- isValid: function() { return true; },
- href: function() { return "#connect"; },
- isActive: function() { return true; }
- });
- }])
+ QDR.module.controller ("QDR.MainController", ['$scope', '$location', function ($scope, $location) {
+ QDR.log.debug("started QDR.MainController with location.url: " + $location.url());
+ QDR.log.debug("started QDR.MainController with window.location.pathname : " + window.location.pathname);
+ $scope.topLevelTabs = [];
+ $scope.topLevelTabs.push({
+ id: "qdr",
+ content: "Qpid Dispatch Router Console",
+ title: "Dispatch Router Console",
+ isValid: function() { return true; },
+ href: function() { return "#connect"; },
+ isActive: function() { return true; }
+ });
+ }])
- QDR.module.controller ("QDR.Core", function ($scope, $rootScope) {
- $scope.alerts = [];
- $scope.closeAlert = function(index) {
+ QDR.module.controller ("QDR.Core", function ($scope, $rootScope) {
+ $scope.alerts = [];
+ $scope.closeAlert = function(index) {
$scope.alerts.splice(index, 1);
};
- $scope.$on('newAlert', function(event, data) {
- $scope.alerts.push(data);
- $scope.$apply();
- });
- $scope.$on("clearAlerts", function () {
- $scope.alerts = [];
- $scope.$apply();
- })
+ $scope.$on('newAlert', function(event, data) {
+ $scope.alerts.push(data);
+ $scope.$apply();
+ });
+ $scope.$on("clearAlerts", function () {
+ $scope.alerts = [];
+ $scope.$apply();
+ })
- })
+ })
return QDR;
}(QDR || {}));
@@ -260,8 +269,8 @@ var QDR = (function(QDR) {
var Folder = (function () {
function Folder(title) {
this.title = title;
- this.children = [];
- this.folder = true;
+ this.children = [];
+ this.folder = true;
}
return Folder;
})();
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/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 14d1ee9..7ca0d21 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', function($scope, QDRService, $location, $timeout) {
+ QDR.module.controller("QDR.OverviewController", ['$scope', 'QDRService', '$location', '$timeout', '$dialog', function($scope, QDRService, $location, $timeout, $dialog) {
console.log("QDR.OverviewControll started with location of " + $location.path() + " and connection of " + QDRService.connected);
var COLUMNSTATEKEY = 'QDRColumnKey.';
@@ -87,7 +87,7 @@ var QDR = (function (QDR) {
{ name: 'Connections', url: 'connections.html'},
{ name: 'Connection', url: 'connection.html'},
{ name: 'Logs', url: 'logs.html'},
- { name: 'Log', url: 'log.html'}
+ { name: 'Log', url: 'logModule.html'}
];
var topLevelChildren = [];
@@ -850,7 +850,7 @@ var QDR = (function (QDR) {
$("#overtree").dynatree("getTree").activateKey(nodeId);
}
}
- };
+ };
// get info for a all connections
var allConnectionInfo = function () {
getAllConnectionFields([updateConnectionGrid, updateConnectionTree, scheduleNextUpdate])
@@ -1159,6 +1159,132 @@ QDR.log.debug("setting linkFields to [] in selectMode")
loadColState($scope.connectionGrid);
}
+
+ var logModuleCellTemplate = '<div ng-click="logInfoFor(row, col)" class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text>{{COL_FIELD | pretty}}</span></div>'
+ $scope.logModule = {}
+ $scope.logModuleSelected = []
+ $scope.logModuleData = []
+ $scope.logModuleGrid = {
+ data: 'logModuleData',
+ columnDefs: [
+ {
+ field: 'nodeName',
+ displayName: 'Router',
+ },
+ {
+ field: 'enable',
+ displayName: 'Enable level',
+ },
+ {
+ field: 'noticeCount',
+ displayName: 'Notice',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'infoCount',
+ displayName: 'Info',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'traceCount',
+ displayName: 'Trace',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'debugCount',
+ displayName: 'Debug',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'warningCount',
+ displayName: 'Warning',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'errorCount',
+ displayName: 'Error',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'criticalCount',
+ displayName: 'Critical',
+ cellTemplate: logModuleCellTemplate,
+ cellClass: 'grid-align-value',
+ },
+ ],
+ enableColumnResize: true,
+ multiSelect: false,
+ selectedItems: $scope.logModuleSelected,
+ plugins: [new ngGridFlexibleHeightPlugin()],
+ afterSelectionChange: function(data) {
+ if (data.selected) {
+ var selItem = $scope.logModuleSelected[0]
+ var nodeId = selItem.nodeId
+
+ }
+ }
+ }
+
+ $scope.logInfoFor = function (row, col) {
+ var gotLogInfo = function (nodeId, entity, response, context) {
+ var statusCode = context.message.application_properties.statusCode;
+ if (statusCode < 200 || statusCode >= 300) {
+ Core.notification('error', context.message.application_properties.statusDescription);
+ } else {
+ var levelLogs = response.filter( function (result) {
+ if (result[1] == null)
+ result[1] = "error"
+ return result[1].toUpperCase() === col.displayName.toUpperCase() && result[0] === row.entity.name
+ })
+ var logFields = levelLogs.map( function (result) {
+ return {
+ nodeId: QDRService.nameFromId(nodeId),
+ name: result[0],
+ type: result[1],
+ message: result[2],
+ source: result[3],
+ line: result[4],
+ time: Date(result[5]).toString()
+ }
+ })
+ logDialog(row, col, logFields)
+ }
+ }
+ QDRService.sendMethod(row.entity.nodeId, undefined, {}, "GET-LOG", {module: row.entity.name}, gotLogInfo)
+ }
+
+ function logDialog(row, col, logs) {
+ var d = $dialog.dialog({
+ backdrop: false,
+ keyboard: true,
+ backdropClick: false,
+ templateUrl: 'viewLogs.html',
+ controller: "QDR.OverviewLogsController",
+ resolve: {
+ logs: function() {
+ return logs
+ },
+ nodeName: function () {
+ return row.entity.nodeName
+ },
+ module: function () {
+ return row.entity.name
+ },
+ level: function () {
+ return col.displayName
+ },
+ }
+ });
+ d.open().then(function(result) { console.log("d.open().then"); });
+ };
+
+ var numberTemplate = '<div class="ngCellText" ng-class="col.colIndex()"><span ng-cell-text>{{COL_FIELD | pretty}}</span></div>'
$scope.allLogFields = []
$scope.allLogSelections = [];
$scope.allLogGrid = {
@@ -1166,7 +1292,7 @@ QDR.log.debug("setting linkFields to [] in selectMode")
data: 'allLogFields',
columnDefs: [
{
- field: 'module',
+ field: 'name',
saveKey: 'allLogGrid',
displayName: 'Module'
},
@@ -1177,32 +1303,103 @@ QDR.log.debug("setting linkFields to [] in selectMode")
*/
{
- field: 'count',
- displayName: 'Count'
- }
-
+ field: 'noticeCount',
+ displayName: 'Notice',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'infoCount',
+ displayName: 'Info',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'traceCount',
+ displayName: 'Trace',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'debugCount',
+ displayName: 'Debug',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'warningCount',
+ displayName: 'Warning',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'errorCount',
+ displayName: 'Error',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
+ {
+ field: 'criticalCount',
+ displayName: 'Critical',
+ cellTemplate: numberTemplate,
+ cellClass: 'grid-align-value',
+ },
],
+ //enableCellSelection: true,
enableColumnResize: true,
multiSelect: false,
selectedItems: $scope.allLogSelections,
plugins: [new ngGridFlexibleHeightPlugin()],
+
afterSelectionChange: function(data) {
if (data.selected) {
var selItem = $scope.allLogSelections[0]
- var nodeId = selItem.module
+ var nodeId = selItem.name
// activate in the tree
$("#overtree").dynatree("getTree").activateKey(nodeId);
}
}
+
};
- var allLogEntries = []
+ var allLogEntries = {}
var allLogInfo = function () {
- var nodeIds = QDRService.nodeIdList()
- var haveLogFields = function () {
// update the count of entries for each module
+ $scope.allLogFields = []
+ var logResults = {}
+ var logDetails = {}
+
+ var gotLogStats = function (node, entity, response) {
+ logDetails[node] = []
+ response.results.forEach( function (result) {
+ var oresult = QDRService.flatten(response.attributeNames, result)
+ // make a copy for the details grid since logResults has the same object reference
+ logDetails[node].push(angular.copy(oresult))
+ if (!(oresult.name in logResults)) {
+ logResults[oresult.name] = oresult
+ }
+ else {
+ response.attributeNames.forEach( function (attr, i) {
+ if (attr.substr(attr.length-5) === 'Count') {
+ logResults[oresult.name][attr] += result[i]
+ }
+ })
+ }
+ })
+ }
+ var gotAllLogStats = function () {
+ var sortedModules = Object.keys(logResults)
+ sortedModules.sort(function (a,b) {return a<b?-1:a>b?1:0})
+ sortedModules.forEach( function (module) {
+ $scope.allLogFields.push(logResults[module])
+ })
+ allLogEntries = logDetails
+ updateLogTree($scope.allLogFields)
+ }
+ QDRService.fetchAllEntities({entity: 'logStats'}, gotAllLogStats, gotLogStats)
+/*
var q = QDR.queue(1)
- var logResults = []
+
var queuedSendMethod = function (node, callback) {
var gotLogInfo = function (nodeId, entity, response, context) {
var statusCode = context.message.application_properties.statusCode;
@@ -1246,12 +1443,11 @@ QDR.log.debug("setting linkFields to [] in selectMode")
})
}
if ($scope.allLogFields.length == 0) {
- QDRService.fetchEntity(nodeIds[0], "log", ["module"], function (nodeName, entity, response) {
- var moduleIndex = response.attributeNames.indexOf("module")
+ QDRService.fetchEntity(nodeIds[0], "logStats", [], function (nodeName, entity, response) {
+ var moduleIndex = response.attributeNames.indexOf("name")
response.results.sort( function (a,b) {return a[moduleIndex] < b[moduleIndex] ? -1 : a[moduleIndex] > b[moduleIndex] ? 1 : 0})
response.results.forEach( function (result) {
var log = QDRService.flatten(response.attributeNames, result)
- log.count = 0;
$scope.allLogFields.push(log)
})
updateLogTree($scope.allLogFields)
@@ -1260,18 +1456,54 @@ QDR.log.debug("setting linkFields to [] in selectMode")
} else {
haveLogFields()
}
+ */
}
$scope.logFields = []
// get info for a single log
var logInfo = function (node) {
+
+ var gotLogInfo = function (responses) {
+ $timeout(function () {
+ $scope.logModuleData = []
+ $scope.logModule.module = node.data.key
+ for (var n in responses) {
+ var moduleIndex = responses[n]['log'].attributeNames.indexOf("module")
+ var result = responses[n]['log'].results.filter( function (r) {
+ return r[moduleIndex] === node.data.key
+ })[0]
+ var logInfo = QDRService.flatten(responses[n]['log'].attributeNames, result)
+ var entry = allLogEntries[n]
+ entry.forEach( function (module) {
+ if (module.name === node.data.key) {
+ module.nodeName = QDRService.nameFromId(n)
+ module.nodeId = n
+ module.enable = logInfo.enable
+ $scope.logModuleData.push(module)
+ }
+ })
+ }
+ $scope.logModuleData.sort ( function (a,b) { return a.nodeName < b.nodeName? -1 : a.nodeName> b.nodeName? 1 : 0})
+ scheduleNextUpdate()
+ })
+ }
+ QDRService.fetchAllEntities({entity: 'log', attrs: ['module', 'enable']}, gotLogInfo)
+/*
$timeout(function () {
$scope.log = node
- $scope.logFields = allLogEntries.filter( function (log) {
- return node.data.key === log.name
- })
+ $scope.logFields = []
+ for (var n in allLogEntries) {
+ var entry = allLogEntries[n]
+ entry.forEach( function (module) {
+ if (module.name === node.data.key) {
+ module.nodeId = n
+ $scope.logFields.push(module)
+ }
+ })
+ }
scheduleNextUpdate()
})
+*/
}
var getExpandedList = function () {
@@ -1525,10 +1757,10 @@ QDR.log.debug("newly created node needs to be activated")
var updateLogTree = function (logFields) {
var worker = function (log) {
- var l = new Folder(log.module)
+ var l = new Folder(log.name)
l.type = "Log"
l.info = logInfo
- l.key = log.module
+ l.key = log.name
l.parent = "Logs"
l.activate = lastKey === l.key
l.addClass = "log"
@@ -1547,7 +1779,8 @@ QDR.log.debug("newly created node needs to be activated")
logs.clickFolderMode = 1
logs.key = "Logs"
logs.parent = "Logs"
- topLevelChildren.push(logs)
+ if (QDRService.versionCheck('0.8.0'))
+ topLevelChildren.push(logs)
var initTreeAndGrid = function () {
if (!htmlReady || !dataReady)
return;
http://git-wip-us.apache.org/repos/asf/qpid-dispatch/blob/5ec550b6/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 a4b673d..8691b75 100644
--- a/console/stand-alone/plugin/js/qdrService.js
+++ b/console/stand-alone/plugin/js/qdrService.js
@@ -48,6 +48,7 @@ var QDR = (function(QDR) {
*/
sender: undefined,
receiver: undefined,
+ version: undefined,
sendable: false,
schema: undefined,
@@ -133,6 +134,21 @@ console.dump(e)
return self.connected;
},
+ versionCheck: function (minVer) {
+ var verparts = self.version.split('.')
+ var minparts = minVer.split('.')
+ try {
+ for (var i=0; i<minparts.length; ++i) {
+ if (parseInt(minVer[i] > parseInt(verparts[i])))
+ return false
+ }
+ } catch (e) {
+ QDR.log.debug("error doing version check between: " + self.version + " and " + minVer + " " + e.message)
+ return false
+ }
+ return true
+ },
+
correlator: {
_objects: {},
_correlationID: 0,
@@ -430,9 +446,7 @@ console.dump(e)
// optionally supply a resultCallBack that will be called as each result is avaialble
// if a resultCallBack is supplied, the calling function is responsible for accumulating the responses
// otherwise the responses will be returned to the doneCallback as an object
- // There is a 10 second limit between each response
fetchAllEntities: function (entityAttribs, doneCallback, resultCallback) {
-//QDR.log.debug("fetchAllEntities")
var q = QDR.queue(self.queueDepth())
var results = {}
if (!resultCallback) {
@@ -971,6 +985,7 @@ console.dump(e)
}
if (!self.connectionError) {
connection.on('connection_open', function(context) {
+ self.version = context.connection.properties.version
QDR.log.debug("connection_opened")
okay.connection = true;
okay.receiver = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org