1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Add hasUsers flag to config nodes

This commit is contained in:
Nick O'Leary 2016-06-29 21:07:45 +01:00
parent 9d52ed5ff6
commit 3008e4e60f
2 changed files with 7 additions and 5 deletions

View File

@ -182,7 +182,7 @@ RED.deploy = (function() {
var unusedConfigNodes = [];
RED.nodes.eachConfig(function(node) {
if (node.users.length === 0) {
if (node.users.length === 0 && (node._def.hasUsers !== false)) {
unusedConfigNodes.push(getNodeInfo(node));
hasUnusedConfig = true;
}

View File

@ -798,7 +798,9 @@ RED.editor = (function() {
var trayBody = tray.find(".editor-tray-body");
var trayFooter = tray.find(".editor-tray-footer");
if (node_def.hasUsers !== false) {
trayFooter.prepend('<div id="node-config-dialog-user-count"><i class="fa fa-info-circle"></i> <span></span></div>');
}
trayFooter.append('<span id="node-config-dialog-scope-container"><span id="node-config-dialog-scope-warning" data-i18n="[title]editor.errors.scopeChange"><i class="fa fa-warning"></i></span><select id="node-config-dialog-scope"></select></span>');
var dialogForm = $('<form id="node-config-dialog-edit-form" class="form-horizontal"></form>').appendTo(trayBody);
@ -865,9 +867,9 @@ RED.editor = (function() {
tabSelect.i18n();
dialogForm.i18n();
if (node_def.hasUsers !== false) {
$("#node-config-dialog-user-count").find("span").html(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show();
}
},
close: function() {
RED.workspaces.refresh();