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:
parent
9d52ed5ff6
commit
3008e4e60f
@ -182,7 +182,7 @@ RED.deploy = (function() {
|
|||||||
|
|
||||||
var unusedConfigNodes = [];
|
var unusedConfigNodes = [];
|
||||||
RED.nodes.eachConfig(function(node) {
|
RED.nodes.eachConfig(function(node) {
|
||||||
if (node.users.length === 0) {
|
if (node.users.length === 0 && (node._def.hasUsers !== false)) {
|
||||||
unusedConfigNodes.push(getNodeInfo(node));
|
unusedConfigNodes.push(getNodeInfo(node));
|
||||||
hasUnusedConfig = true;
|
hasUnusedConfig = true;
|
||||||
}
|
}
|
||||||
|
@ -798,7 +798,9 @@ RED.editor = (function() {
|
|||||||
var trayBody = tray.find(".editor-tray-body");
|
var trayBody = tray.find(".editor-tray-body");
|
||||||
var trayFooter = tray.find(".editor-tray-footer");
|
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.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>');
|
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);
|
var dialogForm = $('<form id="node-config-dialog-edit-form" class="form-horizontal"></form>').appendTo(trayBody);
|
||||||
@ -865,9 +867,9 @@ RED.editor = (function() {
|
|||||||
tabSelect.i18n();
|
tabSelect.i18n();
|
||||||
|
|
||||||
dialogForm.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();
|
$("#node-config-dialog-user-count").find("span").html(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
RED.workspaces.refresh();
|
RED.workspaces.refresh();
|
||||||
|
Loading…
Reference in New Issue
Block a user