diff --git a/README.md b/README.md index 1e20908a..e0a98689 100755 --- a/README.md +++ b/README.md @@ -70,6 +70,12 @@ Get visibility of what's going on on your WIFI/LAN network. Schedule scans for d > - [Fing](https://www.fing.com/) - Network scanner app for your Internet security (Commercial, Phone App, Proprietary hardware) > - [NetBox](https://netboxlabs.com/) - Network management software (Commercial) +## π Get notified what's new + +Get notified about a new release, what new functionality you can use and about breaking changes. + +![Follow and star][follow_star] + ### β Sponsors [](https://github.com/sponsors/jokob-sk) @@ -130,18 +136,19 @@ Help out and suggest languages in the [online portal of Weblate](https://hosted. -[main]: ./docs/img/devices_split.png "Main screen" -[screen1]: ./docs/img/device_details.png "Screen 1" -[screen2]: ./docs/img/events.png "Screen 2" -[screen3]: ./docs/img/presence.png "Screen 3" -[screen4]: ./docs/img/maintenance.png "Screen 4" -[screen5]: ./docs/img/network.png "Screen 5" -[screen6]: ./docs/img/settings.png "Screen 6" -[screen7]: ./docs/img/help_faq.png "Screen 7" -[screen8]: ./docs/img/plugins_rogue_dhcp.png "Screen 8" -[screen9]: ./docs/img/device_nmap.png "Screen 9" -[report1]: ./docs/img/4_report_1.jpg "Report sample 1" -[report2]: ./docs/img/4_report_2.jpg "Report sample 2" -[main_dark]: /docs/img/1_devices_dark.jpg "Main screen dark" -[maintain_dark]: /docs/img/5_maintain.jpg "Maintain screen dark" +[main]: ./docs/img/devices_split.png "Main screen" +[screen1]: ./docs/img/device_details.png "Screen 1" +[screen2]: ./docs/img/events.png "Screen 2" +[screen3]: ./docs/img/presence.png "Screen 3" +[screen4]: ./docs/img/maintenance.png "Screen 4" +[screen5]: ./docs/img/network.png "Screen 5" +[screen6]: ./docs/img/settings.png "Screen 6" +[screen7]: ./docs/img/help_faq.png "Screen 7" +[screen8]: ./docs/img/plugins_rogue_dhcp.png "Screen 8" +[screen9]: ./docs/img/device_nmap.png "Screen 9" +[report1]: ./docs/img/4_report_1.jpg "Report sample 1" +[report2]: ./docs/img/4_report_2.jpg "Report sample 2" +[main_dark]: /docs/img/1_devices_dark.jpg "Main screen dark" +[maintain_dark]: /docs/img/5_maintain.jpg "Maintain screen dark" +[follow_star]: /docs/img/Follow_Releases_and_Star.gif "Follow and Star" diff --git a/docs/img/Follow_Releases_and_Star.gif b/docs/img/Follow_Releases_and_Star.gif new file mode 100755 index 00000000..da59c92d Binary files /dev/null and b/docs/img/Follow_Releases_and_Star.gif differ diff --git a/front/css/app.css b/front/css/app.css index b75f505a..6c39b26a 100755 --- a/front/css/app.css +++ b/front/css/app.css @@ -144,6 +144,17 @@ { background-color: rgba(0, 0, 0, 0); } +.header-status-locked-db +{ + width: 25px; + height: 25px; + color: red; + position: absolute; + top: 12px; + right: -17px; + display: none; +} + .navbar-nav > li > a { line-height: 30px; diff --git a/front/deviceDetails.php b/front/deviceDetails.php index bcd49102..a3a3947e 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -628,7 +628,7 @@ - + diff --git a/front/js/db_methods.js b/front/js/db_methods.js index 9a21dde1..84268976 100755 --- a/front/js/db_methods.js +++ b/front/js/db_methods.js @@ -1,7 +1,9 @@ // ----------------------------------------------------------------------------- -// General utilities to interact with teh database +// General utilities to interact with the database // ----------------------------------------------------------------------------- + +// -------------------------------------------------- // Read data and place intotarget location, callback processies the results function readData(sqlQuery, processDataCallback, valuesArray, targetLocation, targetField, nameTransformer) { var apiUrl = `php/server/dbHelper.php?action=read&rawSql=${encodeURIComponent(sqlQuery)}`; @@ -15,4 +17,31 @@ function readData(sqlQuery, processDataCallback, valuesArray, targetLocation, ta // Place the resulting HTML into the specified placeholder div $("#" + targetLocation).replaceWith(htmlResult); }); -} \ No newline at end of file +} + +// -------------------------------------------------- +// Check if database is locked +function checkDbLock() { + $.ajax({ + url: 'php/server/dbHelper.php', // Replace with the actual path to your PHP file + type: 'GET', + data: { action: 'checkLock' }, + success: function(response) { + if (response == 1) { + console.log('π₯ Database is locked'); + $(".header-status-locked-db").show() + } else { + // console.log('Database is not locked'); + $(".header-status-locked-db").hide() + } + }, + error: function() { + console.log('Error checking database lock status'); + } + }); +} + +// Start the loop +setInterval(() => { + checkDbLock(); +}, 1000); diff --git a/front/multiEditCore.php b/front/multiEditCore.php index 7ea02745..3d104403 100755 --- a/front/multiEditCore.php +++ b/front/multiEditCore.php @@ -326,7 +326,6 @@ getData(); - diff --git a/front/php/server/dbHelper.php b/front/php/server/dbHelper.php index 639e53e5..134395e3 100755 --- a/front/php/server/dbHelper.php +++ b/front/php/server/dbHelper.php @@ -72,6 +72,7 @@ case 'read' : read($rawSql); break; case 'update': update($columnName, $id, $defaultValue, $expireMinutes, $dbtable, $columns, $values); break; case 'delete': delete($columnName, $id, $dbtable); break; + case 'checkLock': checkLock(); break; default: logServerConsole ('Action: '. $action); break; } } @@ -264,4 +265,20 @@ function delete($columnName, $id, $dbtable) +//------------------------------------------------------------------------------ +// check if the database is locked +//------------------------------------------------------------------------------ +function checkLock() { + global $db; + try { + $db->exec('BEGIN EXCLUSIVE TRANSACTION'); + $db->exec('COMMIT'); + echo 0; // Not locked + return 0; + } catch (Exception $e) { + echo 1; // Locked + return 1; + } +} + ?> diff --git a/front/php/templates/footer.php b/front/php/templates/footer.php index 52bd9f8c..a28d977f 100755 --- a/front/php/templates/footer.php +++ b/front/php/templates/footer.php @@ -55,6 +55,7 @@ + diff --git a/front/php/templates/header.php b/front/php/templates/header.php index 021df71c..c0399c86 100755 --- a/front/php/templates/header.php +++ b/front/php/templates/header.php @@ -57,12 +57,6 @@ require dirname(__FILE__).'/security.php'; - - - @@ -173,6 +167,9 @@ if ($ENABLED_DARKMODE === True) {