You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2017/01/03 00:57:51 UTC
nifi git commit: NIFI-2917: disable canvas refresh after ajax error
and allow page refresh
Repository: nifi
Updated Branches:
refs/heads/master 55f4716f3 -> 67cbef5df
NIFI-2917: disable canvas refresh after ajax error and allow page refresh
This closes #1351.
Signed-off-by: Andy LoPresto <al...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/67cbef5d
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/67cbef5d
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/67cbef5d
Branch: refs/heads/master
Commit: 67cbef5df33ec3194f8086589911398d9d57b4b1
Parents: 55f4716
Author: Scott Aslan <sc...@gmail.com>
Authored: Wed Dec 21 10:33:58 2016 -0500
Committer: Andy LoPresto <al...@apache.org>
Committed: Mon Jan 2 16:32:05 2017 -0800
----------------------------------------------------------------------
.../src/main/webapp/js/nf/canvas/nf-canvas.js | 16 ++++++++++++++--
.../nifi-web-ui/src/main/webapp/js/nf/nf-common.js | 3 +++
2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/nifi/blob/67cbef5d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
index a1301d4..c118ece 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-canvas.js
@@ -112,6 +112,7 @@ nf.Canvas = (function () {
var MIN_SCALE_TO_RENDER = 0.6;
var polling = false;
+ var allowPageRefresh = false;
var groupId = 'root';
var groupName = null;
var permissions = null;
@@ -587,6 +588,10 @@ nf.Canvas = (function () {
var isCtrl = evt.ctrlKey || evt.metaKey;
if (isCtrl) {
if (evt.keyCode === 82) {
+ if (allowPageRefresh === true) {
+ location.reload();
+ return;
+ }
// ctrl-r
nf.Actions.reload();
@@ -688,7 +693,7 @@ nf.Canvas = (function () {
// update the access policies
permissions = flowResponse.permissions;
-
+
// update the breadcrumbs
nf.ng.Bridge.injector.get('breadcrumbsCtrl').resetBreadcrumbs();
nf.ng.Bridge.injector.get('breadcrumbsCtrl').generateBreadcrumbs(breadcrumb);
@@ -772,6 +777,13 @@ nf.Canvas = (function () {
},
/**
+ * Disable the canvas refresh hot key.
+ */
+ disableRefreshHotKey: function () {
+ allowPageRefresh = true;
+ },
+
+ /**
* Reloads the flow from the server based on the currently specified group id.
* To load another group, update nf.Canvas.setGroupId, clear the canvas, and call nf.Canvas.reload.
*/
@@ -885,7 +897,7 @@ nf.Canvas = (function () {
});
});
}).promise();
-
+
userXhr.done(function () {
// load the client id
var clientXhr = nf.Client.init();
http://git-wip-us.apache.org/repos/asf/nifi/blob/67cbef5d/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
index 868bbb0..0b0e614 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/nf-common.js
@@ -607,6 +607,9 @@ nf.Common = (function () {
// shut off the auto refresh
nf.Canvas.stopPolling();
+
+ // allow page refresh with ctrl-r
+ nf.Canvas.disableRefreshHotKey();
}
},