mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Add "search for" buttons to notifications
This commit is contained in:
@@ -358,6 +358,14 @@ var RED = (function() {
|
||||
} else {
|
||||
options.buttons = [
|
||||
{
|
||||
text: RED._("notification.label.unknownNodesButton"),
|
||||
class: "pull-left",
|
||||
click: function() {
|
||||
RED.actions.invoke("core:search", "type:unknown");
|
||||
}
|
||||
},
|
||||
{
|
||||
class: "primary",
|
||||
text: RED._("common.label.close"),
|
||||
click: function() {
|
||||
persistentNotifications[notificationId].hideNotification();
|
||||
|
@@ -383,6 +383,13 @@ RED.deploy = (function() {
|
||||
"</p>";
|
||||
|
||||
notificationButtons = [
|
||||
{
|
||||
text: RED._("deploy.unknownNodesButton"),
|
||||
class: "pull-left",
|
||||
click: function() {
|
||||
RED.actions.invoke("core:search","type:unknown");
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
||||
text: RED._("deploy.confirm.button.confirm"),
|
||||
@@ -402,6 +409,14 @@ RED.deploy = (function() {
|
||||
RED._('deploy.confirm.confirm') +
|
||||
"</p>";
|
||||
notificationButtons = [
|
||||
{
|
||||
text: RED._("deploy.invalidNodesButton"),
|
||||
class: "pull-left",
|
||||
click: function() {
|
||||
notification.close();
|
||||
RED.actions.invoke("core:search","is:invalid");
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "red-ui-deploy-dialog-confirm-deploy-deploy",
|
||||
text: RED._("deploy.confirm.button.confirm"),
|
||||
@@ -462,9 +477,31 @@ RED.deploy = (function() {
|
||||
RED.nodes.version(data.rev);
|
||||
RED.nodes.originalFlow(nns);
|
||||
if (hasUnusedConfig) {
|
||||
const opts = {
|
||||
type: "success",
|
||||
fixed: false,
|
||||
timeout: 6000,
|
||||
buttons: [
|
||||
{
|
||||
text: RED._("deploy.unusedConfigNodesButton"),
|
||||
class: "pull-left",
|
||||
click: function() {
|
||||
RED.actions.invoke("core:search","is:config is:unused");
|
||||
}
|
||||
},
|
||||
{
|
||||
text: RED._("common.label.close"),
|
||||
class: "primary",
|
||||
click: function () {
|
||||
save(true);
|
||||
notification.close();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
RED.notify(
|
||||
'<p>' + RED._("deploy.successfulDeploy") + '</p>' +
|
||||
'<p>' + RED._("deploy.unusedConfigNodes") + ' <a href="#" onclick="RED.sidebar.config.show(true); return false;">' + RED._("deploy.unusedConfigNodesLink") + '</a></p>', "success", false, 6000);
|
||||
'<p>' + RED._("deploy.unusedConfigNodes") + '</p>', opts);
|
||||
} else {
|
||||
RED.notify('<p>' + RED._("deploy.successfulDeploy") + '</p>', "success");
|
||||
}
|
||||
|
Reference in New Issue
Block a user