mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Change the way the darkmode is activated
The dark mode can now be activated or deactivated via the maintenance page with the help of a button.
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
case 'deleteEvents': deleteEvents(); break;
|
||||
case 'PiaBackupDBtoArchive': PiaBackupDBtoArchive(); break;
|
||||
case 'PiaRestoreDBfromArchive': PiaRestoreDBfromArchive(); break;
|
||||
case 'PiaEnableDarkmode': PiaEnableDarkmode(); break;
|
||||
|
||||
case 'getDevicesTotals': getDevicesTotals(); break;
|
||||
case 'getDevicesList': getDevicesList(); break;
|
||||
@@ -314,6 +315,25 @@ function PiaRestoreDBfromArchive() {
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Switch Themes
|
||||
//------------------------------------------------------------------------------
|
||||
function PiaEnableDarkmode() {
|
||||
$file = '../../../db/darkmode';
|
||||
|
||||
if (file_exists($file)) {
|
||||
echo 'Darkmode Disabled';
|
||||
unlink($file);
|
||||
echo("<meta http-equiv='refresh' content='1'>");
|
||||
} else {
|
||||
echo 'Darkmode Enabled';
|
||||
$darkmode = fopen($file, 'w');
|
||||
echo("<meta http-equiv='refresh' content='1'>");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Query total numbers of Devices by status
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user