You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by mc...@apache.org on 2018/01/05 14:14:36 UTC
nifi git commit: NIFI-4402 - Add component location in Summary view
Repository: nifi
Updated Branches:
refs/heads/master ce4374ee0 -> 41d9506a2
NIFI-4402 - Add component location in Summary view
Implemented as described in the issue. Improvements are welcome.
Reworded the title according to feedback.
This closes #2195
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/41d9506a
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/41d9506a
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/41d9506a
Branch: refs/heads/master
Commit: 41d9506a2beea9506d6ee09e3ee9a154c13378e3
Parents: ce4374e
Author: yuri1969 <19...@gmail.com>
Authored: Wed Oct 4 22:53:16 2017 +0200
Committer: Matt Gilman <ma...@gmail.com>
Committed: Fri Jan 5 09:09:37 2018 -0500
----------------------------------------------------------------------
.../webapp/js/nf/summary/nf-summary-table.js | 43 +++++++++++++++++---
1 file changed, 37 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/41d9506a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
index 1cf0e49..dbc3b70 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/summary/nf-summary-table.js
@@ -413,6 +413,15 @@
resizable: true,
formatter: nfCommon.genericValueFormatter
},
+ {
+ id: 'parentGroup',
+ field: 'parentProcessGroupName',
+ name: 'Process Group',
+ sortable: true,
+ resizable: true,
+ formatter: nfCommon.genericValueFormatter,
+ toolTip: 'Parent Process Group name'
+ },
runStatusColumn,
inputColumn,
ioColumn,
@@ -430,7 +439,7 @@
var markup = '';
if (isInShell) {
- markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Processor" style="margin-right: 3px;"></div>';
+ markup += '<div class="pointer go-to fa fa-long-arrow-right" title="Go To Processor in ' + nfCommon.escapeHtml(dataContext.processGroupNamePath) + '" style="margin-right: 3px;"></div>';
}
if (nfCommon.SUPPORTS_SVG) {
@@ -2523,12 +2532,21 @@
* @argument {array} inputPortItems The input port data
* @argument {array} outputPortItems The input port data
* @argument {array} remoteProcessGroupItems The remote process group data
- * @argument {object} aggregateSnapshot The process group status
+ * @argument {object} aggregateSnapshot The process group status
+ * @argument {array} ancestorsSnapshot The process group hierarchy
*/
- var populateProcessGroupStatus = function (processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot) {
+ var populateProcessGroupStatus = function (processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot, ancestorsSnapshot) {
// add the processors to the summary grid
$.each(aggregateSnapshot.processorStatusSnapshots, function (i, procStatusEntity) {
- processorItems.push(procStatusEntity.processorStatusSnapshot);
+ var currentProcessorStatusSnapshot = procStatusEntity.processorStatusSnapshot;
+
+ currentProcessorStatusSnapshot.parentProcessGroupName = aggregateSnapshot.name;
+ // construct a 'path' based on hierarchical group levels
+ currentProcessorStatusSnapshot.processGroupNamePath = ancestorsSnapshot.reduce(function(tempGroupNamesPath, ancestorGroup) {
+ return tempGroupNamesPath + '/' + ancestorGroup.name;
+ }, '');
+
+ processorItems.push(currentProcessorStatusSnapshot);
});
// add the processors to the summary grid
@@ -2556,11 +2574,24 @@
// add any child group's status
$.each(aggregateSnapshot.processGroupStatusSnapshots, function (i, childProcessGroupEntity) {
- populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, childProcessGroupEntity.processGroupStatusSnapshot);
+ var childProcessGroupStatusSnapshot = childProcessGroupEntity.processGroupStatusSnapshot;
+ populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, childProcessGroupStatusSnapshot, createUpdatedAncestorsSnapshot(ancestorsSnapshot, childProcessGroupStatusSnapshot));
});
};
/**
+ * Creates a new process group hierarchy.
+ *
+ * @argument {array} ancestorsSnapshot The process group hierarchy
+ * @argument {object} newAncestor The process group to add
+ */
+ var createUpdatedAncestorsSnapshot = function(ancestorsSnapshot, newAncestor) {
+ var snapshotCopy = ancestorsSnapshot.slice();
+ snapshotCopy.push(newAncestor);
+ return snapshotCopy;
+ };
+
+ /**
* Applies the filter found in the filter expression text field.
*/
var applyFilter = function () {
@@ -3105,7 +3136,7 @@
var remoteProcessGroupItems = [];
// populate the tables
- populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot);
+ populateProcessGroupStatus(processorItems, connectionItems, processGroupItems, inputPortItems, outputPortItems, remoteProcessGroupItems, aggregateSnapshot, [aggregateSnapshot]);
// update the processors
processorsData.setItems(processorItems);