diff --git a/docs/DEBUG_API_SERVER.md b/docs/DEBUG_API_SERVER.md
index 2c3db557..b8feac8a 100644
--- a/docs/DEBUG_API_SERVER.md
+++ b/docs/DEBUG_API_SERVER.md
@@ -40,7 +40,7 @@ There are several ways to check if the GraphQL server is running.
### 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:

diff --git a/docs/img/DEBUG_API_SERVER/Init_check.png b/docs/img/DEBUG_API_SERVER/Init_check.png
index 92d9d562..54ef9c9b 100644
Binary files a/docs/img/DEBUG_API_SERVER/Init_check.png and b/docs/img/DEBUG_API_SERVER/Init_check.png differ
diff --git a/front/js/tests.js b/front/js/tests.js
index 67261ea8..01840fd5 100755
--- a/front/js/tests.js
+++ b/front/js/tests.js
@@ -5,24 +5,24 @@ function lockDatabase(delay=20) {
url: 'php/server/dbHelper.php', // Replace with the actual path to your PHP file
type: 'GET',
data: { action: 'lockDatabase', delay: delay },
- success: function(response) {
- console.log('Executed');
+ success: function(response) {
+ console.log('Executed');
},
error: function() {
- console.log('Error ocurred');
+ console.log('Error ocurred');
}
});
- let times = delay;
+ let times = delay;
let countdownInterval = setInterval(() => {
times--;
console.log(`Remaining time: ${times} seconds`);
-
+
if (times <= 0) {
clearInterval(countdownInterval);
console.log('Countdown finished');
}
- }, 1000);
+ }, 5000);
}
@@ -52,7 +52,7 @@ const requiredFiles = [
function updateFileStatusUI(file, status) {
const item = $(`#file-${file.replace(/[^a-z0-9]/gi, '-')}`);
const icon = item.find('span.icon-wrap');
-
+
if (status === 'ok') {
icon.html('');
} else if (status === 'fail') {
@@ -61,7 +61,7 @@ const requiredFiles = [
icon.html('');
}
}
-
+
function checkAppInitializedJson() {
requiredFiles.forEach(file => {
@@ -77,17 +77,17 @@ const requiredFiles = [
updateFileStatusUI(file, 'fail');
});
});
-
+
const allOk = requiredFiles.every(file => fileStatus[file] === 'ok');
-
+
if (allOk) {
checkInternalStatusAfterFiles();
} else {
- setTimeout(checkAppInitializedJson, 1000);
+ setTimeout(checkAppInitializedJson, 5000);
}
}
-
-
+
+
function checkInternalStatusAfterFiles() {
const promises = [
waitForAppInitialized().then(() => {
@@ -97,7 +97,7 @@ const requiredFiles = [
fileStatus['isAppInitialized'] = 'fail';
updateFileStatusUI('isAppInitialized', 'fail');
}),
-
+
waitForGraphQLServer().then(() => {
fileStatus['isGraphQLServerRunning'] = 'ok';
updateFileStatusUI('isGraphQLServerRunning', 'ok');
@@ -106,14 +106,14 @@ const requiredFiles = [
updateFileStatusUI('isGraphQLServerRunning', 'fail');
})
];
-
+
Promise.allSettled(promises).then(() => {
const allPassed = internalChecks.every(key => fileStatus[key] === 'ok');
if (allPassed) {
$('#check-status').show();
$('#check-status-plc').hide();
} else {
- setTimeout(checkInternalStatusAfterFiles, 1000);
+ setTimeout(checkInternalStatusAfterFiles, 5000);
}
});
}
@@ -132,8 +132,8 @@ function checkAppInitializedJsonInit() {
const allItems = [...requiredFiles, ...internalChecks];
allItems.forEach(file => {
-
-
+
+
$('#file-check-list').append(`
@@ -151,7 +151,7 @@ function checkAppInitializedJsonInit() {
checkAppInitializedJson();
}
-
+
diff --git a/front/maintenance.php b/front/maintenance.php
index ceb9ce4a..dc4427ec 100755
--- a/front/maintenance.php
+++ b/front/maintenance.php
@@ -8,7 +8,7 @@
-
+
@@ -28,7 +28,7 @@ $nax_db_mod = file_exists($nax_db) ? date ("F d Y H:i:s", filemtime($nax_db)) :
// Table sizes -----------------------------------------------------------------
$tableSizesHTML = "";
-
+
// Open a connection to the SQLite database
$db = new SQLite3($nax_db);
@@ -46,7 +46,7 @@ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
// Close the database connection
$db->close();
-
+
?>
@@ -55,13 +55,13 @@ $db->close();
-
+
= lang('Maintenance_version');?>
@@ -73,41 +73,41 @@ $db->close();
= lang('Maintenance_built_on');?>
-
= lang('Maintenance_Running_Version');?>
-
= lang('Maintenance_database_path');?>
-
+
= lang('Maintenance_database_size');?>
(wal: )
-
+
= lang('Maintenance_database_rows');?>
-
+
= lang('Maintenance_database_lastmod');?>
-
-
+
+
@@ -118,34 +118,28 @@ $db->close();
@@ -215,13 +209,13 @@ $db->close();
= lang('Maintenance_Tool_ImportPastedCSV_text');?>
-
+
= lang('Maintenance_Tool_DownloadConfig_text');?>
-
+
@@ -233,7 +227,7 @@ $db->close();
= lang('Maintenance_Tool_DownloadWorkflows_text');?>
-
+
@@ -257,17 +251,17 @@ $db->close();
-
-
+
@@ -280,20 +274,6 @@ $db->close();
-
-
-
-
@@ -302,22 +282,22 @@ $db->close();
-
+
-
-
+
+
-
-
+
+
-
+
', '= lang('Maintenance_Tool_del_empty_macs_noti_text');?>',
'Cancel', 'Delete', 'deleteDevicesWithEmptyMACs');
}
// -----------------------------------------------------------
function deleteDevicesWithEmptyMACs()
-{
+{
// Delete device
$.get('php/server/devices.php?action=deleteAllWithEmptyMACs', function(msg) {
showMessage (msg);
@@ -355,15 +335,15 @@ function deleteDevicesWithEmptyMACs()
}
// -----------------------------------------------------------
-// delete all devices
+// delete all devices
function askDeleteAllDevices () {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_del_alldev_noti');?>', '= lang('Maintenance_Tool_del_alldev_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Delete');?>', 'deleteAllDevices');
}
// -----------------------------------------------------------
function deleteAllDevices()
-{
+{
// Delete device
$.get('php/server/devices.php?action=deleteAllDevices', function(msg) {
showMessage (msg);
@@ -372,15 +352,15 @@ function deleteAllDevices()
}
// -----------------------------------------------------------
-// delete all (unknown) devices
+// delete all (unknown) devices
function askDeleteUnknown () {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_del_unknowndev_noti');?>', '= lang('Maintenance_Tool_del_unknowndev_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Delete');?>', 'deleteUnknownDevices');
}
// -----------------------------------------------------------
function deleteUnknownDevices()
-{
+{
// Execute
$.get('php/server/devices.php?action=deleteUnknownDevices', function(msg) {
showMessage (msg);
@@ -389,15 +369,15 @@ function deleteUnknownDevices()
}
// -----------------------------------------------------------
-// delete all Events
+// delete all Events
function askDeleteEvents () {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_del_allevents_noti');?>', '= lang('Maintenance_Tool_del_allevents_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Delete');?>', 'deleteEvents');
}
// -----------------------------------------------------------
function deleteEvents()
-{
+{
// Execute
$.get('php/server/devices.php?action=deleteEvents', function(msg) {
showMessage (msg);
@@ -408,13 +388,13 @@ function deleteEvents()
// -----------------------------------------------------------
// delete all Events older than 30 days
function askDeleteEvents30 () {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_del_allevents30_noti');?>', '= lang('Maintenance_Tool_del_allevents30_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Delete');?>', 'deleteEvents30');
}
// -----------------------------------------------------------
function deleteEvents30()
-{
+{
// Execute
$.get('php/server/devices.php?action=deleteEvents30', function(msg) {
showMessage (msg);
@@ -423,14 +403,14 @@ function deleteEvents30()
}
// -----------------------------------------------------------
-// delete History
+// delete History
function askDeleteActHistory () {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_del_ActHistory_noti');?>', '= lang('Maintenance_Tool_del_ActHistory_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Delete');?>', 'deleteActHistory');
}
function deleteActHistory()
-{
+{
// Execute
$.get('php/server/devices.php?action=deleteActHistory', function(msg) {
showMessage (msg);
@@ -441,7 +421,7 @@ function deleteActHistory()
// Import pasted Config ASK
function askImportPastedConfig() {
- // Add new icon as base64 string
+ // Add new icon as base64 string
showModalInput (' = lang('Maintenance_Tool_ImportConfig_noti');?>', '= lang('Maintenance_Tool_ImportPastedConfig_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Okay');?>', 'UploadConfig');
}
@@ -449,15 +429,15 @@ function askImportPastedConfig() {
// -----------------------------------------------------------
// Upload Settings Config
function UploadConfig()
-{
+{
appConf = $('#modal-input-textarea').val()
// encode for import
appConfBase64 = btoa(appConf)
// import
$.post('php/server/query_replace_config.php', { base64data: appConfBase64, fileName: "app.conf" }, function(msg) {
- console.log(msg);
- // showMessage(msg);
+ console.log(msg);
+ // showMessage(msg);
write_notification(`[Maintenance]: ${msg}`, 'interrupt');
});
@@ -466,7 +446,7 @@ function UploadConfig()
// -----------------------------------------------------------
// Download Settings Config
function DownloadConfig()
-{
+{
// Execute
openInNewTab("php/server/query_config.php?file=app.conf&download=true")
}
@@ -475,7 +455,7 @@ function DownloadConfig()
// Download Workflows
function DownloadWorkflows()
-{
+{
// Execute
openInNewTab("php/server/query_config.php?file=workflows.json&download=true")
}
@@ -485,7 +465,7 @@ function DownloadWorkflows()
// -----------------------------------------------------------
// Export CSV
function ExportCSV()
-{
+{
// Execute
openInNewTab("php/server/devices.php?action=ExportCSV")
}
@@ -493,12 +473,12 @@ function ExportCSV()
// -----------------------------------------------------------
// Import CSV
function askImportCSV() {
- // Ask
+ // Ask
showModalWarning('= lang('Maintenance_Tool_ImportCSV_noti');?>', '= lang('Maintenance_Tool_ImportCSV_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Okay');?>', 'ImportCSV');
}
function ImportCSV()
-{
+{
// Execute
$.get('php/server/devices.php?action=ImportCSV', function(msg) {
showMessage (msg);
@@ -510,21 +490,21 @@ function ImportCSV()
// Import pasted CSV
function askImportPastedCSV() {
- // Add new icon as base64 string
+ // Add new icon as base64 string
showModalInput (' = lang('Maintenance_Tool_ImportCSV_noti');?>', '= lang('Maintenance_Tool_ImportPastedCSV_noti_text');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Okay');?>', 'ImportPastedCSV');
}
function ImportPastedCSV()
-{
+{
var csv = $('#modal-input-textarea').val();
console.log(csv);
- csvBase64 = utf8ToBase64(csv);
+ csvBase64 = utf8ToBase64(csv);
console.log(csvBase64);
-
+
$.post('php/server/devices.php?action=ImportCSV', { content: csvBase64 }, function(msg) {
showMessage(msg);
@@ -537,7 +517,7 @@ function ImportPastedCSV()
// --------------------------------------------------------
-// Clean log file
+// Clean log file
var targetLogFile = "";
var logFileAction = "";
@@ -547,17 +527,17 @@ var logFileAction = "";
function logManage(callback) {
targetLogFile = arguments[0]; // target
logFileAction = arguments[1]; // action
- // Ask
+ // Ask
showModalWarning('= lang('Gen_Purge');?>' + ' ' + arguments[1], '= lang('Gen_AreYouSure');?>',
'= lang('Gen_Cancel');?>', '= lang('Gen_Okay');?>', "performLogManage");
}
// --------------------------------------------------------
-function performLogManage() {
+function performLogManage() {
// Execute
console.log("targetLogFile:" + targetLogFile)
console.log("logFileAction:" + logFileAction)
-
+
$.ajax({
method: "POST",
url: "php/server/util.php",
@@ -572,7 +552,7 @@ function performLogManage() {
// --------------------------------------------------------
// scroll down the log areas
function scrollDown() {
-
+
var elementToCheck = $("#tab_Logging_id");
// Check if the parent is active
@@ -583,14 +563,14 @@ function scrollDown() {
$(this).scrollTop(this.scrollHeight);
});
}
-
+
}
// --------------------------------------------------------
// General initialization
// --------------------------------------------------------
-function initializeTabs() {
+function initializeTabs() {
setTimeout(() => {
const key = "activeMaintenanceTab";
@@ -608,7 +588,7 @@ function initializeTabs() {
}
// update cookie if target specified
- if (target) {
+ if (target) {
selectedTab = target.endsWith("_id") ? target : `${target}_id`;
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
function applyFilter() {
const filterText = $("#logsFilter").val().toLowerCase();
-
+
$(".logs").each(function() {
const originalText = $(this).data('originalText') || $(this).val();
-
+
if (!$(this).data('originalText')) {
$(this).data('originalText', originalText);
}
- const filteredLines = originalText.split('\n').filter(line =>
+ const filteredLines = originalText.split('\n').filter(line =>
line.toLowerCase().includes(filterText)
);
@@ -692,7 +672,7 @@ function renderLogs(customData) {
{
scrollDown(); // scroll down the logs
}
-
+
},
error: function(xhr, status, error) {
console.error('Error fetching infoboxes:', error);
diff --git a/front/php/templates/header.php b/front/php/templates/header.php
index 5e621cf2..55919a89 100755
--- a/front/php/templates/header.php
+++ b/front/php/templates/header.php
@@ -1,8 +1,8 @@
@@ -15,7 +15,7 @@
?>
-
+
@@ -80,7 +80,7 @@
-
+
-
+
NetAlertx
-
+
@@ -175,35 +175,35 @@
-
+
+