mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Compare commits
21 Commits
4508
...
4536-handl
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c24f05c2cd | ||
|
|
5b096bfd5e | ||
|
|
a1e242ec1e | ||
|
|
5b9d002f56 | ||
|
|
6620679008 | ||
|
|
f93654f680 | ||
|
|
1bef0c32a2 | ||
|
|
a5725c59fd | ||
|
|
4168bbb751 | ||
|
|
b0086edcf9 | ||
|
|
89c2efe17d | ||
|
|
9030b7d27c | ||
|
|
de5111b13f | ||
|
|
8600f4131e | ||
|
|
8a8245b560 | ||
|
|
962fc5990e | ||
|
|
eb2f57fc0d | ||
|
|
3a6b1e86dc | ||
|
|
c31e622160 | ||
|
|
0b0f1f8701 | ||
|
|
b5e955bd5e |
@@ -1231,7 +1231,11 @@ RED.editor = (function() {
|
||||
})
|
||||
|
||||
if (node_def.hasUsers !== false) {
|
||||
$('<span><i class="fa fa-info-circle"></i> <span id="red-ui-editor-config-user-count"></span></span>').css("margin-left", "10px").appendTo(trayFooterLeft);
|
||||
// $('<span><i class="fa fa-info-circle"></i> <span id="red-ui-editor-config-user-count"></span></span>').css("margin-left", "10px").appendTo(trayFooterLeft);
|
||||
$('<button type="button" class="red-ui-button"><i class="fa fa-user"></i><span id="red-ui-editor-config-user-count"></span></button>').on('click', function() {
|
||||
RED.sidebar.info.outliner.search('uses:'+editing_config_node.id)
|
||||
RED.sidebar.info.show()
|
||||
}).appendTo(trayFooterLeft);
|
||||
}
|
||||
trayFooter.append('<span class="red-ui-tray-footer-right"><span id="red-ui-editor-config-scope-warning" data-i18n="[title]editor.errors.scopeChange"><i class="fa fa-warning"></i></span><select id="red-ui-editor-config-scope"></select></span>');
|
||||
|
||||
@@ -1289,7 +1293,8 @@ RED.editor = (function() {
|
||||
});
|
||||
}
|
||||
if (node_def.hasUsers !== false) {
|
||||
$("#red-ui-editor-config-user-count").text(RED._("editor.nodesUse", {count:editing_config_node.users.length})).parent().show();
|
||||
$("#red-ui-editor-config-user-count").text(editing_config_node.users.length).parent().show();
|
||||
RED.popover.tooltip($("#red-ui-editor-config-user-count").parent(), function() { return RED._('editor.nodesUse',{count:editing_config_node.users.length})});
|
||||
}
|
||||
trayBody.i18n();
|
||||
trayFooter.i18n();
|
||||
|
||||
@@ -158,6 +158,7 @@ RED.sidebar.config = (function() {
|
||||
entry.data('node',node.id);
|
||||
nodeDiv.data('node',node.id);
|
||||
var label = $('<div class="red-ui-palette-label"></div>').text(labelText).appendTo(nodeDiv);
|
||||
|
||||
if (node.d) {
|
||||
nodeDiv.addClass("red-ui-palette-node-config-disabled");
|
||||
$('<i class="fa fa-ban"></i>').prependTo(label);
|
||||
@@ -179,6 +180,20 @@ RED.sidebar.config = (function() {
|
||||
nodeDiv.addClass("red-ui-palette-node-config-unused");
|
||||
}
|
||||
}
|
||||
|
||||
if (!node.valid) {
|
||||
nodeDiv.addClass("red-ui-palette-node-config-invalid")
|
||||
const nodeDivAnnotations = $('<svg class="red-ui-palette-node-annotations red-ui-flow-node-error" width="10" height="10"></svg>').appendTo(nodeDiv)
|
||||
const errorBadge = document.createElementNS("http://www.w3.org/2000/svg","path");
|
||||
errorBadge.setAttribute("d","M 0,9 l 10,0 -5,-8 z");
|
||||
nodeDivAnnotations.append($(errorBadge))
|
||||
RED.popover.tooltip(nodeDivAnnotations, function () {
|
||||
if (node.validationErrors && node.validationErrors.length > 0) {
|
||||
return RED._("editor.errors.invalidProperties")+"<br> - "+node.validationErrors.join("<br> - ")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
nodeDiv.on('click',function(e) {
|
||||
e.stopPropagation();
|
||||
RED.view.select(false);
|
||||
|
||||
@@ -232,7 +232,7 @@ RED.sidebar.context = (function() {
|
||||
typeHint: data.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools,
|
||||
path: ""
|
||||
path: k
|
||||
}).appendTo(propRow.children()[1]);
|
||||
}
|
||||
})
|
||||
@@ -278,7 +278,7 @@ RED.sidebar.context = (function() {
|
||||
typeHint: data.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools,
|
||||
path: ""
|
||||
path: k
|
||||
}).appendTo(propRow.children()[1]);
|
||||
}
|
||||
});
|
||||
@@ -299,7 +299,7 @@ RED.sidebar.context = (function() {
|
||||
typeHint: v.format,
|
||||
sourceId: id+"."+k,
|
||||
tools: tools,
|
||||
path: ""
|
||||
path: k
|
||||
}).appendTo(propRow.children()[1]);
|
||||
if (contextStores.length > 1) {
|
||||
$("<span>",{class:"red-ui-sidebar-context-property-storename"}).text(v.store).appendTo($(propRow.children()[0]))
|
||||
|
||||
@@ -4155,10 +4155,15 @@ RED.view = (function() {
|
||||
scaleFactor = 30/largestEdge;
|
||||
}
|
||||
var width = img.width * scaleFactor;
|
||||
if (width > 20) {
|
||||
scalefactor *= 20/width;
|
||||
width = 20;
|
||||
}
|
||||
var height = img.height * scaleFactor;
|
||||
icon.attr("width",width);
|
||||
icon.attr("height",height);
|
||||
icon.attr("x",15-width/2);
|
||||
icon.attr("y",(30-height)/2);
|
||||
}
|
||||
icon.attr("xlink:href",iconUrl);
|
||||
icon.style("display",null);
|
||||
|
||||
@@ -36,7 +36,7 @@ ul.red-ui-sidebar-node-config-list {
|
||||
text-align: center;
|
||||
}
|
||||
.red-ui-palette-node {
|
||||
overflow: hidden;
|
||||
// overflow: hidden;
|
||||
cursor: default;
|
||||
&.selected {
|
||||
border-color: transparent;
|
||||
@@ -113,6 +113,15 @@ ul.red-ui-sidebar-node-config-list li.red-ui-palette-node-config-type {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.red-ui-palette-node-config-invalid {
|
||||
border-color: var(--red-ui-form-input-border-error-color)
|
||||
}
|
||||
.red-ui-palette-node-annotations {
|
||||
position: absolute;
|
||||
left: calc(100% - 15px);
|
||||
top: -8px;
|
||||
display: block;
|
||||
}
|
||||
.red-ui-sidebar-node-config-filter-info {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<title>{{ page.title }}</title>
|
||||
<link rel="icon" type="image/png" href="{{ page.favicon }}">
|
||||
<link rel="mask-icon" href="{{ page.tabicon.icon }}" color="{{ page.tabicon.colour }}">
|
||||
<link rel="icon" type="image/png" href="{{{ page.favicon }}}">
|
||||
<link rel="mask-icon" href="{{{ page.tabicon.icon }}}" color="{{ page.tabicon.colour }}">
|
||||
<link rel="stylesheet" href="vendor/jquery/css/base/jquery-ui.min.css?v={{ cacheBuster }}">
|
||||
<link rel="stylesheet" href="vendor/font-awesome/css/font-awesome.min.css?v={{ cacheBuster }}">
|
||||
<link rel="stylesheet" href="red/style.min.css?v={{ cacheBuster }}">
|
||||
@@ -38,10 +38,10 @@
|
||||
<div id="red-ui-editor"></div>
|
||||
<script src="vendor/vendor.js?v={{ cacheBuster }}"></script>
|
||||
{{#asset.vendorMonaco}}
|
||||
<script src="{{ asset.vendorMonaco }}?v={{ cacheBuster }}"></script>
|
||||
<script src="{{{ asset.vendorMonaco }}}?v={{ cacheBuster }}"></script>
|
||||
{{/asset.vendorMonaco}}
|
||||
<script src="{{ asset.red }}?v={{ cacheBuster }}"></script>
|
||||
<script src="{{ asset.main }}?v={{ cacheBuster }}"></script>
|
||||
<script src="{{{ asset.red }}}?v={{ cacheBuster }}"></script>
|
||||
<script src="{{{ asset.main }}}?v={{ cacheBuster }}"></script>
|
||||
{{# page.scripts }}
|
||||
<script src="{{.}}"></script>
|
||||
{{/ page.scripts }}
|
||||
|
||||
@@ -315,7 +315,7 @@ module.exports = function(RED) {
|
||||
var spec = module.module;
|
||||
if (spec && (spec !== "")) {
|
||||
moduleLoadPromises.push(RED.import(module.module).then(lib => {
|
||||
sandbox[vname] = lib.default;
|
||||
sandbox[vname] = lib.default || lib;
|
||||
}).catch(err => {
|
||||
node.error(RED._("function.error.moduleLoadError",{module:module.spec, error:err.toString()}))
|
||||
throw err;
|
||||
|
||||
@@ -141,15 +141,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
});
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param {Object} headersObject
|
||||
* @param {string} name
|
||||
* @return {any} value
|
||||
*/
|
||||
const getHeaderValue = (headersObject, name) => {
|
||||
const asLowercase = name.toLowercase();
|
||||
return headersObject[Object.keys(headersObject).find(k => k.toLowerCase() === asLowercase)];
|
||||
}
|
||||
|
||||
this.on("input",function(msg,nodeSend,nodeDone) {
|
||||
checkNodeAgentPatch();
|
||||
//reset redirectList on each request
|
||||
@@ -300,7 +292,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
}
|
||||
|
||||
opts.headers = {};
|
||||
//add msg.headers
|
||||
//add msg.headers
|
||||
//NOTE: ui headers will take precidence over msg.headers
|
||||
if (msg.headers) {
|
||||
if (msg.headers.hasOwnProperty('x-node-red-request-node')) {
|
||||
@@ -633,7 +625,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
msg.payload = msg.payload.toString('utf8'); // txt
|
||||
|
||||
if (node.ret === "obj") {
|
||||
if (msg.statusCode == 204){msg.payload= "{}"};
|
||||
if (msg.statusCode == 204){msg.payload= "{}"};
|
||||
try { msg.payload = JSON.parse(msg.payload); } // obj
|
||||
catch(e) { node.warn(RED._("httpin.errors.json-error")); }
|
||||
}
|
||||
@@ -740,7 +732,7 @@ in your Node-RED user directory (${RED.settings.userDir}).
|
||||
*
|
||||
* If the algorithm directive's value ends with "-sess", then HA1 is
|
||||
* HA1=digestCompute(digestCompute(username:realm:password):nonce:cnonce)
|
||||
*
|
||||
*
|
||||
* If the algorithm directive's value does not end with "-sess", then HA1 is
|
||||
* HA1=digestCompute(username:realm:password)
|
||||
*/
|
||||
|
||||
@@ -485,7 +485,7 @@ class Flow {
|
||||
}
|
||||
if (!key.startsWith("$parent.")) {
|
||||
if (this._env.hasOwnProperty(key)) {
|
||||
return this._env[key]
|
||||
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
|
||||
}
|
||||
} else {
|
||||
key = key.substring(8);
|
||||
|
||||
@@ -41,7 +41,7 @@ class Group {
|
||||
}
|
||||
if (!key.startsWith("$parent.")) {
|
||||
if (this._env.hasOwnProperty(key)) {
|
||||
return this._env[key]
|
||||
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
|
||||
}
|
||||
} else {
|
||||
key = key.substring(8);
|
||||
|
||||
@@ -375,7 +375,7 @@ class Subflow extends Flow {
|
||||
}
|
||||
if (!key.startsWith("$parent.")) {
|
||||
if (this._env.hasOwnProperty(key)) {
|
||||
return this._env[key]
|
||||
return (Object.hasOwn(this._env[key], 'value') && this._env[key].__clone__) ? clone(this._env[key].value) : this._env[key]
|
||||
}
|
||||
} else {
|
||||
key = key.substring(8);
|
||||
|
||||
@@ -102,6 +102,9 @@ async function evaluateEnvProperties(flow, env, credentials) {
|
||||
pendingEvaluations.push(new Promise((resolve, _) => {
|
||||
redUtil.evaluateNodeProperty(value, 'jsonata', {_flow: flow}, null, (err, result) => {
|
||||
if (!err) {
|
||||
if (typeof result === 'object') {
|
||||
result = { value: result, __clone__: true}
|
||||
}
|
||||
evaluatedEnv[name] = result
|
||||
}
|
||||
resolve()
|
||||
@@ -109,6 +112,9 @@ async function evaluateEnvProperties(flow, env, credentials) {
|
||||
}))
|
||||
} else {
|
||||
value = redUtil.evaluateNodeProperty(value, type, {_flow: flow}, null, null);
|
||||
if (typeof value === 'object') {
|
||||
value = { value: value, __clone__: true}
|
||||
}
|
||||
}
|
||||
evaluatedEnv[name] = value
|
||||
}
|
||||
@@ -138,8 +144,13 @@ async function evaluateEnvProperties(flow, env, credentials) {
|
||||
}
|
||||
}}, null, null);
|
||||
}
|
||||
if (typeof value === 'object' && !value.__clone__) {
|
||||
value = { value: value, __clone__: true}
|
||||
}
|
||||
evaluatedEnv[name] = value
|
||||
|
||||
}
|
||||
// console.log(evaluatedEnv)
|
||||
|
||||
return evaluatedEnv
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user