From 4010afb8661aba2fc067cd2de14ef1f399349674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20Ple=C3=9F?= Date: Sun, 4 Sep 2022 13:53:33 +0200 Subject: [PATCH] removed old not used routes --- routes/index.js | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/routes/index.js b/routes/index.js index d073ecf..1b2a439 100755 --- a/routes/index.js +++ b/routes/index.js @@ -2,48 +2,3 @@ exports.index = function (req, res) { res.render('index', { title: 'Home' }) }; -/* -exports.db = function (req, res) { - res.render('database', { title: 'Manage MAC' }) -}; - -exports.form = function (req, res) { - var snmpMac = req.app.get('snmpMac'); //TODO: wie kann man das schoener machen? - var mac = req.body.mac, - label = req.body.label, - action = req.body.action; - var status = ""; - mac = mac.toLowerCase(); - var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress; - - if (/^([0-9a-f]{2}[:-]){5}([0-9a-f]{2})$/.exec(mac)) { - if (action == "add") { - if (label) { - if(label.split('').length > 1) { - console.log("add mac request mac: " +mac + " label " + label + " ip: " + ip); - snmpMac.add(mac, '"' + label + '"', function (err) { - console.log("add mac result: " + err); - req.flash('status', err == null ? "" : "database error: " + err); - res.redirect("/db"); - }); - } - } else { - req.flash('status', 'label is invalid ("^[0-9a-zA-Z]+$")'); - res.redirect("/db"); - } - } else if (action == "remove") { - 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); - res.redirect("/db"); - }); - } else { - res.redirect("/db"); - } - } else { - req.flash('status', 'mac address is invalid'); - res.redirect("/db"); - } -}; -*/ \ No newline at end of file