maintenance task DB

This commit is contained in:
jokob-sk
2022-01-14 16:31:58 +11:00
parent b008017174
commit 903478524c
4 changed files with 4 additions and 198 deletions

View File

@@ -32,34 +32,15 @@
<div class="col-xs-12">
<div class="pull-right">
<div class="center">
<button type="button" class="btn btn-default pa-btn pa-btn-delete" style="margin-left:0px;"
id="btnDeleteMAC" onclick="askDeleteDevicesWithEmptyMACs()"> Delete Devices with empty MACs </button>
</div>
<div class="pull-right">
<div class="center">
<button type="button" class="btn btn-default pa-btn pa-btn-delete" style="margin-left:0px;"
id="btnDeleteMAC" onclick="askDeleteAllDevices()"> Delete All Devices </button>
</div>
<!-- <div class="pull-right">
<button type="button" class="btn btn-default pa-btn pa-btn-create" style="margin-left:0px;"
id="btnDelete" onclick="askRunScan1min()"> Run 1 min scan now</button>
</div>
<div class="pull-right">
<button type="button" class="btn btn-default pa-btn pa-btn-create" style="margin-left:0px;"
id="btnDelete" onclick="askRunScan15min()"> Run 15 min scan now</button>
</div>
<div class="pull-right">
<button type="button" class="btn btn-default pa-btn pa-btn-create" style="margin-left:0px;"
id="btnBackup" onclick="askCreateBackupDB()"> Backup DB </button>
</div>
<div class="pull-right">
<button type="button" class="btn btn-default pa-btn pa-btn-delete" style="margin-left:0px;"
id="btnRestore" onclick="askRestoreBackupDB()"> Restore DB </button>
</div> -->
</div>
@@ -114,79 +95,6 @@ function deleteAllDevices()
}
// Run ad-hoc scans
function askRunScan1min () {
// Ask delete device
showModalWarning('Scan 1 min now', 'This runs the 1 min scan sequence',
'Cancel', 'Scan', 'runScan1min');
}
function runScan1min()
{
// Scan
$.get('php/server/devices.php?action=runScan1min', function(msg) {
showMessage (msg);
});
}
function askRunScan15min () {
// Ask delete device
showModalWarning('Scan 15 min now', 'This runs the 15 min scan sequence',
'Cancel', 'Scan', 'runScan15min');
}
function runScan15min()
{
// Scan
$.get('php/server/devices.php?action=runScan15min', function(msg) {
showMessage (msg);
});
}
// DB backup
function askCreateBackupDB () {
// Ask delete device
showModalWarning('Backup DB', 'This creates a pialert.db_bak file in the /config folder',
'Cancel', 'Create', 'createBackupDB');
}
function createBackupDB()
{
// Delete device
$.get('php/server/devices.php?action=createBackupDB', function(msg) {
showMessage (msg);
});
}
// DB restore
function askRestoreBackupDB () {
// Ask delete device
showModalWarning('Restore DB', 'This restores a pialert.db_bak file from the /config folder',
'Cancel', 'Restore', 'restoreBackupDB');
}
function restoreBackupDB()
{
// Delete device
$.get('php/server/devices.php?action=restoreBackupDB', function(msg) {
showMessage (msg);
});
}