mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Move io to network
This commit is contained in:
parent
da6db24f9e
commit
69b781419f
@ -21,7 +21,9 @@ RED.palette = (function() {
|
|||||||
'subflows',
|
'subflows',
|
||||||
'common',
|
'common',
|
||||||
'function',
|
'function',
|
||||||
'input/output',
|
'network',
|
||||||
|
'input',
|
||||||
|
'output',
|
||||||
'sequence',
|
'sequence',
|
||||||
'parser',
|
'parser',
|
||||||
'storage',
|
'storage',
|
||||||
@ -44,12 +46,12 @@ RED.palette = (function() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function createCategoryContainer(originalCategory,category, labelId) {
|
function createCategoryContainer(originalCategory,category, labelId) {
|
||||||
console.log("createCategoryContainer",originalCategory,category,labelId);
|
|
||||||
var label = RED._(labelId, {defaultValue:category});
|
var label = RED._(labelId, {defaultValue:category});
|
||||||
label = (label || category).replace(/_/g, " ");
|
label = (label || category).replace(/_/g, " ");
|
||||||
var catDiv = $('<div id="red-ui-palette-container-'+category+'" class="red-ui-palette-category hide">'+
|
var catDiv = $('<div id="red-ui-palette-container-'+category+'" class="red-ui-palette-category hide">'+
|
||||||
'<div id="red-ui-palette-header-'+category+'" class="red-ui-palette-header"><i class="expanded fa fa-angle-down"></i><span>'+label+'</span></div>'+
|
'<div id="red-ui-palette-header-'+category+'" class="red-ui-palette-header"><i class="expanded fa fa-angle-down"></i><span>'+label+'</span></div>'+
|
||||||
'<div class="red-ui-palette-content" id="red-ui-palette-base-category-'+category+'">'+
|
'<div class="red-ui-palette-content" id="red-ui-palette-base-category-'+category+'">'+
|
||||||
|
'<div id="red-ui-palette-'+category+'"></div>'+
|
||||||
'<div id="red-ui-palette-'+category+'-input"></div>'+
|
'<div id="red-ui-palette-'+category+'-input"></div>'+
|
||||||
'<div id="red-ui-palette-'+category+'-output"></div>'+
|
'<div id="red-ui-palette-'+category+'-output"></div>'+
|
||||||
'<div id="red-ui-palette-'+category+'-function"></div>'+
|
'<div id="red-ui-palette-'+category+'-function"></div>'+
|
||||||
@ -173,10 +175,12 @@ RED.palette = (function() {
|
|||||||
if (getPaletteNode(nt).length) {
|
if (getPaletteNode(nt).length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (exclusion.indexOf(def.category)===-1) {
|
var nodeCategory = def.category;
|
||||||
|
|
||||||
var originalCategory = def.category;
|
if (exclusion.indexOf(nodeCategory)===-1) {
|
||||||
var category = escapeCategory(def.category);
|
|
||||||
|
var originalCategory = nodeCategory;
|
||||||
|
var category = escapeCategory(nodeCategory);
|
||||||
var rootCategory = category.split("-")[0];
|
var rootCategory = category.split("-")[0];
|
||||||
|
|
||||||
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
|
var d = $('<div>',{class:"red-ui-palette-node"}).attr("data-palette-type",nt).data('category',rootCategory);
|
||||||
@ -219,7 +223,7 @@ RED.palette = (function() {
|
|||||||
d.append(portIn);
|
d.append(portIn);
|
||||||
}
|
}
|
||||||
|
|
||||||
createCategory(def.category,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id);
|
createCategory(nodeCategory,rootCategory,category,(coreCategories.indexOf(rootCategory) !== -1)?"node-red":def.set.id);
|
||||||
|
|
||||||
$("#red-ui-palette-"+category).append(d);
|
$("#red-ui-palette-"+category).append(d);
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('mqtt in',{
|
RED.nodes.registerType('mqtt in',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
topic: {value:"",required:true,validate: RED.validators.regex(/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/)},
|
topic: {value:"",required:true,validate: RED.validators.regex(/^(#$|(\+|[^+#]*)(\/(\+|[^+#]*))*(\/(\+|#|[^+#]*))?$)/)},
|
||||||
@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('mqtt out',{
|
RED.nodes.registerType('mqtt out',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
topic: {value:""},
|
topic: {value:""},
|
@ -66,7 +66,7 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
(function() {
|
(function() {
|
||||||
RED.nodes.registerType('http in',{
|
RED.nodes.registerType('http in',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"rgb(231, 231, 174)",
|
color:"rgb(231, 231, 174)",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
@ -142,7 +142,7 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
RED.nodes.registerType('http response',{
|
RED.nodes.registerType('http response',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"rgb(231, 231, 174)",
|
color:"rgb(231, 231, 174)",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('http request',{
|
RED.nodes.registerType('http request',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"rgb(231, 231, 174)",
|
color:"rgb(231, 231, 174)",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
@ -97,7 +97,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
RED.nodes.registerType('websocket in',{
|
RED.nodes.registerType('websocket in',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
server: {type:"websocket-listener", validate: ws_validateserver},
|
server: {type:"websocket-listener", validate: ws_validateserver},
|
||||||
@ -116,7 +116,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
RED.nodes.registerType('websocket out',{
|
RED.nodes.registerType('websocket out',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
server: {type:"websocket-listener", validate: ws_validateserver},
|
server: {type:"websocket-listener", validate: ws_validateserver},
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('tcp in',{
|
RED.nodes.registerType('tcp in',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"Silver",
|
color:"Silver",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
@ -143,7 +143,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('tcp out',{
|
RED.nodes.registerType('tcp out',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"Silver",
|
color:"Silver",
|
||||||
defaults: {
|
defaults: {
|
||||||
host: {value:"",validate:function(v) { return (this.beserver != "client")||v.length > 0;} },
|
host: {value:"",validate:function(v) { return (this.beserver != "client")||v.length > 0;} },
|
||||||
@ -215,7 +215,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('tcp request',{
|
RED.nodes.registerType('tcp request',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"Silver",
|
color:"Silver",
|
||||||
defaults: {
|
defaults: {
|
||||||
server: {value:""},
|
server: {value:""},
|
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('udp in',{
|
RED.nodes.registerType('udp in',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"Silver",
|
color:"Silver",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
||||||
@ -159,7 +159,7 @@
|
|||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
RED.nodes.registerType('udp out',{
|
RED.nodes.registerType('udp out',{
|
||||||
category: 'input/output',
|
category: 'network',
|
||||||
color:"Silver",
|
color:"Silver",
|
||||||
defaults: {
|
defaults: {
|
||||||
name: {value:""},
|
name: {value:""},
|
@ -22,9 +22,9 @@ var express = require("express");
|
|||||||
var bodyParser = require('body-parser');
|
var bodyParser = require('body-parser');
|
||||||
var stoppable = require('stoppable');
|
var stoppable = require('stoppable');
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
var httpRequestNode = require("nr-test-utils").require("@node-red/nodes/core/io/21-httprequest.js");
|
var httpRequestNode = require("nr-test-utils").require("@node-red/nodes/core/network/21-httprequest.js");
|
||||||
var tlsNode = require("nr-test-utils").require("@node-red/nodes/core/io/05-tls.js");
|
var tlsNode = require("nr-test-utils").require("@node-red/nodes/core/network/05-tls.js");
|
||||||
var httpProxyNode = require("nr-test-utils").require("@node-red/nodes/core/io/06-httpproxy.js");
|
var httpProxyNode = require("nr-test-utils").require("@node-red/nodes/core/network/06-httpproxy.js");
|
||||||
var hashSum = require("hash-sum");
|
var hashSum = require("hash-sum");
|
||||||
var httpProxy = require('http-proxy');
|
var httpProxy = require('http-proxy');
|
||||||
var cookieParser = require('cookie-parser');
|
var cookieParser = require('cookie-parser');
|
@ -18,7 +18,7 @@ var ws = require("ws");
|
|||||||
var when = require("when");
|
var when = require("when");
|
||||||
var should = require("should");
|
var should = require("should");
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
var websocketNode = require("nr-test-utils").require("@node-red/nodes/core/io/22-websocket.js");
|
var websocketNode = require("nr-test-utils").require("@node-red/nodes/core/network/22-websocket.js");
|
||||||
|
|
||||||
var sockets = [];
|
var sockets = [];
|
||||||
|
|
@ -19,7 +19,7 @@ var should = require("should");
|
|||||||
var stoppable = require('stoppable');
|
var stoppable = require('stoppable');
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
|
|
||||||
var tcpinNode = require("nr-test-utils").require("@node-red/nodes/core/io/31-tcpin.js");
|
var tcpinNode = require("nr-test-utils").require("@node-red/nodes/core/network/31-tcpin.js");
|
||||||
|
|
||||||
|
|
||||||
describe('TCP in Node', function() {
|
describe('TCP in Node', function() {
|
@ -18,7 +18,7 @@ var net = require("net");
|
|||||||
var should = require("should");
|
var should = require("should");
|
||||||
var stoppable = require('stoppable');
|
var stoppable = require('stoppable');
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
var tcpinNode = require("nr-test-utils").require("@node-red/nodes/core/io/31-tcpin.js");
|
var tcpinNode = require("nr-test-utils").require("@node-red/nodes/core/network/31-tcpin.js");
|
||||||
var RED = require("nr-test-utils").require("node-red/lib/red.js");
|
var RED = require("nr-test-utils").require("node-red/lib/red.js");
|
||||||
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
|||||||
var dgram = require("dgram");
|
var dgram = require("dgram");
|
||||||
var should = require("should");
|
var should = require("should");
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
var udpNode = require("nr-test-utils").require("@node-red/nodes/core/io/32-udp.js");
|
var udpNode = require("nr-test-utils").require("@node-red/nodes/core/network/32-udp.js");
|
||||||
|
|
||||||
|
|
||||||
describe('UDP in Node', function() {
|
describe('UDP in Node', function() {
|
@ -17,7 +17,7 @@
|
|||||||
var dgram = require("dgram");
|
var dgram = require("dgram");
|
||||||
var should = require("should");
|
var should = require("should");
|
||||||
var helper = require("node-red-node-test-helper");
|
var helper = require("node-red-node-test-helper");
|
||||||
var udpNode = require("nr-test-utils").require("@node-red/nodes/core/io/32-udp.js");
|
var udpNode = require("nr-test-utils").require("@node-red/nodes/core/network/32-udp.js");
|
||||||
|
|
||||||
|
|
||||||
describe('UDP out Node', function() {
|
describe('UDP out Node', function() {
|
Loading…
Reference in New Issue
Block a user