mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-13 05:31:28 -07:00
Icon cleanup
This commit is contained in:
@@ -1260,6 +1260,11 @@ input[readonly] {
|
|||||||
display: flex;
|
display: flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.iconColumn
|
||||||
|
{
|
||||||
|
max-height: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
.iconPreviewSelector svg
|
.iconPreviewSelector svg
|
||||||
{
|
{
|
||||||
width:40px;
|
width:40px;
|
||||||
@@ -1277,6 +1282,21 @@ input[readonly] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#tableDevices .fab
|
||||||
|
{
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tableDevices .fa
|
||||||
|
{
|
||||||
|
font-size: 1.0em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tableDevices tbody tr
|
||||||
|
{
|
||||||
|
height: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
.info-icon-nav
|
.info-icon-nav
|
||||||
{
|
{
|
||||||
top: -6px;
|
top: -6px;
|
||||||
|
|||||||
@@ -561,9 +561,10 @@ function initializeDatatable (status) {
|
|||||||
|
|
||||||
'columnDefs' : [
|
'columnDefs' : [
|
||||||
{visible: false, targets: tableColumnHide },
|
{visible: false, targets: tableColumnHide },
|
||||||
{className: 'text-center', targets: [mapIndx(3), mapIndx(4), mapIndx(9), mapIndx(10), mapIndx(15), mapIndx(18)] },
|
{className: 'text-center', targets: [mapIndx(4), mapIndx(9), mapIndx(10), mapIndx(15), mapIndx(18)] },
|
||||||
|
{className: 'iconColumn text-center', targets: [mapIndx(3)]},
|
||||||
{width: '80px', targets: [mapIndx(6), mapIndx(7), mapIndx(15)] },
|
{width: '80px', targets: [mapIndx(6), mapIndx(7), mapIndx(15)] },
|
||||||
{width: '30px', targets: [mapIndx(10), mapIndx(13), mapIndx(18)] },
|
{width: '30px', targets: [mapIndx(3), mapIndx(10), mapIndx(13), mapIndx(18)] },
|
||||||
{orderData: [mapIndx(12)], targets: mapIndx(8) },
|
{orderData: [mapIndx(12)], targets: mapIndx(8) },
|
||||||
|
|
||||||
// Device Name
|
// Device Name
|
||||||
|
|||||||
@@ -455,6 +455,8 @@ def update_devices_data_from_scan (db):
|
|||||||
|
|
||||||
default_icon = get_setting_value('NEWDEV_devIcon')
|
default_icon = get_setting_value('NEWDEV_devIcon')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if get_setting_value('NEWDEV_replace_preset_icon'):
|
if get_setting_value('NEWDEV_replace_preset_icon'):
|
||||||
query = f"""SELECT * FROM Devices
|
query = f"""SELECT * FROM Devices
|
||||||
WHERE devIcon in ('', 'null', '{default_icon}')
|
WHERE devIcon in ('', 'null', '{default_icon}')
|
||||||
@@ -470,6 +472,9 @@ def update_devices_data_from_scan (db):
|
|||||||
|
|
||||||
recordsToUpdate.append ([devIcon, device['devMac']])
|
recordsToUpdate.append ([devIcon, device['devMac']])
|
||||||
|
|
||||||
|
|
||||||
|
mylog('debug',f'[Update Devices] recordsToUpdate: {recordsToUpdate}')
|
||||||
|
|
||||||
if len(recordsToUpdate) > 0:
|
if len(recordsToUpdate) > 0:
|
||||||
sql.executemany ("UPDATE Devices SET devIcon = ? WHERE devMac = ? ", recordsToUpdate )
|
sql.executemany ("UPDATE Devices SET devIcon = ? WHERE devMac = ? ", recordsToUpdate )
|
||||||
|
|
||||||
@@ -708,6 +713,8 @@ def guess_icon(vendor, mac, ip, name, default):
|
|||||||
result = icons.get("google")
|
result = icons.get("google")
|
||||||
elif 'desktop' in name:
|
elif 'desktop' in name:
|
||||||
result = icons.get("desktop")
|
result = icons.get("desktop")
|
||||||
|
elif 'raspberry' in name:
|
||||||
|
result = icons.get("raspberry")
|
||||||
|
|
||||||
# Guess icon based on IP address ranges
|
# Guess icon based on IP address ranges
|
||||||
elif ip.startswith("192.168.1."):
|
elif ip.startswith("192.168.1."):
|
||||||
|
|||||||
Reference in New Issue
Block a user