NIFI-2917: disable canvas refresh after ajax error and allow page refresh

This closes #1351.

Signed-off-by: Andy LoPresto <alopresto@apache.org>
This commit is contained in:
Scott Aslan 2016-12-21 10:33:58 -05:00 committed by Andy LoPresto
parent 55f4716f3d
commit 67cbef5df3
No known key found for this signature in database
GPG Key ID: 3C6EF65B2F7DEF69
2 changed files with 17 additions and 2 deletions

View File

@ -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();
@ -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.

View File

@ -607,6 +607,9 @@ nf.Common = (function () {
// shut off the auto refresh
nf.Canvas.stopPolling();
// allow page refresh with ctrl-r
nf.Canvas.disableRefreshHotKey();
}
},