mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-03-30 23:03:03 -07:00
FE: initCheck moved into systeminfo
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
@@ -40,7 +40,7 @@ There are several ways to check if the GraphQL server is running.
|
|||||||
|
|
||||||
### Init Check
|
### Init Check
|
||||||
|
|
||||||
You can navigate to Maintenance -> Init Check to see if `isGraphQLServerRunning` is ticked:
|
You can navigate to System Info -> Init Check to see if `isGraphQLServerRunning` is ticked:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 135 KiB After Width: | Height: | Size: 68 KiB |
@@ -5,24 +5,24 @@ function lockDatabase(delay=20) {
|
|||||||
url: 'php/server/dbHelper.php', // Replace with the actual path to your PHP file
|
url: 'php/server/dbHelper.php', // Replace with the actual path to your PHP file
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
data: { action: 'lockDatabase', delay: delay },
|
data: { action: 'lockDatabase', delay: delay },
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log('Executed');
|
console.log('Executed');
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function() {
|
||||||
console.log('Error ocurred');
|
console.log('Error ocurred');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let times = delay;
|
let times = delay;
|
||||||
let countdownInterval = setInterval(() => {
|
let countdownInterval = setInterval(() => {
|
||||||
times--;
|
times--;
|
||||||
console.log(`Remaining time: ${times} seconds`);
|
console.log(`Remaining time: ${times} seconds`);
|
||||||
|
|
||||||
if (times <= 0) {
|
if (times <= 0) {
|
||||||
clearInterval(countdownInterval);
|
clearInterval(countdownInterval);
|
||||||
console.log('Countdown finished');
|
console.log('Countdown finished');
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ const requiredFiles = [
|
|||||||
function updateFileStatusUI(file, status) {
|
function updateFileStatusUI(file, status) {
|
||||||
const item = $(`#file-${file.replace(/[^a-z0-9]/gi, '-')}`);
|
const item = $(`#file-${file.replace(/[^a-z0-9]/gi, '-')}`);
|
||||||
const icon = item.find('span.icon-wrap');
|
const icon = item.find('span.icon-wrap');
|
||||||
|
|
||||||
if (status === 'ok') {
|
if (status === 'ok') {
|
||||||
icon.html('<i class="fa-solid fa-check "></i>');
|
icon.html('<i class="fa-solid fa-check "></i>');
|
||||||
} else if (status === 'fail') {
|
} else if (status === 'fail') {
|
||||||
@@ -61,7 +61,7 @@ const requiredFiles = [
|
|||||||
icon.html('<i class="fa-solid fa-spinner fa-spin text-secondary"></i>');
|
icon.html('<i class="fa-solid fa-spinner fa-spin text-secondary"></i>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkAppInitializedJson() {
|
function checkAppInitializedJson() {
|
||||||
requiredFiles.forEach(file => {
|
requiredFiles.forEach(file => {
|
||||||
@@ -77,17 +77,17 @@ const requiredFiles = [
|
|||||||
updateFileStatusUI(file, 'fail');
|
updateFileStatusUI(file, 'fail');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const allOk = requiredFiles.every(file => fileStatus[file] === 'ok');
|
const allOk = requiredFiles.every(file => fileStatus[file] === 'ok');
|
||||||
|
|
||||||
if (allOk) {
|
if (allOk) {
|
||||||
checkInternalStatusAfterFiles();
|
checkInternalStatusAfterFiles();
|
||||||
} else {
|
} else {
|
||||||
setTimeout(checkAppInitializedJson, 1000);
|
setTimeout(checkAppInitializedJson, 5000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkInternalStatusAfterFiles() {
|
function checkInternalStatusAfterFiles() {
|
||||||
const promises = [
|
const promises = [
|
||||||
waitForAppInitialized().then(() => {
|
waitForAppInitialized().then(() => {
|
||||||
@@ -97,7 +97,7 @@ const requiredFiles = [
|
|||||||
fileStatus['isAppInitialized'] = 'fail';
|
fileStatus['isAppInitialized'] = 'fail';
|
||||||
updateFileStatusUI('isAppInitialized', 'fail');
|
updateFileStatusUI('isAppInitialized', 'fail');
|
||||||
}),
|
}),
|
||||||
|
|
||||||
waitForGraphQLServer().then(() => {
|
waitForGraphQLServer().then(() => {
|
||||||
fileStatus['isGraphQLServerRunning'] = 'ok';
|
fileStatus['isGraphQLServerRunning'] = 'ok';
|
||||||
updateFileStatusUI('isGraphQLServerRunning', 'ok');
|
updateFileStatusUI('isGraphQLServerRunning', 'ok');
|
||||||
@@ -106,14 +106,14 @@ const requiredFiles = [
|
|||||||
updateFileStatusUI('isGraphQLServerRunning', 'fail');
|
updateFileStatusUI('isGraphQLServerRunning', 'fail');
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
Promise.allSettled(promises).then(() => {
|
Promise.allSettled(promises).then(() => {
|
||||||
const allPassed = internalChecks.every(key => fileStatus[key] === 'ok');
|
const allPassed = internalChecks.every(key => fileStatus[key] === 'ok');
|
||||||
if (allPassed) {
|
if (allPassed) {
|
||||||
$('#check-status').show();
|
$('#check-status').show();
|
||||||
$('#check-status-plc').hide();
|
$('#check-status-plc').hide();
|
||||||
} else {
|
} else {
|
||||||
setTimeout(checkInternalStatusAfterFiles, 1000);
|
setTimeout(checkInternalStatusAfterFiles, 5000);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -132,8 +132,8 @@ function checkAppInitializedJsonInit() {
|
|||||||
const allItems = [...requiredFiles, ...internalChecks];
|
const allItems = [...requiredFiles, ...internalChecks];
|
||||||
|
|
||||||
allItems.forEach(file => {
|
allItems.forEach(file => {
|
||||||
|
|
||||||
|
|
||||||
$('#file-check-list').append(`
|
$('#file-check-list').append(`
|
||||||
<div class="panel panel-secondary col-xs-6 col-sm-4 col-md-3 col-lg-2 col-xxl-1 padding-5px">
|
<div class="panel panel-secondary col-xs-6 col-sm-4 col-md-3 col-lg-2 col-xxl-1 padding-5px">
|
||||||
<div class="file-checking border rounded p-2 d-flex flex-column justify-content-between h-100" id="file-${file.replace(/[^a-z0-9]/gi, '-')}">
|
<div class="file-checking border rounded p-2 d-flex flex-column justify-content-between h-100" id="file-${file.replace(/[^a-z0-9]/gi, '-')}">
|
||||||
@@ -151,7 +151,7 @@ function checkAppInitializedJsonInit() {
|
|||||||
checkAppInitializedJson();
|
checkAppInitializedJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
<!-- Main content ---------------------------------------------------------- -->
|
<!-- Main content ---------------------------------------------------------- -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
showSpinner();
|
showSpinner();
|
||||||
</script>
|
</script>
|
||||||
@@ -28,7 +28,7 @@ $nax_db_mod = file_exists($nax_db) ? date ("F d Y H:i:s", filemtime($nax_db)) :
|
|||||||
// Table sizes -----------------------------------------------------------------
|
// Table sizes -----------------------------------------------------------------
|
||||||
|
|
||||||
$tableSizesHTML = "";
|
$tableSizesHTML = "";
|
||||||
|
|
||||||
// Open a connection to the SQLite database
|
// Open a connection to the SQLite database
|
||||||
$db = new SQLite3($nax_db);
|
$db = new SQLite3($nax_db);
|
||||||
|
|
||||||
@@ -46,7 +46,7 @@ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
|||||||
|
|
||||||
// Close the database connection
|
// Close the database connection
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@@ -55,13 +55,13 @@ $db->close();
|
|||||||
<div class="box" id="Maintain-Status">
|
<div class="box" id="Maintain-Status">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">
|
<h3 class="box-title">
|
||||||
<i class="fa fa-display"></i>
|
<i class="fa fa-display"></i>
|
||||||
<?= lang('Maintenance_Status');?>
|
<?= lang('Maintenance_Status');?>
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body" style="padding-bottom: 5px;">
|
<div class="box-body" style="padding-bottom: 5px;">
|
||||||
<div class="db_info_table">
|
<div class="db_info_table">
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_version');?>
|
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_version');?>
|
||||||
<a href="https://github.com/jokob-sk/NetAlertX/blob/main/docs/VERSIONS.md" target="_blank"> <span><i class="fa fa-circle-question"></i></a></span>
|
<a href="https://github.com/jokob-sk/NetAlertX/blob/main/docs/VERSIONS.md" target="_blank"> <span><i class="fa fa-circle-question"></i></a></span>
|
||||||
</div>
|
</div>
|
||||||
@@ -73,41 +73,41 @@ $db->close();
|
|||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_built_on');?></div>
|
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_built_on');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php echo date("Y-m-d", ((int)file_get_contents( "buildtimestamp.txt")));?>
|
<?php echo date("Y-m-d", ((int)file_get_contents( "buildtimestamp.txt")));?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_Running_Version');?></div>
|
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_Running_Version');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php include 'php/templates/version.php'; ?>
|
<?php include 'php/templates/version.php'; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_database_path');?></div>
|
<div class="db_info_table_cell" style="min-width: 140px"><?= lang('Maintenance_database_path');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php echo $nax_db;?>
|
<?php echo $nax_db;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell"><?= lang('Maintenance_database_size');?></div>
|
<div class="db_info_table_cell"><?= lang('Maintenance_database_size');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php echo $nax_db_size;?> (wal: <?php echo $nax_wal_size;?>)
|
<?php echo $nax_db_size;?> (wal: <?php echo $nax_wal_size;?>)
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell"><?= lang('Maintenance_database_rows');?></div>
|
<div class="db_info_table_cell"><?= lang('Maintenance_database_rows');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php echo $tableSizesHTML;?>
|
<?php echo $tableSizesHTML;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_info_table_cell"><?= lang('Maintenance_database_lastmod');?></div>
|
<div class="db_info_table_cell"><?= lang('Maintenance_database_lastmod');?></div>
|
||||||
<div class="db_info_table_cell">
|
<div class="db_info_table_cell">
|
||||||
<?php echo $nax_db_mod;?>
|
<?php echo $nax_db_mod;?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.box-body -->
|
<!-- /.box-body -->
|
||||||
</div>
|
</div>
|
||||||
@@ -118,34 +118,28 @@ $db->close();
|
|||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a id="tab_DBTools_id" href="#tab_DBTools" data-toggle="tab">
|
<a id="tab_DBTools_id" href="#tab_DBTools" data-toggle="tab">
|
||||||
<i class="fa fa-toolbox"></i>
|
<i class="fa fa-toolbox"></i>
|
||||||
<?= lang('Maintenance_Tools_Tab_Tools');?>
|
<?= lang('Maintenance_Tools_Tab_Tools');?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_BackupRestore_id" href="#tab_BackupRestore" data-toggle="tab">
|
<a id="tab_BackupRestore_id" href="#tab_BackupRestore" data-toggle="tab">
|
||||||
<i class="fa fa-file-shield"></i>
|
<i class="fa fa-file-shield"></i>
|
||||||
<?= lang('Maintenance_Tools_Tab_BackupRestore');?>
|
<?= lang('Maintenance_Tools_Tab_BackupRestore');?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_Logging_id" href="#tab_Logging" data-toggle="tab">
|
<a id="tab_Logging_id" href="#tab_Logging" data-toggle="tab">
|
||||||
<i class="fa fa-triangle-exclamation"></i>
|
<i class="fa fa-triangle-exclamation"></i>
|
||||||
<?= lang('Maintenance_Tools_Tab_Logging');?>
|
<?= lang('Maintenance_Tools_Tab_Logging');?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_multiEdit_id" href="#tab_multiEdit" data-toggle="tab">
|
<a id="tab_multiEdit_id" href="#tab_multiEdit" data-toggle="tab">
|
||||||
<i class="fa fa-pencil pointer" ></i>
|
<i class="fa fa-pencil pointer" ></i>
|
||||||
<?= lang('Device_MultiEdit');?>
|
<?= lang('Device_MultiEdit');?>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<a id="tab_initCheck_id" href="#tab_initCheck" data-toggle="tab">
|
|
||||||
<i class="fa-solid fa-check"></i>
|
|
||||||
<?= lang('Maintenance_InitCheck');?>
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content spinnerTarget">
|
<div class="tab-content spinnerTarget">
|
||||||
<div class="tab-pane active" id="tab_DBTools">
|
<div class="tab-pane active" id="tab_DBTools">
|
||||||
@@ -215,13 +209,13 @@ $db->close();
|
|||||||
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnImportPastedCSV" onclick="askImportPastedCSV()"><?= lang('Maintenance_Tool_ImportPastedCSV');?></button>
|
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnImportPastedCSV" onclick="askImportPastedCSV()"><?= lang('Maintenance_Tool_ImportPastedCSV');?></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_ImportPastedCSV_text');?></div>
|
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_ImportPastedCSV_text');?></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_tools_table_cell_a" >
|
<div class="db_tools_table_cell_a" >
|
||||||
<button type="button" class="btn btn-default pa-btn bg-green dbtools-button" id="btnDownloadConfig" onclick="DownloadConfig()"><?= lang('Maintenance_Tool_DownloadConfig');?></button>
|
<button type="button" class="btn btn-default pa-btn bg-green dbtools-button" id="btnDownloadConfig" onclick="DownloadConfig()"><?= lang('Maintenance_Tool_DownloadConfig');?></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_DownloadConfig_text');?></div>
|
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_DownloadConfig_text');?></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table_row">
|
<div class="db_info_table_row">
|
||||||
<div class="db_tools_table_cell_a" >
|
<div class="db_tools_table_cell_a" >
|
||||||
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnImportPastedConfig" onclick="askImportPastedConfig()"><?= lang('Maintenance_Tool_ImportPastedConfig');?></button>
|
<button type="button" class="btn btn-default pa-btn pa-btn-delete bg-red dbtools-button" id="btnImportPastedConfig" onclick="askImportPastedConfig()"><?= lang('Maintenance_Tool_ImportPastedConfig');?></button>
|
||||||
@@ -233,7 +227,7 @@ $db->close();
|
|||||||
<button type="button" class="btn btn-default pa-btn bg-green dbtools-button" id="btnDownloadWorkflows" onclick="DownloadWorkflows()"><?= lang('Maintenance_Tool_DownloadWorkflows');?></button>
|
<button type="button" class="btn btn-default pa-btn bg-green dbtools-button" id="btnDownloadWorkflows" onclick="DownloadWorkflows()"><?= lang('Maintenance_Tool_DownloadWorkflows');?></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_DownloadWorkflows_text');?></div>
|
<div class="db_tools_table_cell_b"><?= lang('Maintenance_Tool_DownloadWorkflows_text');?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- ---------------------------Logging-------------------------------------------- -->
|
<!-- ---------------------------Logging-------------------------------------------- -->
|
||||||
@@ -257,17 +251,17 @@ $db->close();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<div class="form-inline toggle">
|
<div class="form-inline toggle">
|
||||||
<input class="form-control" type="text" id="logsFilter" oninput="applyFilter()" placeholder="Filter lines with text..." />
|
<input class="form-control" type="text" id="logsFilter" oninput="applyFilter()" placeholder="Filter lines with text..." />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="db_info_table">
|
<div class="db_info_table">
|
||||||
<div id="logsPlc"></div>
|
<div id="logsPlc"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ---------------------------Bulk edit -------------------------------------------- -->
|
<!-- ---------------------------Bulk edit -------------------------------------------- -->
|
||||||
<div class="tab-pane" id="tab_multiEdit">
|
<div class="tab-pane" id="tab_multiEdit">
|
||||||
<div class="db_info_table">
|
<div class="db_info_table">
|
||||||
@@ -280,20 +274,6 @@ $db->close();
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ---------------------------Init check -------------------------------------------- -->
|
|
||||||
<div class="tab-pane" id="tab_initCheck">
|
|
||||||
<div class="db_info_table">
|
|
||||||
<div class="box box-solid">
|
|
||||||
|
|
||||||
<?php
|
|
||||||
require 'initCheck.php';
|
|
||||||
?>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ------------------------------------------------------------------------------ -->
|
<!-- ------------------------------------------------------------------------------ -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -302,22 +282,22 @@ $db->close();
|
|||||||
<div class="box-body " style="text-align: center;">
|
<div class="box-body " style="text-align: center;">
|
||||||
<h5 class="text-aqua" style="font-size: 16px;">
|
<h5 class="text-aqua" style="font-size: 16px;">
|
||||||
<span id="lastCommit">
|
<span id="lastCommit">
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
<span id="lastDockerUpdate">
|
<span id="lastDockerUpdate">
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
</h5>
|
</h5>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
<?php
|
<?php
|
||||||
@@ -340,13 +320,13 @@ var selectedTab = 'tab_DBTools_id';
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete devices with emty macs
|
// delete devices with emty macs
|
||||||
function askDeleteDevicesWithEmptyMACs () {
|
function askDeleteDevicesWithEmptyMACs () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_empty_macs_noti');?>', '<?= lang('Maintenance_Tool_del_empty_macs_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_empty_macs_noti');?>', '<?= lang('Maintenance_Tool_del_empty_macs_noti_text');?>',
|
||||||
'Cancel', 'Delete', 'deleteDevicesWithEmptyMACs');
|
'Cancel', 'Delete', 'deleteDevicesWithEmptyMACs');
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
function deleteDevicesWithEmptyMACs()
|
function deleteDevicesWithEmptyMACs()
|
||||||
{
|
{
|
||||||
// Delete device
|
// Delete device
|
||||||
$.get('php/server/devices.php?action=deleteAllWithEmptyMACs', function(msg) {
|
$.get('php/server/devices.php?action=deleteAllWithEmptyMACs', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -355,15 +335,15 @@ function deleteDevicesWithEmptyMACs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete all devices
|
// delete all devices
|
||||||
function askDeleteAllDevices () {
|
function askDeleteAllDevices () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_alldev_noti');?>', '<?= lang('Maintenance_Tool_del_alldev_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_alldev_noti');?>', '<?= lang('Maintenance_Tool_del_alldev_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteAllDevices');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteAllDevices');
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
function deleteAllDevices()
|
function deleteAllDevices()
|
||||||
{
|
{
|
||||||
// Delete device
|
// Delete device
|
||||||
$.get('php/server/devices.php?action=deleteAllDevices', function(msg) {
|
$.get('php/server/devices.php?action=deleteAllDevices', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -372,15 +352,15 @@ function deleteAllDevices()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete all (unknown) devices
|
// delete all (unknown) devices
|
||||||
function askDeleteUnknown () {
|
function askDeleteUnknown () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_unknowndev_noti');?>', '<?= lang('Maintenance_Tool_del_unknowndev_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_unknowndev_noti');?>', '<?= lang('Maintenance_Tool_del_unknowndev_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteUnknownDevices');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteUnknownDevices');
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
function deleteUnknownDevices()
|
function deleteUnknownDevices()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
$.get('php/server/devices.php?action=deleteUnknownDevices', function(msg) {
|
$.get('php/server/devices.php?action=deleteUnknownDevices', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -389,15 +369,15 @@ function deleteUnknownDevices()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete all Events
|
// delete all Events
|
||||||
function askDeleteEvents () {
|
function askDeleteEvents () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_allevents_noti');?>', '<?= lang('Maintenance_Tool_del_allevents_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_allevents_noti');?>', '<?= lang('Maintenance_Tool_del_allevents_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteEvents');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteEvents');
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
function deleteEvents()
|
function deleteEvents()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
$.get('php/server/devices.php?action=deleteEvents', function(msg) {
|
$.get('php/server/devices.php?action=deleteEvents', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -408,13 +388,13 @@ function deleteEvents()
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete all Events older than 30 days
|
// delete all Events older than 30 days
|
||||||
function askDeleteEvents30 () {
|
function askDeleteEvents30 () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_allevents30_noti');?>', '<?= lang('Maintenance_Tool_del_allevents30_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_allevents30_noti');?>', '<?= lang('Maintenance_Tool_del_allevents30_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteEvents30');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteEvents30');
|
||||||
}
|
}
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
function deleteEvents30()
|
function deleteEvents30()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
$.get('php/server/devices.php?action=deleteEvents30', function(msg) {
|
$.get('php/server/devices.php?action=deleteEvents30', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -423,14 +403,14 @@ function deleteEvents30()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// delete History
|
// delete History
|
||||||
function askDeleteActHistory () {
|
function askDeleteActHistory () {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_del_ActHistory_noti');?>', '<?= lang('Maintenance_Tool_del_ActHistory_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_del_ActHistory_noti');?>', '<?= lang('Maintenance_Tool_del_ActHistory_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteActHistory');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteActHistory');
|
||||||
}
|
}
|
||||||
function deleteActHistory()
|
function deleteActHistory()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
$.get('php/server/devices.php?action=deleteActHistory', function(msg) {
|
$.get('php/server/devices.php?action=deleteActHistory', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -441,7 +421,7 @@ function deleteActHistory()
|
|||||||
// Import pasted Config ASK
|
// Import pasted Config ASK
|
||||||
function askImportPastedConfig() {
|
function askImportPastedConfig() {
|
||||||
|
|
||||||
// Add new icon as base64 string
|
// Add new icon as base64 string
|
||||||
showModalInput ('<i class="fa fa-square-plus pointer"></i> <?= lang('Maintenance_Tool_ImportConfig_noti');?>', '<?= lang('Maintenance_Tool_ImportPastedConfig_noti_text');?>',
|
showModalInput ('<i class="fa fa-square-plus pointer"></i> <?= lang('Maintenance_Tool_ImportConfig_noti');?>', '<?= lang('Maintenance_Tool_ImportPastedConfig_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'UploadConfig');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'UploadConfig');
|
||||||
}
|
}
|
||||||
@@ -449,15 +429,15 @@ function askImportPastedConfig() {
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// Upload Settings Config
|
// Upload Settings Config
|
||||||
function UploadConfig()
|
function UploadConfig()
|
||||||
{
|
{
|
||||||
appConf = $('#modal-input-textarea').val()
|
appConf = $('#modal-input-textarea').val()
|
||||||
// encode for import
|
// encode for import
|
||||||
appConfBase64 = btoa(appConf)
|
appConfBase64 = btoa(appConf)
|
||||||
|
|
||||||
// import
|
// import
|
||||||
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
|
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
|
||||||
console.log(msg);
|
console.log(msg);
|
||||||
// showMessage(msg);
|
// showMessage(msg);
|
||||||
write_notification(`[Maintenance]: ${msg}`, 'interrupt');
|
write_notification(`[Maintenance]: ${msg}`, 'interrupt');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -466,7 +446,7 @@ function UploadConfig()
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// Download Settings Config
|
// Download Settings Config
|
||||||
function DownloadConfig()
|
function DownloadConfig()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
openInNewTab("php/server/query_config.php?file=app.conf&download=true")
|
openInNewTab("php/server/query_config.php?file=app.conf&download=true")
|
||||||
}
|
}
|
||||||
@@ -475,7 +455,7 @@ function DownloadConfig()
|
|||||||
// Download Workflows
|
// Download Workflows
|
||||||
|
|
||||||
function DownloadWorkflows()
|
function DownloadWorkflows()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
openInNewTab("php/server/query_config.php?file=workflows.json&download=true")
|
openInNewTab("php/server/query_config.php?file=workflows.json&download=true")
|
||||||
}
|
}
|
||||||
@@ -485,7 +465,7 @@ function DownloadWorkflows()
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// Export CSV
|
// Export CSV
|
||||||
function ExportCSV()
|
function ExportCSV()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
openInNewTab("php/server/devices.php?action=ExportCSV")
|
openInNewTab("php/server/devices.php?action=ExportCSV")
|
||||||
}
|
}
|
||||||
@@ -493,12 +473,12 @@ function ExportCSV()
|
|||||||
// -----------------------------------------------------------
|
// -----------------------------------------------------------
|
||||||
// Import CSV
|
// Import CSV
|
||||||
function askImportCSV() {
|
function askImportCSV() {
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Maintenance_Tool_ImportCSV_noti');?>', '<?= lang('Maintenance_Tool_ImportCSV_noti_text');?>',
|
showModalWarning('<?= lang('Maintenance_Tool_ImportCSV_noti');?>', '<?= lang('Maintenance_Tool_ImportCSV_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'ImportCSV');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'ImportCSV');
|
||||||
}
|
}
|
||||||
function ImportCSV()
|
function ImportCSV()
|
||||||
{
|
{
|
||||||
// Execute
|
// Execute
|
||||||
$.get('php/server/devices.php?action=ImportCSV', function(msg) {
|
$.get('php/server/devices.php?action=ImportCSV', function(msg) {
|
||||||
showMessage (msg);
|
showMessage (msg);
|
||||||
@@ -510,21 +490,21 @@ function ImportCSV()
|
|||||||
// Import pasted CSV
|
// Import pasted CSV
|
||||||
function askImportPastedCSV() {
|
function askImportPastedCSV() {
|
||||||
|
|
||||||
// Add new icon as base64 string
|
// Add new icon as base64 string
|
||||||
showModalInput ('<i class="fa fa-square-plus pointer"></i> <?= lang('Maintenance_Tool_ImportCSV_noti');?>', '<?= lang('Maintenance_Tool_ImportPastedCSV_noti_text');?>',
|
showModalInput ('<i class="fa fa-square-plus pointer"></i> <?= lang('Maintenance_Tool_ImportCSV_noti');?>', '<?= lang('Maintenance_Tool_ImportPastedCSV_noti_text');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'ImportPastedCSV');
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', 'ImportPastedCSV');
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportPastedCSV()
|
function ImportPastedCSV()
|
||||||
{
|
{
|
||||||
var csv = $('#modal-input-textarea').val();
|
var csv = $('#modal-input-textarea').val();
|
||||||
|
|
||||||
console.log(csv);
|
console.log(csv);
|
||||||
|
|
||||||
csvBase64 = utf8ToBase64(csv);
|
csvBase64 = utf8ToBase64(csv);
|
||||||
|
|
||||||
console.log(csvBase64);
|
console.log(csvBase64);
|
||||||
|
|
||||||
|
|
||||||
$.post('php/server/devices.php?action=ImportCSV', { content: csvBase64 }, function(msg) {
|
$.post('php/server/devices.php?action=ImportCSV', { content: csvBase64 }, function(msg) {
|
||||||
showMessage(msg);
|
showMessage(msg);
|
||||||
@@ -537,7 +517,7 @@ function ImportPastedCSV()
|
|||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
|
|
||||||
// Clean log file
|
// Clean log file
|
||||||
var targetLogFile = "";
|
var targetLogFile = "";
|
||||||
var logFileAction = "";
|
var logFileAction = "";
|
||||||
|
|
||||||
@@ -547,17 +527,17 @@ var logFileAction = "";
|
|||||||
function logManage(callback) {
|
function logManage(callback) {
|
||||||
targetLogFile = arguments[0]; // target
|
targetLogFile = arguments[0]; // target
|
||||||
logFileAction = arguments[1]; // action
|
logFileAction = arguments[1]; // action
|
||||||
// Ask
|
// Ask
|
||||||
showModalWarning('<?= lang('Gen_Purge');?>' + ' ' + arguments[1], '<?= lang('Gen_AreYouSure');?>',
|
showModalWarning('<?= lang('Gen_Purge');?>' + ' ' + arguments[1], '<?= lang('Gen_AreYouSure');?>',
|
||||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', "performLogManage");
|
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Okay');?>', "performLogManage");
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
function performLogManage() {
|
function performLogManage() {
|
||||||
// Execute
|
// Execute
|
||||||
console.log("targetLogFile:" + targetLogFile)
|
console.log("targetLogFile:" + targetLogFile)
|
||||||
console.log("logFileAction:" + logFileAction)
|
console.log("logFileAction:" + logFileAction)
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: "php/server/util.php",
|
url: "php/server/util.php",
|
||||||
@@ -572,7 +552,7 @@ function performLogManage() {
|
|||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// scroll down the log areas
|
// scroll down the log areas
|
||||||
function scrollDown() {
|
function scrollDown() {
|
||||||
|
|
||||||
var elementToCheck = $("#tab_Logging_id");
|
var elementToCheck = $("#tab_Logging_id");
|
||||||
|
|
||||||
// Check if the parent <li> is active
|
// Check if the parent <li> is active
|
||||||
@@ -583,14 +563,14 @@ function scrollDown() {
|
|||||||
$(this).scrollTop(this.scrollHeight);
|
$(this).scrollTop(this.scrollHeight);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
// General initialization
|
// General initialization
|
||||||
// --------------------------------------------------------
|
// --------------------------------------------------------
|
||||||
function initializeTabs() {
|
function initializeTabs() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const key = "activeMaintenanceTab";
|
const key = "activeMaintenanceTab";
|
||||||
|
|
||||||
@@ -608,7 +588,7 @@ function initializeTabs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// update cookie if target specified
|
// update cookie if target specified
|
||||||
if (target) {
|
if (target) {
|
||||||
selectedTab = target.endsWith("_id") ? target : `${target}_id`;
|
selectedTab = target.endsWith("_id") ? target : `${target}_id`;
|
||||||
setCache(key, selectedTab); // _id is added so it doesn't conflict with AdminLTE tab behavior
|
setCache(key, selectedTab); // _id is added so it doesn't conflict with AdminLTE tab behavior
|
||||||
}
|
}
|
||||||
@@ -659,15 +639,15 @@ function toggleAutoRefresh() {
|
|||||||
// Manages the filter application on the logs
|
// Manages the filter application on the logs
|
||||||
function applyFilter() {
|
function applyFilter() {
|
||||||
const filterText = $("#logsFilter").val().toLowerCase();
|
const filterText = $("#logsFilter").val().toLowerCase();
|
||||||
|
|
||||||
$(".logs").each(function() {
|
$(".logs").each(function() {
|
||||||
const originalText = $(this).data('originalText') || $(this).val();
|
const originalText = $(this).data('originalText') || $(this).val();
|
||||||
|
|
||||||
if (!$(this).data('originalText')) {
|
if (!$(this).data('originalText')) {
|
||||||
$(this).data('originalText', originalText);
|
$(this).data('originalText', originalText);
|
||||||
}
|
}
|
||||||
|
|
||||||
const filteredLines = originalText.split('\n').filter(line =>
|
const filteredLines = originalText.split('\n').filter(line =>
|
||||||
line.toLowerCase().includes(filterText)
|
line.toLowerCase().includes(filterText)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -692,7 +672,7 @@ function renderLogs(customData) {
|
|||||||
{
|
{
|
||||||
scrollDown(); // scroll down the logs
|
scrollDown(); // scroll down the logs
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
console.error('Error fetching infoboxes:', error);
|
console.error('Error fetching infoboxes:', error);
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<!-- ---------------------------------------------------------------------------
|
<!-- ---------------------------------------------------------------------------
|
||||||
# NetAlertX
|
# NetAlertX
|
||||||
# Open Source Network Guard / WIFI & LAN intrusion detector
|
# Open Source Network Guard / WIFI & LAN intrusion detector
|
||||||
#
|
#
|
||||||
# header.php - Front module. Common header to all the web pages
|
# header.php - Front module. Common header to all the web pages
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||||
#--------------------------------------------------------------------------- -->
|
#--------------------------------------------------------------------------- -->
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
|
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<link id="favicon" rel="icon" type="image/x-icon" href="img/NetAlertX_logo.png">
|
<link id="favicon" rel="icon" type="image/x-icon" href="img/NetAlertX_logo.png">
|
||||||
|
|
||||||
<!-- For better UX on Mobile Devices using the Shortcut on the Homescreen -->
|
<!-- For better UX on Mobile Devices using the Shortcut on the Homescreen -->
|
||||||
<link rel="manifest" href="img/manifest.json" crossorigin="use-credentials">
|
<link rel="manifest" href="img/manifest.json" crossorigin="use-credentials">
|
||||||
<!-- Dark-Mode Patch -->
|
<!-- Dark-Mode Patch -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
@@ -102,12 +102,12 @@
|
|||||||
// -------------------------------------------------------------
|
// -------------------------------------------------------------
|
||||||
// Updates the backend application state/status in the header
|
// Updates the backend application state/status in the header
|
||||||
function updateState(){
|
function updateState(){
|
||||||
$.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
$.get('php/server/query_json.php', { file: 'app_state.json', nocache: Date.now() }, function(appState) {
|
||||||
|
|
||||||
document.getElementById('state').innerHTML = appState["currentState"].replaceAll('"', '');
|
document.getElementById('state').innerHTML = appState["currentState"].replaceAll('"', '');
|
||||||
|
|
||||||
setTimeout("updateState()", 1000);
|
setTimeout("updateState()", 1000);
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,13 +160,13 @@
|
|||||||
<a href="devices.php" class="logo">
|
<a href="devices.php" class="logo">
|
||||||
<!-- mini logo for sidebar mini 50x50 pixels -->
|
<!-- mini logo for sidebar mini 50x50 pixels -->
|
||||||
<span class="logo-mini">
|
<span class="logo-mini">
|
||||||
<img src="img/NetAlertX_logo.png" class="top-left-logo" alt="NetAlertX Logo"/>
|
<img src="img/NetAlertX_logo.png" class="top-left-logo" alt="NetAlertX Logo"/>
|
||||||
</span>
|
</span>
|
||||||
<!-- logo for regular state and mobile devices -->
|
<!-- logo for regular state and mobile devices -->
|
||||||
<span class="logo-lg">Net<b>Alert</b><sup>x</sup>
|
<span class="logo-lg">Net<b>Alert</b><sup>x</sup>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
@@ -175,35 +175,35 @@
|
|||||||
<!-- Sidebar toggle button-->
|
<!-- Sidebar toggle button-->
|
||||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||||
<i class="fa-solid fa-bars"></i>
|
<i class="fa-solid fa-bars"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<!-- ticker message Placeholder for ticker announcement messages -->
|
<!-- ticker message Placeholder for ticker announcement messages -->
|
||||||
<div id="ticker_announcement_plc"></div>
|
<div id="ticker_announcement_plc"></div>
|
||||||
|
|
||||||
<!-- Navbar Right Menu -->
|
<!-- Navbar Right Menu -->
|
||||||
<div class="navbar-custom-menu">
|
<div class="navbar-custom-menu">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<!-- Back Button -->
|
<!-- Back Button -->
|
||||||
<li>
|
<li>
|
||||||
<a id="back-button" href="javascript:history.go(-1);" role="button" span class='fa fa-arrow-left'></a>
|
<a id="back-button" href="javascript:history.go(-1);" role="button" span class='fa fa-arrow-left'></a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Next Button -->
|
<!-- Next Button -->
|
||||||
<li>
|
<li>
|
||||||
<a id="next-button" href="javascript:history.go(1);" role="button" span class='fa fa-arrow-right'></a>
|
<a id="next-button" href="javascript:history.go(1);" role="button" span class='fa fa-arrow-right'></a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Clear cache & Reload -->
|
<!-- Clear cache & Reload -->
|
||||||
<li>
|
<li>
|
||||||
<a id="reload-button" href='#' role="button" span onclick='clearCache()' class='fa-solid fa-rotate'></a>
|
<a id="reload-button" href='#' role="button" span onclick='clearCache()' class='fa-solid fa-rotate'></a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Full Screen -->
|
<!-- Full Screen -->
|
||||||
<li>
|
<li>
|
||||||
<a id="fullscreen-button" href='#' role="button" span class='fa fa-arrows-alt' onclick='toggleFullscreen()'></a>
|
<a id="fullscreen-button" href='#' role="button" span class='fa fa-arrows-alt' onclick='toggleFullscreen()'></a>
|
||||||
</li>
|
</li>
|
||||||
<!-- Notifications -->
|
<!-- Notifications -->
|
||||||
<li>
|
<li>
|
||||||
<a id="notifications-button" href='userNotifications.php' role="button" span class='fa-solid fa-bell'></a>
|
<a id="notifications-button" href='userNotifications.php' role="button" span class='fa-solid fa-bell'></a>
|
||||||
<span id="unread-notifications-bell-count" title="" class="badge bg-red unread-notifications-bell" >0</span>
|
<span id="unread-notifications-bell-count" title="" class="badge bg-red unread-notifications-bell" >0</span>
|
||||||
</li>
|
</li>
|
||||||
<!-- Server Status -->
|
<!-- Server Status -->
|
||||||
<li>
|
<li>
|
||||||
<a onclick="setCache('activeMaintenanceTab', 'tab_Logging_id')" href="maintenance.php#tab_Logging">
|
<a onclick="setCache('activeMaintenanceTab', 'tab_Logging_id')" href="maintenance.php#tab_Logging">
|
||||||
@@ -220,7 +220,7 @@
|
|||||||
<div class="header-server-time small">
|
<div class="header-server-time small">
|
||||||
<div>
|
<div>
|
||||||
<?php echo gethostname();?>
|
<?php echo gethostname();?>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<span id="NAX_Servertime_plc"></span>
|
<span id="NAX_Servertime_plc"></span>
|
||||||
<span id="NAX_TZ" class="hidden"></span>
|
<span id="NAX_TZ" class="hidden"></span>
|
||||||
@@ -232,7 +232,7 @@
|
|||||||
<li class="dropdown user user-menu">
|
<li class="dropdown user user-menu">
|
||||||
<!-- Menu Toggle Button -->
|
<!-- Menu Toggle Button -->
|
||||||
<a href="#" class="dropdown-toggle" style=" height: 50px;" data-toggle="dropdown">
|
<a href="#" class="dropdown-toggle" style=" height: 50px;" data-toggle="dropdown">
|
||||||
|
|
||||||
<span class="hidden-xs" ><!-- The user image in the navbar-->
|
<span class="hidden-xs" ><!-- The user image in the navbar-->
|
||||||
<img src="img/NetAlertX_logo.png" class="user-image" style="border-radius: initial" alt="NetAlertX Logo">
|
<img src="img/NetAlertX_logo.png" class="user-image" style="border-radius: initial" alt="NetAlertX Logo">
|
||||||
<!-- hidden-xs hides the username on small devices so only the image appears. --></span>
|
<!-- hidden-xs hides the username on small devices so only the image appears. --></span>
|
||||||
@@ -260,7 +260,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
|
||||||
@@ -336,11 +336,11 @@
|
|||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="report.php"> <?= lang("Navigation_Report");?> </a>
|
<a href="report.php"> <?= lang("Navigation_Report");?> </a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="userNotifications.php"> <?= lang("Navigation_Notifications");?> </a>
|
<a href="userNotifications.php"> <?= lang("Navigation_Notifications");?> </a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -374,10 +374,6 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="maintenance.php#tab_multiEdit" onclick="initializeTabs()"> <?= lang("Device_MultiEdit");?> </a>
|
<a href="maintenance.php#tab_multiEdit" onclick="initializeTabs()"> <?= lang("Device_MultiEdit");?> </a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
|
||||||
<a href="maintenance.php#tab_initCheck" onclick="initializeTabs()"> <?= lang("Maintenance_InitCheck");?> </a>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -408,7 +404,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="settings.php#publishers_content_header"> <?= lang("settings_publishers_label");?> </a>
|
<a href="settings.php#publishers_content_header"> <?= lang("settings_publishers_label");?> </a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -420,13 +416,13 @@
|
|||||||
<i class="fa fa-angle-left pull-right"></i>
|
<i class="fa fa-angle-left pull-right"></i>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'appEvents.php' ) ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('plugins.php', 'appEvents.php' ) ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
||||||
<li>
|
<li>
|
||||||
<a href="appEvents.php"><?= lang('Navigation_AppEvents');?></a>
|
<a href="appEvents.php"><?= lang('Navigation_AppEvents');?></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="plugins.php"><?= lang("Navigation_Plugins");?> </a>
|
<a href="plugins.php"><?= lang("Navigation_Plugins");?> </a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -443,16 +439,19 @@
|
|||||||
<i class="fa fa-angle-left pull-right"></i>
|
<i class="fa fa-angle-left pull-right"></i>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('systeminfo.php') ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
<ul class="treeview-menu " style="display: <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('systeminfo.php') ) ){ echo 'block'; } else {echo 'none';} ?>;">
|
||||||
<li>
|
<li>
|
||||||
<a href="systeminfo.php#panServer" onclick="setCache('activeSysinfoTab','tabServer');initializeTabs()"><?= lang('Systeminfo_System');?></a>
|
<a href="systeminfo.php#panServer" onclick="setCache('activeSysinfoTab','tabServer');initializeTabs()"><?= lang('Systeminfo_System');?></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="systeminfo.php#panNetwork" onclick="setCache('activeSysinfoTab','tabNetwork');initializeTabs()"><?= lang('Systeminfo_Network');?></a>
|
<a href="systeminfo.php#panNetwork" onclick="setCache('activeSysinfoTab','tabNetwork');initializeTabs()"><?= lang('Systeminfo_Network');?></a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a href="systeminfo.php#panStorage" onclick="setCache('activeSysinfoTab','tabStorage');initializeTabs()"><?= lang('Systeminfo_Storage');?></a>
|
<a href="systeminfo.php#panStorage" onclick="setCache('activeSysinfoTab','tabStorage');initializeTabs()"><?= lang('Systeminfo_Storage');?></a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="systeminfo.php#panInitCheck" onclick="setCache('activeSysinfoTab','tabInitCheck');initializeTabs()"> <?= lang("Maintenance_InitCheck");?> </a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -475,7 +474,7 @@
|
|||||||
document.documentElement.requestFullscreen();
|
document.documentElement.requestFullscreen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|
||||||
// Update server time in the header
|
// Update server time in the header
|
||||||
@@ -483,5 +482,5 @@
|
|||||||
|
|
||||||
// Update server state in the header
|
// Update server state in the header
|
||||||
updateState()
|
updateState()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
#---------------------------------------------------------------------------------#
|
#---------------------------------------------------------------------------------#
|
||||||
# NetAlertX #
|
# NetAlertX #
|
||||||
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
# Open Source Network Guard / WIFI & LAN intrusion detector #
|
||||||
# #
|
# #
|
||||||
# systeminfo.php - Front module. Server side. System Information #
|
# systeminfo.php - Front module. Server side. System Information #
|
||||||
#---------------------------------------------------------------------------------#
|
#---------------------------------------------------------------------------------#
|
||||||
@@ -15,61 +15,72 @@
|
|||||||
?>
|
?>
|
||||||
<?php require 'php/templates/modals.php'; ?>
|
<?php require 'php/templates/modals.php'; ?>
|
||||||
<!-- ----------------------------------------------------------------------- -->
|
<!-- ----------------------------------------------------------------------- -->
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
// show spinning icon
|
// show spinning icon
|
||||||
showSpinner()
|
showSpinner()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<!-- Page ------------------------------------------------------------------ -->
|
<!-- Page ------------------------------------------------------------------ -->
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
|
|
||||||
<!-- Main content ---------------------------------------------------------- -->
|
<!-- Main content ---------------------------------------------------------- -->
|
||||||
<section class="content">
|
<section class="content">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 col-sm-12 col-xs-12">
|
<div class="col-lg-12 col-sm-12 col-xs-12">
|
||||||
<!-- <div class="box-transparent"> -->
|
<!-- <div class="box-transparent"> -->
|
||||||
<div id="navSysInfo" class="nav-tabs-custom">
|
<div id="navSysInfo" class="nav-tabs-custom">
|
||||||
<ul class="nav nav-tabs" style="font-size:16px;">
|
<ul class="nav nav-tabs" style="font-size:16px;">
|
||||||
<li>
|
<li>
|
||||||
<a id="tabServer" href="#panServer" data-toggle="tab">
|
<a id="tabServer" href="#panServer" data-toggle="tab">
|
||||||
<i class="fa fa-info-circle"></i>
|
<i class="fa fa-info-circle"></i>
|
||||||
<span class="dev-detail-tab-name">
|
<span class="dev-detail-tab-name">
|
||||||
<?= lang('Systeminfo_System');?>
|
<?= lang('Systeminfo_System');?>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tabNetwork" href="#panNetwork" data-toggle="tab">
|
<a id="tabNetwork" href="#panNetwork" data-toggle="tab">
|
||||||
<i class="fa fa-sitemap fa-rotate-270"></i>
|
<i class="fa fa-sitemap fa-rotate-270"></i>
|
||||||
<span class="dev-detail-tab-name">
|
<span class="dev-detail-tab-name">
|
||||||
<?= lang('Systeminfo_Network');?>
|
<?= lang('Systeminfo_Network');?>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tabStorage" href="#panStorage" data-toggle="tab">
|
<a id="tabStorage" href="#panStorage" data-toggle="tab">
|
||||||
<i class="fa fa-hdd"></i>
|
<i class="fa fa-hdd"></i>
|
||||||
<span class="dev-detail-tab-name">
|
<span class="dev-detail-tab-name">
|
||||||
<?= lang('Systeminfo_Storage');?>
|
<?= lang('Systeminfo_Storage');?>
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a id="tabInitCheck" href="#panInitCheck" data-toggle="tab">
|
||||||
|
<i class="fa fa-check"></i>
|
||||||
|
<span class="dev-detail-tab-name">
|
||||||
|
<?= lang('Maintenance_InitCheck');?>
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="tab-content spinnerTarget" style="min-height: 430px;">
|
<div class="tab-content spinnerTarget" style="min-height: 430px;">
|
||||||
<div class="tab-pane fade" data-php-file="systeminfoServer.php" id="panServer">
|
<div class="tab-pane fade" data-php-file="systeminfoServer.php" id="panServer">
|
||||||
<!-- PLACEHOLDER -->
|
<!-- PLACEHOLDER -->
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" data-php-file="systeminfoNetwork.php" id="panNetwork">
|
<div class="tab-pane fade" data-php-file="systeminfoNetwork.php" id="panNetwork">
|
||||||
<!-- PLACEHOLDER -->
|
<!-- PLACEHOLDER -->
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade table-responsive" data-php-file="systeminfoStorage.php" id="panStorage">
|
<div class="tab-pane fade table-responsive" data-php-file="systeminfoStorage.php" id="panStorage">
|
||||||
<!-- PLACEHOLDER -->
|
<!-- PLACEHOLDER -->
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane fade table-responsive" data-php-file="systeminfoInitCheck.php" id="panInitCheck">
|
||||||
|
<!-- PLACEHOLDER -->
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- /.tab-content -->
|
<!-- /.tab-content -->
|
||||||
</div>
|
</div>
|
||||||
@@ -134,7 +145,7 @@ function initializeTabs() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
window.onload = function async() {
|
window.onload = function async() {
|
||||||
initializeTabs();
|
initializeTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
12
front/initCheck.php → front/systeminfoInitCheck.php
Executable file → Normal file
12
front/initCheck.php → front/systeminfoInitCheck.php
Executable file → Normal file
@@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// check if authenticated
|
// check if authenticated
|
||||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||||
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/server/db.php';
|
||||||
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/language/lang.php';
|
||||||
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/globals.php';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -16,10 +19,10 @@
|
|||||||
<i class="fa-solid fa-check text-success"></i> <?= lang('Maintenance_InitCheck_Success');?>
|
<i class="fa-solid fa-check text-success"></i> <?= lang('Maintenance_InitCheck_Success');?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="d-flex flex-wrap gap-2 w-100" id="file-check-list"></div>
|
<div class="d-flex flex-wrap gap-2 w-100" id="file-check-list"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -36,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
function retryCheck() {
|
function retryCheck() {
|
||||||
// re-set page
|
// re-set page
|
||||||
$('#file-check-list').empty();
|
$('#file-check-list').empty();
|
||||||
@@ -48,5 +51,6 @@
|
|||||||
|
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
checkAppInitializedJsonInit();
|
checkAppInitializedJsonInit();
|
||||||
|
hideSpinner();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
Reference in New Issue
Block a user