Maintaining

Changing the layout of maintenance page, fixing some bugs, add a function to disable the network scan (just for fun), update the readme
This commit is contained in:
leiweibau
2022-06-24 22:46:16 +02:00
parent 39afc075ca
commit 76ed2d8fd1
8 changed files with 382 additions and 266 deletions

View File

@@ -42,6 +42,7 @@
case 'PiaBackupDBtoArchive': PiaBackupDBtoArchive(); break;
case 'PiaRestoreDBfromArchive': PiaRestoreDBfromArchive(); break;
case 'PiaEnableDarkmode': PiaEnableDarkmode(); break;
case 'PiaToggleArpScan': PiaToggleArpScan(); break;
case 'getDevicesTotals': getDevicesTotals(); break;
case 'getDevicesList': getDevicesList(); break;
@@ -318,10 +319,10 @@ function PiaRestoreDBfromArchive() {
}
//------------------------------------------------------------------------------
// Switch Themes
// Toggle Dark/Light Themes
//------------------------------------------------------------------------------
function PiaEnableDarkmode() {
$file = '../../../db/darkmode';
$file = '../../../db/setting_darkmode';
if (file_exists($file)) {
echo 'Darkmode Disabled';
@@ -335,6 +336,22 @@ function PiaEnableDarkmode() {
}
//------------------------------------------------------------------------------
// Toggle on/off Arp-Scans
//------------------------------------------------------------------------------
function PiaToggleArpScan() {
$file = '../../../db/setting_stoparpscan';
if (file_exists($file)) {
echo 'Arp-Scan Enabled';
unlink($file);
echo("<meta http-equiv='refresh' content='1'>");
} else {
echo 'Arp-Scan Disabled';
$startarpscan = fopen($file, 'w');
echo("<meta http-equiv='refresh' content='1'>");
}
}
//------------------------------------------------------------------------------
// Query total numbers of Devices by status

View File

@@ -17,7 +17,6 @@
$conf_data = parse_ini_file($conf_file);
echo '<span style="display:inline-block; transform: rotate(180deg)">&copy;</span> '. $conf_data['VERSION_YEAR'] .' Puche';
?>
<!-- To the right -->
<div class="pull-right no-hidden-xs">

View File

@@ -9,7 +9,7 @@
<?php
if (file_exists('../db/darkmode')) {
if (file_exists('../db/setting_darkmode')) {
$ENABLED_DARKMODE = True;
}
foreach (glob("../db/skin*") as $filename) {
@@ -66,7 +66,7 @@ if (strlen($pia_skin_selected) == 0) {$pia_skin_selected = 'skin-blue';}
<!-- For better UX on Mobile Devices using the Shortcut on the Homescreen -->
<link rel="manifest" href="img/manifest.json">
<link rel="apple-touch-icon" href="https://net-dev.de/pialert_homescreen.png">
<!-- Dark-Mode Patch -->
<?php
if ($ENABLED_DARKMODE === True) {