Add maintenance features

Theme Selector, some bugfixing, update Readme
This commit is contained in:
leiweibau
2022-06-23 18:47:23 +02:00
parent 86a78b7e3a
commit e7168ca832
7 changed files with 106 additions and 12 deletions

View File

@@ -272,7 +272,7 @@ function PiaBackupDBtoArchive() {
// copy files as a fast Backup
if (!copy($file, $newfile)) {
echo "The Backup executed not successfully";
echo "The original database could not be saved.";
} else {
// Create archive with actual date
$Pia_Archive_Name = 'pialertdb_'.date("Ymd_His").'.zip';
@@ -282,8 +282,9 @@ function PiaBackupDBtoArchive() {
if (file_exists($Pia_Archive_Path.$Pia_Archive_Name) && filesize($Pia_Archive_Path.$Pia_Archive_Name) > 0) {
echo 'The backup executed successfully with the new archive: ('.$Pia_Archive_Name.')';
unlink($newfile);
echo("<meta http-equiv='refresh' content='1'>");
} else {
echo 'Test backup executed partially successfully. The archive could not be created or is empty. (pialert.db.latestbackup)';
echo 'The backup executed partially successfully. The archive could not be created or is empty. (pialert.db.latestbackup)';
}
}
@@ -299,7 +300,7 @@ function PiaRestoreDBfromArchive() {
// copy files as a fast Backup
if (!copy($file, $oldfile)) {
echo "Test Function executed not successfully";
echo 'The original database could not be saved.';
} else {
// extract latest archive and overwrite the actual pialert.db
$Pia_Archive_Path = '../../../db/';
@@ -308,6 +309,7 @@ function PiaRestoreDBfromArchive() {
if (file_exists($file)) {
echo 'Restore executed successfully';
unlink($oldfile);
echo("<meta http-equiv='refresh' content='1'>");
} else {
echo 'Restore Failed. Please restore the backup manually.';
}

View File

@@ -8,9 +8,14 @@
#--------------------------------------------------------------------------- -->
<?php
if (file_exists('../db/darkmode')) {
$ENABLED_DARKMODE = True;
}
foreach (glob("../db/skin*") as $filename) {
$pia_skin_selected = basename($filename);
}
if (strlen($pia_skin_selected) == 0) {$pia_skin_selected = 'skin-blue';}
?>
<!DOCTYPE html>
@@ -42,7 +47,7 @@ if (file_exists('../db/darkmode')) {
<!-- AdminLTE Skins. We have chosen the skin-blue for this starter
page. However, you can choose any other skin. Make sure you
apply the skin class to the body tag so the changes take effect. -->
<link rel="stylesheet" href="lib/AdminLTE/dist/css/skins/skin-blue.min.css">
<link rel="stylesheet" href="lib/AdminLTE/dist/css/skins/<?php echo $pia_skin_selected;?>.min.css">
<!-- Pi.Alert CSS -->
<link rel="stylesheet" href="css/pialert.css">
@@ -61,7 +66,7 @@ if (file_exists('../db/darkmode')) {
<!-- 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) {
@@ -93,7 +98,7 @@ function show_pia_servertime() {
<!-- ----------------------------------------------------------------------- -->
<!-- Layout Boxed Yellow -->
<body class="hold-transition skin-blue layout-boxed sidebar-mini" <?php echo $BACKGROUND_IMAGE_PATCH;?> onLoad="show_pia_servertime();" >
<body class="hold-transition <?php echo $pia_skin_selected;?> layout-boxed sidebar-mini" <?php echo $BACKGROUND_IMAGE_PATCH;?> onLoad="show_pia_servertime();" >
<!-- Site wrapper -->
<div class="wrapper">