This is an automated email from the ASF dual-hosted git repository.
mtien pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 60a8b3bc5f NIFI-10698: Add filtering options to summary table (#6610)
60a8b3bc5f is described below
commit 60a8b3bc5f83fae89b7651a132150300bee1d590
Author: Shane Ardell <[email protected]>
AuthorDate: Mon Nov 7 13:34:42 2022 -0500
NIFI-10698: Add filtering options to summary table (#6610)
* NIFI-10698: Add filtering options to summary table
* NIFI-10698: fix checkbox spacing and alignment
* NIFI-10698: fix spacing between dropdowns
Merged #6610 into main.
---
.../WEB-INF/partials/summary/summary-content.jsp | 7 +-
.../nifi-web-ui/src/main/webapp/css/common-ui.css | 10 ++-
.../main/webapp/js/nf/summary/nf-summary-table.js | 76 +++++++++++++++++++++-
3 files changed, 90 insertions(+), 3 deletions(-)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/summary-content.jsp
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/summary-content.jsp
index f8195b5396..8dbfcb6d14 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/summary-content.jsp
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/WEB-INF/partials/summary/summary-content.jsp
@@ -27,7 +27,12 @@
</div>
<div id="summary-filter-container" class="filter-container">
<input type="text" placeholder="Filter" id="summary-filter"
class="filter"/>
- <div id="summary-filter-type" class="filter-type"></div>
+ <div id="summary-filter-type" class="filter-type filter"></div>
+ <div id="summary-filter-status-dropdown"
class="filter-status-dropdown"></div>
+ <div id="summary-filter-primary-node-container"
class="setting-field summary-filter-primary-node-container">
+ <div id="summary-filter-primary-node"
class="summary-filter-primary-node nf-checkbox checkbox-unchecked"></div>
+ <div class="relationship-name nf-checkbox-label
ellipsis">Primary Node</div>
+ </div>
</div>
</div>
<div id="view-options-container">
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/common-ui.css
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/common-ui.css
index 7a6cffe248..ef56a9b454 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/common-ui.css
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/common-ui.css
@@ -411,7 +411,8 @@ input.filter {
width: 173px;
}
-.filter-type {
+.filter-type,
+.filter-status-dropdown {
float: left;
width: 148px;
}
@@ -425,6 +426,13 @@ input.filter {
margin-bottom: 5px;
}
+.setting-field.summary-filter-primary-node-container {
+ display: inline-block;
+ margin-left: 10px;
+ margin-top: 8px;
+ width: auto;
+}
+
/* overlay icon styles */
.stop-configure-icon.fa-stop {
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 2384d00a2d..6a873cb6be 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
@@ -67,6 +67,8 @@
}
};
+ var showOnlyPrimaryNodeProcessors = false;
+
var DATA_SEPARATOR = ' | ';
/**
@@ -177,6 +179,8 @@
select: function () {
var tab = $(this).text();
if (tab === 'Processors') {
+ $('#summary-filter-status-dropdown').show();
+ $('#summary-filter-primary-node-container').show();
// ensure the processor table is sized properly
var processorsGrid =
$('#processor-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(processorsGrid)) {
@@ -200,7 +204,41 @@
applyFilter();
}
});
+
+ // update the combo for processors
+ $('#summary-filter-status-dropdown').combo({
+ options: [{
+ text: 'All Statuses',
+ value: 'all-statuses'
+ },{
+ text: 'Running',
+ value: 'Running'
+ }, {
+ text: 'Stopped',
+ value: 'Stopped'
+ }, {
+ text: 'Validating',
+ value: 'Validating'
+ }, {
+ text: 'Disabled',
+ value: 'Disabled'
+ }, {
+ text: 'Invalid',
+ value: 'Invalid'
+ }],
+ select: function (option) {
+ applyFilter();
+ }
+ });
+
+ $('#summary-filter-primary-node').on('change', function
(event, args) {
+ showOnlyPrimaryNodeProcessors = args.isChecked;
+ applyFilter()
+ });
} else if (tab === 'Connections') {
+ $('#summary-filter-status-dropdown').hide();
+ $('#summary-filter-primary-node-container').hide();
+ resetPrimaryNodeCheckbox();
// ensure the connection table is size properly
var connectionsGrid =
$('#connection-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(connectionsGrid)) {
@@ -228,6 +266,9 @@
}
});
} else if (tab === 'Input Ports') {
+ $('#summary-filter-status-dropdown').show();
+ $('#summary-filter-primary-node-container').hide();
+ resetPrimaryNodeCheckbox();
// ensure the connection table is size properly
var inputPortsGrid =
$('#input-port-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(inputPortsGrid)) {
@@ -249,6 +290,9 @@
}
});
} else if (tab === 'Output Ports') {
+ $('#summary-filter-status-dropdown').show();
+ $('#summary-filter-primary-node-container').hide();
+ resetPrimaryNodeCheckbox();
// ensure the connection table is size properly
var outputPortsGrid =
$('#output-port-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(outputPortsGrid)) {
@@ -270,6 +314,9 @@
}
});
} else if (tab === 'Remote Process Groups') {
+ $('#summary-filter-status-dropdown').hide();
+ $('#summary-filter-primary-node-container').hide();
+ resetPrimaryNodeCheckbox();
// ensure the connection table is size properly
var remoteProcessGroupsGrid =
$('#remote-process-group-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(remoteProcessGroupsGrid))
{
@@ -294,6 +341,9 @@
}
});
} else {
+ $('#summary-filter-status-dropdown').hide();
+ $('#summary-filter-primary-node-container').hide();
+ resetPrimaryNodeCheckbox();
// ensure the connection table is size properly
var processGroupGrid =
$('#process-group-summary-table').data('gridInstance');
if (nfCommon.isDefinedAndNotNull(processGroupGrid)) {
@@ -2481,6 +2531,17 @@
* @returns {Boolean} Whether or not to include the item
*/
var filter = function (item, args) {
+ if (args.showOnlyPrimaryNode) {
+ if (item.executionNode !== 'PRIMARY') {
+ return false;
+ }
+ }
+ if (args.filterByStatus && args.filterByStatus !== 'all-statuses') {
+ if (item.runStatus !== args.filterByStatus) {
+ return false;
+ }
+ }
+
if (args.searchString === '') {
return true;
}
@@ -2496,6 +2557,17 @@
return item[args.property].search(filterExp) >= 0;
};
+ /**
+ * Returns primary node checkbox to original unchecked state
+ */
+ var resetPrimaryNodeCheckbox = function () {
+ var isChecked =
$('#summary-filter-primary-node').hasClass('checkbox-checked');
+ if (isChecked) {
+
$('#summary-filter-primary-node').removeClass('checkbox-checked').addClass('checkbox-unchecked');
+ };
+ showOnlyPrimaryNodeProcessors = false;
+ };
+
/**
* Refreshes the system diagnostics.
*/
@@ -2770,7 +2842,9 @@
// update the search criteria
data.setFilterArgs({
searchString: getFilterText(),
- property:
$('#summary-filter-type').combo('getSelectedOption').value
+ property:
$('#summary-filter-type').combo('getSelectedOption').value,
+ filterByStatus:
$('#summary-filter-status-dropdown').combo('getSelectedOption').value,
+ showOnlyPrimaryNode: showOnlyPrimaryNodeProcessors
});
data.refresh();
}