mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 01:26:11 -08:00
Removed Upgrade database button - upgrade is already handled automatically
This commit is contained in:
@@ -332,13 +332,10 @@ if (submit && isset($_POST['langselector_set'])) {
|
||||
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnPiaPurgeDBBackups" onclick="askPiaPurgeDBBackups()"><?php echo $pia_lang['Maintenance_Tool_purgebackup'];?></button>
|
||||
</div>
|
||||
<div class="db_tools_table_cell_b"><?php echo $pia_lang['Maintenance_Tool_purgebackup_text'];?></div>
|
||||
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnUpgadeDatabase" style="border-top: solid 3px #dd4b39;" onclick="askUpgradeDatabase()"><?php echo $pia_lang['Maintenance_Tool_upgrade_database_noti'];?></button>
|
||||
</div>
|
||||
<div class="db_tools_table_cell_b"><?php echo $pia_lang['Maintenance_Tool_upgrade_database_text'];?></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -486,20 +483,6 @@ function PiaToggleArpScan()
|
||||
});
|
||||
}
|
||||
|
||||
// upgrade DB
|
||||
function askUpgradeDatabase () {
|
||||
// Ask
|
||||
showModalWarning('<?php echo $pia_lang['Maintenance_Tool_upgrade_database_noti'];?>', '<?php echo $pia_lang['Maintenance_Tool_upgrade_database_noti_text'];?>',
|
||||
'Cancel', 'Upgrade', 'upgradeDatabase');
|
||||
}
|
||||
function upgradeDatabase()
|
||||
{
|
||||
// Upgrade DB
|
||||
$.get('php/server/devices.php?action=upgradeDatabase', function(msg) {
|
||||
showMessage (msg);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ if (strlen($pia_lang_selected) == 0) {$pia_lang_selected = 'en_us';}
|
||||
case 'getDeviceData': getDeviceData(); break;
|
||||
case 'setDeviceData': setDeviceData(); break;
|
||||
case 'deleteDevice': deleteDevice(); break;
|
||||
case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break;
|
||||
case 'upgradeDatabase': upgradeDB(); break;
|
||||
case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break;
|
||||
case 'createBackupDB': createBackupDB(); break;
|
||||
case 'restoreBackupDB': restoreBackupDB(); break;
|
||||
case 'deleteAllDevices': deleteAllDevices(); break;
|
||||
@@ -213,36 +212,6 @@ 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
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -263,8 +232,6 @@ function deleteUnknownDevices() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Delete all devices
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user