Merge branch 'leiweibau-merge-2022-07-24' into pr/37

This commit is contained in:
jokob-sk
2022-07-24 10:21:25 +10:00
34 changed files with 1195 additions and 62 deletions

View File

@@ -36,6 +36,7 @@ if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
case 'setDeviceData': setDeviceData(); break;
case 'deleteDevice': deleteDevice(); break;
case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break;
case 'upgradeDatabase': upgradeDB(); break;
case 'createBackupDB': createBackupDB(); break;
case 'restoreBackupDB': restoreBackupDB(); break;
case 'deleteAllDevices': deleteAllDevices(); break;
@@ -212,6 +213,36 @@ function deleteAllWithEmptyMACs() {
}
}
//------------------------------------------------------------------------------
// Upgrade the database to enable new functionality
//------------------------------------------------------------------------------
function upgradeDB() {
global $db;
global $pia_lang;
// sql
$sql = '
-- Online_History definition
CREATE TABLE "Online_History" (
"Index" INTEGER,
"Scan_Date" TEXT,
"Online_Devices" INTEGER,
"Down_Devices" INTEGER,
"All_Devices" INTEGER,
PRIMARY KEY("Index" AUTOINCREMENT)
);';
// execute sql
$result = $db->query($sql);
// check result
if ($result == TRUE) {
echo $pia_lang['BackDevices_DBTools_Upgrade'];
} else {
echo $pia_lang['BackDevices_DBTools_UpgradeError']."\n\n$sql \n\n". $db->lastErrorMsg();
}
}
//------------------------------------------------------------------------------
// Delete all devices with empty MAC addresses
//------------------------------------------------------------------------------

View File

@@ -102,6 +102,12 @@ if ($ENABLED_DARKMODE === True) {
<!-- Servertime to the right of the hostname -->
<script>
<?php
$conf_file = '../config/version.conf';
$conf_data = parse_ini_file($conf_file);
# set timezone for server time in header
date_default_timezone_set($conf_data['TZ']);
?>
var pia_servertime = new Date(<?php echo date("Y, n, j, G, i, s") ?>);
function show_pia_servertime() {
@@ -228,7 +234,6 @@ function show_pia_servertime() {
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('maintenance.php') ) ){ echo 'active'; } ?>">
<a href="maintenance.php"><i class="fa fa-cog"></i> <span><?php echo $pia_lang['Navigation_Maintenance'];?></span></a>
</li>
<!--
<li class="treeview">
<a href="#"><i class="fa fa-link"></i> <span>Config</span>

View File

@@ -15,8 +15,7 @@ $pia_lang['Device_Shortcut_NewDevices'] = 'Neue Geräte';
$pia_lang['Device_Shortcut_DownAlerts'] = 'Down Meldungen';
$pia_lang['Device_Shortcut_Archived'] = 'Archiviert';
$pia_lang['Device_Shortcut_Devices'] = 'Geräte';
$pia_lang['Device_Shortcut_OnlineChart_a'] = 'Netzwerkaktivität über die letzten';
$pia_lang['Device_Shortcut_OnlineChart_b'] = 'Stunden';
$pia_lang['Device_Shortcut_OnlineChart'] = 'Gerätepräsenz im Laufe der Zeit';
$pia_lang['Device_TableHead_Name'] = 'Name';
$pia_lang['Device_TableHead_Owner'] = 'Eigentümer';
$pia_lang['Device_TableHead_Type'] = 'Typ';

View File

@@ -15,8 +15,7 @@ $pia_lang['Device_Shortcut_NewDevices'] = 'New Devices';
$pia_lang['Device_Shortcut_DownAlerts'] = 'Down Alerts';
$pia_lang['Device_Shortcut_Archived'] = 'Archived';
$pia_lang['Device_Shortcut_Devices'] = 'Devices';
$pia_lang['Device_Shortcut_OnlineChart_a'] = 'Network activity over last';
$pia_lang['Device_Shortcut_OnlineChart_b'] = 'hours';
$pia_lang['Device_Shortcut_OnlineChart'] = 'Device presence over time';
$pia_lang['Device_TableHead_Name'] = 'Name';
$pia_lang['Device_TableHead_Owner'] = 'Owner';
$pia_lang['Device_TableHead_Type'] = 'Type';

View File

@@ -15,8 +15,7 @@ $pia_lang['Device_Shortcut_NewDevices'] = 'Nuevo(s)';
$pia_lang['Device_Shortcut_DownAlerts'] = 'Alerta(s) de caída(s)';
$pia_lang['Device_Shortcut_Archived'] = 'Archivado(s)';
$pia_lang['Device_Shortcut_Devices'] = 'Dispositivos';
$pia_lang['Device_Shortcut_OnlineChart_a'] = 'Actividad de la red durante las últimas';
$pia_lang['Device_Shortcut_OnlineChart_b'] = 'horas';
$pia_lang['Device_Shortcut_OnlineChart'] = 'Presencia del dispositivo a lo largo del tiempo';
$pia_lang['Device_TableHead_Name'] = 'Nombre';
$pia_lang['Device_TableHead_Owner'] = 'Propietario';
$pia_lang['Device_TableHead_Type'] = 'Tipo';