Prima versione customizzata
This commit is contained in:
@@ -47,15 +47,13 @@ module.exports = function(RED) {
|
||||
}
|
||||
|
||||
var connection = null;
|
||||
connection = mikrotik.getConnection(host, username, password, {closeOnDone : false, port: port});
|
||||
|
||||
this.on('input', function(msg) {
|
||||
|
||||
if (command == '') command = msg.payload;
|
||||
if(command == '') return false;
|
||||
connection = mikrotik.getConnection(host, username, password, {closeOnDone : true, port: port});
|
||||
connection.getConnectPromise().then(function(conn) {
|
||||
if (command == '') return false;
|
||||
connection.getConnectPromise().then(function resolve(conn) {
|
||||
conn.getCommandPromise(command).then(function resolved(values) {
|
||||
|
||||
var parsed = mikrotik.parseItems(values);
|
||||
var pl = [];
|
||||
parsed.forEach(function(item) {
|
||||
|
||||
20
package.json
20
package.json
@@ -1,16 +1,15 @@
|
||||
{
|
||||
"name": "node-red-contrib-mikrotik2",
|
||||
"version": "0.1.1",
|
||||
"description": "Node based on node-red-contrib-mikrotik to work with Mikrotik devices which fixes device configuration problem",
|
||||
"name": "node-red-contrib-mikrotik3",
|
||||
"version": "0.1.2",
|
||||
"description": "Node based on nodered-contrib-mikrotik to work with Mikrotik devices",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"author": "Alexander Pivovarov <pivovarov@gmail.com>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Ahmed Al Hafoudh",
|
||||
"email": "alhafoudh@freevision.sk",
|
||||
"url": "https://www.freevision.sk"
|
||||
"name": "Emanuele Trabattoni",
|
||||
"email": "ema.trabattoni@gmail.com"
|
||||
}
|
||||
],
|
||||
"node-red": {
|
||||
@@ -21,7 +20,7 @@
|
||||
"keywords": [
|
||||
"node-red"
|
||||
],
|
||||
"license": "ISC",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"mikronode-ng": "^1.0.5"
|
||||
},
|
||||
@@ -29,10 +28,9 @@
|
||||
"devDependencies": {},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/alhafoudh/node-red-contrib-mikrotik2.git"
|
||||
"url": "git+https://git.etss.it/ETSS/nodered-contrib-mikrotik.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/alhafoudh/node-red-contrib-mikrotik2/issues"
|
||||
},
|
||||
"homepage": "https://github.com/alhafoudh/node-red-contrib-mikrotik2#readme"
|
||||
"url": "https://git.etss.it/ETSS/nodered-contrib-mikrotik.git/issues"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user