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 a1301d473e..c118ecefbc 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); @@ -771,6 +776,13 @@ nf.Canvas = (function () { polling = false; }, + /** + * 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(); 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 868bbb0d11..0b0e6147ec 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(); } },