mirror of https://github.com/apache/nifi.git
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:
parent
55f4716f3d
commit
67cbef5df3
|
@ -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.
|
||||
|
|
|
@ -607,6 +607,9 @@ nf.Common = (function () {
|
|||
|
||||
// shut off the auto refresh
|
||||
nf.Canvas.stopPolling();
|
||||
|
||||
// allow page refresh with ctrl-r
|
||||
nf.Canvas.disableRefreshHotKey();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue