mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Better notification message when action is not permitted
This commit is contained in:
parent
913b09570c
commit
75a7be41eb
@ -268,10 +268,12 @@ RED.deploy = (function() {
|
|||||||
RED.events.emit("deploy");
|
RED.events.emit("deploy");
|
||||||
}).fail(function(xhr,textStatus,err) {
|
}).fail(function(xhr,textStatus,err) {
|
||||||
RED.nodes.dirty(true);
|
RED.nodes.dirty(true);
|
||||||
if (xhr.responseText) {
|
if (xhr.status === 401) {
|
||||||
RED.notify(RED._("notification.error",{message:xhr.responseText}),"error");
|
RED.notify(RED._("deploy.deployFailed",{message:RED._("user.notAuthorized")}),"error");
|
||||||
|
} else if (xhr.responseText) {
|
||||||
|
RED.notify(RED._("deploy.deployFailed",{message:xhr.responseText}),"error");
|
||||||
} else {
|
} else {
|
||||||
RED.notify(RED._("notification.error",{message:RED._("deploy.errors.noResponse")}),"error");
|
RED.notify(RED._("deploy.deployFailed",{message:RED._("deploy.errors.noResponse")}),"error");
|
||||||
}
|
}
|
||||||
}).always(function() {
|
}).always(function() {
|
||||||
$("#btn-deploy-icon").removeClass('spinner');
|
$("#btn-deploy-icon").removeClass('spinner');
|
||||||
|
@ -344,7 +344,11 @@ RED.library = (function() {
|
|||||||
}).done(function(data,textStatus,xhr) {
|
}).done(function(data,textStatus,xhr) {
|
||||||
RED.notify(RED._("library.savedType", {type:options.type}),"success");
|
RED.notify(RED._("library.savedType", {type:options.type}),"success");
|
||||||
}).fail(function(xhr,textStatus,err) {
|
}).fail(function(xhr,textStatus,err) {
|
||||||
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
if (xhr.status === 401) {
|
||||||
|
RED.notify(RED._("library.saveFailed",{message:RED._("user.notAuthorized")}),"error");
|
||||||
|
} else {
|
||||||
|
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$( "#node-dialog-library-save-confirm" ).dialog({
|
$( "#node-dialog-library-save-confirm" ).dialog({
|
||||||
@ -444,7 +448,11 @@ RED.library = (function() {
|
|||||||
RED.library.loadFlowLibrary();
|
RED.library.loadFlowLibrary();
|
||||||
RED.notify(RED._("library.savedNodes"),"success");
|
RED.notify(RED._("library.savedNodes"),"success");
|
||||||
}).fail(function(xhr,textStatus,err) {
|
}).fail(function(xhr,textStatus,err) {
|
||||||
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
if (xhr.status === 401) {
|
||||||
|
RED.notify(RED._("library.saveFailed",{message:RED._("user.notAuthorized")}),"error");
|
||||||
|
} else {
|
||||||
|
RED.notify(RED._("library.saveFailed",{message:xhr.responseText}),"error");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$( this ).dialog( "close" );
|
$( this ).dialog( "close" );
|
||||||
|
@ -47,7 +47,8 @@
|
|||||||
"user": {
|
"user": {
|
||||||
"loggedInAs": "Logged in as __name__",
|
"loggedInAs": "Logged in as __name__",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"loginFailed": "Login failed"
|
"loginFailed": "Login failed",
|
||||||
|
"notAuthorized": "Not authorized"
|
||||||
},
|
},
|
||||||
"notification": {
|
"notification": {
|
||||||
"warning": "<strong>Warning</strong>: __message__",
|
"warning": "<strong>Warning</strong>: __message__",
|
||||||
@ -84,6 +85,7 @@
|
|||||||
"modifiedNodes": "Modified Nodes",
|
"modifiedNodes": "Modified Nodes",
|
||||||
"modifiedNodesDesc": "Only deploys nodes that have changed",
|
"modifiedNodesDesc": "Only deploys nodes that have changed",
|
||||||
"successfulDeploy": "Successfully deployed",
|
"successfulDeploy": "Successfully deployed",
|
||||||
|
"deployFailed": "Deploy failed: __message__",
|
||||||
"unusedConfigNodes":"You have some unused configuration nodes.",
|
"unusedConfigNodes":"You have some unused configuration nodes.",
|
||||||
"unusedConfigNodesLink":"Click here to see them",
|
"unusedConfigNodesLink":"Click here to see them",
|
||||||
"errors": {
|
"errors": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user