mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
maintenance task
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
<!-- Content header--------------------------------------------------------- -->
|
||||
<section class="content-header">
|
||||
<?php require 'php/templates/notification.php'; ?>
|
||||
<h1 id="pageTitle">
|
||||
Maintenance tools
|
||||
</h1>
|
||||
@@ -37,6 +38,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<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>
|
||||
|
||||
<div class="col-xs-12">
|
||||
<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>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
</section>
|
||||
<!-- /.content -->
|
||||
@@ -53,7 +68,8 @@
|
||||
<script>
|
||||
function askDeleteDevicesWithEmptyMACs () {
|
||||
// Ask delete device
|
||||
showModalWarning ('Delete Devices', 'Are you sure you want to delete all devices with empty MAC addresses?<br>(maybe you prefer to archive it)',
|
||||
|
||||
showModalWarning('Delete Devices', 'Are you sure you want to delete all devices with empty MAC addresses?<br>(maybe you prefer to archive it)',
|
||||
'Cancel', 'Delete', 'deleteDevicesWithEmptyMACs');
|
||||
}
|
||||
|
||||
@@ -65,6 +81,51 @@ function deleteDevicesWithEmptyMACs()
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user