mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
If debug set not to go to sidebar hide the button
Add button.visible function to view.js Make status independant of tosidebar setting
This commit is contained in:
@@ -73,6 +73,7 @@
|
||||
align: "right",
|
||||
button: {
|
||||
toggle: "active",
|
||||
visible: function() { return this.tosidebar; },
|
||||
onclick: function() {
|
||||
var label = this.name||"debug";
|
||||
var node = this;
|
||||
@@ -84,7 +85,7 @@
|
||||
t:'edit',
|
||||
node:node,
|
||||
changes:{
|
||||
active: !node.active
|
||||
active:!node.active
|
||||
},
|
||||
dirty:node.dirty,
|
||||
changed:node.changed
|
||||
|
@@ -19,10 +19,7 @@ module.exports = function(RED) {
|
||||
if (this.tosidebar === undefined) { this.tosidebar = true; }
|
||||
this.severity = n.severity || 40;
|
||||
this.active = (n.active === null || typeof n.active === "undefined") || n.active;
|
||||
if (this.tostatus) {
|
||||
this.oldStatus = {fill:"grey", shape:"ring"};
|
||||
this.status(this.oldStatus);
|
||||
}
|
||||
if (this.tostatus) { this.status({fill:"grey", shape:"ring"}); }
|
||||
else { this.status({}); }
|
||||
|
||||
var node = this;
|
||||
@@ -78,16 +75,16 @@ module.exports = function(RED) {
|
||||
node.log(util.inspect(output, {colors:useColors}));
|
||||
}
|
||||
}
|
||||
if (this.tostatus === true) {
|
||||
var st = util.inspect(output);
|
||||
var severity = node.severity;
|
||||
if (st.length > 32) { st = st.substr(0,32) + "..."; }
|
||||
node.status({fill:colors[severity], shape:"dot", text:st});
|
||||
}
|
||||
if (this.active) {
|
||||
if (this.tosidebar == true) {
|
||||
sendDebug({id:node.id, z:node.z, name:node.name, topic:msg.topic, property:property, msg:output, _path:msg._path});
|
||||
}
|
||||
if (this.tostatus === true) {
|
||||
var st = util.inspect(output);
|
||||
if (st.length > 32) { st = st.substr(0,32) + "..."; }
|
||||
node.oldStatus = {fill:colors[node.severity], shape:"dot", text:st};
|
||||
node.status(node.oldStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user