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) {
|
||||
|
||||
Reference in New Issue
Block a user