diff --git a/README.md b/README.md index fdbb5833..9da91300 100755 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Scans for devices connected to your WIFI / LAN and alerts you if new and unknown [![Docker Pulls](https://img.shields.io/docker/pulls/jokobsk/pi.alert?label=Pulls&logo=docker&color=0aa8d2&logoColor=fff)](https://hub.docker.com/r/jokobsk/pi.alert) [![Docker Pushed](https://img.shields.io/badge/dynamic/json?color=0aa8d2&logoColor=fff&label=Pushed&query=last_updated&url=https%3A%2F%2Fhub.docker.com%2Fv2%2Frepositories%2Fjokobsk%2Fpi.alert%2F&logo=docker&link=http://left&link=https://hub.docker.com/repository/docker/jokobsk/pi.alert)](https://hub.docker.com/r/jokobsk/pi.alert) -🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📄 [Dockerfile](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) | 📚 [Docker instructions](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) | 🆕 [Release notes](https://github.com/jokob-sk/Pi.Alert/issues/138) +🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📄 [Dockerfile](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) | 📚 [Docker instructions](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) | 🆕 [Release notes](https://github.com/jokob-sk/Pi.Alert/releases) ## 🔍 Scan Methods The system continuously scans the network for, **New devices**, **New connections** (re-connections), **Disconnections**, **"Always Connected" devices down**, Devices **IP changes** and **Internet IP address changes**. Scanning methods are: diff --git a/back/pialert.py b/back/pialert.py index 4db13c82..b9a2f412 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -2730,6 +2730,17 @@ def upgradeDB (): ALTER TABLE "Devices" ADD "dev_Network_Node_port" INTEGER """) + # dev_Icon column + dev_Icon_missing = sql.execute (""" + SELECT COUNT(*) AS CNTREC FROM pragma_table_info('Devices') WHERE name='dev_Icon' + """).fetchone()[0] == 0 + + if dev_Icon_missing : + file_print("[upgradeDB] Adding dev_Icon to the Devices table") + sql.execute(""" + ALTER TABLE "Devices" ADD "dev_Icon" TEXT + """) + # Re-creating Parameters table file_print("[upgradeDB] Re-creating Parameters table") sql.execute("DROP TABLE Parameters;") diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 87bb6935..32741ac6 100755 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -6,7 +6,7 @@ # 🐳 A docker image for Pi.Alert -🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📄 [Dockerfile](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) | 📚 [Docker instructions](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) | 🆕 [Release notes](https://github.com/jokob-sk/Pi.Alert/issues/138) +🐳 [Docker hub](https://registry.hub.docker.com/r/jokobsk/pi.alert) | 📄 [Dockerfile](https://github.com/jokob-sk/Pi.Alert/blob/main/Dockerfile) | 📚 [Docker instructions](https://github.com/jokob-sk/Pi.Alert/blob/main//dockerfiles/README.md) | 🆕 [Release notes](https://github.com/jokob-sk/Pi.Alert/releases) diff --git a/front/deviceDetails.php b/front/deviceDetails.php index cf911272..01b2cce5 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -191,6 +191,17 @@ + +
+ + +
+ +
+
+
@@ -250,31 +261,7 @@
- -

-
- -
-
- - - -
- - -
- -
-
-
-
- -
- -
-
+ @@ -324,6 +311,32 @@ + + +

+
+ +
+
+ + + +
+ + +
+ +
+
+
+
+ +
+ +
+
@@ -691,6 +704,11 @@ if ($ENABLED_DARKMODE === True) { // ------------------------------------------------------------ function getDevicesListValue(idColumn, idValue, returnColumn) { + if(emptyArr.includes(devicesList) || emptyArr.includes(idValue)) + { + return ''; + } + return devicesList.find((item) => {return item[idColumn] == idValue})[returnColumn] } @@ -1235,6 +1253,7 @@ function getDeviceData (readAllData=false) { $('#txtOwner').val ('--'); $('#txtDeviceType').val ('--'); $('#txtVendor').val ('--'); + $('#txtIcon').val ('--'); $('#chkFavorite').iCheck ('uncheck'); $('#txtGroup').val ('--'); @@ -1326,6 +1345,7 @@ function getDeviceData (readAllData=false) { $('#txtOwner').val (deviceData['dev_Owner']); $('#txtDeviceType').val (deviceData['dev_DeviceType']); $('#txtVendor').val (deviceData['dev_Vendor']); + $('#txtIcon').val (initDefault(deviceData['dev_Icon'], 'laptop')); if (deviceData['dev_Favorite'] == 1) {$('#chkFavorite').iCheck('check');} else {$('#chkFavorite').iCheck('uncheck');} $('#txtGroup').val (deviceData['dev_Group']); @@ -1436,6 +1456,15 @@ function performSwitch(direction) reloadTab() } +// ----------------------------------------------------------------------------- +function initDefault (value, defaultVal) { + if (emptyArr.includes(value)) + { + return defaultVal; + } + + return value; +} // ----------------------------------------------------------------------------- function setDeviceData (direction='', refreshCallback='') { // Check MAC @@ -1449,6 +1478,7 @@ function setDeviceData (direction='', refreshCallback='') { + '&owner=' + $('#txtOwner').val() + '&type=' + $('#txtDeviceType').val() + '&vendor=' + $('#txtVendor').val() + + '&icon=' + $('#txtIcon').val() + '&favorite=' + ($('#chkFavorite')[0].checked * 1) + '&group=' + $('#txtGroup').val() + '&location=' + $('#txtLocation').val() diff --git a/front/php/server/devices.php b/front/php/server/devices.php index e3b0f553..1703d637 100755 --- a/front/php/server/devices.php +++ b/front/php/server/devices.php @@ -154,6 +154,7 @@ function setDeviceData() { dev_Owner = "'. quotes($_REQUEST['owner']) .'", dev_DeviceType = "'. quotes($_REQUEST['type']) .'", dev_Vendor = "'. quotes($_REQUEST['vendor']) .'", + dev_Icon = "'. quotes($_REQUEST['icon']) .'", dev_Favorite = "'. quotes($_REQUEST['favorite']) .'", dev_Group = "'. quotes($_REQUEST['group']) .'", dev_Location = "'. quotes($_REQUEST['location']) .'", diff --git a/front/php/templates/language/en_us.php b/front/php/templates/language/en_us.php index 3a5c9a24..fdf9e490 100755 --- a/front/php/templates/language/en_us.php +++ b/front/php/templates/language/en_us.php @@ -165,6 +165,8 @@ $lang['en_us'] = array( 'DevDetail_MainInfo_Name' => 'Name', 'DevDetail_MainInfo_Owner' => 'Owner', 'DevDetail_MainInfo_Type' => 'Type', +'DevDetail_Icon' => 'Icon', +'DevDetail_Icon_Descr' => 'Enter a font awesome icon name without the fa- prefix.', 'DevDetail_MainInfo_Vendor' => 'Vendor', 'DevDetail_MainInfo_Favorite' => 'Favorite', 'DevDetail_MainInfo_Group' => 'Group',