Added very ugly hack for removing the " Char

This commit is contained in:
Tim Windelschmidt 2016-09-27 21:50:18 +02:00
parent f44ebd78e0
commit 7ef49b15d6
2 changed files with 10 additions and 2 deletions

View File

@ -31,7 +31,7 @@ exports.form = function (req, res) {
res.redirect("/db");
}
} else if (action == "remove") {
console.log("remove mac request mac: "+mac + " label " + '"' + label + '"' + " ip: " + ip);
console.log("remove mac request mac: "+mac + " label " + label + " ip: " + ip);
snmpMac.delete(mac, function (err) {
console.log("delete mac result: " + err);
req.flash('status', err == null ? "" : "database error: " + err);

View File

@ -62,7 +62,15 @@ var SnmpMac = function(hostname, community) {
// console.log(mac);
redisClient.get(redisprefix + mac, function(err, reply) {
if(reply != null) {
names.push(reply);
if (reply.split('')[0] == '"' && reply.split('')[reply.split('').length] == '"') {
var name = "";
for (var i = 1; i < reply.split('').length - 1; i++){
name += reply.split('')[i]
}
names.push()
} else {
names.push(reply);
}
}
});
});