Added very ugly hack for removing the " Char
This commit is contained in:
parent
f44ebd78e0
commit
7ef49b15d6
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue