Compare commits

...

4 Commits

Author SHA1 Message Date
jokob-sk
1bce2e80e8 replace external IP check AJAX #1124
Some checks failed
Code checks / check-url-paths (push) Has been cancelled
docker / docker_dev (push) Has been cancelled
Deploy MkDocs / deploy (push) Has been cancelled
2025-08-05 08:15:49 +10:00
jokob-sk
1556d74406 Merge branch 'main' of https://github.com/jokob-sk/NetAlertX 2025-08-05 08:06:48 +10:00
jokob-sk
9b3947cc90 device tools init loading #1130 2025-08-05 08:06:42 +10:00
Sylvain Pichon
18b0309ac4 Translated using Weblate (French)
Currently translated at 100.0% (761 of 761 strings)

Translation: NetAlertX/core
Translate-URL: https://hosted.weblate.org/projects/pialert/core/fr/
2025-08-04 19:02:09 +00:00
5 changed files with 1223 additions and 10 deletions

View File

@@ -323,6 +323,10 @@ scrape_configs:
credentials: <API_TOKEN>
```
### Grafana template
Grafana template sample: [Download json](./samples/API/Grafana_Dashboard.json)
## API Endpoint: /log files
This API endpoint retrieves files from the `/app/log` folder.

File diff suppressed because it is too large Load Diff

View File

@@ -443,6 +443,37 @@
}
// init first time
initNmapButtons();
initCopyFromDevice();
// -----------------------------------------------------------
var toolsPageInitialized = false;
function initDeviceToolsPage()
{
// Only proceed if .panTools is visible
if (!$('#panTools:visible').length) {
return; // exit early if nothing is visible
}
// init page once
if (toolsPageInitialized) return;
toolsPageInitialized = true;
initNmapButtons();
initCopyFromDevice();
hideSpinner();
}
// -----------------------------------------------------------------------------
// Recurring function to monitor the URL and reinitialize if needed
function deviceToolsPageUpdater() {
initDeviceToolsPage();
// Run updater again after delay
setTimeout(deviceToolsPageUpdater, 200);
}
// start updater
deviceToolsPageUpdater();
</script>

2
front/php/templates/language/fr_fr.json Executable file → Normal file
View File

@@ -301,7 +301,7 @@
"Gen_Cancel": "Annuler",
"Gen_Change": "Changement",
"Gen_Copy": "Lancer",
"Gen_CopyToClipboard": "",
"Gen_CopyToClipboard": "Copier vers le presse-papier",
"Gen_DataUpdatedUITakesTime": "OK - cela peut prendre du temps à l'interface pour se mettre à jour si un scan est en cours.",
"Gen_Delete": "Supprimer",
"Gen_DeleteAll": "Supprimer tous",

View File

@@ -100,7 +100,7 @@ echo '<div class="box box-solid">
<div class="box-body">
<div class="row">
<div class="col-sm-3 sysinfo_network_a">' . lang('Systeminfo_Network_IP') . '</div>
<div class="col-sm-9 sysinfo_network_b">' . shell_exec("curl https://ifconfig.co") . '</div>
<div class="col-sm-9 sysinfo_network_b" id="external-ip">Loading...</div>
</div>
<div class="row">
<div class="col-sm-3 sysinfo_network_a">' . lang('Systeminfo_Network_IP_Connection') . '</div>
@@ -274,19 +274,35 @@ function renderAvailableIpsTable(allIps, usedIps) {
// INIT
$(document).ready(function() {
// available IPs
fetchUsedIps(usedIps => {
const allIps = inferNetworkRange(usedIps);
renderAvailableIpsTable(allIps, usedIps);
});
setTimeout(() => {
// Available IPs datatable
$('#networkTable').DataTable({
searching: true,
order: [[0, "desc"]],
initComplete: function(settings, json) {
hideSpinner(); // Called after the DataTable is fully initialized
}
});
searching: true,
order: [[0, "desc"]],
initComplete: function(settings, json) {
hideSpinner(); // Called after the DataTable is fully initialized
}
});
// external IP
$.ajax({
url: 'https://api64.ipify.org?format=json',
method: 'GET',
timeout: 10000, // 10 seconds timeout
success: function (response) {
$('#external-ip').text(response.ip);
},
error: function() {
$('#external-ip').text('ERROR');
}
});
}, 200);
});