From ef725103aa1603f44ebac336901887c9357d302a Mon Sep 17 00:00:00 2001 From: jokob-sk Date: Thu, 2 May 2024 08:39:16 +1000 Subject: [PATCH] =?UTF-8?q?Loading=20cleanup=20in=20Maintenance=20+=20=20c?= =?UTF-8?q?ase=20insensitive=20vendor=20MAC=20matching=20=20#618=20?= =?UTF-8?q?=F0=9F=94=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- front/maintenance.php | 26 +++++++++++++------------ front/multiEditCore.php | 2 +- front/php/templates/language/it_it.json | 0 server/device.py | 7 ++++--- 4 files changed, 19 insertions(+), 16 deletions(-) mode change 100644 => 100755 front/php/templates/language/it_it.json diff --git a/front/maintenance.php b/front/maintenance.php index 1d46c5a8..0a87da8f 100755 --- a/front/maintenance.php +++ b/front/maintenance.php @@ -327,37 +327,37 @@ $db->close();
-
+
-
+
-
+
-
+
-
+
-
+
@@ -367,31 +367,31 @@ $db->close();
-
+
-
+
-
+
-
+
-
+
@@ -922,8 +922,10 @@ function initializeTabs () { $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { var target = $(e.target).attr("href") // activated tab }); + + hideSpinner(); - }, 50); + }, 50); } diff --git a/front/multiEditCore.php b/front/multiEditCore.php index bb3db868..7e5fe502 100755 --- a/front/multiEditCore.php +++ b/front/multiEditCore.php @@ -192,7 +192,7 @@ }) - }, 50); + }, 500); } diff --git a/front/php/templates/language/it_it.json b/front/php/templates/language/it_it.json old mode 100644 new mode 100755 diff --git a/server/device.py b/server/device.py index 2741ab09..8026ca76 100755 --- a/server/device.py +++ b/server/device.py @@ -406,7 +406,7 @@ def query_MAC_vendor (pMAC): pMACstr = str(pMAC) # Check MAC parameter - mac = pMACstr.replace (':','') + mac = pMACstr.replace (':','').lower() if len(pMACstr) != 17 or len(mac) != 12 : return -2 # return -2 if ignored MAC @@ -417,14 +417,15 @@ def query_MAC_vendor (pMAC): try: with open(vendorsPath, 'r') as f: for line in f: - if line.startswith(mac_start_string6): + line_lower = line.lower() # Convert line to lowercase for case-insensitive matching + if line_lower.startswith(mac_start_string6): parts = line.split(' ', 1) if len(parts) > 1: vendor = parts[1].strip() mylog('debug', [f"[Vendor Check] Found '{vendor}' for '{pMAC}' in {vendorsPath}"]) return vendor else: - mylog('debug', [f'[Vendor Check] ⚠ ERROR: Match found, but line could not be processed: "{line}"']) + mylog('debug', [f'[Vendor Check] ⚠ ERROR: Match found, but line could not be processed: "{line_lower}"']) return -1