Fix indents

This commit is contained in:
Akkadius 2017-09-21 22:19:47 -05:00
parent 0c8ebc8226
commit 2634c2058a

View File

@ -10,12 +10,12 @@ module.exports = {
lines = lease_data[i].split("\n"); lines = lease_data[i].split("\n");
for (l = 0; l < lines.length; l++) { for (l = 0; l < lines.length; l++) {
/* Trim whitespaces at each ends of the line */ /* Trim whitespaces at each ends of the line */
lines[l] = lines[l].trim(); lines[l] = lines[l].trim();
/* Break each newline into an array split into spaces /* Break each newline into an array split into spaces
Ex: [ 'starts', '3', '2017/08/09', '04:50:53;' ] Ex: [ 'starts', '3', '2017/08/09', '04:50:53;' ]
*/ */
line_data_arg = lines[l].split(" "); line_data_arg = lines[l].split(" ");
@ -28,18 +28,18 @@ module.exports = {
} }
if (ip_address != "") { if (ip_address != "") {
if (/start/i.test(lines[l])) { if (/start/i.test(lines[l])) {
/* /*
Make sure we force format as UTC because that is what the leases are formatted in Make sure we force format as UTC because that is what the leases are formatted in
*/ */
date = (line_data_arg[2] + ' ' + line_data_arg[3]).trim().replace(/\//gi, '-').replace(/;/i, '') + ' UTC'; date = (line_data_arg[2] + ' ' + line_data_arg[3]).trim().replace(/\//gi, '-').replace(/;/i, '') + ' UTC';
start_unix_time = (Date.parse(date) / 1000); start_unix_time = (Date.parse(date) / 1000);
dhcp_lease_data[ip_address].start = start_unix_time; dhcp_lease_data[ip_address].start = start_unix_time;
} }
if (/ends/i.test(lines[l])) { if (/ends/i.test(lines[l])) {
/* /*
Make sure we force format as UTC because that is what the leases are formatted in Make sure we force format as UTC because that is what the leases are formatted in
*/ */
lease_end = (line_data_arg[2] + ' ' + line_data_arg[3]).trim().replace(/\//gi, '-').replace(/;/i, '') + ' UTC'; lease_end = (line_data_arg[2] + ' ' + line_data_arg[3]).trim().replace(/\//gi, '-').replace(/;/i, '') + ' UTC';
now_unix_time = parseInt((new Date().getTime() / 1000).toFixed(0)); now_unix_time = parseInt((new Date().getTime() / 1000).toFixed(0));
@ -64,7 +64,7 @@ module.exports = {
if (typeof line_data_arg[2] !== "undefined") { if (typeof line_data_arg[2] !== "undefined") {
dhcp_lease_data[ip_address].mac = line_data_arg[2].replace(/;/gi, '').trim(); dhcp_lease_data[ip_address].mac = line_data_arg[2].replace(/;/gi, '').trim();
/* Mac OUI Lookup */ /* Mac OUI Lookup */
var mac_oui = dhcp_lease_data[ip_address].mac.split(":").join("").toUpperCase().slice(0, 6); var mac_oui = dhcp_lease_data[ip_address].mac.split(":").join("").toUpperCase().slice(0, 6);
dhcp_lease_data[ip_address].mac_oui_vendor = ''; dhcp_lease_data[ip_address].mac_oui_vendor = '';
@ -108,7 +108,7 @@ module.exports = {
option_data = []; option_data = [];
} }
/* End of Lease */ /* End of Lease */
if (lines[l].charAt(0) == "}") { if (lines[l].charAt(0) == "}") {
if (debug_watch_lease_parse_stream) { if (debug_watch_lease_parse_stream) {
console.log("[Glass Server] Lease Parse"); console.log("[Glass Server] Lease Parse");