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 2022/03/03 14:13:14 UTC
[nifi] branch main updated: [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized (#5812)
This is an automated email from the ASF dual-hosted git repository.
mcgilman 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 7a16619 [NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized (#5812)
7a16619 is described below
commit 7a16619969a90655b5aed6bf938fa0a3019ab673
Author: Adam Kocsis <ko...@gmail.com>
AuthorDate: Thu Mar 3 15:13:00 2022 +0100
[NIFI-9690] Display icon on Connection Label to show when head of the queue is penalized (#5812)
This closes #5812
---
.../nifi-web-ui/src/main/webapp/css/graph.css | 2 +-
.../src/main/webapp/js/nf/canvas/nf-connection.js | 35 ++++++++++++++++++++++
2 files changed, 36 insertions(+), 1 deletion(-)
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
index f47771b..89dbc5c 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/css/graph.css
@@ -320,7 +320,7 @@ g.connection path.connection-path.unauthorized {
stroke-dasharray: 3,3;
}
-text.connection-from-run-status, text.connection-to-run-status, text.expiration-icon, text.load-balance-icon {
+text.connection-from-run-status, text.connection-to-run-status, text.expiration-icon, text.load-balance-icon, text.penalized-icon {
fill: #728e9b;
font-family: FontAwesome;
font-size: 12px;
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
index 454252b..ad1b086 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-connection.js
@@ -1637,6 +1637,41 @@
return;
}
+ // penalized icon
+ var connectionLabelContainer = updated.select('g.connection-label-container');
+ if (connectionLabelContainer.select('text.penalized-icon').empty()) {
+ connectionLabelContainer.select('g.queued-container')
+ .append('text')
+ .attrs({
+ 'class': 'penalized-icon',
+ 'y': 14
+ })
+ .text(function () {
+ return '\uf252';
+ })
+ .append('title');
+ }
+
+ // determine whether or not to show the penalized icon
+ connectionLabelContainer.select('text.penalized-icon')
+ .classed('hidden', function (d) {
+ var flowFileAvailability = _.get(d, 'status.aggregateSnapshot.flowFileAvailability', null)
+ return flowFileAvailability !== 'HEAD_OF_QUEUE_PENALIZED';
+ })
+ .attr('x', function () {
+ var offset = 0;
+ if (!connectionLabelContainer.select('text.expiration-icon').classed('hidden')) {
+ offset += 16;
+ }
+ if (!connectionLabelContainer.select('text.load-balance-icon').classed('hidden')) {
+ offset += 16;
+ }
+ return 208 - offset;
+ })
+ .select('title').text(function () {
+ return 'A FlowFile is currently penalized and data cannot be processed at this time.';
+ });
+
// update data size
var dataSizeDeferred = $.Deferred(function (deferred) {
// queued count value