您有两种选择:
-
node red使用jquery用户界面,因此您可以创建自己的
jQuery Dialog
无论你想要什么内容。有很多使用该API的例子-我不会在这里重复它们。
-
节点红色提供
RED.notify
下拉通知的API。您可以使用它来显示结果。
最简单的是,您可以调用:
RED.notify("This is my message");
该消息将显示5秒的默认时间。
如果你想让它一直保持到用户点击一个按钮,你可以做如下的事情:
var myNotification = RED.notify("This is the message to display",{
modal: true,
fixed: true,
buttons: [
{
text: "cancel",
click: function(e) {
myNotification.close();
}
},
{
text: "okay",
class:"primary",
click: function(e) {
myNotification.close();
}
}
]
});