mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Merge branch 'main' into feature/freebox
This commit is contained in:
@@ -42,6 +42,7 @@ services:
|
||||
- ${DEV_LOCATION}/front/api:/app/front/api
|
||||
- ${DEV_LOCATION}/front/php:/app/front/php
|
||||
- ${DEV_LOCATION}/front/deviceDetails.php:/app/front/deviceDetails.php
|
||||
- ${DEV_LOCATION}/front/deviceDetailsEdit.php:/app/front/deviceDetailsEdit.php
|
||||
- ${DEV_LOCATION}/front/userNotifications.php:/app/front/userNotifications.php
|
||||
- ${DEV_LOCATION}/front/deviceDetailsTools.php:/app/front/deviceDetailsTools.php
|
||||
- ${DEV_LOCATION}/front/devices.php:/app/front/devices.php
|
||||
|
||||
@@ -38,7 +38,7 @@ Some examples how to apply the above:
|
||||
|
||||
Some useful frontend JavaScript functions:
|
||||
|
||||
- `getDeviceDataByMac(macAddress, devicesColumn)` - method to retrieve any device data (database column) based on MAC address in the frontend
|
||||
- `getDevDataByMac(macAddress, devicesColumn)` - method to retrieve any device data (database column) based on MAC address in the frontend
|
||||
- `getString(string stringKey)` - method to retrieve translated strings in the frontend
|
||||
- `getSetting(string stringKey)` - method to retrieve settings in the frontend
|
||||
|
||||
|
||||
@@ -17,10 +17,9 @@ There are 4 ways how to influence notifications:
|
||||
|
||||
There are 4 settings on the device for influencing notifications. You can:
|
||||
|
||||
1. **Scan Device** - Completely disable the scanning of the device.
|
||||
2. **Alert Events** - Enables alerts of connections, disconnections, IP changes.
|
||||
3. **Alert Down** - Alerts when a device goes down. This setting overrides a disabled **Alert Events** setting, so you will get a notification of a device going down even if you don't have **Alert Events** ticked.
|
||||
4. **Skip repeated notifications**, if for example you know there is a temporary issue and want to pause the same notification for this device for a given time.
|
||||
1. **Alert Events** - Enables alerts of connections, disconnections, IP changes.
|
||||
2. **Alert Down** - Alerts when a device goes down. This setting overrides a disabled **Alert Events** setting, so you will get a notification of a device going down even if you don't have **Alert Events** ticked.
|
||||
3. **Skip repeated notifications**, if for example you know there is a temporary issue and want to pause the same notification for this device for a given time.
|
||||
|
||||
## Plugin settings 🔌
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 126 KiB |
@@ -18,6 +18,16 @@
|
||||
--color-red: #dd4b39;
|
||||
}
|
||||
|
||||
.input-group .checkbox
|
||||
{
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
h5
|
||||
{
|
||||
font-size: medium;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
Helper Classes
|
||||
----------------------------------------------------------------------------- */
|
||||
@@ -1256,6 +1266,7 @@ input[readonly] {
|
||||
position: absolute;
|
||||
font-size: x-small;
|
||||
margin-bottom: 6px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.pageHelp{
|
||||
@@ -1283,6 +1294,10 @@ input[readonly] {
|
||||
height: 1em !important;
|
||||
}
|
||||
|
||||
#panDetails .control-label{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------- */
|
||||
/* MODAL popups */
|
||||
/* ----------------------------------------------------------------- */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
475
front/deviceDetailsEdit.php
Executable file
475
front/deviceDetailsEdit.php
Executable file
@@ -0,0 +1,475 @@
|
||||
<?php
|
||||
//------------------------------------------------------------------------------
|
||||
// check if authenticated
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
?>
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="box-body form-horizontal">
|
||||
<form id="edit-form">
|
||||
<!-- Form fields will be appended here -->
|
||||
</form>
|
||||
</div>
|
||||
<!-- Buttons -->
|
||||
<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="btnDeleteEvents"
|
||||
onclick="askDeleteDeviceEvents()">
|
||||
<?= lang('DevDetail_button_DeleteEvents');?>
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-default pa-btn pa-btn-delete"
|
||||
style="margin-left:0px;"
|
||||
id="btnDelete"
|
||||
onclick="askDeleteDevice()">
|
||||
<?= lang('DevDetail_button_Delete');?>
|
||||
</button>
|
||||
<button type="button"
|
||||
class="btn btn-primary pa-btn"
|
||||
style="margin-left:6px; "
|
||||
id="btnSave"
|
||||
onclick="setDeviceData()" >
|
||||
<?= lang('DevDetail_button_Save');?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script defer>
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Get plugin and settings data from API endpoints
|
||||
function getDeviceData(readAllData){
|
||||
|
||||
mac = getMac()
|
||||
|
||||
console.log(mac);
|
||||
|
||||
// get data from server
|
||||
$.get('php/server/devices.php?action=getServerDeviceData&mac='+ mac + '&period='+ period, function(data) {
|
||||
|
||||
// show loading dialog
|
||||
showSpinner()
|
||||
|
||||
var deviceData = JSON.parse(data);
|
||||
|
||||
// Deactivate next previous buttons
|
||||
if (readAllData) {
|
||||
$('#btnPrevious').attr ('disabled','');
|
||||
$('#btnPrevious').addClass ('text-gray50');
|
||||
$('#btnNext').attr ('disabled','');
|
||||
$('#btnNext').addClass ('text-gray50');
|
||||
}
|
||||
|
||||
// some race condition, need to implement delay
|
||||
setTimeout(() => {
|
||||
$.get('api/table_settings.json?nocache=' + Date.now(), function(res) {
|
||||
|
||||
settingsData = res["data"];
|
||||
|
||||
// columns to hide
|
||||
hiddenFields = ["NEWDEV_devScan", "NEWDEV_devPresentLastScan" ]
|
||||
// columns to disable - conditional depending if a new dummy device is created
|
||||
disabledFields = mac == "new" ? ["NEWDEV_devLastNotification", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection"] : ["NEWDEV_devLastNotification", "NEWDEV_devFirstConnection", "NEWDEV_devLastConnection", "NEWDEV_devMac", "NEWDEV_devLastIP" ];
|
||||
|
||||
// Grouping of fields into categories with associated documentation links
|
||||
const fieldGroups = {
|
||||
// Group for device main information
|
||||
DevDetail_MainInfo_Title: {
|
||||
data: ["devMac", "devLastIP", "devName", "devOwner", "devType", "devVendor", "devGroup", "devIcon", "devLocation", "devComments"],
|
||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
||||
iconClass: "fa fa-pencil"
|
||||
},
|
||||
// Group for session information
|
||||
DevDetail_SessionInfo_Title: {
|
||||
data: ["devStatus", "devLastConnection", "devFirstConnection"],
|
||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
||||
iconClass: "fa fa-calendar"
|
||||
},
|
||||
// Group for event and alert settings
|
||||
DevDetail_EveandAl_Title: {
|
||||
data: ["devAlertEvents", "devAlertDown", "devSkipRepeated"],
|
||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
||||
iconClass: "fa fa-bell"
|
||||
},
|
||||
// Group for network details
|
||||
DevDetail_MainInfo_Network_Title: {
|
||||
data: ["devParentMAC", "devParentPort", "devSSID", "devSite"],
|
||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NETWORK_TREE.md",
|
||||
iconClass: "fa fa-network-wired"
|
||||
},
|
||||
// Group for other fields like static IP, archived status, etc.
|
||||
DevDetail_DisplayFields_Title: {
|
||||
data: ["devStaticIP", "devIsNew", "devFavorite", "devIsArchived"],
|
||||
docs: "https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md",
|
||||
iconClass: "fa fa-list-check"
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
// Filter settings data to get relevant settings
|
||||
const relevantSettings = settingsData.filter(set =>
|
||||
set.setGroup === "NEWDEV" && // Filter for settings in the "NEWDEV" group
|
||||
set.setKey.includes("_dev") && // Include settings with '_dev' in the key
|
||||
!hiddenFields.includes(set.setKey) && // Exclude settings listed in hiddenFields
|
||||
!set.setKey.includes("__metadata") // Exclude metadata fields
|
||||
);
|
||||
|
||||
// Function to generate the form
|
||||
const generateSimpleForm = settings => {
|
||||
const form = $('#edit-form'); // Get the form element to append generated fields
|
||||
|
||||
// Loop over each field group to generate sections for each category
|
||||
Object.entries(fieldGroups).forEach(([groupName, obj]) => {
|
||||
const groupDiv = $('<div>').addClass('field-group col-lg-4 col-sm-6 col-xs-12'); // Create a div for each group with responsive Bootstrap classes
|
||||
|
||||
// Add group title and documentation link
|
||||
groupDiv.append(`<h5><i class="${obj.iconClass}"></i> ${getString(groupName)}
|
||||
<span class="helpIconSmallTopRight">
|
||||
<a target="_blank" href="${obj.docs}">
|
||||
<i class="fa fa-circle-question"></i>
|
||||
</a>
|
||||
</span>
|
||||
</h5>
|
||||
<hr>
|
||||
`);
|
||||
|
||||
// Filter relevant settings for the current group
|
||||
const groupSettings = settings.filter(set => obj.data.includes(set.setKey.replace('NEWDEV_', '')));
|
||||
|
||||
// Loop over each setting in the group to generate form fields
|
||||
groupSettings.forEach(setting => {
|
||||
const column = $('<div>'); // Create a column for each setting (Bootstrap column)
|
||||
|
||||
// Get the field data (replace 'NEWDEV_' prefix from the key)
|
||||
fieldData = deviceData[setting.setKey.replace('NEWDEV_', '')]
|
||||
fieldData = fieldData == null ? "" : fieldData;
|
||||
|
||||
// console.log(setting.setKey);
|
||||
// console.log(fieldData);
|
||||
|
||||
// Additional form elements like the random MAC address button for devMac
|
||||
let inlineControl = "";
|
||||
// handle rendom mac
|
||||
if (setting.setKey == "NEWDEV_devMac" && deviceData["devRandomMAC"] == true) {
|
||||
inlineControl += `<span class="input-group-addon pointer"
|
||||
title="${getString("RandomMAC_hover")}">
|
||||
<a href="https://github.com/jokob-sk/NetAlertX/blob/main/docs/RANDOM_MAC.md" target="_blank">
|
||||
<i class="fa-solid fa-shuffle"></i>
|
||||
</a>
|
||||
</span>`;
|
||||
}
|
||||
// handle generate MAC for new device
|
||||
if (setting.setKey == "NEWDEV_devMac" && deviceData["devMac"] == "") {
|
||||
inlineControl += `<span class="input-group-addon pointer"
|
||||
onclick="generate_NEWDEV_devMac()"
|
||||
title="${getString("Gen_Generate")}">
|
||||
<i class="fa-solid fa-dice" ></i>
|
||||
</span>`;
|
||||
}
|
||||
// handle generate IP for new device
|
||||
if (setting.setKey == "NEWDEV_devLastIP" && deviceData["devLastIP"] == "") {
|
||||
inlineControl += `<span class="input-group-addon pointer"
|
||||
onclick="generate_NEWDEV_devLastIP()"
|
||||
title="${getString("Gen_Generate")}">
|
||||
<i class="fa-solid fa-dice" ></i>
|
||||
</span>`;
|
||||
}
|
||||
|
||||
|
||||
// Generate the input field HTML
|
||||
const inputFormHtml = `<div class="form-group col-xs-12">
|
||||
<label class="col-sm-4 col-xs-12 control-label"> ${setting.setName}
|
||||
<i my-set-key="${setting.setKey}"
|
||||
title="${getString("Settings_Show_Description")}"
|
||||
class="fa fa-circle-info pointer helpIconSmallTopRight"
|
||||
onclick="showDescriptionPopup(this)">
|
||||
</i>
|
||||
</label>
|
||||
<div class="col-sm-8 col-xs-12 input-group">
|
||||
${generateFormHtml(setting, fieldData.toString())}
|
||||
${inlineControl}
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
column.append(inputFormHtml); // Append the input field to the column
|
||||
groupDiv.append(column); // Append the column to the group div
|
||||
});
|
||||
|
||||
form.append(groupDiv); // Append the group div (containing columns) to the form
|
||||
});
|
||||
|
||||
|
||||
// wait until everything is initialized to update icon
|
||||
updateIconPreview();
|
||||
|
||||
// update readonly fields
|
||||
handleReadOnly(settingsData, disabledFields);
|
||||
|
||||
// Page title - Name
|
||||
if (mac == "new") {
|
||||
$('#pageTitle').html(getString("Gen_AddDevice"));
|
||||
} else if (deviceData['devOwner'] == null || deviceData['devOwner'] == '' ||
|
||||
(deviceData['devName'].toString()).indexOf(deviceData['devOwner']) != -1) {
|
||||
$('#pageTitle').html(deviceData['devName']);
|
||||
} else {
|
||||
$('#pageTitle').html(deviceData['devName'] + ' (' + deviceData['devOwner'] + ')');
|
||||
}
|
||||
};
|
||||
|
||||
// console.log(relevantSettings)
|
||||
|
||||
generateSimpleForm(relevantSettings);
|
||||
|
||||
// <> chevrons
|
||||
updateChevrons(deviceData)
|
||||
|
||||
toggleNetworkConfiguration(mac == 'Internet')
|
||||
|
||||
hideSpinner();
|
||||
|
||||
})
|
||||
|
||||
}, 1);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------
|
||||
// Handle previous/next arrows/chevrons
|
||||
function updateChevrons(deviceData) {
|
||||
|
||||
devicesList = getDevicesList();
|
||||
|
||||
// console.log(devicesList);
|
||||
|
||||
// Check if device is part of the devicesList
|
||||
pos = devicesList.findIndex(item => item.rowid == deviceData['rowid']);
|
||||
|
||||
// console.log(pos);
|
||||
|
||||
if (pos == -1) {
|
||||
devicesList.push({"rowid" : deviceData['rowid'], "mac" : deviceData['devMac'], "name": deviceData['devName'], "type": deviceData['devType']});
|
||||
pos=0;
|
||||
}
|
||||
|
||||
// Record number
|
||||
$('#txtRecord').html (pos+1 +' / '+ devicesList.length);
|
||||
|
||||
// Deactivate previous button
|
||||
if (pos <= 0) {
|
||||
$('#btnPrevious').attr ('disabled','');
|
||||
$('#btnPrevious').addClass ('text-gray50');
|
||||
} else {
|
||||
$('#btnPrevious').removeAttr ('disabled');
|
||||
$('#btnPrevious').removeClass ('text-gray50');
|
||||
}
|
||||
|
||||
// Deactivate next button
|
||||
if (pos >= (devicesList.length-1)) {
|
||||
$('#btnNext').attr ('disabled','');
|
||||
$('#btnNext').addClass ('text-gray50');
|
||||
} else {
|
||||
$('#btnNext').removeAttr ('disabled');
|
||||
$('#btnNext').removeClass ('text-gray50');
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------
|
||||
// Handle the read-only fields
|
||||
function handleReadOnly(settingsData, disabledFields) {
|
||||
settingsData.forEach(setting => {
|
||||
const element = $(`#${setting.setKey}`);
|
||||
if (disabledFields.includes(setting.setKey)) {
|
||||
element.prop('readonly', true);
|
||||
} else {
|
||||
element.prop('readonly', false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------
|
||||
// Show the description of a setting
|
||||
function showDescriptionPopup(e) {
|
||||
|
||||
console.log($(e).attr("my-set-key"));
|
||||
|
||||
showModalOK("Info", getString($(e).attr("my-set-key") + '_description'))
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function askDeleteDeviceEvents () {
|
||||
// Check MAC
|
||||
if (mac == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ask delete device Events
|
||||
showModalWarning ('<?= lang('DevDetail_button_DeleteEvents');?>', '<?= lang('DevDetail_button_DeleteEvents_Warning');?>',
|
||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteDeviceEvents');
|
||||
}
|
||||
|
||||
function deleteDeviceEvents () {
|
||||
// Check MAC
|
||||
if (mac == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete device events
|
||||
$.get('php/server/devices.php?action=deleteDeviceEvents&mac='+ mac, function(msg) {
|
||||
showMessage (msg);
|
||||
});
|
||||
|
||||
// Deactivate controls
|
||||
$('#panDetails :input').attr('disabled', true);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function askDeleteDevice () {
|
||||
// Check MAC
|
||||
if (mac == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Ask delete device
|
||||
showModalWarning ('Delete Device', 'Are you sure you want to delete this device?<br>(maybe you prefer to archive it)',
|
||||
'<?= lang('Gen_Cancel');?>', '<?= lang('Gen_Delete');?>', 'deleteDevice');
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function deleteDevice () {
|
||||
// Check MAC
|
||||
if (mac == '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Delete device
|
||||
$.get('php/server/devices.php?action=deleteDevice&mac='+ mac, function(msg) {
|
||||
showMessage (msg);
|
||||
});
|
||||
|
||||
// Deactivate controls
|
||||
$('#panDetails :input').attr('disabled', true);
|
||||
|
||||
// refresh API
|
||||
updateApi("devices,appevents")
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function setDeviceData(direction = '', refreshCallback = '') {
|
||||
// Check MAC
|
||||
if (mac === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// Determine if a new device should be created
|
||||
const createNew = mac === 'new' ? 1 : 0;
|
||||
|
||||
const devLastIP = $('#NEWDEV_devLastIP').val();
|
||||
|
||||
// Validate MAC and Last IP
|
||||
if (mac === '' || !(isValidIPv4(devLastIP) || isValidIPv6(devLastIP))) {
|
||||
showMessage(getString("DeviceEdit_ValidMacIp"), 5000, "modal_red");
|
||||
return;
|
||||
}
|
||||
|
||||
showSpinner();
|
||||
|
||||
// update data to server
|
||||
$.get('php/server/devices.php?action=setDeviceData&mac='+ $('#NEWDEV_devMac').val()
|
||||
+ '&name=' + encodeURIComponent($('#NEWDEV_devName').val().replace(/'/g, ""))
|
||||
+ '&owner=' + encodeURIComponent($('#NEWDEV_devOwner').val().replace(/'/g, ""))
|
||||
+ '&type=' + $('#NEWDEV_devType').val()
|
||||
+ '&vendor=' + encodeURIComponent($('#NEWDEV_devVendor').val().replace(/'/g, ""))
|
||||
+ '&icon=' + encodeURIComponent($('#NEWDEV_devIcon').val())
|
||||
+ '&favorite=' + ($('#NEWDEV_devFavorite')[0].checked * 1)
|
||||
+ '&group=' + encodeURIComponent($('#NEWDEV_devGroup').val())
|
||||
+ '&location=' + encodeURIComponent($('#NEWDEV_devLocation').val())
|
||||
+ '&comments=' + encodeURIComponent(encodeSpecialChars($('#NEWDEV_devComments').val()))
|
||||
+ '&networknode=' + $('#NEWDEV_devParentMAC').val()
|
||||
+ '&networknodeport=' + $('#NEWDEV_devParentPort').val()
|
||||
+ '&ssid=' + $('#NEWDEV_devSSID').val()
|
||||
+ '&networksite=' + $('#NEWDEV_devSite').val()
|
||||
+ '&staticIP=' + ($('#NEWDEV_devStaticIP')[0].checked * 1)
|
||||
+ '&scancycle=' + "1"
|
||||
+ '&alertevents=' + ($('#NEWDEV_devAlertEvents')[0].checked * 1)
|
||||
+ '&alertdown=' + ($('#NEWDEV_devAlertDown')[0].checked * 1)
|
||||
+ '&skiprepeated=' + $('#NEWDEV_devSkipRepeated').val().split(' ')[0]
|
||||
+ '&newdevice=' + ($('#NEWDEV_devIsNew')[0].checked * 1)
|
||||
+ '&archived=' + ($('#NEWDEV_devIsArchived')[0].checked * 1)
|
||||
+ '&devFirstConnection=' + ($('#NEWDEV_devFirstConnection').val())
|
||||
+ '&devLastConnection=' + ($('#NEWDEV_devLastConnection').val())
|
||||
+ '&ip=' + ($('#NEWDEV_devLastIP').val())
|
||||
+ '&createNew=' + createNew
|
||||
, function(msg) {
|
||||
|
||||
showMessage (msg);
|
||||
|
||||
|
||||
// clear session storage
|
||||
setCache("#dropdownOwner","");
|
||||
setCache("#dropdownDeviceType","");
|
||||
setCache("#dropdownGroup","");
|
||||
setCache("#dropdownLocation","");
|
||||
setCache("#dropdownNetworkNodeMac","");
|
||||
|
||||
// Remove navigation prompt "Are you sure you want to leave..."
|
||||
window.onbeforeunload = null;
|
||||
somethingChanged = false;
|
||||
|
||||
// refresh API
|
||||
updateApi("devices,appevents")
|
||||
|
||||
// Callback fuction
|
||||
if (typeof refreshCallback == 'function') {
|
||||
refreshCallback(direction);
|
||||
}
|
||||
|
||||
// everything loaded
|
||||
hideSpinner();
|
||||
});
|
||||
}
|
||||
|
||||
// Helper function to clear dropdown cache
|
||||
function clearDropdownCache() {
|
||||
setCache("#dropdownOwner", "");
|
||||
setCache("#dropdownDeviceType", "");
|
||||
setCache("#dropdownGroup", "");
|
||||
setCache("#dropdownLocation", "");
|
||||
setCache("#dropdownNetworkNodeMac", "");
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------
|
||||
// Disables or enables network configuration for the root node
|
||||
function toggleNetworkConfiguration(disable) {
|
||||
if (disable) {
|
||||
// Completely disable the NEWDEV_devParentMAC <select> and NEWDEV_devParentPort
|
||||
$('#NEWDEV_devParentMAC').prop('disabled', true).val("").prop('selectedIndex', 0);
|
||||
$('#NEWDEV_devParentMAC').empty() // Remove all options
|
||||
.append('<option value="">Root Node</option>')
|
||||
$('#NEWDEV_devParentPort').prop('disabled', true);
|
||||
$('#NEWDEV_devParentPort').prop('readonly', true );
|
||||
$('#NEWDEV_devParentMAC').prop('readonly', true );
|
||||
} else {
|
||||
// Enable the NEWDEV_devParentMAC <select> and NEWDEV_devParentPort
|
||||
$('#NEWDEV_devParentMAC').prop('disabled', false);
|
||||
$('#NEWDEV_devParentPort').prop('disabled', false);
|
||||
$('#NEWDEV_devParentPort').prop('readonly', false );
|
||||
$('#NEWDEV_devParentMAC').prop('readonly', false );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -------------------- INIT ------------------------
|
||||
getDeviceData(true);
|
||||
|
||||
|
||||
</script>
|
||||
@@ -1,74 +1,125 @@
|
||||
<?php
|
||||
//------------------------------------------------------------------------------
|
||||
// check if authenticated
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
?>
|
||||
|
||||
|
||||
<!-- INTERNET INFO -->
|
||||
<?php if ($_REQUEST["mac"] == "Internet") { ?>
|
||||
|
||||
<h4 class=""><i class="fa-solid fa-globe"></i>
|
||||
<h4 class=""><i class="fa-solid fa-globe"></i>
|
||||
<?= lang("DevDetail_Tab_Tools_Internet_Info_Title") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Tab_Tools_Internet_Info_Description") ?>
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="internetinfo()">
|
||||
<?= lang("DevDetail_Tab_Tools_Internet_Info_Start") ?></button>
|
||||
<br>
|
||||
<div id="internetinfooutput" style="margin-top: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- COPY FROM DEVICE -->
|
||||
<?php if ($_REQUEST["mac"] != "Internet") { ?>
|
||||
|
||||
<h4 class=""><i class="fa-solid fa-copy"></i>
|
||||
<?= lang("DevDetail_Copy_Device_Title") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Copy_Device_Tooltip") ?>
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<select class="form-control"
|
||||
title="<?= lang('DevDetail_Copy_Device_Tooltip');?>"
|
||||
id="txtCopyFromDevice" >
|
||||
<option value="lemp_loading" id="lemp_loading">Loading</option>
|
||||
</select>
|
||||
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="()">
|
||||
<?= lang("BackDevDetail_Copy_Title") ?></button>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- WAKE ON LAN - WOL -->
|
||||
<?php if ($_REQUEST["mac"] != "Internet") { ?>
|
||||
|
||||
<h4 class=""><i class="fa-solid fa-bell"></i>
|
||||
<?= lang("DevDetail_Tools_WOL_noti") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Tools_WOL_noti_text") ?>
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<button type="button" id="internetinfo" class="btn btn-primary pa-btn" style="margin: auto;" onclick="wakeonlan()">
|
||||
<?= lang("DevDetail_Tools_WOL_noti") ?></button>
|
||||
<br>
|
||||
<div id="wol_output" style="margin-top: 10px;"></div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- SPEEDTEST -->
|
||||
<?php if ($_REQUEST["mac"] == "Internet") { ?>
|
||||
<h4 class=""><i class="fa-solid fa-gauge-high"></i>
|
||||
<h4 class=""><i class="fa-solid fa-gauge-high"></i>
|
||||
<?= lang("DevDetail_Tab_Tools_Speedtest_Title") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Tab_Tools_Speedtest_Description") ?>
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
</h5>
|
||||
<br>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<button type="button" id="speedtestcli" class="btn btn-primary pa-btn" style="margin: auto;" onclick="speedtestcli()">
|
||||
<?= lang("DevDetail_Tab_Tools_Speedtest_Start") ?></button>
|
||||
<br>
|
||||
<div id="speedtestoutput" style="margin-top: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- TRACEROUTE -->
|
||||
<?php if ($_REQUEST["mac"] != "Internet") { ?>
|
||||
<h4 class=""><i class="fa-solid fa-route"></i>
|
||||
<h4 class=""><i class="fa-solid fa-route"></i>
|
||||
<?= lang("DevDetail_Tab_Tools_Traceroute_Title") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Tab_Tools_Traceroute_Description") ?>
|
||||
</h5>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
</h5>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<button type="button" id="traceroute" class="btn btn-primary pa-btn" style="margin: auto;" onclick="traceroute()">
|
||||
<?= lang("DevDetail_Tab_Tools_Traceroute_Start") ?>
|
||||
</button>
|
||||
<br>
|
||||
<div id="tracerouteoutput" style="margin-top: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- NSLOOKUP -->
|
||||
<?php if ($_REQUEST["mac"] != "Internet") { ?>
|
||||
<h4 class=""><i class="fa-solid fa-magnifying-glass"></i>
|
||||
<h4 class=""><i class="fa-solid fa-magnifying-glass"></i>
|
||||
<?= lang("DevDetail_Tab_Tools_Nslookup_Title") ?>
|
||||
</h4>
|
||||
<h5 class="">
|
||||
</h4>
|
||||
<h5 class="">
|
||||
<?= lang("DevDetail_Tab_Tools_Nslookup_Description") ?>
|
||||
</h5>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
</h5>
|
||||
<div style="width:100%; text-align: center; margin-bottom: 50px;">
|
||||
<button type="button" id="nslookup" class="btn btn-primary pa-btn" style="margin: auto;" onclick="nslookup()">
|
||||
<?= lang("DevDetail_Tab_Tools_Nslookup_Start") ?>
|
||||
</button>
|
||||
<br>
|
||||
<div id="nslookupoutput" style="margin-top: 10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<!-- NMAP SCANS -->
|
||||
<h4 class=""><i class="fa-solid fa-ethernet"></i>
|
||||
<?= lang("DevDetail_Nmap_Scans") ?>
|
||||
</h4>
|
||||
@@ -77,16 +128,16 @@
|
||||
<?= lang("DevDetail_Nmap_Scans_desc") ?>
|
||||
</div>
|
||||
|
||||
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'devLastIP'), 'fast')">
|
||||
<button type="button" id="piamanualnmap_fast" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'fast')">
|
||||
<?= lang("DevDetail_Loading") ?>
|
||||
</button>
|
||||
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'devLastIP'), 'normal')">
|
||||
<button type="button" id="piamanualnmap_normal" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'normal')">
|
||||
<?= lang("DevDetail_Loading") ?>
|
||||
</button>
|
||||
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'devLastIP'), 'detail')">
|
||||
<button type="button" id="piamanualnmap_detail" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'detail')">
|
||||
<?= lang("DevDetail_Loading") ?>
|
||||
</button>
|
||||
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDeviceDataByMac(getMac(), 'devLastIP'), 'skipdiscovery')">
|
||||
<button type="button" id="piamanualnmap_skipdiscovery" class="btn btn-primary pa-btn" style="margin-bottom: 20px; margin-left: 10px; margin-right: 10px;" onclick="manualnmapscan(getDevDataByMac(getMac(), 'devLastIP'), 'skipdiscovery')">
|
||||
<?= lang("DevDetail_Loading") ?>
|
||||
</button>
|
||||
|
||||
@@ -155,7 +206,7 @@
|
||||
$( "#tracerouteoutput" ).empty();
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "./php/server/traceroute.php?action=get&ip=" + getDeviceDataByMac(getMac(), 'devLastIP') + "",
|
||||
url: "./php/server/traceroute.php?action=get&ip=" + getDevDataByMac(getMac(), 'devLastIP') + "",
|
||||
beforeSend: function() { $('#tracerouteoutput').addClass("ajax_scripts_loading"); },
|
||||
complete: function() { $('#tracerouteoutput').removeClass("ajax_scripts_loading"); },
|
||||
success: function(data, textStatus) {
|
||||
@@ -170,7 +221,7 @@
|
||||
$( "#nslookupoutput" ).empty();
|
||||
$.ajax({
|
||||
method: "GET",
|
||||
url: "./php/server/nslookup.php?action=get&ip=" + getDeviceDataByMac(getMac(), 'devLastIP') + "",
|
||||
url: "./php/server/nslookup.php?action=get&ip=" + getDevDataByMac(getMac(), 'devLastIP') + "",
|
||||
beforeSend: function() { $('#nslookupoutput').addClass("ajax_scripts_loading"); },
|
||||
complete: function() { $('#nslookupoutput').removeClass("ajax_scripts_loading"); },
|
||||
success: function(data, textStatus) {
|
||||
@@ -198,6 +249,93 @@
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
function initCopyFromDevice() {
|
||||
|
||||
const devices = getVisibleDevicesList()
|
||||
console.log(devices);
|
||||
|
||||
const $select = $('#txtCopyFromDevice');
|
||||
$select.empty(); // Clear existing options
|
||||
|
||||
devices.forEach(device => {
|
||||
const option = $('<option></option>')
|
||||
.val(device.devMac)
|
||||
.text(device.devName);
|
||||
$select.append(option);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
function wakeonlan() {
|
||||
|
||||
macAddress = getMac();
|
||||
|
||||
// Execute
|
||||
$.get('php/server/devices.php?action=wakeonlan&'
|
||||
+ '&mac=' + macAddress
|
||||
+ '&ip=' + getDevDataByMac(macAddress, "devLastIP")
|
||||
, function(msg) {
|
||||
showMessage (msg);
|
||||
});
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
function copyFromDevice() {
|
||||
|
||||
macAddress = getMac();
|
||||
|
||||
// Execute
|
||||
$.get('php/server/devices.php?action=copyFromDevice&'
|
||||
+ '&macTo=' + macAddress
|
||||
+ '&macFrom=' + $('#txtCopyFromDevice').val()
|
||||
, function(msg) {
|
||||
showMessage (msg);
|
||||
|
||||
setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
function getVisibleDevicesList()
|
||||
{
|
||||
// Read cache (skip cookie expiry check)
|
||||
devicesList = getCache('devicesListAll_JSON', true);
|
||||
|
||||
if (devicesList != '') {
|
||||
devicesList = JSON.parse (devicesList);
|
||||
} else {
|
||||
devicesList = [];
|
||||
}
|
||||
|
||||
// only loop thru the filtered down list
|
||||
visibleDevices = getCache("ntx_visible_macs")
|
||||
|
||||
if(visibleDevices != "") {
|
||||
visibleDevicesMACs = visibleDevices.split(',');
|
||||
|
||||
devicesList_tmp = [];
|
||||
|
||||
// Iterate through the data and filter only visible devices
|
||||
$.each(devicesList, function(index, item) {
|
||||
// Check if the current item's MAC exists in visibleDevicesMACs
|
||||
if (visibleDevicesMACs.includes(item.devMac)) {
|
||||
devicesList_tmp.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// Update devicesList with the filtered items
|
||||
devicesList = devicesList_tmp;
|
||||
}
|
||||
|
||||
return devicesList;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
function internetinfo() {
|
||||
$( "#internetinfooutput" ).empty();
|
||||
@@ -214,4 +352,5 @@
|
||||
|
||||
// init first time
|
||||
initNmapButtons();
|
||||
initCopyFromDevice();
|
||||
</script>
|
||||
|
||||
@@ -75,6 +75,7 @@
|
||||
<div class=" col-md-10 ">
|
||||
<h3 id="tableDevicesTitle" class="box-title text-gray "></h3>
|
||||
</div>
|
||||
<div class=" col-md-2 "><a href="deviceDetails.php?mac=new"><i title="Add new dummy device" class="fa fa-square-plus"></i> <?= lang('Gen_create_new_device');?></a></div>
|
||||
</div>
|
||||
|
||||
<!-- table -->
|
||||
@@ -258,6 +259,12 @@ function processDeviceTotals(devicesData) {
|
||||
});
|
||||
|
||||
// Render info boxes/tile cards
|
||||
console.log(getSetting('UI_hide_empty'));
|
||||
|
||||
console.log(dataArray);
|
||||
console.log(devicesData);
|
||||
|
||||
|
||||
renderInfoboxes(dataArray);
|
||||
}
|
||||
|
||||
@@ -658,7 +665,7 @@ function initializeDatatable (status) {
|
||||
'createdCell': function (td, cellData, rowData, row, col) {
|
||||
// console.log(cellData)
|
||||
if (cellData == 1){
|
||||
$(td).html ('<i data-toggle="tooltip" data-placement="right" title="Random MAC" style="font-size: 16px;" class="text-yellow glyphicon glyphicon-random"></i>');
|
||||
$(td).html ('<i data-toggle="tooltip" data-placement="right" title="Random MAC" class="fa-solid fa-shuffle"></i>');
|
||||
} else {
|
||||
$(td).html ('');
|
||||
}
|
||||
@@ -831,20 +838,22 @@ function getMacsOfShownDevices() {
|
||||
|
||||
var selectedDevices = [];
|
||||
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
// first row is the heading, skip
|
||||
for (var i = 1; i < rows.length; i++) {
|
||||
selectedDevices.push(devicesDataTableData[rows[i]._DT_RowIndex]);
|
||||
}
|
||||
|
||||
for (var i = 1; i < selectedDevices.length; i++) {
|
||||
macs.push(selectedDevices[i][mapIndx(11)]); // mapIndx(11) == MAC
|
||||
for (var j = 0; j < selectedDevices.length; j++) {
|
||||
macs.push(selectedDevices[j][mapIndx(11)]); // mapIndx(11) == MAC
|
||||
}
|
||||
|
||||
return macs;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Update cahce with shown devices before navigating away
|
||||
// Update cache with shown devices before navigating away
|
||||
window.addEventListener('beforeunload', function(event) {
|
||||
// Call your function here
|
||||
macs = getMacsOfShownDevices();
|
||||
|
||||
@@ -165,7 +165,7 @@ switch ($UI_THEME) {
|
||||
|
||||
|
||||
<!-- jQuery 3 -->
|
||||
<script src="js/jquery/jquery.min.js"></script>
|
||||
<script src="lib/jquery/jquery.min.js"></script>
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<script src="lib/bootstrap/bootstrap.min.js"></script>
|
||||
<!-- iCheck -->
|
||||
|
||||
@@ -161,8 +161,8 @@ function cacheSettings()
|
||||
}
|
||||
}
|
||||
|
||||
setCache(`pia_set_${set.setKey}`, set.setValue)
|
||||
setCache(`pia_set_opt_${set.setKey}`, resolvedOptions)
|
||||
setCache(`nax_set_${set.setKey}`, set.setValue)
|
||||
setCache(`nax_set_opt_${set.setKey}`, resolvedOptions)
|
||||
});
|
||||
}).then(() => handleSuccess('cacheSettings', resolve())).catch(() => handleFailure('cacheSettings', reject("cacheSettings already completed"))); // handle AJAX synchronization
|
||||
})
|
||||
@@ -177,7 +177,7 @@ function getSettingOptions (key) {
|
||||
// handle initial load to make sure everything is set-up and cached
|
||||
// handleFirstLoad()
|
||||
|
||||
result = getCache(`pia_set_opt_${key}`, true);
|
||||
result = getCache(`nax_set_opt_${key}`, true);
|
||||
|
||||
if (result == "")
|
||||
{
|
||||
@@ -195,7 +195,7 @@ function getSetting (key) {
|
||||
// handle initial load to make sure everything is set-up and cached
|
||||
// handleFirstLoad()
|
||||
|
||||
result = getCache(`pia_set_${key}`, true);
|
||||
result = getCache(`nax_set_${key}`, true);
|
||||
|
||||
if (result == "")
|
||||
{
|
||||
@@ -690,10 +690,12 @@ function openUrl(urls) {
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// force laod URL in current window with specific anchor
|
||||
// force load URL in current window with specific anchor
|
||||
function forceLoadUrl(relativeUrl) {
|
||||
|
||||
window.location.replace(relativeUrl);
|
||||
window.location.reload()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -721,7 +723,7 @@ function navigateToDeviceWithIp (ip) {
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function getNameByMacAddress(macAddress) {
|
||||
return getDeviceDataByMac(macAddress, "devName")
|
||||
return getDevDataByMac(macAddress, "devName")
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -758,6 +760,12 @@ function isValidIPv6(ipAddress) {
|
||||
return ipv6Regex.test(ipAddress);
|
||||
}
|
||||
|
||||
function isValidIPv4(ip) {
|
||||
const ipv4Regex = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
||||
return ipv4Regex.test(ip);
|
||||
}
|
||||
|
||||
|
||||
function formatIPlong(ipAddress) {
|
||||
if (ipAddress.includes(':') && isValidIPv6(ipAddress)) {
|
||||
const parts = ipAddress.split(':');
|
||||
@@ -823,6 +831,10 @@ function isRandomMAC(mac)
|
||||
if (input === '[]' || input === '') {
|
||||
return [];
|
||||
}
|
||||
// handle integer
|
||||
if (typeof input === 'number') {
|
||||
input = input.toString();
|
||||
}
|
||||
|
||||
// Regex pattern for brackets
|
||||
const patternBrackets = /(^\s*\[)|(\]\s*$)/g;
|
||||
@@ -874,7 +886,7 @@ function isRandomMAC(mac)
|
||||
// -----------------------------------------------------------------------------
|
||||
// A function to get a device property using the mac address as key and DB column nakme as parameter
|
||||
// for the value to be returned
|
||||
function getDeviceDataByMac(macAddress, dbColumn) {
|
||||
function getDevDataByMac(macAddress, dbColumn) {
|
||||
|
||||
const sessionDataKey = 'devicesListAll_JSON';
|
||||
const devicesCache = getCache(sessionDataKey);
|
||||
@@ -1193,6 +1205,40 @@ function hideUIelements(setKey) {
|
||||
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------
|
||||
function getDevicesList()
|
||||
{
|
||||
// Read cache (skip cookie expiry check)
|
||||
devicesList = getCache('devicesListAll_JSON', true);
|
||||
|
||||
if (devicesList != '') {
|
||||
devicesList = JSON.parse (devicesList);
|
||||
} else {
|
||||
devicesList = [];
|
||||
}
|
||||
|
||||
// only loop thru the filtered down list
|
||||
visibleDevices = getCache("ntx_visible_macs")
|
||||
|
||||
if(visibleDevices != "") {
|
||||
visibleDevicesMACs = visibleDevices.split(',');
|
||||
|
||||
devicesList_tmp = [];
|
||||
|
||||
// Iterate through the data and filter only visible devices
|
||||
$.each(devicesList, function(index, item) {
|
||||
// Check if the current item's MAC exists in visibleDevicesMACs
|
||||
if (visibleDevicesMACs.includes(item.devMac)) {
|
||||
devicesList_tmp.push(item);
|
||||
}
|
||||
});
|
||||
|
||||
// Update devicesList with the filtered items
|
||||
devicesList = devicesList_tmp;
|
||||
}
|
||||
|
||||
return devicesList;
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
@@ -87,7 +87,8 @@ function showModalInput(
|
||||
message,
|
||||
btnCancel = getString("Gen_Cancel"),
|
||||
btnOK = getString("Gen_Okay"),
|
||||
callbackFunction = null
|
||||
callbackFunction = null,
|
||||
triggeredBy = null
|
||||
) {
|
||||
prefix = "modal-input";
|
||||
|
||||
@@ -101,6 +102,10 @@ function showModalInput(
|
||||
modalCallbackFunction = callbackFunction;
|
||||
}
|
||||
|
||||
if (triggeredBy != null) {
|
||||
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
|
||||
}
|
||||
|
||||
// Show modal
|
||||
$(`#${prefix}`).modal("show");
|
||||
|
||||
@@ -117,7 +122,8 @@ function showModalFieldInput(
|
||||
btnCancel = getString("Gen_Cancel"),
|
||||
btnOK = getString("Gen_Okay"),
|
||||
curValue = "",
|
||||
callbackFunction = null
|
||||
callbackFunction = null,
|
||||
triggeredBy = null
|
||||
) {
|
||||
// set captions
|
||||
prefix = "modal-field-input";
|
||||
@@ -128,9 +134,14 @@ function showModalFieldInput(
|
||||
$(`#${prefix}-OK`).html(btnOK);
|
||||
|
||||
if (callbackFunction != null) {
|
||||
|
||||
modalCallbackFunction = callbackFunction;
|
||||
}
|
||||
|
||||
if (triggeredBy != null) {
|
||||
$('#'+prefix).attr("data-myparam-triggered-by", triggeredBy)
|
||||
}
|
||||
|
||||
$(`#${prefix}-field`).val(curValue);
|
||||
|
||||
setTimeout(function () {
|
||||
@@ -148,7 +159,13 @@ function modalDefaultOK() {
|
||||
|
||||
// timer to execute function
|
||||
window.setTimeout(function () {
|
||||
window[modalCallbackFunction]();
|
||||
if (typeof modalCallbackFunction === "function") {
|
||||
modalCallbackFunction(); // Direct call
|
||||
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
|
||||
window[modalCallbackFunction](); // Call via window
|
||||
} else {
|
||||
console.error("Invalid callback function");
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -159,7 +176,13 @@ function modalDefaultInput() {
|
||||
|
||||
// timer to execute function
|
||||
window.setTimeout(function () {
|
||||
window[modalCallbackFunction]();
|
||||
if (typeof modalCallbackFunction === "function") {
|
||||
modalCallbackFunction(); // Direct call
|
||||
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
|
||||
window[modalCallbackFunction](); // Call via window
|
||||
} else {
|
||||
console.error("Invalid callback function");
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -170,7 +193,13 @@ function modalDefaultFieldInput() {
|
||||
|
||||
// timer to execute function
|
||||
window.setTimeout(function () {
|
||||
modalCallbackFunction();
|
||||
if (typeof modalCallbackFunction === "function") {
|
||||
modalCallbackFunction(); // Direct call
|
||||
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
|
||||
window[modalCallbackFunction](); // Call via window
|
||||
} else {
|
||||
console.error("Invalid callback function");
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
@@ -181,7 +210,13 @@ function modalWarningOK() {
|
||||
|
||||
// timer to execute function
|
||||
window.setTimeout(function () {
|
||||
window[modalCallbackFunction]();
|
||||
if (typeof modalCallbackFunction === "function") {
|
||||
modalCallbackFunction(); // Direct call
|
||||
} else if (typeof modalCallbackFunction === "string" && typeof window[modalCallbackFunction] === "function") {
|
||||
window[modalCallbackFunction](); // Call via window
|
||||
} else {
|
||||
console.error("Invalid callback function");
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -859,3 +859,164 @@ function genListWithInputSet(options, valuesArray, targetField, transformers, pl
|
||||
// Place the resulting HTML into the specified placeholder div
|
||||
$("#" + placeholder).replaceWith(listHtml);
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Generate the form control for setting
|
||||
function generateFormHtml(set, overrideValue) {
|
||||
let inputHtml = '';
|
||||
|
||||
|
||||
isEmpty(overrideValue) ? inVal = set['setValue'] : inVal = overrideValue;
|
||||
const setKey = set['setKey'];
|
||||
const setType = set['setType'];
|
||||
|
||||
// console.log(setType);
|
||||
// console.log(setKey);
|
||||
// console.log(overrideValue);
|
||||
// console.log(inVal);
|
||||
|
||||
|
||||
// Parse the setType JSON string
|
||||
const setTypeObject = JSON.parse(setType.replace(/'/g, '"'));
|
||||
const dataType = setTypeObject.dataType;
|
||||
const elements = setTypeObject.elements || [];
|
||||
|
||||
// Generate HTML for elements
|
||||
elements.forEach(elementObj => {
|
||||
const { elementType, elementOptions = [], transformers = [] } = elementObj;
|
||||
|
||||
// Handle element options
|
||||
const {
|
||||
inputType,
|
||||
readOnly,
|
||||
isMultiSelect,
|
||||
isOrdeable,
|
||||
cssClasses,
|
||||
placeholder,
|
||||
suffix,
|
||||
sourceIds,
|
||||
separator,
|
||||
editable,
|
||||
valRes,
|
||||
getStringKey,
|
||||
onClick,
|
||||
onChange,
|
||||
customParams,
|
||||
customId
|
||||
} = handleElementOptions(setKey, elementOptions, transformers, inVal);
|
||||
|
||||
// Override value
|
||||
const val = valRes;
|
||||
|
||||
// console.log(val);
|
||||
|
||||
|
||||
// Generate HTML based on elementType
|
||||
switch (elementType) {
|
||||
case 'select':
|
||||
const multi = isMultiSelect ? "multiple" : "";
|
||||
const addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
||||
|
||||
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
||||
my-data-type="${dataType}"
|
||||
my-editable="${editable}"
|
||||
class="form-control ${addCss}"
|
||||
name="${setKey}"
|
||||
id="${setKey}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
${multi}>
|
||||
<option value="" id="${setKey + "_temp_"}"></option>
|
||||
</select>`;
|
||||
|
||||
generateOptionsOrSetOptions(setKey, createArray(val), `${setKey}_temp_`, generateOptions, null, transformers);
|
||||
break;
|
||||
|
||||
case 'input':
|
||||
const checked = val === 'True' || val === '1' ? 'checked' : '';
|
||||
const inputClass = inputType === 'checkbox' ? 'checkbox' : 'form-control';
|
||||
|
||||
inputHtml += `<input
|
||||
class="${inputClass} ${cssClasses}"
|
||||
onChange="settingsChanged();${onChange}"
|
||||
my-data-type="${dataType}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
id="${setKey}${suffix}"
|
||||
type="${inputType}"
|
||||
value="${val}"
|
||||
${readOnly}
|
||||
${checked}
|
||||
placeholder="${placeholder}"
|
||||
/>`;
|
||||
break;
|
||||
|
||||
case 'button':
|
||||
inputHtml += `<button
|
||||
class="btn btn-primary ${cssClasses}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
my-input-from="${sourceIds}"
|
||||
my-input-to="${setKey}"
|
||||
onclick="${onClick}">
|
||||
${getString(getStringKey)}
|
||||
</button>`;
|
||||
break;
|
||||
|
||||
case 'textarea':
|
||||
inputHtml += `<textarea
|
||||
class="form-control input"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
my-data-type="${dataType}"
|
||||
id="${setKey}"
|
||||
${readOnly}>${val}</textarea>`;
|
||||
break;
|
||||
|
||||
case 'span':
|
||||
inputHtml += `<span
|
||||
class="${cssClasses}"
|
||||
my-data-type="${dataType}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}">
|
||||
${getString(getStringKey)}
|
||||
</span>`;
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn(`🟥 Unknown element type: ${elementType}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Generate event HTML if applicable
|
||||
let eventsHtml = '';
|
||||
|
||||
// console.log(setTypeObject);
|
||||
|
||||
// console.log(set);
|
||||
|
||||
const eventsList = createArray(set['setEvents']);
|
||||
// inline buttons events
|
||||
|
||||
|
||||
if (eventsList.length > 0) {
|
||||
eventsList.forEach(event => {
|
||||
|
||||
eventsHtml += `<span class="input-group-addon pointer"
|
||||
id="${`${event}_${setKey}`}"
|
||||
data-myparam-setkey="${setKey}"
|
||||
data-myparam="${setKey}"
|
||||
data-myparam-plugin="${setTypeObject.prefix || ''}"
|
||||
data-myevent="${event}"
|
||||
onclick="execute_settingEvent(this)">
|
||||
<i title="${getString(event + "_event_tooltip")}" class="fa ${getString(event + "_event_icon")}"></i>
|
||||
</span>`;
|
||||
});
|
||||
}
|
||||
|
||||
// Combine and return the final HTML
|
||||
return inputHtml + eventsHtml;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -97,64 +97,66 @@ function generateApiToken(elem, length) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------
|
||||
// Updates the icon preview
|
||||
function updateIconPreview(elem) {
|
||||
// Retrieve and parse custom parameters from the element
|
||||
let params = $(elem).attr("my-customparams")?.split(',').map(param => param.trim());
|
||||
const targetElement = $('[my-customid="NEWDEV_devIcon_preview"]');
|
||||
const iconInput = $("#NEWDEV_devIcon");
|
||||
|
||||
// console.log(params);
|
||||
let attempts = 0;
|
||||
|
||||
if (params && params.length >= 2) {
|
||||
var inputElementID = params[0];
|
||||
var targetElementID = params[1];
|
||||
} else {
|
||||
console.error("Invalid parameters passed to updateIconPreview function");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the input element using the inputElementID
|
||||
let iconInput = $("#" + inputElementID);
|
||||
|
||||
if (iconInput.length === 0) {
|
||||
console.error("Icon input element not found");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the initial value and update the target element
|
||||
function tryUpdateIcon() {
|
||||
let value = iconInput.val();
|
||||
if (!value) {
|
||||
console.error("Input value is empty or not defined");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!targetElementID) {
|
||||
targetElementID = "txtIcon";
|
||||
}
|
||||
|
||||
// Check if the target element exists, if not find an element with matching custom attribute
|
||||
let targetElement = $('#' + targetElementID);
|
||||
if (targetElement.length === 0) {
|
||||
// Look for an element with my-custom-id attribute equal to targetElementID
|
||||
targetElement = $('[my-customid="' + targetElementID + '"]');
|
||||
if (targetElement.length === 0) {
|
||||
console.error("Neither target element with ID nor element with custom attribute found");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Update the target element with decoded base64 value
|
||||
if (value) {
|
||||
targetElement.html(atob(value));
|
||||
|
||||
// Add event listener to update the icon on input change
|
||||
iconInput.on('change input', function () {
|
||||
iconInput.off('change input').on('change input', function () {
|
||||
let newValue = $(this).val();
|
||||
$('#' + targetElementID).html(atob(newValue));
|
||||
targetElement.html(atob(newValue));
|
||||
});
|
||||
return; // Stop retrying if successful
|
||||
}
|
||||
|
||||
attempts++;
|
||||
if (attempts < 10) {
|
||||
setTimeout(tryUpdateIcon, 1000); // Retry after 1 second
|
||||
} else {
|
||||
console.error("Input value is empty after 10 attempts");
|
||||
}
|
||||
}
|
||||
|
||||
tryUpdateIcon();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Nice checkboxes with iCheck
|
||||
function initializeiCheck () {
|
||||
// Blue
|
||||
$('input[type="checkbox"].blue').iCheck({
|
||||
checkboxClass: 'icheckbox_flat-blue',
|
||||
radioClass: 'iradio_flat-blue',
|
||||
increaseArea: '20%'
|
||||
});
|
||||
|
||||
// Orange
|
||||
$('input[type="checkbox"].orange').iCheck({
|
||||
checkboxClass: 'icheckbox_flat-orange',
|
||||
radioClass: 'iradio_flat-orange',
|
||||
increaseArea: '20%'
|
||||
});
|
||||
|
||||
// Red
|
||||
$('input[type="checkbox"].red').iCheck({
|
||||
checkboxClass: 'icheckbox_flat-red',
|
||||
radioClass: 'iradio_flat-red',
|
||||
increaseArea: '20%'
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -219,19 +221,24 @@ function getCellValue(row, index) {
|
||||
return $(row).children('td').eq(index).text();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// handling events on the backend initiated by the front end START
|
||||
// -----------------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// handling events
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
modalEventStatusId = 'modal-message-front-event'
|
||||
modalEventStatusId = 'modal-message-front-event'
|
||||
|
||||
// --------------------------------------------------------
|
||||
function execute_settingEvent(element) {
|
||||
|
||||
feEvent = $(element).attr('data-myevent');
|
||||
fePlugin = $(element).attr('data-myparam-plugin');
|
||||
feSetKey = $(element).attr('data-myparam-setkey');
|
||||
feParam = $(element).attr('data-myparam');
|
||||
feSourceId = $(element).attr('id');
|
||||
|
||||
if (["test", "run"].includes(feEvent)) {
|
||||
// Calls a backend function to add a front-end event (specified by the attributes 'data-myevent' and 'data-myparam-plugin' on the passed element) to an execution queue
|
||||
function addToExecutionQueue_settingEvent(element)
|
||||
{
|
||||
|
||||
// value has to be in format event|param. e.g. run|ARPSCAN
|
||||
action = `${getGuid()}|${$(element).attr('data-myevent')}|${$(element).attr('data-myparam-plugin')}`
|
||||
action = `${getGuid()}|${feEvent}|${fePlugin}`
|
||||
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
@@ -246,11 +253,64 @@ function getCellValue(row, index) {
|
||||
updateModalState()
|
||||
}
|
||||
})
|
||||
|
||||
} else if (["add_option"].includes(feEvent)) {
|
||||
showModalFieldInput (
|
||||
'<i class="fa fa-square-plus pointer"></i> ' + getString('Gen_Add'),
|
||||
getString('Gen_Add'),
|
||||
getString('Gen_Cancel'),
|
||||
getString('Gen_Okay'),
|
||||
'', // curValue
|
||||
'addOptionFromModalInput',
|
||||
feSourceId // triggered by id
|
||||
);
|
||||
} else if (["add_icon"].includes(feEvent)) {
|
||||
|
||||
// Add new icon as base64 string
|
||||
showModalInput (
|
||||
'<i class="fa fa-square-plus pointer"></i> ' + getString('DevDetail_button_AddIcon'),
|
||||
getString('DevDetail_button_AddIcon_Help'),
|
||||
getString('Gen_Cancel'),
|
||||
getString('Gen_Okay'),
|
||||
() => addIconAsBase64(element), // Wrap in an arrow function
|
||||
feSourceId // triggered by id
|
||||
);
|
||||
} else if (["copy_icons"].includes(feEvent)) {
|
||||
|
||||
|
||||
// Ask overwrite icon types
|
||||
showModalWarning (
|
||||
getString('DevDetail_button_OverwriteIcons'),
|
||||
getString('DevDetail_button_OverwriteIcons_Warning'),
|
||||
getString('Gen_Cancel'),
|
||||
getString('Gen_Okay'),
|
||||
'overwriteIconType'
|
||||
);
|
||||
} else if (["go_to_node"].includes(feEvent)) {
|
||||
|
||||
goToNetworkNode('NEWDEV_devParentMAC');
|
||||
|
||||
} else {
|
||||
console.warn(`🔺Not implemented: ${feEvent}`)
|
||||
}
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Updating the execution queue in in modal pop-up
|
||||
function updateModalState() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Go to the correct network node in the Network section
|
||||
function goToNetworkNode(dropdownId)
|
||||
{
|
||||
setCache('activeNetworkTab', $('#'+dropdownId).val().replaceAll(":","_")+'_id');
|
||||
window.location.href = './network.php';
|
||||
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Updating the execution queue in in modal pop-up
|
||||
function updateModalState() {
|
||||
setTimeout(function() {
|
||||
// Fetch the content from the log file using an AJAX request
|
||||
$.ajax({
|
||||
@@ -268,7 +328,63 @@ function getCellValue(row, index) {
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
// --------------------------------------------------------
|
||||
// A method to add option to select and make it selected
|
||||
function addOptionFromModalInput() {
|
||||
var inputVal = $(`#modal-field-input-field`).val();
|
||||
console.log($('#modal-field-input-field'));
|
||||
|
||||
var triggeredBy = $('#modal-field-input').attr("data-myparam-triggered-by");
|
||||
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
||||
|
||||
// Add new option and set it as selected
|
||||
$('#' + targetId).append(new Option(inputVal, inputVal)).val(inputVal);
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Generate a random MAC address starting 00:1A
|
||||
function generate_NEWDEV_devMac() {
|
||||
const randomHexPair = () => Math.floor(Math.random() * 256).toString(16).padStart(2, '0').toUpperCase();
|
||||
$('#NEWDEV_devMac').val(`00:1A:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}:${randomHexPair()}`.toLowerCase());
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------
|
||||
// Generate a random IP address starting 192.
|
||||
function generate_NEWDEV_devLastIP() {
|
||||
const randomByte = () => Math.floor(Math.random() * 256);
|
||||
$('#NEWDEV_devLastIP').val(`192.${randomByte()}.${randomByte()}.${Math.floor(Math.random() * 254) + 1}`);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// A method to add an Icon as an option to select and make it selected
|
||||
function addIconAsBase64 (el) {
|
||||
|
||||
var iconHtml = $('#modal-input-textarea').val();
|
||||
|
||||
console.log(iconHtml);
|
||||
|
||||
iconHtmlBase64 = btoa(iconHtml.replace(/"/g, "'"));
|
||||
|
||||
console.log(iconHtmlBase64);
|
||||
|
||||
|
||||
console.log($('#modal-field-input-field'));
|
||||
|
||||
var triggeredBy = $('#modal-input').attr("data-myparam-triggered-by");
|
||||
var targetId = $('#' + triggeredBy).attr("data-myparam-setkey");
|
||||
|
||||
// $('#'+targetId).val(iconHtmlBase64);
|
||||
|
||||
// Add new option and set it as selected
|
||||
$('#' + targetId).append(new Option(iconHtmlBase64, iconHtmlBase64)).val(iconHtmlBase64);
|
||||
|
||||
updateIconPreview(el)
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@@ -324,15 +440,14 @@ function initSelect2() {
|
||||
}
|
||||
}
|
||||
|
||||
// init select2 after dom laoded
|
||||
// init functions after dom loaded
|
||||
window.addEventListener("load", function() {
|
||||
// try to initialize select2
|
||||
// try to initialize
|
||||
setTimeout(() => {
|
||||
initSelect2()
|
||||
initializeiCheck();
|
||||
}, 1000);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
console.log("init ui_components.js")
|
||||
1
front/lib/bootstrap/bootstrap.min.css.map
Executable file
1
front/lib/bootstrap/bootstrap.min.css.map
Executable file
File diff suppressed because one or more lines are too long
@@ -1,4 +1,8 @@
|
||||
|
||||
<?php
|
||||
//------------------------------------------------------------------------------
|
||||
// check if authenticated
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
?>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="callout callout-warning">
|
||||
|
||||
57
front/php/components/device_cards.php
Executable file
57
front/php/components/device_cards.php
Executable file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
require '../server/init.php';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// check if authenticated
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
|
||||
function renderSmallBox($params) {
|
||||
$onclickEvent = isset($params['onclickEvent']) ? $params['onclickEvent'] : '';
|
||||
$color = isset($params['color']) ? $params['color'] : '';
|
||||
$headerId = isset($params['headerId']) ? $params['headerId'] : '';
|
||||
$headerStyle = isset($params['headerStyle']) ? $params['headerStyle'] : '';
|
||||
$labelLang = isset($params['labelLang']) ? $params['labelLang'] : '';
|
||||
$iconId = isset($params['iconId']) ? $params['iconId'] : '';
|
||||
$iconClass = isset($params['iconClass']) ? $params['iconClass'] : '';
|
||||
$dataValue = isset($params['dataValue']) ? $params['dataValue'] : '';
|
||||
|
||||
return '
|
||||
<div class="col-lg-3 col-sm-6 col-xs-6">
|
||||
<a href="#" onclick="javascript: ' . htmlspecialchars($onclickEvent) . '">
|
||||
<div class="small-box ' . htmlspecialchars($color) . '">
|
||||
<div class="inner">
|
||||
<h3 id="' . htmlspecialchars($headerId) . '" style="' . htmlspecialchars($headerStyle) . '"> '.$dataValue.' </h3>
|
||||
<p class="infobox_label">'.lang(htmlspecialchars($labelLang)).'</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i id="' . htmlspecialchars($iconId) . '" class="' . htmlspecialchars($iconClass) . '"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
// Load default data from JSON file
|
||||
$defaultDataFile = 'device_cards_defaults.json';
|
||||
$defaultData = file_exists($defaultDataFile) ? json_decode(file_get_contents($defaultDataFile), true) : [];
|
||||
|
||||
// Check if 'items' parameter exists and is valid JSON
|
||||
$items = isset($_POST['items']) ? json_decode($_POST['items'], true) : [];
|
||||
|
||||
// Use default data if 'items' is not provided or cannot be decoded
|
||||
if (empty($items)) {
|
||||
$items = $defaultData;
|
||||
}
|
||||
|
||||
// Generate HTML
|
||||
$html = '<div class="row">';
|
||||
foreach ($items as $item) {
|
||||
$html .= renderSmallBox($item);
|
||||
}
|
||||
$html .= '</div>';
|
||||
|
||||
// Output generated HTML
|
||||
echo $html;
|
||||
exit();
|
||||
?>
|
||||
43
front/php/components/device_cards_defaults.json
Executable file
43
front/php/components/device_cards_defaults.json
Executable file
@@ -0,0 +1,43 @@
|
||||
[
|
||||
{
|
||||
"onclickEvent": "$('#tabDetails').trigger('click')",
|
||||
"color": "bg-aqua",
|
||||
"headerId": "deviceStatus",
|
||||
"headerStyle": "margin-left: 0em",
|
||||
"labelLang": "DevDetail_Shortcut_CurrentStatus",
|
||||
"iconId": "deviceStatusIcon",
|
||||
"iconClass": "",
|
||||
"dataValue": "--"
|
||||
},
|
||||
{
|
||||
"onclickEvent": "$('#tabSessions').trigger('click');",
|
||||
"color": "bg-green",
|
||||
"headerId": "deviceSessions",
|
||||
"headerStyle": "",
|
||||
"labelLang": "DevDetail_Shortcut_Sessions",
|
||||
"iconId": "",
|
||||
"iconClass": "fa fa-plug",
|
||||
"dataValue": "--"
|
||||
},
|
||||
{
|
||||
"onclickEvent": "$('#tabPresence').trigger('click')",
|
||||
"color": "bg-yellow",
|
||||
"headerId": "deviceEvents",
|
||||
"headerStyle": "margin-left: 0em",
|
||||
"labelLang": "DevDetail_Shortcut_Presence",
|
||||
"iconId": "deviceEventsIcon",
|
||||
"iconClass": "fa fa-calendar",
|
||||
"dataValue": "--"
|
||||
},
|
||||
{
|
||||
"onclickEvent": "$('#tabEvents').trigger('click');",
|
||||
"color": "bg-red",
|
||||
"headerId": "deviceDownAlerts",
|
||||
"headerStyle": "",
|
||||
"labelLang": "DevDetail_Shortcut_DownAlerts",
|
||||
"iconId": "",
|
||||
"iconClass": "fa fa-warning",
|
||||
"dataValue": "--"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
},
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"labelStringCode": "Maint_PurgeLog",
|
||||
"event": "logManage('db_is_locked.log', 'cleanLog')"
|
||||
}
|
||||
],
|
||||
"fileName": "db_is_locked.log",
|
||||
"filePath": "/app/front/log/db_is_locked.log",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
if (isset ($_REQUEST['action']) && !empty ($_REQUEST['action'])) {
|
||||
$action = $_REQUEST['action'];
|
||||
switch ($action) {
|
||||
case 'getDeviceData': getDeviceData(); break;
|
||||
case 'getServerDeviceData': getServerDeviceData(); break;
|
||||
case 'setDeviceData': setDeviceData(); break;
|
||||
case 'deleteDevice': deleteDevice(); break;
|
||||
case 'deleteAllWithEmptyMACs': deleteAllWithEmptyMACs(); break;
|
||||
@@ -64,13 +64,59 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// Query Device Data
|
||||
//------------------------------------------------------------------------------
|
||||
function getDeviceData() {
|
||||
function getServerDeviceData() {
|
||||
global $db;
|
||||
|
||||
// Request Parameters
|
||||
$periodDate = getDateFromPeriod();
|
||||
$mac = $_REQUEST['mac'];
|
||||
|
||||
// Check for "new" MAC case
|
||||
if ($mac === "new") {
|
||||
$now = date('Y-m-d H:i');
|
||||
$deviceData = [
|
||||
"devMac" => "",
|
||||
"devName" => "",
|
||||
"devOwner" => "",
|
||||
"devType" => "",
|
||||
"devVendor" => "",
|
||||
"devFavorite" => 0,
|
||||
"devGroup" => "",
|
||||
"devComments" => "",
|
||||
"devFirstConnection" => $now,
|
||||
"devLastConnection" => $now,
|
||||
"devLastIP" => "",
|
||||
"devStaticIP" => 0,
|
||||
"devScan" => 0,
|
||||
"devLogEvents" => 0,
|
||||
"devAlertEvents" => 0,
|
||||
"devAlertDown" => 0,
|
||||
"devSkipRepeated" => 0,
|
||||
"devLastNotification" => "",
|
||||
"devPresentLastScan" => 0,
|
||||
"devIsNew" => 1,
|
||||
"devLocation" => "",
|
||||
"devIsArchived" => 0,
|
||||
"devParentMAC" => "",
|
||||
"devParentPort" => "",
|
||||
"devIcon" => "",
|
||||
"devGUID" => "",
|
||||
"devSite" => "",
|
||||
"devSSID" => "",
|
||||
"devSyncHubNode" => "",
|
||||
"devSourcePlugin" => "",
|
||||
"devStatus" => "Unknown",
|
||||
"devRandomMAC" => false,
|
||||
"devSessions" => 0,
|
||||
"devEvents" => 0,
|
||||
"devDownAlerts" => 0,
|
||||
"devPresenceHours" => 0
|
||||
];
|
||||
echo json_encode($deviceData);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Device Data
|
||||
$sql = 'SELECT rowid, *,
|
||||
CASE WHEN devAlertDown !=0 AND devPresentLastScan=0 THEN "Down"
|
||||
@@ -143,29 +189,118 @@ function getDeviceData() {
|
||||
function setDeviceData() {
|
||||
global $db;
|
||||
|
||||
// sql
|
||||
$sql = 'UPDATE Devices SET
|
||||
devName = "'. quotes($_REQUEST['name']) .'",
|
||||
devOwner = "'. quotes($_REQUEST['owner']) .'",
|
||||
devType = "'. quotes($_REQUEST['type']) .'",
|
||||
devVendor = "'. quotes($_REQUEST['vendor']) .'",
|
||||
devIcon = "'. quotes($_REQUEST['icon']) .'",
|
||||
devFavorite = "'. quotes($_REQUEST['favorite']) .'",
|
||||
devGroup = "'. quotes($_REQUEST['group']) .'",
|
||||
devLocation = "'. quotes($_REQUEST['location']) .'",
|
||||
devComments = "'. quotes($_REQUEST['comments']) .'",
|
||||
devParentMAC = "'. quotes($_REQUEST['networknode']).'",
|
||||
devParentPort = "'. quotes($_REQUEST['networknodeport']).'",
|
||||
devSSID = "'. quotes($_REQUEST['ssid']).'",
|
||||
devSite = "'. quotes($_REQUEST['networksite']).'",
|
||||
devStaticIP = "'. quotes($_REQUEST['staticIP']) .'",
|
||||
devScan = "'. quotes($_REQUEST['scancycle']) .'",
|
||||
devAlertEvents = "'. quotes($_REQUEST['alertevents']) .'",
|
||||
devAlertDown = "'. quotes($_REQUEST['alertdown']) .'",
|
||||
devSkipRepeated = "'. quotes($_REQUEST['skiprepeated']) .'",
|
||||
devIsNew = "'. quotes($_REQUEST['newdevice']) .'",
|
||||
devIsArchived = "'. quotes($_REQUEST['archived']) .'"
|
||||
WHERE devMac="' . $_REQUEST['mac'] .'"';
|
||||
// Sanitize input
|
||||
$mac = quotes($_REQUEST['mac']);
|
||||
$name = quotes($_REQUEST['name']);
|
||||
$owner = quotes($_REQUEST['owner']);
|
||||
$type = quotes($_REQUEST['type']);
|
||||
$vendor = quotes($_REQUEST['vendor']);
|
||||
$icon = quotes($_REQUEST['icon']);
|
||||
$favorite = quotes($_REQUEST['favorite']);
|
||||
$group = quotes($_REQUEST['group']);
|
||||
$location = quotes($_REQUEST['location']);
|
||||
$comments = quotes($_REQUEST['comments']);
|
||||
$parentMac = quotes($_REQUEST['networknode']);
|
||||
$parentPort = quotes($_REQUEST['networknodeport']);
|
||||
$ssid = quotes($_REQUEST['ssid']);
|
||||
$site = quotes($_REQUEST['networksite']);
|
||||
$staticIP = quotes($_REQUEST['staticIP']);
|
||||
$scancycle = quotes($_REQUEST['scancycle']);
|
||||
$alertevents = quotes($_REQUEST['alertevents']);
|
||||
$alertdown = quotes($_REQUEST['alertdown']);
|
||||
$skiprepeated = quotes($_REQUEST['skiprepeated']);
|
||||
$newdevice = quotes($_REQUEST['newdevice']);
|
||||
$archived = quotes($_REQUEST['archived']);
|
||||
$devFirstConnection = quotes($_REQUEST['devFirstConnection']);
|
||||
$devLastConnection = quotes($_REQUEST['devLastConnection']);
|
||||
$ip = quotes($_REQUEST['ip']);
|
||||
$createNew = quotes($_REQUEST['createNew']);
|
||||
$devNewGuid = generateGUID();
|
||||
|
||||
// an update
|
||||
if ($_REQUEST['createNew'] == 0)
|
||||
{
|
||||
// UPDATE SQL query
|
||||
$sql = "UPDATE Devices SET
|
||||
devName = '$name',
|
||||
devOwner = '$owner',
|
||||
devType = '$type',
|
||||
devVendor = '$vendor',
|
||||
devIcon = '$icon',
|
||||
devFavorite = '$favorite',
|
||||
devGroup = '$group',
|
||||
devLocation = '$location',
|
||||
devComments = '$comments',
|
||||
devParentMAC = '$parentMac',
|
||||
devParentPort = '$parentPort',
|
||||
devSSID = '$ssid',
|
||||
devSite = '$site',
|
||||
devStaticIP = '$staticIP',
|
||||
devScan = '$scancycle',
|
||||
devAlertEvents = '$alertevents',
|
||||
devAlertDown = '$alertdown',
|
||||
devSkipRepeated = '$skiprepeated',
|
||||
devIsNew = '$newdevice',
|
||||
devIsArchived = '$archived'
|
||||
WHERE devMac = '$mac'";
|
||||
} else // an INSERT
|
||||
{
|
||||
$sql = "INSERT INTO Devices (
|
||||
devMac,
|
||||
devName,
|
||||
devOwner,
|
||||
devType,
|
||||
devVendor,
|
||||
devIcon,
|
||||
devFavorite,
|
||||
devGroup,
|
||||
devLocation,
|
||||
devComments,
|
||||
devParentMAC,
|
||||
devParentPort,
|
||||
devSSID,
|
||||
devSite,
|
||||
devStaticIP,
|
||||
devScan,
|
||||
devAlertEvents,
|
||||
devAlertDown,
|
||||
devSkipRepeated,
|
||||
devIsNew,
|
||||
devIsArchived,
|
||||
devLastConnection,
|
||||
devFirstConnection,
|
||||
devLastIP,
|
||||
devGUID
|
||||
) VALUES (
|
||||
'$mac',
|
||||
'$name',
|
||||
'$owner',
|
||||
'$type',
|
||||
'$vendor',
|
||||
'$icon',
|
||||
'$favorite',
|
||||
'$group',
|
||||
'$location',
|
||||
'$comments',
|
||||
'$parentMac',
|
||||
'$parentPort',
|
||||
'$ssid',
|
||||
'$site',
|
||||
'$staticIP',
|
||||
'$scancycle',
|
||||
'$alertevents',
|
||||
'$alertdown',
|
||||
'$skiprepeated',
|
||||
'$newdevice',
|
||||
'$archived',
|
||||
'$devLastConnection',
|
||||
'$devFirstConnection',
|
||||
'$ip',
|
||||
'$devNewGuid'
|
||||
)
|
||||
";
|
||||
}
|
||||
|
||||
// update Data
|
||||
$result = $db->query($sql);
|
||||
|
||||
|
||||
@@ -588,6 +588,18 @@ function getDevicesColumns(){
|
||||
return $columns;
|
||||
}
|
||||
|
||||
|
||||
function generateGUID() {
|
||||
return sprintf(
|
||||
'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
random_int(0, 0xffff), random_int(0, 0xffff),
|
||||
random_int(0, 0xffff),
|
||||
random_int(0, 0x0fff) | 0x4000, // Version 4 UUID
|
||||
random_int(0, 0x3fff) | 0x8000, // Variant 1
|
||||
random_int(0, 0xffff), random_int(0, 0xffff), random_int(0, 0xffff)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Simple cookie cache
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -41,6 +41,8 @@
|
||||
<!-- Bootstrap 3.3.7 -->
|
||||
<link rel="stylesheet" href="lib/bootstrap/bootstrap.min.css">
|
||||
|
||||
<!-- iCheck -->
|
||||
<script src="lib/iCheck/icheck.min.js"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="lib/font-awesome/fontawesome.min.css">
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "",
|
||||
"DevDetail_Copy_Device_Title": "",
|
||||
"DevDetail_Copy_Device_Tooltip": "",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "",
|
||||
"DevDetail_EveandAl_AlertDown": "",
|
||||
"DevDetail_EveandAl_Archived": "",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "",
|
||||
"DevDetail_button_Reset": "",
|
||||
"DevDetail_button_Save": "",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "",
|
||||
"Device_MultiEdit_Backup": "",
|
||||
"Device_MultiEdit_Fields": "",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "",
|
||||
"Gen_Add": "",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_All_Devices": "",
|
||||
"Gen_AreYouSure": "",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "",
|
||||
"Gen_Offline": "",
|
||||
"Gen_Okay": "",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "",
|
||||
"Gen_Warning": "",
|
||||
"Gen_Work_In_Progress": "",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "",
|
||||
"General_icon": "",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "",
|
||||
"general_event_description": "",
|
||||
"general_event_title": "",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "",
|
||||
"report_guid_missing": "",
|
||||
"report_select_format": "",
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"BackDevDetail_Actions_Ask_Run": "Vol executar aquesta comanda?",
|
||||
"BackDevDetail_Actions_Not_Registered": "Comanda no registrada: ",
|
||||
"BackDevDetail_Actions_Title_Run": "Executar la comanda",
|
||||
"BackDevDetail_Copy_Ask": "Copiar detalls del dispositius des de la llista desplegable? Tot el d'aquesta pàgina es sobre-escriurà",
|
||||
"BackDevDetail_Copy_Ask": "Copiar detalls del dispositius des de la llista desplegable (Tot el d'aquesta pàgina es sobre-escriurà) ?",
|
||||
"BackDevDetail_Copy_Title": "Copiar detalls",
|
||||
"BackDevDetail_Tools_WOL_error": "La comanda NO s'ha executat.",
|
||||
"BackDevDetail_Tools_WOL_okay": "La comanda s'ha executat.",
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Esborrar esdeveniments més vells de",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copiar detalls des del dispositiu",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copiar detalls del dispositius des de la llista desplegable. Tot el d'aquesta pàgina es sobre-escriurà",
|
||||
"DevDetail_DisplayFields_Title": "Pantalla",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Alertes",
|
||||
"DevDetail_EveandAl_AlertDown": "Cancel·lar alerta",
|
||||
"DevDetail_EveandAl_Archived": "Arxivat",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Dispositiu d'escaneig",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "No Escanejar Dispositiu",
|
||||
"DevDetail_EveandAl_Skip": "Omet notificacions repetides per",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Configuració de Successos i Alertes",
|
||||
"DevDetail_EveandAl_Title": "Configuració de Successos i Alertes",
|
||||
"DevDetail_Events_CheckBox": "Amagar successos de connexió",
|
||||
"DevDetail_GoToNetworkNode": "Navegació a la pàgina de la Xarxa del node donat.",
|
||||
"DevDetail_Icon": "Icona",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Node (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "Lloc web",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Xarxa",
|
||||
"DevDetail_MainInfo_Network_Title": "Xarxa",
|
||||
"DevDetail_MainInfo_Owner": "Propietari",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Informació principal",
|
||||
"DevDetail_MainInfo_Title": "Informació principal",
|
||||
"DevDetail_MainInfo_Type": "Tipus",
|
||||
"DevDetail_MainInfo_Vendor": "Venedor",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Últim Fora de línia",
|
||||
"DevDetail_SessionInfo_StaticIP": "IP estàtica",
|
||||
"DevDetail_SessionInfo_Status": "Estat",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Informació de la sessió",
|
||||
"DevDetail_SessionInfo_Title": "Informació de la sessió",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Informació addicional",
|
||||
"DevDetail_SessionTable_Connection": "Connexió",
|
||||
"DevDetail_SessionTable_Disconnection": "Desconnexió",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Estàs segur que vols sobreescriure totes les icones de tots els dispositius amb el mateix tipus de dispositiu que el tipus de dispositiu actual?",
|
||||
"DevDetail_button_Reset": "Restablir canvis",
|
||||
"DevDetail_button_Save": "Guardar",
|
||||
"DeviceEdit_ValidMacIp": "Entra una adreça <b>IP</b> i <b>Mac</b> vàlides.",
|
||||
"Device_MultiEdit": "Multi-edició",
|
||||
"Device_MultiEdit_Backup": "Atenció, entrar valors incorrectes a continuació trencarà la configuració. Si us plau, abans feu còpia de seguretat la vostra base de dades o configuració de Dispositius (<a href=\"php/server/devices.php?action=ExportCSV\">clic per descarregar <i class=\"fa-solid fa-download fa-bounce\"></i></a>). Llegiu com per recuperar Dispositius des d'aquest fitxer al <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">documentació de Còpies de seguretat</a>.",
|
||||
"Device_MultiEdit_Fields": "Editar camps:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "Port GraphQL",
|
||||
"Gen_Action": "Acció",
|
||||
"Gen_Add": "Afegir",
|
||||
"Gen_AddDevice": "Afegir dispositiu",
|
||||
"Gen_Add_All": "Afegeix tot",
|
||||
"Gen_All_Devices": "Tots els dispositius",
|
||||
"Gen_AreYouSure": "Estàs segur?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "ERROR - DB podria estar bloquejada - Fes servir F12 Eines desenvolupament -> Consola o provar-ho més tard.",
|
||||
"Gen_Offline": "Fora de línia",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "En línia",
|
||||
"Gen_Purge": "Elimina",
|
||||
"Gen_ReadDocs": "Llegit més dins el docs.",
|
||||
"Gen_Remove_All": "Esborra tot",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Actualitzar Valor",
|
||||
"Gen_Warning": "Advertència",
|
||||
"Gen_Work_In_Progress": "Work in progress, un bon moment per retroalimentació a https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "Crear un dispositiu simulat",
|
||||
"General_display_name": "General",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Això és un paràmetre de manteniment <b>ELIMINANT dispositius</b>. Si s'activa (<code>0</code> està desactivat), els dispositius marcats com <b>Dispositiu Nou</b> seran eliminats si el temps de <b>Primera Sessió</b> es més vell que les hores especificades en aquest paràmetre. Faci servir aquest paràmetre si vol auto-eliminar <b>Nous Dispositius</b> després de <code>X</code> hores.",
|
||||
@@ -576,7 +581,7 @@
|
||||
"REPORT_MAIL_description": "Si està activat s'envia un correu electrònic amb una llista de canvis als quals s'ha subscrit. Si us plau, ompli tots els paràmetres restants relacionats amb la configuració SMTP. Si té problemes, configuri <code>LOG_LEVEL</code> i <code>debug</code> comprovi <a href=\"/maintenance.php#tab_Logging\"> el registre d'errors</a>.",
|
||||
"REPORT_MAIL_name": "Activa el correu electrònic",
|
||||
"REPORT_TITLE": "Informe",
|
||||
"RandomMAC_hover": "Auto detectat - indica que el dispositiu aleatoritza l'adreça MAC.",
|
||||
"RandomMAC_hover": "Auto detectat - indica que el dispositiu aleatoritza l'adreça MAC. Pots excloure MACs específiques amb la configuració UI_NOT_RANDOM_MAC. Fes click per saber més.",
|
||||
"Reports_Sent_Log": "Registre d'informes enviats",
|
||||
"SCAN_SUBNETS_description": "La majoria dels escàners en xarxa (ARP-SCAN, NMAP, NSLOOKUP, DIG) es basen en l'exploració d'interfícies de xarxa específiques i subxarxes. Comproveu la <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentació de subxarxes</a> per ajudar en aquesta configuració, especialment VLANs, i quines VLANs són compatibles, o com esbrinar la màscara de xarxa i la seva interfície. <br/> <br/> Una alternativa als escàners en xarxa és activar alguns altres escàners / importadors de dispositius que no requereixin NetAlert<sup>X</sup> per tenir accés a la xarxa (UNIFI, dhcp. leases, PiHole, etc.). <br/> <br/> Nota: El temps d'exploració en si mateix depèn del nombre d'adreces IP per verificar, així que s'ha establir amb cura amb la màscara i la interfície de xarxa adequats.",
|
||||
"SCAN_SUBNETS_name": "Xarxes per escanejar",
|
||||
@@ -592,7 +597,7 @@
|
||||
"Systeminfo_CPU_Cores": "Nuclis de CPU:",
|
||||
"Systeminfo_CPU_Name": "Nom de CPU:",
|
||||
"Systeminfo_CPU_Speed": "Velocitat de CPU:",
|
||||
"Systeminfo_CPU_Temp": "CPU Temp:",
|
||||
"Systeminfo_CPU_Temp": "Temp CPU:",
|
||||
"Systeminfo_CPU_Vendor": "Venedor de CPU:",
|
||||
"Systeminfo_Client_Resolution": "Resolució del navegador:",
|
||||
"Systeminfo_Client_User_Agent": "Agent d'usuari:",
|
||||
@@ -717,5 +722,13 @@
|
||||
"settings_system_label": "Sistema",
|
||||
"settings_update_item_warning": "Actualitza el valor sota. Sigues curós de seguir el format anterior. <b>No hi ha validació.</b>",
|
||||
"test_event_icon": "fa-vial-circle-check",
|
||||
"test_event_tooltip": "Deseu els canvis primer abans de comprovar la configuració."
|
||||
"test_event_tooltip": "Deseu els canvis primer abans de comprovar la configuració.",
|
||||
"add_icon_event_tooltip": "Afegir nova icona",
|
||||
"add_option_event_icon": "fa-square-plus",
|
||||
"copy_icons_event_icon": "fa-copy",
|
||||
"go_to_node_event_icon": "fa-square-up-right",
|
||||
"go_to_node_event_tooltip": "Navegació a la pàgina de la Xarxa del node donat",
|
||||
"add_icon_event_icon": "fa-square-plus",
|
||||
"add_option_event_tooltip": "Afegir nou valor",
|
||||
"copy_icons_event_tooltip": "Sobreescriure icones de tots els dispositius amb el mateix tipus de dispositiu"
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "",
|
||||
"DevDetail_Copy_Device_Title": "",
|
||||
"DevDetail_Copy_Device_Tooltip": "",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "",
|
||||
"DevDetail_EveandAl_AlertDown": "",
|
||||
"DevDetail_EveandAl_Archived": "",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "",
|
||||
"DevDetail_button_Reset": "",
|
||||
"DevDetail_button_Save": "",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "",
|
||||
"Device_MultiEdit_Backup": "",
|
||||
"Device_MultiEdit_Fields": "",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "",
|
||||
"Gen_Add": "",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "",
|
||||
"Gen_All_Devices": "",
|
||||
"Gen_AreYouSure": "",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "",
|
||||
"Gen_Offline": "",
|
||||
"Gen_Okay": "",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "",
|
||||
"Gen_Warning": "",
|
||||
"Gen_Work_In_Progress": "",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "",
|
||||
"General_icon": "",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "",
|
||||
"general_event_description": "",
|
||||
"general_event_title": "",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "",
|
||||
"report_guid_missing": "",
|
||||
"report_select_format": "",
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"API_CUSTOM_SQL_description": "Benutzerdefinierte SQL-Abfrage, welche eine JSON-Datei generiert und diese mit dem <a href=\"/api/table_custom_endpoint.json\" target=\"_blank\">Dateiendpunkt <code>table_custom_endpoint.json</code></a> zur Verfügung stellt.",
|
||||
"API_CUSTOM_SQL_name": "Benutzerdefinierte SQL-Abfrage",
|
||||
"API_TOKEN_description": "",
|
||||
"API_TOKEN_name": "",
|
||||
"API_TOKEN_description": "API-Token zur Absicherung der Kommunikation – Sie können einen generieren oder einen beliebigen Wert eingeben. Er wird im Anfrage-Header übermittelt. Wird im <code>SYNC</code>-Plugin und GraphQL-Server verwendet.",
|
||||
"API_TOKEN_name": "API-Schlüssel",
|
||||
"API_display_name": "API",
|
||||
"API_icon": "<i class=\"fa fa-arrow-down-up-across-line\"></i>",
|
||||
"APPRISE_HOST_description": "Apprise host URL starting with <code>http://</code> or <code>https://</code>. (do not forget to include <code>/notify</code> at the end)",
|
||||
@@ -70,27 +70,28 @@
|
||||
"BackDevices_Restore_okay": "Die Wiederherstellung wurde erfolgreich ausgeführt.",
|
||||
"BackDevices_darkmode_disabled": "Heller Modus aktiviert",
|
||||
"BackDevices_darkmode_enabled": "Dunkler Modus aktiviert",
|
||||
"CLEAR_NEW_FLAG_description": "",
|
||||
"CLEAR_NEW_FLAG_description": "Wenn aktiviert (<code>0</code> bedeutet deaktiviert), werden Geräte, die als <b>Neues Gerät</b> gekennzeichnet sind, wieder freigegeben, wenn das Zeitlimit (in Stunden) die Zeit ihrer <b>Ersten Sitzung</b> überschreitet.",
|
||||
"CLEAR_NEW_FLAG_name": "Neues Flag löschen",
|
||||
"DAYS_TO_KEEP_EVENTS_description": "Dies ist eine Wartungseinstellung. Spezifiziert wie viele Tage Events gespeichert bleiben. Alle älteren Events werden periodisch gelöscht. Wird auch auf die Plugins History angewendet.",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Lösche Events älter als",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Details von Gerät kopieren",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Ereignisse löschen, die älter sind als",
|
||||
"DevDetail_Copy_Device_Title": "Details von Gerät kopieren",
|
||||
"DevDetail_Copy_Device_Tooltip": "Details vom Gerät aus der Dropdown-Liste kopieren. Alles auf dieser Seite wird überschrieben",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Melde alle Ereignisse",
|
||||
"DevDetail_DisplayFields_Title": "Anzeige",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Alarmereignisse",
|
||||
"DevDetail_EveandAl_AlertDown": "Melde Down",
|
||||
"DevDetail_EveandAl_Archived": "Archivierung",
|
||||
"DevDetail_EveandAl_Archived": "Archiviert",
|
||||
"DevDetail_EveandAl_NewDevice": "Neues Gerät",
|
||||
"DevDetail_EveandAl_NewDevice_Tooltip": "",
|
||||
"DevDetail_EveandAl_NewDevice_Tooltip": "Zeigt den Status „Neu“ für das Gerät an und nimmt es in Listen auf, wenn der Filter „Neue Geräte“ aktiv ist. Hat keine Auswirkungen auf Benachrichtigungen.",
|
||||
"DevDetail_EveandAl_RandomMAC": "Zufällige MAC",
|
||||
"DevDetail_EveandAl_ScanCycle": "Scan Abstand",
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Gerät scannen",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Gerät nicht scannen",
|
||||
"DevDetail_EveandAl_Skip": "pausiere wiederhol. Meldungen für",
|
||||
"DevDetail_EveandAl_Title": "Ereignisse & Alarme einstellen",
|
||||
"DevDetail_EveandAl_Title": "Konfiguration der Benachrichtigungen",
|
||||
"DevDetail_Events_CheckBox": "Blende Verbindungs-Ereignisse aus",
|
||||
"DevDetail_GoToNetworkNode": "Zur Netzwerkseite des angegebenen Knotens navigieren.",
|
||||
"DevDetail_Icon": "Icon",
|
||||
"DevDetail_Icon_Descr": "",
|
||||
"DevDetail_Icon_Descr": "Geben Sie einen Font Awesome Icon-Namen ohne das Präfix „fa-“ ein oder die vollständige Klasse, z. B.: fa fa-brands fa-apple.",
|
||||
"DevDetail_Loading": "Laden ...",
|
||||
"DevDetail_MainInfo_Comments": "Notiz",
|
||||
"DevDetail_MainInfo_Favorite": "Favorit",
|
||||
@@ -100,10 +101,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Knoten (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "Seite",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Network",
|
||||
"DevDetail_MainInfo_Network_Title": "Network",
|
||||
"DevDetail_MainInfo_Owner": "Eigen­tümer",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Hauptinformation",
|
||||
"DevDetail_MainInfo_Title": "Hauptinformation",
|
||||
"DevDetail_MainInfo_Type": "Typ",
|
||||
"DevDetail_MainInfo_Vendor": "Hersteller",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -133,7 +134,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Zuletzt offline",
|
||||
"DevDetail_SessionInfo_StaticIP": "Statische IP",
|
||||
"DevDetail_SessionInfo_Status": "Status",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Sitzungsinformation",
|
||||
"DevDetail_SessionInfo_Title": "Sitzungsinformation",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Zusätzliche Info",
|
||||
"DevDetail_SessionTable_Connection": "Verbindung",
|
||||
"DevDetail_SessionTable_Disconnection": "Trennung",
|
||||
@@ -196,6 +197,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Bist du sicher, dass du alle Symbole aller Geräte mit dem gleichen Gerätetyp wie dem aktuellen Gerätetyp überschreiben willst?",
|
||||
"DevDetail_button_Reset": "Verwerfen",
|
||||
"DevDetail_button_Save": "Speichern",
|
||||
"DeviceEdit_ValidMacIp": "Gib eine gültige <b>MAC</b>- und <b>IP</b>-Adresse ein.",
|
||||
"Device_MultiEdit": "Mehrfach-bearbeiten",
|
||||
"Device_MultiEdit_Backup": "",
|
||||
"Device_MultiEdit_Fields": "Felder bearbeiten:",
|
||||
@@ -229,7 +231,7 @@
|
||||
"Device_TableHead_Owner": "Eigentümer",
|
||||
"Device_TableHead_Parent_MAC": "Übergeordnete MAC",
|
||||
"Device_TableHead_Port": "Port",
|
||||
"Device_TableHead_PresentLastScan": "",
|
||||
"Device_TableHead_PresentLastScan": "Anwesenheit",
|
||||
"Device_TableHead_RowID": "Zeilen ID",
|
||||
"Device_TableHead_Rowid": "Zeilennummer",
|
||||
"Device_TableHead_SSID": "SSID",
|
||||
@@ -286,10 +288,11 @@
|
||||
"Events_Tablelenght": "Zeige _MENU_ Einträge",
|
||||
"Events_Tablelenght_all": "Alle",
|
||||
"Events_Title": "Ereignisse",
|
||||
"GRAPHQL_PORT_description": "",
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"GRAPHQL_PORT_description": "Die Portnummer des GraphQL-Servers.",
|
||||
"GRAPHQL_PORT_name": "GraphQL-Port",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "Hinzufügen",
|
||||
"Gen_AddDevice": "Gerät hinzufügen",
|
||||
"Gen_Add_All": "Alle hinzufügen",
|
||||
"Gen_All_Devices": "Alle Geräte",
|
||||
"Gen_AreYouSure": "Sind Sie sich sicher?",
|
||||
@@ -303,10 +306,11 @@
|
||||
"Gen_Description": "Beschreibung",
|
||||
"Gen_Error": "Fehler",
|
||||
"Gen_Filter": "Filter",
|
||||
"Gen_Generate": "",
|
||||
"Gen_Generate": "Generieren",
|
||||
"Gen_LockedDB": "ERROR - DB eventuell gesperrt - Nutze die Konsole in den Entwickler Werkzeugen (F12) zur Überprüfung oder probiere es später erneut.",
|
||||
"Gen_Offline": "Offline",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "Online",
|
||||
"Gen_Purge": "Aufräumen",
|
||||
"Gen_ReadDocs": "Mehr in der Dokumentation.",
|
||||
"Gen_Remove_All": "Alle entfernen",
|
||||
@@ -325,12 +329,13 @@
|
||||
"Gen_Update_Value": "Wert aktualisieren",
|
||||
"Gen_Warning": "Warnung",
|
||||
"Gen_Work_In_Progress": "Keine Finalversion, feedback bitte unter: https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Allgemein",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Dies ist eine Wartungseinstellung <b>DELETING devices</b>. Wenn aktiviert (<code>0</code> bedeutet deaktiviert), werden als <b>\"Neues Gerät\"</b> markierte Geräte gelöscht, wenn ihre <b>erste Sitzung</b> länger her ist als in dieser Einstellung angegeben. Verwenden Sie diese Einstellung, wenn Sie <b>Neue Geräte</b> nach <code>X</code> Stunden automatisch löschen wollen.",
|
||||
"HRS_TO_KEEP_NEWDEV_name": "Neue Geräte löschen nach",
|
||||
"HRS_TO_KEEP_OFFDEV_description": "",
|
||||
"HRS_TO_KEEP_OFFDEV_name": "",
|
||||
"HRS_TO_KEEP_OFFDEV_name": "Offline-Geräte löschen nach",
|
||||
"HelpFAQ_Cat_Detail": "Detailansicht",
|
||||
"HelpFAQ_Cat_Detail_300_head": "Was bedeutet ",
|
||||
"HelpFAQ_Cat_Detail_300_text_a": "meint ein Netzwerkgerät (ein Gerät vom Typ AP, Gateway, Firewall, Hypervisor, Powerline, Switch, WLAN, PLC, Router, USB-LAN-Adapter oder Internet). Benutzerdefinierte Typen können über die <code>NETWORK_DEVICE_TYPES</code> Einstellung hinzugefügt werden.",
|
||||
@@ -596,7 +601,7 @@
|
||||
"Presence_CalHead_week": "Woche",
|
||||
"Presence_CalHead_year": "Jahr",
|
||||
"Presence_CallHead_Devices": "Geräte",
|
||||
"Presence_Key_OnlineNow": "",
|
||||
"Presence_Key_OnlineNow": "Jetzt online",
|
||||
"Presence_Key_OnlineNow_desc": "",
|
||||
"Presence_Key_OnlinePast": "",
|
||||
"Presence_Key_OnlinePastMiss": "",
|
||||
@@ -762,9 +767,17 @@
|
||||
"WEBHOOK_URL_name": "Target URL",
|
||||
"Webhooks_display_name": "Webhooks",
|
||||
"Webhooks_icon": "<i class=\"fa fa-circle-nodes\"></i>",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "Icons aller Geräte mit demselben Gerätetyp überschreiben",
|
||||
"devices_old": "Aktualisiert...",
|
||||
"general_event_description": "Das Ereignis, das Sie ausgelöst haben, könnte eine Weile dauern, bis Hintergrundprozesse abgeschlossen sind. Die Ausführung endet, wenn die unten ausgeführte Warteschlangen abgearbeitet ist. (Siehe <a href='/maintenance.php#tab_Logging'>error log</a>, wenn Probleme auftreten.)<br/> <br/> Ausführungsschlange:",
|
||||
"general_event_title": "",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "",
|
||||
"report_guid_missing": "",
|
||||
"report_select_format": "Format auswählen:",
|
||||
|
||||
@@ -62,8 +62,9 @@
|
||||
"CLEAR_NEW_FLAG_name": "Clear new flag",
|
||||
"DAYS_TO_KEEP_EVENTS_description": "This is a maintenance setting. This specifies the number of days worth of event entries that will be kept. All older events will be deleted periodically. Also applies on Plugin Events History.",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Delete events older than",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copy details from device",
|
||||
"DevDetail_Copy_Device_Title": "Copy details from device",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copy details from device from the dropdown list. Everything on this page will be overwritten",
|
||||
"DevDetail_DisplayFields_Title": "Display",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Alert Events",
|
||||
"DevDetail_EveandAl_AlertDown": "Alert Down",
|
||||
"DevDetail_EveandAl_Archived": "Archived",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Scan Device",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Don't Scan Device",
|
||||
"DevDetail_EveandAl_Skip": "Skip repeated notifications for",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Events & Alerts config",
|
||||
"DevDetail_EveandAl_Title": "Notifications config",
|
||||
"DevDetail_Events_CheckBox": "Hide Connection Events",
|
||||
"DevDetail_GoToNetworkNode": "Navigate to the Network page of the given node.",
|
||||
"DevDetail_Icon": "Icon",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Node (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "Site",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Network",
|
||||
"DevDetail_MainInfo_Network_Title": "Network",
|
||||
"DevDetail_MainInfo_Owner": "Owner",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Main Info",
|
||||
"DevDetail_MainInfo_Title": "Main Info",
|
||||
"DevDetail_MainInfo_Type": "Type",
|
||||
"DevDetail_MainInfo_Vendor": "Vendor",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Last Offline",
|
||||
"DevDetail_SessionInfo_StaticIP": "Static IP",
|
||||
"DevDetail_SessionInfo_Status": "Status",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Session Info",
|
||||
"DevDetail_SessionInfo_Title": "Session Info",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Additional info",
|
||||
"DevDetail_SessionTable_Connection": "Connection",
|
||||
"DevDetail_SessionTable_Disconnection": "Disconnection",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Are you sure you want to overwrite all icons of all devices with the same device type as the current device type?",
|
||||
"DevDetail_button_Reset": "Reset Changes",
|
||||
"DevDetail_button_Save": "Save",
|
||||
"DeviceEdit_ValidMacIp": "Enter a valid <b>Mac</b> and <b>IP</b> address.",
|
||||
"Device_MultiEdit": "Multi-edit",
|
||||
"Device_MultiEdit_Backup": "Careful, entering wrong values below will break your setup. Please backup your database or Devices configuration first (<a href=\"php/server/devices.php?action=ExportCSV\">click to download <i class=\"fa-solid fa-download fa-bounce\"></i></a>). Read how to recover Devices from this file in the <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">Backups documentation</a>.",
|
||||
"Device_MultiEdit_Fields": "Edit fields:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "GraphQL port",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "Add",
|
||||
"Gen_AddDevice": "Add Device",
|
||||
"Gen_Add_All": "Add all",
|
||||
"Gen_All_Devices": "All Devices",
|
||||
"Gen_AreYouSure": "Are you sure?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "ERROR - DB might be locked - Check F12 Dev tools -> Console or try later.",
|
||||
"Gen_Offline": "Offline",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "Online",
|
||||
"Gen_Purge": "Purge",
|
||||
"Gen_ReadDocs": "Read more in the docs.",
|
||||
"Gen_Remove_All": "Remove all",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Update Value",
|
||||
"Gen_Warning": "Warning",
|
||||
"Gen_Work_In_Progress": "Work in progress, good time to feedback on https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "Create dummy device",
|
||||
"General_display_name": "General",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "This is a maintenance setting <b>DELETING devices</b>. If enabled (<code>0</code> is disabled), devices marked as <b>New Device</b> will be deleted if their <b>First Session</b> time was older than the specified hours in this setting. Use this setting if you want to auto-delete <b>New Devices</b> after <code>X</code> hours.",
|
||||
@@ -576,7 +581,7 @@
|
||||
"REPORT_MAIL_description": "If enabled an email is sent out with a list of changes you have subscribed to. Please also fill out all remaining settings related to the SMTP setup below. If facing issues, set <code>LOG_LEVEL</code> to <code>debug</code> and check the <a href=\"/maintenance.php#tab_Logging\">error log</a>.",
|
||||
"REPORT_MAIL_name": "Enable email",
|
||||
"REPORT_TITLE": "Report",
|
||||
"RandomMAC_hover": "Autodetected - indicates if the device randomizes it's MAC address.",
|
||||
"RandomMAC_hover": "Autodetected - indicates if the device randomizes it's MAC address. You can exclude specific MACs with the UI_NOT_RANDOM_MAC setting. Click to find out more.",
|
||||
"Reports_Sent_Log": "Sent Reports Log",
|
||||
"SCAN_SUBNETS_description": "Most on-network scanners (ARP-SCAN, NMAP, NSLOOKUP, DIG) rely on scanning specific network interfaces and subnets. Check the <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">subnets documentation</a> for help on this setting, especially VLANs, what VLANs are supported, or how to figure out the network mask and your interface. <br/> <br/> An alternative to on-network scanners is to enable some other Device scanners/importers that don't rely on NetAlert<sup>X</sup> having access to the network (UNIFI, dhcp.leases, PiHole, etc.). <br/> <br/> Note: The scan time itself depends on the number of IP addresses to check, so set this up carefully with the appropriate network mask and interface.",
|
||||
"SCAN_SUBNETS_name": "Networks to scan",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Auto-refresh UI",
|
||||
"VERSION_description": "Version or timestamp helper value to check if app was upgraded.",
|
||||
"VERSION_name": "Version or timestamp",
|
||||
"add_icon_event_icon": "fa-square-plus",
|
||||
"add_icon_event_tooltip": "Add new icon",
|
||||
"add_option_event_icon": "fa-square-plus",
|
||||
"add_option_event_tooltip": "Add new value",
|
||||
"copy_icons_event_icon": "fa-copy",
|
||||
"copy_icons_event_tooltip": "Overwrite icons of all devices with the same device type",
|
||||
"devices_old": "Refreshing...",
|
||||
"general_event_description": "The event you have triggered might take a while until background processes finish. The execution ended once the below execution queue empties (Check the <a href='/maintenance.php#tab_Logging'>error log</a> if you encounter issues). <br/> <br/> Execution queue:",
|
||||
"general_event_title": "Executing an ad-hoc event",
|
||||
"go_to_node_event_icon": "fa-square-up-right",
|
||||
"go_to_node_event_tooltip": "Navigate to the Network page of the given node",
|
||||
"report_guid": "Notification guid:",
|
||||
"report_guid_missing": "Linked notification not found. There is a small delay between recently sent notifications and them being available. Referesh your page and cache after a few seconds. It's also possible the selected notification have been deleted during maintenance as specified in the <code>DBCLNP_NOTIFI_HIST</code> setting. <br/> <br/>The latest notification is displayed instead. The missing notification has the following GUID:",
|
||||
"report_select_format": "Select Format:",
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
"CLEAR_NEW_FLAG_name": "Eliminar la nueva bandera",
|
||||
"DAYS_TO_KEEP_EVENTS_description": "Esta es una configuración de mantenimiento. Esto especifica el número de días de entradas de eventos que se guardarán. Todos los eventos anteriores se eliminarán periódicamente.",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Eliminar eventos anteriores a",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copiar detalles del dispositivo",
|
||||
"DevDetail_Copy_Device_Title": "Copiar detalles del dispositivo",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copiar detalles del dispositivo de la lista desplegable. Todo en esta página se sobrescribirá",
|
||||
"DevDetail_DisplayFields_Title": "Mostrar",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Notificaciones de eventos",
|
||||
"DevDetail_EveandAl_AlertDown": "Alerta de caída",
|
||||
"DevDetail_EveandAl_Archived": "Archivada",
|
||||
@@ -84,7 +85,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Escanear Dispositivo",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "No Escanear Dispositivo",
|
||||
"DevDetail_EveandAl_Skip": "Omitir notificaciones repetidas durante",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Configuración de eventos y alertas",
|
||||
"DevDetail_EveandAl_Title": "Configuración de eventos y alertas",
|
||||
"DevDetail_Events_CheckBox": "Ocultar eventos de conexión",
|
||||
"DevDetail_GoToNetworkNode": "Navegar a la página de Internet del nodo seleccionado.",
|
||||
"DevDetail_Icon": "Icono",
|
||||
@@ -98,10 +99,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Nodo (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Puerto de Red HW",
|
||||
"DevDetail_MainInfo_Network_Site": "Lugar",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Red",
|
||||
"DevDetail_MainInfo_Network_Title": "Red",
|
||||
"DevDetail_MainInfo_Owner": "Propietario",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Información principal",
|
||||
"DevDetail_MainInfo_Title": "Información principal",
|
||||
"DevDetail_MainInfo_Type": "Tipo",
|
||||
"DevDetail_MainInfo_Vendor": "Proveedor",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -131,7 +132,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Última conexión",
|
||||
"DevDetail_SessionInfo_StaticIP": "IP estática",
|
||||
"DevDetail_SessionInfo_Status": "Estado",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Información de sesión",
|
||||
"DevDetail_SessionInfo_Title": "Información de sesión",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Información adicional",
|
||||
"DevDetail_SessionTable_Connection": "Conexión",
|
||||
"DevDetail_SessionTable_Disconnection": "Desconexión",
|
||||
@@ -194,6 +195,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "¿Sobreescribir todos los iconos de todos los dispositivos con el mismo tipo que el dispositivo actual?",
|
||||
"DevDetail_button_Reset": "Restablecer cambios",
|
||||
"DevDetail_button_Save": "Guardar",
|
||||
"DeviceEdit_ValidMacIp": "Introduzca una dirección <b>Mac</b> y una dirección <b>IP</b> válidas .",
|
||||
"Device_MultiEdit": "Edición múltiple",
|
||||
"Device_MultiEdit_Backup": "Tenga cuidado, ingresar valores incorrectos o romperá su configuración. Por favor, haga una copia de seguridad de su base de datos o de la configuración de los dispositivos primero (<a href=\"php/server/devices.php?action=ExportCSV\">haga clic para descargar <i class=\"fa-solid fa-download fa-bounce\"></i></a>). Lea cómo recuperar dispositivos de este archivo en la documentación de <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">Copia de seguridad</a>.",
|
||||
"Device_MultiEdit_Fields": "Editar campos:",
|
||||
@@ -288,6 +290,7 @@
|
||||
"GRAPHQL_PORT_name": "Puerto GraphQL",
|
||||
"Gen_Action": "Acción",
|
||||
"Gen_Add": "Añadir",
|
||||
"Gen_AddDevice": "Añadir dispositivo",
|
||||
"Gen_Add_All": "Añadir todo",
|
||||
"Gen_All_Devices": "Todo los dispositivos",
|
||||
"Gen_AreYouSure": "¿Estás seguro?",
|
||||
@@ -305,6 +308,7 @@
|
||||
"Gen_LockedDB": "Fallo - La base de datos puede estar bloqueada - Pulsa F1 -> Ajustes de desarrolladores -> Consola o prueba más tarde.",
|
||||
"Gen_Offline": "Desconectado",
|
||||
"Gen_Okay": "Aceptar",
|
||||
"Gen_Online": "En linea",
|
||||
"Gen_Purge": "Purgar",
|
||||
"Gen_ReadDocs": "Lee más en los documentos.",
|
||||
"Gen_Remove_All": "Quitar todo",
|
||||
@@ -323,6 +327,7 @@
|
||||
"Gen_Update_Value": "Actualizar valor",
|
||||
"Gen_Warning": "Advertencia",
|
||||
"Gen_Work_In_Progress": "Trabajo en curso, un buen momento para hacer comentarios en https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "Crear un dispositivo ficticio",
|
||||
"General_display_name": "General",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Se trata de una configuración de mantenimiento <b>BORRAR dispositivos</b>. Si está activado (<code>0</code> está desactivado), los dispositivos marcados como <b>Nuevo dispositivo</b> se eliminarán si su fecha de <b>primera sesión</b> es anterior a las horas especificadas en este ajuste. Use este ajuste si desea eliminar automáticamente <b>Nuevos dispositivos</b> después de <code>X</code> horas.",
|
||||
@@ -629,7 +634,7 @@
|
||||
"REPORT_TO_name": "Enviar el email a",
|
||||
"REPORT_WEBHOOK_description": "Habilite webhooks para notificaciones. Los webhooks lo ayudan a conectarse a muchas herramientas de terceros, como IFTTT, Zapier o <a href=\"https://n8n.io/\" target=\"_blank\">n8n</a>, por nombrar algunas. Consulte esta sencilla <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/WEBHOOK_N8N.md\" target=\"_blank\">guía de n8n aquí</a> para obtener comenzó. Si está habilitado, configure los ajustes relacionados a continuación.",
|
||||
"REPORT_WEBHOOK_name": "Habilitar webhooks",
|
||||
"RandomMAC_hover": "Autodetectado - indica si el dispositivo aleatoriza su dirección MAC.",
|
||||
"RandomMAC_hover": "Autodetectado: indica si el dispositivo aleatoriza su dirección MAC. Puede excluir direcciones MAC específicas con la configuración UI_NOT_RANDOM_MAC. Haga clic para obtener más información.",
|
||||
"Reports_Sent_Log": "Registro de informes enviados",
|
||||
"SCAN_SUBNETS_description": "La mayoría de los escáneres en red (ARP-SCAN, NMAP, NSLOOKUP, DIG) se basan en el escaneo de interfaces de red y subredes específicas. Consulte la <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentación sobre subredes</a> para obtener ayuda sobre esta configuración, especialmente VLANs, qué VLANs son compatibles, o cómo averiguar la máscara de red y su interfaz. <br/> <br/>Una alternativa a los escáneres en red es habilitar algunos otros escáneres/importadores de dispositivos que no dependen de que NetAlert<sup>X</sup> tenga acceso a la red (UNIFI, dhcp.leases, PiHole, etc.). <br/> <br/> Nota: El tiempo de escaneo en sí depende del número de direcciones IP a comprobar, así que configure esto cuidadosamente con la máscara de red y la interfaz adecuadas.",
|
||||
"SCAN_SUBNETS_name": "Subredes para escanear",
|
||||
@@ -760,9 +765,17 @@
|
||||
"Webhooks_display_name": "Webhooks",
|
||||
"Webhooks_icon": "<i class=\"fa fa-circle-nodes\"></i>",
|
||||
"Webhooks_settings_group": "<i class=\"fa fa-circle-nodes\"></i> Webhooks",
|
||||
"add_icon_event_icon": "fa-square-plus",
|
||||
"add_icon_event_tooltip": "Agregar nuevo icono",
|
||||
"add_option_event_icon": "fa-square-plus",
|
||||
"add_option_event_tooltip": "Añadir nuevo valor",
|
||||
"copy_icons_event_icon": "fa-copy",
|
||||
"copy_icons_event_tooltip": "Sobrescribir los iconos de todos los dispositivos con el mismo tipo de dispositivo",
|
||||
"devices_old": "Volviendo a actualizar....",
|
||||
"general_event_description": "El evento que ha activado puede tardar un poco hasta que finalicen los procesos en segundo plano. La ejecución finalizó una vez que se vacía la cola de ejecución a continuación (consulte el <a href='/maintenance.php#tab_Logging'>registro de errores</a> si encuentra problemas). <br/> <br/> Cola de ejecución:",
|
||||
"general_event_title": "Ejecutar un evento ad-hoc",
|
||||
"go_to_node_event_icon": "fa-square-up-right",
|
||||
"go_to_node_event_tooltip": "Vaya a la página de Red del nodo indicado",
|
||||
"report_guid": "Guía de las notificaciones:",
|
||||
"report_guid_missing": "No se ha encontrado la notificación vinculada. Hay un pequeño retraso entre las notificaciones enviadas recientemente y su disponibilidad. Actualiza tu página y la caché después de unos segundos. También es posible que la notificación seleccionada se haya eliminado durante el mantenimiento, tal y como se especifica en la configuración <code>de DBCLNP_NOTIFI_HIST</code>. <br/> <br/>En su lugar, se muestra la notificación más reciente. La notificación que falta tiene el siguiente GUID:",
|
||||
"report_select_format": "Selecciona el formato:",
|
||||
|
||||
27
front/php/templates/language/fr_fr.json
Normal file → Executable file
27
front/php/templates/language/fr_fr.json
Normal file → Executable file
@@ -29,7 +29,7 @@
|
||||
"BackDevDetail_Actions_Ask_Run": "Voulez-vous exécuter cette action ?",
|
||||
"BackDevDetail_Actions_Not_Registered": "Action non enregistrée : ",
|
||||
"BackDevDetail_Actions_Title_Run": "Lancer l'action",
|
||||
"BackDevDetail_Copy_Ask": "Copier les détails des objets sélectionnés dans la liste (tout ce qui est présent sur cette page sera remplacé) ?",
|
||||
"BackDevDetail_Copy_Ask": "Copier les détails de l'appareil depuis la liste (tout ce qui est présent sur cette page sera remplacé) ?",
|
||||
"BackDevDetail_Copy_Title": "Copier les détails",
|
||||
"BackDevDetail_Tools_WOL_error": "Cette commande N'A PAS été exécutée.",
|
||||
"BackDevDetail_Tools_WOL_okay": "Commande exécutée.",
|
||||
@@ -62,8 +62,9 @@
|
||||
"CLEAR_NEW_FLAG_name": "Supprime le nouveau drapeau",
|
||||
"DAYS_TO_KEEP_EVENTS_description": "Il s'agit d'un paramètre de maintenance. Il indique le nombre de jours pendant lesquels les entrées d'événements seront conservées. Tous les événements plus anciens seront supprimés périodiquement. S'applique également à l'historique des événements du plugin.",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Supprimer les événements plus anciens que",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copier les détails de l'appareil",
|
||||
"DevDetail_Copy_Device_Title": "Copier les détails de l'appareil",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copier les détails de l'appareil dans la liste déroulante. Tout ce qui se trouve sur cette page sera remplacé",
|
||||
"DevDetail_DisplayFields_Title": "Afficher",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Alerter les événements",
|
||||
"DevDetail_EveandAl_AlertDown": "Alerte de panne",
|
||||
"DevDetail_EveandAl_Archived": "Archivés",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Scanner l'appareil",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Ne pas scanner l'appareil",
|
||||
"DevDetail_EveandAl_Skip": "Passer les notifications répétées durant",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Configuration des événements & Alertes",
|
||||
"DevDetail_EveandAl_Title": "Configuration des événements & Alertes",
|
||||
"DevDetail_Events_CheckBox": "Masquer les événements de connexion",
|
||||
"DevDetail_GoToNetworkNode": "Naviguer à la page Réseau pour le nœud sélectionné.",
|
||||
"DevDetail_Icon": "Icône",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Nœud (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "Site",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Réseau",
|
||||
"DevDetail_MainInfo_Network_Title": "Réseau",
|
||||
"DevDetail_MainInfo_Owner": "Possesseur",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Informations principales",
|
||||
"DevDetail_MainInfo_Title": "Informations principales",
|
||||
"DevDetail_MainInfo_Type": "Type",
|
||||
"DevDetail_MainInfo_Vendor": "Fabricant",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Hors ligne depuis",
|
||||
"DevDetail_SessionInfo_StaticIP": "IP statique",
|
||||
"DevDetail_SessionInfo_Status": "État",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Info de session",
|
||||
"DevDetail_SessionInfo_Title": "Info de session",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Informations supplémentaires",
|
||||
"DevDetail_SessionTable_Connection": "Connexion",
|
||||
"DevDetail_SessionTable_Disconnection": "Déconnexion",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Êtes-vous sûr de vouloir remplacer toutes les icônes de tous les appareils du même type que l'appareil actuel ?",
|
||||
"DevDetail_button_Reset": "Réinitialiser les modifications",
|
||||
"DevDetail_button_Save": "Enregistrer",
|
||||
"DeviceEdit_ValidMacIp": "Renseigner une adresse <b>Mac</b> et une adresse <b>IP</b> valides.",
|
||||
"Device_MultiEdit": "Édition multiple",
|
||||
"Device_MultiEdit_Backup": "Attention, renseigner des valeurs non cohérentes ci-dessous peut bloquer votre paramétrage. Veillez à faire une sauvegarde de votre base de données ou de la configuration de vos appareils en premier lieu (<a href=\"php/server/devices.php?action=ExportCSV\">clisuer ici pour la télécharger <i class=\"fa-solid fa-download fa-bounce\"></i></a>). Renseignez-vous sur comment remettre les appareils depuis ce fichier via la <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">documentation des sauvegardes</a>.",
|
||||
"Device_MultiEdit_Fields": "Champs modifiables :",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "Port GraphQL",
|
||||
"Gen_Action": "Action",
|
||||
"Gen_Add": "Ajouter",
|
||||
"Gen_AddDevice": "Ajouter un appareil",
|
||||
"Gen_Add_All": "Ajouter tous",
|
||||
"Gen_All_Devices": "Tous les appareils",
|
||||
"Gen_AreYouSure": "Êtes-vous sûr ?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "Erreur - La base de données est peut-être verrouillée - Vérifier avec les outils de dév via F12 -> Console ou essayer plus tard.",
|
||||
"Gen_Offline": "Hors ligne",
|
||||
"Gen_Okay": "OK",
|
||||
"Gen_Online": "En ligne",
|
||||
"Gen_Purge": "Purger",
|
||||
"Gen_ReadDocs": "Plus d'infos dans la documentation.",
|
||||
"Gen_Remove_All": "Enlever tous",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Valeur à mettre à jour",
|
||||
"Gen_Warning": "Avertissement",
|
||||
"Gen_Work_In_Progress": "Travaux en cours, c'est le bon moment pour faire un retour via la liste d'anomalies sur Github https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "Créer un appareil fictif",
|
||||
"General_display_name": "Général",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Paramètre de maintenance. S'il est activé (<code>0</code> s'il est désactivé), les appareils marqués comme <b>Nouvel appareil</b> seront supprimés si leur durée depuis la <b>première session</b> est plus ancienne que le nombre d'heures paramétré. Utilisez ce paramétrage si vous voulez supprimer automatiquement les <b>Nouveaux appareils</b> après <code>X</code> heures.",
|
||||
@@ -576,7 +581,7 @@
|
||||
"REPORT_MAIL_description": "Si activé, un courriel est envoyé, avec la liste des changements pour lesquels on a souscrit. Cela nécessite de renseigner les paramètres associés au paramétrage SMTP plus bas. Si vous rencontrez des problèmes, positionnez le <code>LOG_LEVEL</code> au niveau <code>debug</code> et vérifiez les <a href=\"/maintenance.php#tab_Logging\">journaux d'erreurs</a>.",
|
||||
"REPORT_MAIL_name": "Activer les courriels",
|
||||
"REPORT_TITLE": "Rapport",
|
||||
"RandomMAC_hover": "Détecté automatiquement - indique si l'appareil dispose d'une adresse MAC générée aléatoirement.",
|
||||
"RandomMAC_hover": "Détecté automatiquement - indique si l'appareil dispose d'une adresse MAC générée aléatoirement. Vous pouvez exclure des adresses MAC spécifiques via le paramètre UI_NOT_RANDOM_MAC. Cliquez pour plus d'informations.",
|
||||
"Reports_Sent_Log": "Rapports de log transmis",
|
||||
"SCAN_SUBNETS_description": "La plupart des scanners sur le réseau (scan ARP, NMAP, Nslookup, DIG) se base sur le scan d'une partie spécifique des interfaces réseau ou de sous-réseau. Consulter la <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentation des sous-réseaux</a> pour plus d'aide sur ce paramètre, notamment pour des VLAN, lesquels sont supportés ou sur comment identifier le masque réseau et votre interface réseau. <br/> <br/> Une alternative à ces scanner sur le réseau et d'activer d'autres scanners d'appareils ou des importe, qui ne dépendent pas du fait de laisser NetAlert<sup>X</sup> accéder au réseau (Unifié, baux DHCP, Pi-hole, etc.).<br/><br/> Remarque : la durée du scan en lui-même dépend du nombre d'adresses IP à scanner, renseignez donc soigneusement avec le bon masque réseau et la bonne interface réseau.",
|
||||
"SCAN_SUBNETS_name": "Réseaux à scanner",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Rafraîchir automatiquement l'interface graphique",
|
||||
"VERSION_description": "Valeur de la version ou du timestamp d'aide à vérifier si l'application a été mise à jour.",
|
||||
"VERSION_name": "Version ou Timestamp",
|
||||
"add_icon_event_icon": "fa-square-plus",
|
||||
"add_icon_event_tooltip": "Ajouter une nouvelle icône",
|
||||
"add_option_event_icon": "fa-square-plus",
|
||||
"add_option_event_tooltip": "Ajouter une nouvelle valeur",
|
||||
"copy_icons_event_icon": "fa-copy",
|
||||
"copy_icons_event_tooltip": "Remplace les icônes de tous les appareils du même type",
|
||||
"devices_old": "Rafraichissement...",
|
||||
"general_event_description": "L'événement que vous avez lancé peut prendre du temps avant que les tâches de fond ne soit terminées. La durée d'exécution finira une fois que la file d'exécution ci-dessous sera vide (consulter les <a href='/maintenance.php#tab_Logging'>journaux d'erreur</a> si vous rencontrez des erreurs). <br/> <br/> File d'exécution :",
|
||||
"general_event_title": "Lancement d'un événement sur mesure",
|
||||
"go_to_node_event_icon": "fa-square-up-right",
|
||||
"go_to_node_event_tooltip": "Aller vers la page Réseau du nœud concerné",
|
||||
"report_guid": "GUID de la notification :",
|
||||
"report_guid_missing": "La notification associée n'a pas été trouvée. Un petit délai existe entre l'envoi d'une notification et sa disponibilité réelle pour affichage. Rafraichissez la page et votre cache après quelques secondes. Il est aussi possible que la notification sélectionnée ait été supprimée durant une opération de maintenance, comme renseigné dans le paramètre <code>DBCLNP_NOTIFI_HIST</code>. <br/> <br/> La dernière notification est affichée à sa place. La notification manquante dispose du GUID suivant :",
|
||||
"report_select_format": "Sélectionner un format :",
|
||||
|
||||
@@ -62,8 +62,9 @@
|
||||
"CLEAR_NEW_FLAG_name": "Cancella nuova bandiera",
|
||||
"DAYS_TO_KEEP_EVENTS_description": "Questa è un'impostazione di manutenzione. Specifica il numero di giorni delle voci degli eventi che verranno conservati. Tutti gli eventi più vecchi verranno eliminati periodicamente. Si applica anche alla cronologia degli eventi del plugin (Plugin Events History).",
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Elimina eventi più vecchi di",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copia dettagli dal dispositivo",
|
||||
"DevDetail_Copy_Device_Title": "Copia dettagli dal dispositivo",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copia i dettagli dal dispositivo dall'elenco a discesa. Tutto in questa pagina verrà sovrascritto",
|
||||
"DevDetail_DisplayFields_Title": "Visualizza",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Notifica eventi",
|
||||
"DevDetail_EveandAl_AlertDown": "Avviso disconnessione",
|
||||
"DevDetail_EveandAl_Archived": "Archiviato",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Scansiona dispositivo",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Non scansionare dispositivo",
|
||||
"DevDetail_EveandAl_Skip": "Salta notifiche ripetute per",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Configurazione Eventi e avvisi",
|
||||
"DevDetail_EveandAl_Title": "Configurazione Eventi e avvisi",
|
||||
"DevDetail_Events_CheckBox": "Nascondi eventi di connessione",
|
||||
"DevDetail_GoToNetworkNode": "Passa alla pagina Rete del nodo specificato.",
|
||||
"DevDetail_Icon": "Icona",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Nodo (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Porta",
|
||||
"DevDetail_MainInfo_Network_Site": "Sito",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Rete",
|
||||
"DevDetail_MainInfo_Network_Title": "Rete",
|
||||
"DevDetail_MainInfo_Owner": "Proprietario",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Informazioni principali",
|
||||
"DevDetail_MainInfo_Title": "Informazioni principali",
|
||||
"DevDetail_MainInfo_Type": "Tipo",
|
||||
"DevDetail_MainInfo_Vendor": "Produttore",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Ultimo offline",
|
||||
"DevDetail_SessionInfo_StaticIP": "IP statico",
|
||||
"DevDetail_SessionInfo_Status": "Stato",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Info sessione",
|
||||
"DevDetail_SessionInfo_Title": "Info sessione",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Info aggiuntive",
|
||||
"DevDetail_SessionTable_Connection": "Connessione",
|
||||
"DevDetail_SessionTable_Disconnection": "Disconnessione",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Sei sicuro di voler sovrascrivere tutte le icone di tutti i dispositivi con lo stesso tipo di dispositivo come l'attuale tipo di dispositivo?",
|
||||
"DevDetail_button_Reset": "Reimposta modifiche",
|
||||
"DevDetail_button_Save": "Salva",
|
||||
"DeviceEdit_ValidMacIp": "Inserisci un indirizzo <b>Mac</b> e un indirizzo <b>IP</b> validi.",
|
||||
"Device_MultiEdit": "Modifica multipla",
|
||||
"Device_MultiEdit_Backup": "Attento, l'inserimento di valori errati di seguito interromperà la configurazione. Effettua prima il backup del database o della configurazione dei dispositivi (<a href=\"php/server/devices.php?action=ExportCSV\">fai clic per scaricare <i class=\"fa-solid fa-download fa-bounce\"></i> </a>). Leggi come ripristinare i dispositivi da questo file nella <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\" _blank\">Documentazione di backup</a>.",
|
||||
"Device_MultiEdit_Fields": "Modifica campi:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "Porta GraphQL",
|
||||
"Gen_Action": "Azione",
|
||||
"Gen_Add": "Aggiungi",
|
||||
"Gen_AddDevice": "Aggiungi dispositivo",
|
||||
"Gen_Add_All": "Aggiungi tutti",
|
||||
"Gen_All_Devices": "Tutti i dispositivi",
|
||||
"Gen_AreYouSure": "Sei sicuro?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "ERRORE: il DB potrebbe essere bloccato, controlla F12 Strumenti di sviluppo -> Console o riprova più tardi.",
|
||||
"Gen_Offline": "Offline",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "Online",
|
||||
"Gen_Purge": "Svuota",
|
||||
"Gen_ReadDocs": "Maggiori informazioni nella documentazione.",
|
||||
"Gen_Remove_All": "Rimuovi tutti",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Aggiorna valore",
|
||||
"Gen_Warning": "Avviso",
|
||||
"Gen_Work_In_Progress": "Lavori in corso, è quindi un buon momento per un feedback su https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "Crea dispositivo fittizio",
|
||||
"General_display_name": "Generale",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Questa è un'impostazione di manutenzione <b>ELIMINAZIONE dispositivi</b>. Se abilitata (<code>0</code> è disabilitata), tutti i dispositivi marcati con <b>Nuovo dispositivo</b> verranno eliminati se l'orario della <b>Prima sessione</b> è precedente all'orario di questa impostazione. Usa questa impostazione se vuoi eliminare automaticamente i <b>Nuovi dispositivi</b> dopo <code>X</code> ore.",
|
||||
@@ -576,7 +581,7 @@
|
||||
"REPORT_MAIL_description": "Se abilitato, viene inviata un'e-mail con un elenco delle modifiche a cui sei iscritto. Compila anche tutte le restanti impostazioni relative alla configurazione SMTP. In caso di problemi, imposta <code>LOG_LEVEL</code> su <code>debug</code> e controlla il <a href=\"/maintenance.php#tab_Logging\">log degli errori</a>.",
|
||||
"REPORT_MAIL_name": "Abilita e-mail",
|
||||
"REPORT_TITLE": "Rapporto",
|
||||
"RandomMAC_hover": "Rilevato automaticamente: indica se il dispositivo genera il suo indirizzo MAC casualmente.",
|
||||
"RandomMAC_hover": "Rilevato automaticamente: indica se il dispositivo genera casualmente il suo indirizzo MAC. Puoi escludere MAC specifici con l'impostazione UI_NOT_RANDOM_MAC. Fai clic per saperne di più.",
|
||||
"Reports_Sent_Log": "Log rapporti inviati",
|
||||
"SCAN_SUBNETS_description": "La maggior parte degli scanner di rete (ARP-SCAN, NMAP, NSLOOKUP, DIG) si basano sulla scansione di interfacce di rete e sottoreti specifiche. Consulta la <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md\" target=\"_blank\">documentazione sulle sottoreti</a> per assistenza su questa impostazione, in particolare VLAN, quali VLAN sono supportate o come individuare la maschera di rete e l'interfaccia. <br/> <br/> Un'alternativa agli scanner in rete è abilitare altri scanner/importatori di dispositivi che non si affidano a NetAlert<sup>X</sup> che hanno accesso alla rete (UNIFI, dhcp.leases , PiHole, ecc.). <br/> <br/> Nota: il tempo di scansione stesso dipende dal numero di indirizzi IP da controllare, quindi impostalo attentamente con la maschera di rete e l'interfaccia appropriate.",
|
||||
"SCAN_SUBNETS_name": "Reti da scansionare",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Aggiorna automaticamente la UI",
|
||||
"VERSION_description": "Valore di supporto della versione o della marca temporale per verificare se l'app è stata aggiornata.",
|
||||
"VERSION_name": "Versione o marca temporale",
|
||||
"add_icon_event_icon": "fa-square-plus",
|
||||
"add_icon_event_tooltip": "Aggiungi nuova icona",
|
||||
"add_option_event_icon": "fa-square-plus",
|
||||
"add_option_event_tooltip": "Aggiungi nuovo valore",
|
||||
"copy_icons_event_icon": "fa-copy",
|
||||
"copy_icons_event_tooltip": "Sovrascrivi le icone di tutti i dispositivi con lo stesso tipo di dispositivo",
|
||||
"devices_old": "Aggiornamento...",
|
||||
"general_event_description": "L'evento che hai attivato potrebbe richiedere del tempo prima che i processi in background vengano completati. L'esecuzione è terminata una volta che la coda di esecuzione sottostante si è svuotata (controlla il <a href='/maintenance.php#tab_Logging'>log degli errori</a> se riscontri problemi). <br/> <br/> Coda di esecuzione:",
|
||||
"general_event_title": "Esecuzione di un evento ad-hoc",
|
||||
"go_to_node_event_icon": "fa-square-up-right",
|
||||
"go_to_node_event_tooltip": "Passa alla pagina Rete del nodo specificato",
|
||||
"report_guid": "GUID notifica:",
|
||||
"report_guid_missing": "Notifica collegata non trovata. C'è un piccolo ritardo tra la disponibilità delle notifiche inviate di recente e la loro disponibilità. Aggiorna la pagina e la cache dopo alcuni secondi. È anche possibile che la notifica selezionata sia stata eliminata durante la manutenzione come specificato nell'impostazione <code>DBCLNP_NOTIFI_HIST</code>. <br/> <br/>Viene invece visualizzata l'ultima notifica. La notifica mancante ha il seguente GUID:",
|
||||
"report_select_format": "Seleziona formato:",
|
||||
|
||||
@@ -12,7 +12,7 @@ global $db;
|
||||
|
||||
$result = $db->querySingle("SELECT setValue FROM Settings WHERE setKey = 'UI_LANG'");
|
||||
|
||||
// below has to match exactly teh values in /front/php/templates/language/lang.php & /front/js/common.js
|
||||
// below has to match exactly the values in /front/php/templates/language/lang.php & /front/js/common.js
|
||||
switch($result){
|
||||
case 'Spanish': $pia_lang_selected = 'es_es'; break;
|
||||
case 'German': $pia_lang_selected = 'de_de'; break;
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Slett hendelser eldre enn",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Kopier detaljer fra enhet",
|
||||
"DevDetail_Copy_Device_Tooltip": "Kopier detaljer fra enheten via nedtrekks menyen. Alt på denne siden vil bli overskrevet",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Varsel Alle Hendelser",
|
||||
"DevDetail_EveandAl_AlertDown": "Varsel Nede",
|
||||
"DevDetail_EveandAl_Archived": "Arkivert",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Skann Enhet",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Don't Skann Enhet",
|
||||
"DevDetail_EveandAl_Skip": "Hopp over gjentatte varsler for",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Hendelse og Varslings konfigurasjon",
|
||||
"DevDetail_EveandAl_Title": "Hendelse og Varslings konfigurasjon",
|
||||
"DevDetail_Events_CheckBox": "Skjul Tilkoblingshendelser",
|
||||
"DevDetail_GoToNetworkNode": "Naviger til Nettverkssiden på noden.",
|
||||
"DevDetail_Icon": "Ikon",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Node (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Nettverk",
|
||||
"DevDetail_MainInfo_Network_Title": "Nettverk",
|
||||
"DevDetail_MainInfo_Owner": "Eier",
|
||||
"DevDetail_MainInfo_SSID": "",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Hovedinfo",
|
||||
"DevDetail_MainInfo_Title": "Hovedinfo",
|
||||
"DevDetail_MainInfo_Type": "Type",
|
||||
"DevDetail_MainInfo_Vendor": "Leverandør",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Siste Sesjon",
|
||||
"DevDetail_SessionInfo_StaticIP": "Statisk IP",
|
||||
"DevDetail_SessionInfo_Status": "Status",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Sesjonsinformasjon",
|
||||
"DevDetail_SessionInfo_Title": "Sesjonsinformasjon",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Tilleggsinformasjon",
|
||||
"DevDetail_SessionTable_Connection": "Koble til",
|
||||
"DevDetail_SessionTable_Disconnection": "Koble fra",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Er du sikker på at du vil overskrive alle ikonene på alle enheter med samme enhetstype som gjeldende enhetstype?",
|
||||
"DevDetail_button_Reset": "Tilbakestill endringer",
|
||||
"DevDetail_button_Save": "Lagre",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "Multiredigering",
|
||||
"Device_MultiEdit_Backup": "Forsiktig, hvis du legger inn feil verdier nedenfor, vil oppsettet ditt ødelegges. Ta sikkerhetskopi av databasen eller enhetskonfigurasjonen først (<a href=\"php/server/devices.php?action=ExportCSV\">klikk for å laste ned <i class=\"fa-solid fa-download fa-bounce\"></i> </a>). Les hvordan du gjenoppretter enheter fra denne filen i <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">Sikkerhetskopierings dokumentasjon</a>.",
|
||||
"Device_MultiEdit_Fields": "Rediger felt:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "Handling",
|
||||
"Gen_Add": "Legg til",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "Legg til alle",
|
||||
"Gen_All_Devices": "",
|
||||
"Gen_AreYouSure": "Er du sikker?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "FEIL - DB kan være låst - Sjekk F12 Dev tools -> Konsoll eller prøv senere.",
|
||||
"Gen_Offline": "Frakoblet",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "Rensing",
|
||||
"Gen_ReadDocs": "Les mer i dokumentasjonen.",
|
||||
"Gen_Remove_All": "Fjern alle",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Oppdater verdi",
|
||||
"Gen_Warning": "Advarsel",
|
||||
"Gen_Work_In_Progress": "Work in progress, gjerne kom med tilbakemeldinger på https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Generelt",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Dette er en vedlikeholdsinnstilling. Hvis aktivert (<code>0</code> er deaktivert), vil enheter merket som <b>Ny Enhet</b> bli slettet hvis tiden deres for <b>Første økt</b> var eldre enn de angitte timene i denne innstilling. Bruk denne innstillingen hvis du vil automatisk slette <b>Nye Enheter</b> etter <code>X</code> timer.",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Oppdater UI automatisk",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "Oppdaterer...",
|
||||
"general_event_description": "Hendelsen du har utløst kan ta en stund til før bakgrunnsprosesser er ferdig. Utførelsen ble avsluttet når utførelseskøen nedenfor tømmes (sjekk <a href='/maintenance.php#tab_Logging'>Feillogg</a> Hvis du møter problemer). <br/> <br/> Utførelseskø:",
|
||||
"general_event_title": "Utfører en ad-hoc hendelse",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "Notifikasjons GUID:",
|
||||
"report_guid_missing": "Koblet notifikasjon ikke funnet. Det er en liten forsinkelse mellom nylig sendt notifikasjoner og at de er tilgjengelige. Oppdater siden din og hurtigbufferen etter noen sekunder. Det er også mulig den valgte notifikasjonen er slettet under vedlikehold som spesifisert i <code>DBCLNP_NOTIFI_HIST</code> innstillingen. <br/> <br/> Den siste notifikasjonen vises i stedet. Den manglende notifikasjonen har følgende GUID:",
|
||||
"report_select_format": "Velg format:",
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Usuń wydarzenia starsze niż",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i>Kopiuj opis z urządzenia",
|
||||
"DevDetail_Copy_Device_Tooltip": "Kopiuj opis z urządzenia z listy rozwijanej. Wszystko na tej stronie zostanie nadpisane",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Powiadamiaj o wszystkich wydarzeniach",
|
||||
"DevDetail_EveandAl_AlertDown": "Wyłącz powiadomienia",
|
||||
"DevDetail_EveandAl_Archived": "Zarchiwizowane",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Skanuj Urządzenie",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Nie skanuj Urządzenia",
|
||||
"DevDetail_EveandAl_Skip": "Pomiń powtarzające się powiadomienia przez",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Konfiguracja powiadomień i alertów",
|
||||
"DevDetail_EveandAl_Title": "Konfiguracja powiadomień i alertów",
|
||||
"DevDetail_Events_CheckBox": "Ukryj wydarzenia połączeń",
|
||||
"DevDetail_GoToNetworkNode": "Przenieś do strony Sieć danego węzła.",
|
||||
"DevDetail_Icon": "Ikona",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Węzeł (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Port",
|
||||
"DevDetail_MainInfo_Network_Site": "Lokalizacja",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Sieć",
|
||||
"DevDetail_MainInfo_Network_Title": "Sieć",
|
||||
"DevDetail_MainInfo_Owner": "Właściciel",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Główne informacje",
|
||||
"DevDetail_MainInfo_Title": "Główne informacje",
|
||||
"DevDetail_MainInfo_Type": "Typ",
|
||||
"DevDetail_MainInfo_Vendor": "Dostawca",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Czy na pewno chcesz nadpisać wszystkie ikony dla urządzeń o tym samym typie co to urządzenie?",
|
||||
"DevDetail_button_Reset": "Zresetuj Zmiany",
|
||||
"DevDetail_button_Save": "Zapisz",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "Multi-edycja",
|
||||
"Device_MultiEdit_Backup": "Ostrożnie, wprowadzenie błędnych wartości poniżej może zepsuć konfiguracje. Najpierw wykonaj kopie zapasową bazy danych lub konfiguracji Urządzeń (<a href=\"php/server/devices.php?action=ExportCSV\">kliknij aby pobrać<i class=\"fa-solid fa-download fa-bounce\"></i></a>). Przeczytaj jak odzyskać Urządzenia z tego pliku w <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">Dokumentacji Kopii Zapasowej</a>.",
|
||||
"Device_MultiEdit_Fields": "Edytuj pola:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "Akcja",
|
||||
"Gen_Add": "Dodaj",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "Dodaj wszystko",
|
||||
"Gen_All_Devices": "Wszystkie urządzenia",
|
||||
"Gen_AreYouSure": "Jesteś pewien?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "BŁĄD - BAZA DANYCH może być zablokowana - Sprawdź F12 narzędzia dewelopera -> Konsola lub spróbuj ponownie później.",
|
||||
"Gen_Offline": "Wyłączone",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "Wyczyść",
|
||||
"Gen_ReadDocs": "Przeczytaj więcej w dokumentacji.",
|
||||
"Gen_Remove_All": "Usuń wszystko",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Aktualizuj Wartość",
|
||||
"Gen_Warning": "Uwaga",
|
||||
"Gen_Work_In_Progress": "Praca w toku, dobry czas na feedback https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Ogólne",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "To jest ustawienie konserwacyjne. Jeżeli uruchomione (<code>0</code> jest wyłączone), urządzenie oznaczone jako <b>Nowe Urządzenie</b> zostanie usunięte jeżeli czas <b>Pierwszej Sesji</b> jest starszy niż godzina podana w tym ustawieniu. Uzyj tego ustawienia jeżeli chcesz automatycznie usuwać <b>Nowe Urządzenia</b> po <code>X</code> godzinach.",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Automatycznie odświeżaj UI",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "Odświeżanie...",
|
||||
"general_event_description": "Wydarzenie które wyzwoliłeś może chwilę zająć dopóki procesy w tle nie zakończą się. Wykonanie zakończy się kiedy kolejka się opróżni (Sprawdź <a href='/maintenance.php#tab_Logging'>logi błędów</a> jeżeli napotkasz błędy).<br/><br/> Kolejka wykonywania:",
|
||||
"general_event_title": "Wykonywanie wydarzeń ad-hoc",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "Przewodnik powiadomień:",
|
||||
"report_guid_missing": "Linkowane powiadomienie nie znaleziono. Jest małe opóźnienie między wysłaniem powiadomienia a ich dostępnością. Odśwież stronę i cache za kilka sekund. Możliwe też że zaznaczone powiadomienie zostało usunięte podczas konserwacji tak jak określono w ustawieniu <code>DBCLNP_NOTIFI_HIST</code>. <br/><br/>Zamiast tego wyświetlane jest najnowsze powiadomienie. Brakujące powiadomienie ma następujące GUID:",
|
||||
"report_select_format": "Wybierz Format:",
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Excluir eventos mais antigos que",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Copiar detalhes do dispositivo",
|
||||
"DevDetail_Copy_Device_Tooltip": "Copiar detalhes do dispositivo a partir da lista pendente. Tudo o que se encontra nesta página será substituído",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Alerte Todos os Eventos",
|
||||
"DevDetail_EveandAl_AlertDown": "Alerta Desligado",
|
||||
"DevDetail_EveandAl_Archived": "Arquivado",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Rastrear Dispositivo",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Não Rastrear Dispositivo",
|
||||
"DevDetail_EveandAl_Skip": "Pular notificações repetidas para",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Configuração de Eventos & Alertas",
|
||||
"DevDetail_EveandAl_Title": "Configuração de Eventos & Alertas",
|
||||
"DevDetail_Events_CheckBox": "Esconder Eventos de Conexão",
|
||||
"DevDetail_GoToNetworkNode": "Navega para a página Rede do nó indicado.",
|
||||
"DevDetail_Icon": "Icone",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"> </i> Node (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i>Porta",
|
||||
"DevDetail_MainInfo_Network_Site": "Site",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Rede",
|
||||
"DevDetail_MainInfo_Network_Title": "Rede",
|
||||
"DevDetail_MainInfo_Owner": "Proprietário",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Informações principais",
|
||||
"DevDetail_MainInfo_Title": "Informações principais",
|
||||
"DevDetail_MainInfo_Type": "Tipo",
|
||||
"DevDetail_MainInfo_Vendor": "Vendedor",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Último offline",
|
||||
"DevDetail_SessionInfo_StaticIP": "IP estático",
|
||||
"DevDetail_SessionInfo_Status": "Estado",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Informações de Sessão",
|
||||
"DevDetail_SessionInfo_Title": "Informações de Sessão",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Informações adicionais",
|
||||
"DevDetail_SessionTable_Connection": "Conexão",
|
||||
"DevDetail_SessionTable_Disconnection": "Desconexão",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Tem certeza de que deseja substituir todos os ícones de todos os dispositivos pelo mesmo tipo de dispositivo do tipo de dispositivo atual?",
|
||||
"DevDetail_button_Reset": "Redefinir alterações",
|
||||
"DevDetail_button_Save": "Salvar",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "Edição múltipla",
|
||||
"Device_MultiEdit_Backup": "Cuidado, inserir valores errados abaixo interromperá sua configuração. Faça backup do seu banco de dados ou da configuração dos dispositivos primeiro (<a href=\"php/server/devices.php?action=ExportCSV\">clique para baixar <i class=\"fa-solid fa-download fa-bounce\"></i> </a>). Leia como recuperar dispositivos deste arquivo no <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\" _blank\">Documentação de backups</a>.",
|
||||
"Device_MultiEdit_Fields": "Editar campos:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "Ação",
|
||||
"Gen_Add": "Adicionar",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "Adicionar todos",
|
||||
"Gen_All_Devices": "Todos os Dispositivos",
|
||||
"Gen_AreYouSure": "Tem certeza?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "ERRO - O banco de dados pode estar bloqueado - Verifique F12 Ferramentas de desenvolvimento -> Console ou tente mais tarde.",
|
||||
"Gen_Offline": "Offline",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "Purge",
|
||||
"Gen_ReadDocs": "Leia mais em documentos.",
|
||||
"Gen_Remove_All": "Remover tudo",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Atualizar valor",
|
||||
"Gen_Warning": "Aviso",
|
||||
"Gen_Work_In_Progress": "Trabalho em andamento, um bom momento para enviar feedback em https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Geral",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Esta é uma configuração de manutenção. Se habilitada (<code>0</code> is disabled), dispositivos marcados como <b>Novo Dispositivo</b> serão excluídos se o tempo de <b>Primeira Sessão</b> for mais antigo que as horas especificadas nesta configuração. Use esta configuração se quiser excluir automaticamente <b>Novos Dispositivos</b> após <code>X</code> horas.",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "",
|
||||
"general_event_description": "",
|
||||
"general_event_title": "",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "",
|
||||
"report_guid_missing": "",
|
||||
"report_select_format": "",
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "Удалить события старше",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> Скопировать данные с устройства",
|
||||
"DevDetail_Copy_Device_Tooltip": "Скопируйте данные с устройства из раскрывающегося списка. Все на этой странице будет перезаписано",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "Оповещения о событиях",
|
||||
"DevDetail_EveandAl_AlertDown": "Оповещение о доступности",
|
||||
"DevDetail_EveandAl_Archived": "Архив",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "Сканировать Устройство",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "Не сканировать устройство",
|
||||
"DevDetail_EveandAl_Skip": "Пропустить повторные уведомления",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> Конфигурация событий и оповещений",
|
||||
"DevDetail_EveandAl_Title": "Конфигурация событий и оповещений",
|
||||
"DevDetail_Events_CheckBox": "Скрыть события подключения",
|
||||
"DevDetail_GoToNetworkNode": "Перейти на страницу Сеть данного узла.",
|
||||
"DevDetail_Icon": "Значок",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> Узел (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> Порт",
|
||||
"DevDetail_MainInfo_Network_Site": "Сайт",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> Сеть",
|
||||
"DevDetail_MainInfo_Network_Title": "Сеть",
|
||||
"DevDetail_MainInfo_Owner": "Владелец",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> Основное",
|
||||
"DevDetail_MainInfo_Title": "Основное",
|
||||
"DevDetail_MainInfo_Type": "Тип",
|
||||
"DevDetail_MainInfo_Vendor": "Поставщик",
|
||||
"DevDetail_MainInfo_mac": "MAC адрес",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "Последний оффлайн",
|
||||
"DevDetail_SessionInfo_StaticIP": "Статический IP",
|
||||
"DevDetail_SessionInfo_Status": "Статус",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Информация о сеансе",
|
||||
"DevDetail_SessionInfo_Title": "Информация о сеансе",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Дополнительная информация",
|
||||
"DevDetail_SessionTable_Connection": "Подключение",
|
||||
"DevDetail_SessionTable_Disconnection": "Отключение",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "Вы уверены, что хотите перезаписать все значки всех устройств с тем же типом устройства, что и текущий тип устройства?",
|
||||
"DevDetail_button_Reset": "Сбросить изменения",
|
||||
"DevDetail_button_Save": "Сохранить",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "Мультиредакт",
|
||||
"Device_MultiEdit_Backup": "Будьте осторожны: ввод неправильных значений ниже приведет к поломке вашей настройки. Сначала сделайте резервную копию базы данных или конфигурации устройств (<a href=\"php/server/devices.php?action=ExportCSV\">нажмите для загрузки <i class=\"fa-solid fa-download fa-bounce\"></i></a>). О том, как восстановить Устройства из этого файла, читайте в разделе <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">Документация о резервном копировании</a>.",
|
||||
"Device_MultiEdit_Fields": "Редактировать поля:",
|
||||
@@ -199,7 +201,7 @@
|
||||
"Device_Shortcut_Favorites": "Избранные",
|
||||
"Device_Shortcut_NewDevices": "Новые устройства",
|
||||
"Device_Shortcut_OnlineChart": "Присутствие устройств",
|
||||
"Device_TableHead_AlertDown": "",
|
||||
"Device_TableHead_AlertDown": "Оповещение о сост. ВЫКЛ",
|
||||
"Device_TableHead_Connected_Devices": "Соединения",
|
||||
"Device_TableHead_Favorite": "Избранное",
|
||||
"Device_TableHead_FirstSession": "Первый сеанс",
|
||||
@@ -217,7 +219,7 @@
|
||||
"Device_TableHead_Owner": "Владелец",
|
||||
"Device_TableHead_Parent_MAC": "MAC род. узла",
|
||||
"Device_TableHead_Port": "Порт",
|
||||
"Device_TableHead_PresentLastScan": "",
|
||||
"Device_TableHead_PresentLastScan": "Присутствие",
|
||||
"Device_TableHead_RowID": "ID строки",
|
||||
"Device_TableHead_Rowid": "ID строки",
|
||||
"Device_TableHead_SSID": "SSID",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "Порт GraphQL",
|
||||
"Gen_Action": "Действия",
|
||||
"Gen_Add": "Добавить",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "Добавить все",
|
||||
"Gen_All_Devices": "Все устройства",
|
||||
"Gen_AreYouSure": "Вы уверены?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "ОШИБКА - Возможно, база данных заблокирована. Проверьте инструменты разработчика F12 -> Консоль или повторите попытку позже.",
|
||||
"Gen_Offline": "Оффлайн",
|
||||
"Gen_Okay": "OK",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "Очистить",
|
||||
"Gen_ReadDocs": "Подробнее читайте в документации.",
|
||||
"Gen_Remove_All": "Удалить все",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "Обновить значение",
|
||||
"Gen_Warning": "Предупреждение",
|
||||
"Gen_Work_In_Progress": "Работа продолжается, самое время оставить отзыв на https://github.com/jokob-sk/NetAlertX/issues",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Главное",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "Это настройка обслуживания <b>УДАЛЕНИЕ устройств</b>. Если этот параметр включен (<code>0</code> отключен), устройства, помеченные как <b>Новое устройство</b>, будут удалены, если время их <b>Первого сеанса</b> было старше указанных в этой настройке часов. Используйте этот параметр, если вы хотите автоматически удалять <b>Новые устройства</b> через <code>X</code> часов.",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "Автоматическое обновление интерфейса",
|
||||
"VERSION_description": "Вспомогательное значение версии или метки времени, позволяющее проверить, было ли приложение обновлено.",
|
||||
"VERSION_name": "Версия или временная метка",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "Актуализируется...",
|
||||
"general_event_description": "Событие, которое вы инициировали, может занять некоторое время, прежде чем фоновые процессы завершатся. Выполнение завершится, как только очередь выполнения, указанная ниже, опустеет (Проверьте <a href='/maintenance.php#tab_Logging'>журнал ошибок</a> при возникновении проблем). <br/> <br/>· · Очередь выполнения:",
|
||||
"general_event_title": "Выполнение специального события",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "Идентификатор уведомления:",
|
||||
"report_guid_missing": "Связанное уведомление не найдено. Между недавно отправленными уведомлениями и их доступностью существует небольшая задержка. Обновите страницу и кэшируйте ее через несколько секунд. Также возможно, что выбранное уведомление было удалено во время обслуживания, как указано в настройке <code>DBCLNP_NOTIFI_HIST</code>. <br/> <br/>Вместо этого отображается последнее уведомление. Отсутствующее уведомление имеет следующий GUID:",
|
||||
"report_select_format": "Выбрать формат:",
|
||||
@@ -711,7 +724,7 @@
|
||||
"settings_publishers_icon": "fa-solid fa-paper-plane",
|
||||
"settings_publishers_info": "Загрузите больше нотификаторов с помощью настройки <a href=\"/settings.php#LOADED_PLUGINS\">LOADED_PLUGINS</a>",
|
||||
"settings_publishers_label": "Уведомления",
|
||||
"settings_readonly": "",
|
||||
"settings_readonly": "Невозможно ПРОЧИТАТЬ или ЗАПИСАТЬ <code>app.conf</code>. Попробуйте перезапустить контейнер и прочитать <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/FILE_PERMISSIONS.md\" target=\"_blank\">документацию по разрешениям файлов</a>",
|
||||
"settings_saved": "<br/>Настройки сохранены. <br/> Перезагрузка... <br/><i class=\"ion ion-ios-loop-strong fa-spin fa-2x fa-fw\"></i> <br/>",
|
||||
"settings_system_icon": "fa-solid fa-gear",
|
||||
"settings_system_label": "Система",
|
||||
|
||||
15
front/php/templates/language/tr_tr.json
Normal file → Executable file
15
front/php/templates/language/tr_tr.json
Normal file → Executable file
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "",
|
||||
"DevDetail_Copy_Device_Title": "",
|
||||
"DevDetail_Copy_Device_Tooltip": "",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "",
|
||||
"DevDetail_EveandAl_AlertDown": "",
|
||||
"DevDetail_EveandAl_Archived": "",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "",
|
||||
"DevDetail_SessionInfo_StaticIP": "",
|
||||
"DevDetail_SessionInfo_Status": "Durum",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> Oturum Bİlgisi",
|
||||
"DevDetail_SessionInfo_Title": "Oturum Bİlgisi",
|
||||
"DevDetail_SessionTable_Additionalinfo": "Ek bilgi",
|
||||
"DevDetail_SessionTable_Connection": "Bağlantı",
|
||||
"DevDetail_SessionTable_Disconnection": "",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "",
|
||||
"DevDetail_button_Reset": "Değişiklikleri Sıfırla",
|
||||
"DevDetail_button_Save": "Kaydet",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "",
|
||||
"Device_MultiEdit_Backup": "",
|
||||
"Device_MultiEdit_Fields": "",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "Komut",
|
||||
"Gen_Add": "Ekle",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "Tümünü ekle",
|
||||
"Gen_All_Devices": "Tüm Cihazlar",
|
||||
"Gen_AreYouSure": "Emin misiniz?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "",
|
||||
"Gen_Offline": "Çevrimdışı",
|
||||
"Gen_Okay": "Tamam",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "Çıkar",
|
||||
"Gen_ReadDocs": "",
|
||||
"Gen_Remove_All": "Tümünü kaldır",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "",
|
||||
"Gen_Warning": "Uyarı",
|
||||
"Gen_Work_In_Progress": "",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "Genel",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "Yenileniyor...",
|
||||
"general_event_description": "",
|
||||
"general_event_title": "",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "",
|
||||
"report_guid_missing": "",
|
||||
"report_select_format": "",
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
"DAYS_TO_KEEP_EVENTS_name": "删除早于",
|
||||
"DevDetail_Copy_Device_Title": "<i class=\"fa fa-copy\"></i> 从设备复制详细信息",
|
||||
"DevDetail_Copy_Device_Tooltip": "从下拉列表中复制设备的详细信息。此页面上的所有内容都将被覆盖",
|
||||
"DevDetail_DisplayFields_Title": "",
|
||||
"DevDetail_EveandAl_AlertAllEvents": "提醒所有事件",
|
||||
"DevDetail_EveandAl_AlertDown": "警报关闭",
|
||||
"DevDetail_EveandAl_Archived": "已归档",
|
||||
@@ -74,7 +75,7 @@
|
||||
"DevDetail_EveandAl_ScanCycle_a": "扫描设备",
|
||||
"DevDetail_EveandAl_ScanCycle_z": "不扫描设备",
|
||||
"DevDetail_EveandAl_Skip": "跳过重复通知",
|
||||
"DevDetail_EveandAl_Title": "<i class=\"fa fa-bolt\"></i> 事件和警报配置",
|
||||
"DevDetail_EveandAl_Title": "事件和警报配置",
|
||||
"DevDetail_Events_CheckBox": "隐藏连接事件",
|
||||
"DevDetail_GoToNetworkNode": "导航到指定节点的网络页面。",
|
||||
"DevDetail_Icon": "图标",
|
||||
@@ -88,10 +89,10 @@
|
||||
"DevDetail_MainInfo_Network": "<i class=\"fa fa-server\"></i> 节点 (MAC)",
|
||||
"DevDetail_MainInfo_Network_Port": "<i class=\"fa fa-ethernet\"></i> 端口",
|
||||
"DevDetail_MainInfo_Network_Site": "地点",
|
||||
"DevDetail_MainInfo_Network_Title": "<i class=\"fa fa-network-wired\"></i> 网络",
|
||||
"DevDetail_MainInfo_Network_Title": "网络",
|
||||
"DevDetail_MainInfo_Owner": "所有者",
|
||||
"DevDetail_MainInfo_SSID": "SSID",
|
||||
"DevDetail_MainInfo_Title": "<i class=\"fa fa-pencil\"></i> 主要信息",
|
||||
"DevDetail_MainInfo_Title": "主要信息",
|
||||
"DevDetail_MainInfo_Type": "类型",
|
||||
"DevDetail_MainInfo_Vendor": "制造商",
|
||||
"DevDetail_MainInfo_mac": "MAC",
|
||||
@@ -121,7 +122,7 @@
|
||||
"DevDetail_SessionInfo_LastSession": "上次离线",
|
||||
"DevDetail_SessionInfo_StaticIP": "静态 IP",
|
||||
"DevDetail_SessionInfo_Status": "状态",
|
||||
"DevDetail_SessionInfo_Title": "<i class=\"fa fa-calendar\"></i> 进程信息",
|
||||
"DevDetail_SessionInfo_Title": "进程信息",
|
||||
"DevDetail_SessionTable_Additionalinfo": "附加信息",
|
||||
"DevDetail_SessionTable_Connection": "连接",
|
||||
"DevDetail_SessionTable_Disconnection": "断开",
|
||||
@@ -184,6 +185,7 @@
|
||||
"DevDetail_button_OverwriteIcons_Warning": "您确定要覆盖与当前设备类型相同的所有设备的所有图标吗?",
|
||||
"DevDetail_button_Reset": "重置",
|
||||
"DevDetail_button_Save": "保存",
|
||||
"DeviceEdit_ValidMacIp": "",
|
||||
"Device_MultiEdit": "编辑",
|
||||
"Device_MultiEdit_Backup": "小心,输入错误的值将破坏您的设置。请先备份您的数据库或设备配置(<a href=\"php/server/devices.php?action=ExportCSV\">点击下载<i class=\"fa-solid fa-download fa-bounce\"></i></a>)。在<a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/BACKUPS.md#scenario-2-corrupted-database\" target=\"_blank\">备份文档</a>中了解如何从此文件恢复设备。",
|
||||
"Device_MultiEdit_Fields": "编辑:",
|
||||
@@ -278,6 +280,7 @@
|
||||
"GRAPHQL_PORT_name": "",
|
||||
"Gen_Action": "动作",
|
||||
"Gen_Add": "增加",
|
||||
"Gen_AddDevice": "",
|
||||
"Gen_Add_All": "全部添加",
|
||||
"Gen_All_Devices": "所有设备",
|
||||
"Gen_AreYouSure": "你确定吗?",
|
||||
@@ -295,6 +298,7 @@
|
||||
"Gen_LockedDB": "错误 - DB 可能被锁定 - 检查 F12 开发工具 -> 控制台或稍后重试。",
|
||||
"Gen_Offline": "离线",
|
||||
"Gen_Okay": "Ok",
|
||||
"Gen_Online": "",
|
||||
"Gen_Purge": "清除",
|
||||
"Gen_ReadDocs": "在文档中阅读更多内容。",
|
||||
"Gen_Remove_All": "全部删除",
|
||||
@@ -313,6 +317,7 @@
|
||||
"Gen_Update_Value": "更新值",
|
||||
"Gen_Warning": "警告",
|
||||
"Gen_Work_In_Progress": "工作正在进行中,欢迎在 https://github.com/jokob-sk/NetAlertX/issues 上反馈",
|
||||
"Gen_create_new_device": "",
|
||||
"General_display_name": "通用",
|
||||
"General_icon": "<i class=\"fa fa-gears\"></i>",
|
||||
"HRS_TO_KEEP_NEWDEV_description": "这是一项维护设置。如果启用(<code>0</code> 为禁用),则标记为<b>新设备</b>的设备(如果其<b>首次会话</b>时间早于此设置中指定的小时数)将被删除。如果您想在 <code>X</code> 小时后自动删除<b>新设备</b>,请使用此设置。",
|
||||
@@ -681,9 +686,17 @@
|
||||
"UI_REFRESH_name": "自动刷新界面",
|
||||
"VERSION_description": "",
|
||||
"VERSION_name": "",
|
||||
"add_icon_event_icon": "",
|
||||
"add_icon_event_tooltip": "",
|
||||
"add_option_event_icon": "",
|
||||
"add_option_event_tooltip": "",
|
||||
"copy_icons_event_icon": "",
|
||||
"copy_icons_event_tooltip": "",
|
||||
"devices_old": "刷新中...",
|
||||
"general_event_description": "您触发的事件可能需要一段时间才能完成后台进程。一旦以下执行队列清空,执行就会结束(如果遇到问题,请检查<a href='/maintenance.php#tab_Logging'>错误日志</a>)。<br/> <br/> 执行队列:",
|
||||
"general_event_title": "执行自组织网络事件",
|
||||
"go_to_node_event_icon": "",
|
||||
"go_to_node_event_tooltip": "",
|
||||
"report_guid": "通知guid:",
|
||||
"report_guid_missing": "未找到链接的通知。最近发送的通知与可用通知之间存在短暂延迟。几秒钟后刷新页面并缓存。所选通知也可能已在维护期间被删除,如 <code>DBCLNP_NOTIFI_HIST</code> 设置中所述。<br/> <br/>系统将改为显示最新通知。缺失的通知具有以下 GUID:",
|
||||
"report_select_format": "选择格式:",
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Modal textarea input -->
|
||||
<div class="modal modal-warning fade" id="modal-input" style="display: none;">
|
||||
<div class="modal modal-warning fade" id="modal-input" data-myparam-triggered-by="" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
|
||||
<!-- Modal field input -->
|
||||
<div class="modal modal-warning fade" id="modal-field-input" style="display: none;">
|
||||
<div class="modal modal-warning fade" id="modal-field-input" data-myparam-triggered-by="" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
|
||||
|
||||
|
||||
| ID | Type | Description | Features | Required | Data source | Detailed docs |
|
||||
| ----------- | ----- | --------------------------------------------------- | -------- | -------- | ----------- | ------------------------------------------------------------------ |
|
||||
|---------------|---------|--------------------------------------------|----------|----------|--------------------|---------------------------------------------------------------|
|
||||
| `APPRISE` | ▶️ | Apprise notification proxy | | | Script | [_publisher_apprise](/front/plugins/_publisher_apprise/) |
|
||||
| `ARPSCAN` | 🔍 | ARP-scan on current network | | | Script | [arp_scan](/front/plugins/arp_scan/) |
|
||||
| `AVAHISCAN` | ♻ | Avahi (mDNS-based) name resolution | | | Script | [avahi_scan](/front/plugins/avahi_scan/) |
|
||||
@@ -33,8 +33,11 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
|
||||
| `DDNS` | ⚙ | DDNS update | | | Script | [ddns_update](/front/plugins/ddns_update/) |
|
||||
| `DHCPLSS` | 🔍/📥 | Import devices from DHCP leases | | | Script | [dhcp_leases](/front/plugins/dhcp_leases/) |
|
||||
| `DHCPSRVS` | ♻ | DHCP servers | | | Script | [dhcp_servers](/front/plugins/dhcp_servers/) |
|
||||
| `FREEBOX` | 🔍/♻ | Pull data and names from Freebox/Iliadbox | | | Script | [freebox](/front/plugins/freebox/) |
|
||||
| `ICMP` | 🔍 | ICMP (ping) status checker | | | Script | [icmp_scan](/front/plugins/icmp_scan/) |
|
||||
| `INTRNT` | 🔍 | Internet IP scanner | | | Script | [internet_ip](/front/plugins/internet_ip/) |
|
||||
| `INTRSPD` | ♻ | Internet speed test | | | Script | [internet_speedtest](/front/plugins/internet_speedtest/) |
|
||||
| `IPNEIGH` | 🔍 | Scan ARP (IPv4) and NDP (IPv6) tables | | | Script | [ipneigh](/front/plugins/ipneigh/) |
|
||||
| `MAINT` | ⚙ | Maintenance of logs, etc. | | | Script | [maintenance](/front/plugins/maintenance/) |
|
||||
| `MQTT` | ▶️ | MQTT for synching to Home Assistant | | | Script | [_publisher_mqtt](/front/plugins/_publisher_mqtt/) |
|
||||
| `NBTSCAN` | ♻ | Nbtscan (NetBIOS-based) name resolution | | | Script | [nbtscan_scan](/front/plugins/nbtscan_scan/) |
|
||||
@@ -42,7 +45,7 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
|
||||
| `NMAP` | ♻ | Nmap port scanning & discovery | | | Script | [nmap_scan](/front/plugins/nmap_scan/) |
|
||||
| `NMAPDEV` | 🔍 | Nmap dev scan on current network | | | Script | [nmap_dev_scan](/front/plugins/nmap_dev_scan/) |
|
||||
| `NSLOOKUP` | ♻ | NSLookup (DNS-based) name resolution | | | Script | [nslookup_scan](/front/plugins/nslookup_scan/) |
|
||||
| `NTFPRCS` | ⚙ | Notification processing | | Yes | Template | [notification_processing](/front/plugins/notification_processing/) |
|
||||
| `NTFPRCS` | ⚙ | Notification processing | | Yes | Template | [notification_processing](/front/plugins/notification_processing/)|
|
||||
| `NTFY` | ▶️ | NTFY notifications | | | Script | [_publisher_ntfy](/front/plugins/_publisher_ntfy/) |
|
||||
| `OMDSDN` | 📥 | OMADA TP-Link import | 🖧 🔄 | | Script | [omada_sdn_imp](/front/plugins/omada_sdn_imp/) |
|
||||
| `PIHOLE` | 🔍/📥 | Pi-hole device import & sync | | | SQLite DB | [pihole_scan](/front/plugins/pihole_scan/) |
|
||||
@@ -51,14 +54,14 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
|
||||
| `SETPWD` | ⚙ | Set password | | Yes | Template | [set_password](/front/plugins/set_password/) |
|
||||
| `SMTP` | ▶️ | Email notifications | | | Script | [_publisher_email](/front/plugins/_publisher_email/) |
|
||||
| `SNMPDSC` | 🔍/📥 | SNMP device import & sync | | | Script | [snmp_discovery](/front/plugins/snmp_discovery/) |
|
||||
| `SYNC` | 🔍/⚙/📥 | Sync & import from NetAlertX instances | 🖧 🔄 | | Script | [sync](/front/plugins/sync/) |
|
||||
| `SYNC` | 🔍/⚙/📥| Sync & import from NetAlertX instances | 🖧 🔄 | | Script | [sync](/front/plugins/sync/) |
|
||||
| `TELEGRAM` | ▶️ | Telegram notifications | | | Script | [_publisher_telegram](/front/plugins/_publisher_telegram/) |
|
||||
| `UNDIS` | 🔍/📥 | Create dummy devices | | | Script | [undiscoverables](/front/plugins/undiscoverables/) |
|
||||
| `UNFIMP` | 🔍/📥 | UniFi device import & sync | 🖧 | | Script | [unifi_import](/front/plugins/unifi_import/) |
|
||||
| `VNDRPDT` | ⚙ | Vendor database update | | | Script | [vendor_update](/front/plugins/vendor_update/) |
|
||||
| `WEBHOOK` | ▶️ | Webhook notifications | | | Script | [_publisher_webhook](/front/plugins/_publisher_webhook/) |
|
||||
| `WEBMON` | ♻ | Website down monitoring | | | Script | [website_monitor](/front/plugins/website_monitor/) |
|
||||
| `FREEBOX` | 🔍/♻ | Pull data and names from a Freebox/Iliadbox gateway | | | Script | [freebox](/front/plugins/freebox/) |
|
||||
|
||||
|
||||
> \* The database cleanup plugin (`DBCLNP`) is not _required_ but the app will become unusable after a while if not executed.
|
||||
>
|
||||
|
||||
7
front/plugins/icmp_scan/README.md
Executable file
7
front/plugins/icmp_scan/README.md
Executable file
@@ -0,0 +1,7 @@
|
||||
## Overview
|
||||
|
||||
Plugin for pinging existing devices via the [ping](https://linux.die.net/man/8/ping) network utility. The devices have to be accessible from the container. You can use this plugin with other suplementing plugins as described in the [subnets docs](https://github.com/jokob-sk/NetAlertX/blob/main/docs/SUBNETS.md).
|
||||
|
||||
### Usage
|
||||
|
||||
- Check the Settings page for details.
|
||||
399
front/plugins/icmp_scan/config.json
Executable file
399
front/plugins/icmp_scan/config.json
Executable file
@@ -0,0 +1,399 @@
|
||||
{
|
||||
"code_name": "icmp_scan",
|
||||
"unique_prefix": "ICMP",
|
||||
"plugin_type": "other",
|
||||
"execution_order" : "Layer_4",
|
||||
"enabled": true,
|
||||
"data_source": "script",
|
||||
"show_ui": true,
|
||||
"data_filters": [
|
||||
{
|
||||
"compare_column": "Object_PrimaryID",
|
||||
"compare_operator": "==",
|
||||
"compare_field_id": "txtMacFilter",
|
||||
"compare_js_template": "'{value}'.toString()",
|
||||
"compare_use_quotes": true
|
||||
}
|
||||
],
|
||||
"localized": ["display_name", "description", "icon"],
|
||||
"display_name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "ICMP (Status check)"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "<i class=\"fa-solid fa-search\"></i>"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "A plugin to check the status of the device."
|
||||
}
|
||||
],
|
||||
"params": [
|
||||
{
|
||||
"name": "ips",
|
||||
"type": "sql",
|
||||
"value": "SELECT devLastIP from DEVICES order by devMac",
|
||||
"timeoutMultiplier": true
|
||||
}
|
||||
],
|
||||
"settings": [
|
||||
{
|
||||
"function": "RUN",
|
||||
"events": ["run"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{ "elementType": "select", "elementOptions": [], "transformers": [] }
|
||||
]
|
||||
},
|
||||
"default_value": "disabled",
|
||||
"options": [
|
||||
"disabled",
|
||||
"on_new_device",
|
||||
"once",
|
||||
"schedule",
|
||||
"always_after_scan"
|
||||
],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "When to run"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Enable a regular scan of your devices with PING to determine their status. If you select <code>schedule</code> the interval from below is applied, for which the recommendation is to <a href=\"https://github.com/jokob-sk/NetAlertX/blob/main/docs/NOTIFICATIONS.md\" target=\"_blank\">align all scan schedules</a> otherwise false down reports will be generated."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "CMD",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "readonly": "true" }],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "python3 /app/front/plugins/icmp_scan/icmp.py",
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Command"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Command to run. This can not be changed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "ARGS",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "-i 0.5 -c 3 -W 4 -w 5",
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Command arguments"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Arguments passed to the <code>ping</code> command. Please be careful modifying these."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "RUN_SCHD",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{ "elementType": "input", "elementOptions": [], "transformers": [] }
|
||||
]
|
||||
},
|
||||
"default_value": "*/5 * * * *",
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Schedule"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#ICMP_RUN\"><code>ICMP_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "RUN_TIMEOUT",
|
||||
"type": {
|
||||
"dataType": "integer",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "type": "number" }],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": 10,
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Run timeout"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"database_column_definitions": [
|
||||
{
|
||||
"column": "Index",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "none",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Index"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Object_PrimaryID",
|
||||
"mapped_to_column": "cur_MAC",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "device_name_mac",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "MAC"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Object_SecondaryID",
|
||||
"mapped_to_column": "cur_IP",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "device_ip",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "IP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value1",
|
||||
"mapped_to_column": "cur_Name",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Name"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value2",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Output"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value3",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": false,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "N/A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value4",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": false,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "N/A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Dummy",
|
||||
"mapped_to_column": "cur_ScanMethod",
|
||||
"mapped_to_column_data": {
|
||||
"value": "ICMP"
|
||||
},
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Scan method"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "DateTimeCreated",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Created"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "DateTimeChanged",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Changed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Status",
|
||||
"css_classes": "col-sm-1",
|
||||
"show": true,
|
||||
"type": "replace",
|
||||
"default_value": "",
|
||||
"options": [
|
||||
{
|
||||
"equals": "watched-not-changed",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-square-check'></i><div></div>"
|
||||
},
|
||||
{
|
||||
"equals": "watched-changed",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-triangle-exclamation'></i></div>"
|
||||
},
|
||||
{
|
||||
"equals": "new",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-circle-plus'></i></div>"
|
||||
},
|
||||
{
|
||||
"equals": "missing-in-last-scan",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
||||
}
|
||||
],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Status"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
156
front/plugins/icmp_scan/icmp.py
Executable file
156
front/plugins/icmp_scan/icmp.py
Executable file
@@ -0,0 +1,156 @@
|
||||
#!/usr/bin/env python
|
||||
# test script by running:
|
||||
# tbc
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import argparse
|
||||
import subprocess
|
||||
import sys
|
||||
import hashlib
|
||||
import csv
|
||||
import sqlite3
|
||||
import re
|
||||
from io import StringIO
|
||||
from datetime import datetime
|
||||
|
||||
# Register NetAlertX directories
|
||||
INSTALL_PATH="/app"
|
||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||
|
||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64
|
||||
from logger import mylog, append_line_to_file
|
||||
from helper import timeNowTZ, get_setting_value
|
||||
from const import logPath, applicationPath, fullDbPath
|
||||
from database import DB
|
||||
from device import Device_obj
|
||||
import conf
|
||||
from pytz import timezone
|
||||
|
||||
# Make sure the TIMEZONE for logging is correct
|
||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||
|
||||
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
|
||||
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
|
||||
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
|
||||
|
||||
pluginName = 'ICMP'
|
||||
|
||||
def main():
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] In script'])
|
||||
|
||||
|
||||
timeout = get_setting_value('ICMP_RUN_TIMEOUT')
|
||||
args = get_setting_value('ICMP_ARGS')
|
||||
|
||||
# Create a database connection
|
||||
db = DB() # instance of class DB
|
||||
db.open()
|
||||
|
||||
# Initialize the Plugin obj output file
|
||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||
|
||||
# Create a Device_obj instance
|
||||
device_handler = Device_obj(db)
|
||||
|
||||
# Retrieve devices
|
||||
all_devices = device_handler.getAll()
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Devices to PING: {len(all_devices)}'])
|
||||
|
||||
for device in all_devices:
|
||||
is_online, output = execute_scan(device['devLastIP'], timeout, args)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] ip: "{device['devLastIP']}" is_online: "{is_online}"'])
|
||||
|
||||
if is_online:
|
||||
plugin_objects.add_object(
|
||||
# "MAC", "IP", "Name", "Output"
|
||||
primaryId = device['devMac'],
|
||||
secondaryId = device['devLastIP'],
|
||||
watched1 = device['devName'],
|
||||
watched2 = output.replace('\n',''),
|
||||
watched3 = '',
|
||||
watched4 = '',
|
||||
extra = '',
|
||||
foreignKey = device['devMac'])
|
||||
|
||||
plugin_objects.write_result_file()
|
||||
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Script finished'])
|
||||
|
||||
return 0
|
||||
|
||||
#===============================================================================
|
||||
# Execute scan
|
||||
#===============================================================================
|
||||
def execute_scan (ip, timeout, args):
|
||||
"""
|
||||
Execute the ICMP command on IP.
|
||||
"""
|
||||
|
||||
icmp_args = ['ping'] + args.split() + [ip]
|
||||
|
||||
# Execute command
|
||||
output = ""
|
||||
|
||||
try:
|
||||
# try runnning a subprocess with a forced (timeout) in case the subprocess hangs
|
||||
output = subprocess.check_output (icmp_args, universal_newlines=True, stderr=subprocess.STDOUT, timeout=(timeout), text=True)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] DEBUG OUTPUT : {output}'])
|
||||
|
||||
# Parse output using case-insensitive regular expressions
|
||||
#Synology-NAS:/# ping -i 0.5 -c 3 -W 8 -w 9 192.168.1.82
|
||||
# PING 192.168.1.82 (192.168.1.82): 56 data bytes
|
||||
# 64 bytes from 192.168.1.82: seq=0 ttl=64 time=0.080 ms
|
||||
# 64 bytes from 192.168.1.82: seq=1 ttl=64 time=0.081 ms
|
||||
# 64 bytes from 192.168.1.82: seq=2 ttl=64 time=0.089 ms
|
||||
|
||||
# --- 192.168.1.82 ping statistics ---
|
||||
# 3 packets transmitted, 3 packets received, 0% packet loss
|
||||
# round-trip min/avg/max = 0.080/0.083/0.089 ms
|
||||
# Synology-NAS:/# ping -i 0.5 -c 3 -W 8 -w 9 192.168.1.82a
|
||||
# ping: bad address '192.168.1.82a'
|
||||
# Synology-NAS:/# ping -i 0.5 -c 3 -W 8 -w 9 192.168.1.92
|
||||
# PING 192.168.1.92 (192.168.1.92): 56 data bytes
|
||||
|
||||
# --- 192.168.1.92 ping statistics ---
|
||||
# 3 packets transmitted, 0 packets received, 100% packet loss
|
||||
|
||||
# TODO: parse output and return True if online, False if Offline (100% packet loss, bad address)
|
||||
is_online = True
|
||||
|
||||
# Check for 0% packet loss in the output
|
||||
if re.search(r"0% packet loss", output, re.IGNORECASE):
|
||||
is_online = True
|
||||
elif re.search(r"bad address", output, re.IGNORECASE):
|
||||
is_online = False
|
||||
elif re.search(r"100% packet loss", output, re.IGNORECASE):
|
||||
is_online = False
|
||||
|
||||
return is_online, output
|
||||
|
||||
except subprocess.CalledProcessError as e:
|
||||
# An error occurred, handle it
|
||||
mylog('verbose', [f'[{pluginName}] ⚠ ERROR - check logs'])
|
||||
mylog('verbose', [f'[{pluginName}]', e.output])
|
||||
|
||||
return False, output
|
||||
|
||||
except subprocess.TimeoutExpired as timeErr:
|
||||
mylog('verbose', [f'[{pluginName}] TIMEOUT - the process forcefully terminated as timeout reached'])
|
||||
return False, output
|
||||
|
||||
return False, output
|
||||
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# BEGIN
|
||||
#===============================================================================
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
27
front/plugins/ipneigh/README.md
Executable file
27
front/plugins/ipneigh/README.md
Executable file
@@ -0,0 +1,27 @@
|
||||
## Overview
|
||||
|
||||
This plugin reads from the ARP and NDP tables using the `ip neigh` command.
|
||||
|
||||
This differs from the `ARPSCAN` plugin because
|
||||
* It does *not* send arp requests, it just reads the table
|
||||
* It supports IPv6
|
||||
* It sends an IPv6 multicast ping to solicit IPv6 neighbour discovery
|
||||
|
||||
### Quick setup guide
|
||||
|
||||
To set up the plugin correctly, make sure to add in the plugin settings the name of the interfaces you want to scan. This plugin doesn't use the global `SCAN_SUBNET` setting, this is because by design it is not aware of subnets, it just looks at all the IPs reachable from an interface.
|
||||
|
||||
### Usage
|
||||
|
||||
- Head to **Settings** > **IP Neigh** to adjust the settings
|
||||
- Interfaces are extracted from the `SCAN_SUBNETS` setting (make sure you add interfaces in the prescribed format, e.g. `192.168.1.0/24 --interface=eth1`)
|
||||
|
||||
### Notes
|
||||
|
||||
- `ARPSCAN` does a better job at discovering IPv4 devices because it explicitly sends arp requests
|
||||
- IPv6 devices will often have multiple addresses, but the ping answer will contain only one. This means that in general this plugin will not discover every address but only those who answer
|
||||
|
||||
### Other info
|
||||
|
||||
- Author : [KayJay7](https://github.com/KayJay7)
|
||||
- Date : 31-Nov-2024 - version 1.0
|
||||
402
front/plugins/ipneigh/config.json
Executable file
402
front/plugins/ipneigh/config.json
Executable file
@@ -0,0 +1,402 @@
|
||||
{
|
||||
"code_name": "ipneigh",
|
||||
"unique_prefix": "IPNEIGH",
|
||||
"plugin_type": "device_scanner",
|
||||
"execution_order": "Layer_0",
|
||||
"enabled": true,
|
||||
"data_source": "script",
|
||||
"mapped_to_table": "CurrentScan",
|
||||
"data_filters": [
|
||||
{
|
||||
"compare_column": "Object_PrimaryID",
|
||||
"compare_operator": "==",
|
||||
"compare_field_id": "txtMacFilter",
|
||||
"compare_js_template": "'{value}'.toString()",
|
||||
"compare_use_quotes": true
|
||||
}
|
||||
],
|
||||
"show_ui": true,
|
||||
"localized": [
|
||||
"display_name",
|
||||
"description",
|
||||
"icon"
|
||||
],
|
||||
"display_name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "IP Neigh"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Plugin to scan the ip tables"
|
||||
}
|
||||
],
|
||||
"icon": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "<i class=\"fa fa-search\"></i>"
|
||||
}
|
||||
],
|
||||
"params": [],
|
||||
"settings": [
|
||||
{
|
||||
"function": "RUN",
|
||||
"events": [
|
||||
"run"
|
||||
],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "select",
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "disabled",
|
||||
"options": [
|
||||
"disabled",
|
||||
"once",
|
||||
"schedule",
|
||||
"always_after_scan",
|
||||
"on_new_device",
|
||||
"on_notification"
|
||||
],
|
||||
"localized": [
|
||||
"name",
|
||||
"description"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "When to run"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "When the plugin should run. Good options are <code>always_after_scan</code>, <code>on_new_device</code>, <code>on_notification</code>"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "RUN_SCHD",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "*/5 * * * *",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name",
|
||||
"description"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Schedule"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Only enabled if you select <code>schedule</code> in the <a href=\"#SYNC_RUN\"><code>SYNC_RUN</code> setting</a>. Make sure you enter the schedule in the correct cron-like format (e.g. validate at <a href=\"https://crontab.guru/\" target=\"_blank\">crontab.guru</a>). For example entering <code>0 4 * * *</code> will run the scan after 4 am in the <a onclick=\"toggleAllSettings()\" href=\"#TIMEZONE\"><code>TIMEZONE</code> you set above</a>. Will be run NEXT time the time passes."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "CMD",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [
|
||||
{
|
||||
"readonly": "true"
|
||||
}
|
||||
],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "python3 /app/front/plugins/ipneigh/ipneigh.py",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name",
|
||||
"description"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Command"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Command to run. This can not be changed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "RUN_TIMEOUT",
|
||||
"type": {
|
||||
"dataType": "integer",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [
|
||||
{
|
||||
"type": "number"
|
||||
}
|
||||
],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": 30,
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name",
|
||||
"description"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Run timeout"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Maximum time in seconds to wait for the script to finish. If this time is exceeded the script is aborted."
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"database_column_definitions": [
|
||||
{
|
||||
"column": "Index",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "none",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Index"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Object_PrimaryID",
|
||||
"mapped_to_column": "cur_MAC",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "device_name_mac",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "MAC"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Object_SecondaryID",
|
||||
"mapped_to_column": "cur_IP",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "device_ip",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "IP"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value1",
|
||||
"mapped_to_column": "cur_Name",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Name"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value2",
|
||||
"mapped_to_column": "cur_Vendor",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Vendor"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value3",
|
||||
"mapped_to_column": "cur_Type",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Type"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Watched_Value4",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": false,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "N/A"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Dummy",
|
||||
"mapped_to_column": "cur_ScanMethod",
|
||||
"mapped_to_column_data": {
|
||||
"value": "IPNEIGH"
|
||||
},
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Scan method"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "DateTimeCreated",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Created"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "DateTimeChanged",
|
||||
"css_classes": "col-sm-2",
|
||||
"show": true,
|
||||
"type": "label",
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Changed"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"column": "Status",
|
||||
"css_classes": "col-sm-1",
|
||||
"show": true,
|
||||
"type": "replace",
|
||||
"default_value": "",
|
||||
"options": [
|
||||
{
|
||||
"equals": "watched-not-changed",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-square-check'></i><div></div>"
|
||||
},
|
||||
{
|
||||
"equals": "watched-changed",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-triangle-exclamation'></i></div>"
|
||||
},
|
||||
{
|
||||
"equals": "new",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-circle-plus'></i></div>"
|
||||
},
|
||||
{
|
||||
"equals": "missing-in-last-scan",
|
||||
"replacement": "<div style='text-align:center'><i class='fa-solid fa-question'></i></div>"
|
||||
}
|
||||
],
|
||||
"localized": [
|
||||
"name"
|
||||
],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Status"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
146
front/plugins/ipneigh/ipneigh.py
Executable file
146
front/plugins/ipneigh/ipneigh.py
Executable file
@@ -0,0 +1,146 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
import json
|
||||
import sqlite3
|
||||
import subprocess
|
||||
from datetime import datetime
|
||||
from pytz import timezone
|
||||
from functools import reduce
|
||||
|
||||
# Define the installation path and extend the system path for plugin imports
|
||||
INSTALL_PATH = "/app"
|
||||
sys.path.extend([f"{INSTALL_PATH}/front/plugins", f"{INSTALL_PATH}/server"])
|
||||
|
||||
from plugin_helper import Plugin_Object, Plugin_Objects, decodeBase64, handleEmpty
|
||||
from plugin_utils import get_plugins_configs
|
||||
from logger import mylog
|
||||
from const import pluginsPath, fullDbPath
|
||||
from helper import timeNowTZ, get_setting_value
|
||||
from notification import write_notification
|
||||
import conf
|
||||
|
||||
# Make sure the TIMEZONE for logging is correct
|
||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||
|
||||
# Define the current path and log file paths
|
||||
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
|
||||
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
|
||||
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
|
||||
|
||||
# Initialize the Plugin obj output file
|
||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||
|
||||
pluginName = 'IPNEIGH'
|
||||
|
||||
def main():
|
||||
mylog('verbose', [f'[{pluginName}] In script'])
|
||||
|
||||
# Retrieve configuration settings
|
||||
SCAN_SUBNETS = get_setting_value('SCAN_SUBNETS')
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] SCAN_SUBNETS value: {SCAN_SUBNETS}'])
|
||||
|
||||
# Extract interfaces from SCAN_SUBNETS
|
||||
interfaces = ','.join(
|
||||
entry.split('--interface=')[-1].strip() for entry in SCAN_SUBNETS if '--interface=' in entry
|
||||
)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Interfaces value: "{interfaces}"'])
|
||||
|
||||
# retrieve data
|
||||
raw_neighbors = get_neighbors(interfaces)
|
||||
|
||||
neighbors = parse_neighbors(raw_neighbors)
|
||||
|
||||
# Process the data into native application tables
|
||||
if len(neighbors) > 0:
|
||||
|
||||
for device in neighbors:
|
||||
plugin_objects.add_object(
|
||||
primaryId = device['mac'],
|
||||
secondaryId = device['ip'],
|
||||
watched4 = device['last_seen'],
|
||||
|
||||
# The following are always unknown
|
||||
watched1 = device['hostname'], # don't use these --> handleEmpty(device['hostname']),
|
||||
watched2 = device['vendor'], # handleEmpty(device['vendor']),
|
||||
watched3 = device['device_type'], # handleEmpty(device['device_type']),
|
||||
extra = '',
|
||||
foreignKey = "" #device['mac']
|
||||
# helpVal1 = "Something1", # Optional Helper values to be passed for mapping into the app
|
||||
# helpVal2 = "Something1", # If you need to use even only 1, add the remaining ones too
|
||||
# helpVal3 = "Something1", # and set them to 'null'. Check the the docs for details:
|
||||
# helpVal4 = "Something1", # https://github.com/jokob-sk/NetAlertX/blob/main/docs/PLUGINS_DEV.md
|
||||
)
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] New entries: "{len(neighbors)}"'])
|
||||
|
||||
# log result
|
||||
plugin_objects.write_result_file()
|
||||
|
||||
return 0
|
||||
|
||||
def parse_neighbors(raw_neighbors: list[str]):
|
||||
neighbors = []
|
||||
for line in raw_neighbors:
|
||||
if "lladdr" in line and "REACHABLE" in line:
|
||||
# Known data
|
||||
fields = line.split()
|
||||
|
||||
if not is_multicast(fields[0]):
|
||||
# mylog('verbose', [f'[{pluginName}] adding ip {fields[0]}"'])
|
||||
neighbor = {}
|
||||
neighbor['ip'] = fields[0]
|
||||
neighbor['mac'] = fields[2]
|
||||
neighbor['last_seen'] = datetime.now()
|
||||
|
||||
# Unknown data
|
||||
neighbor['hostname'] = '(unknown)'
|
||||
neighbor['vendor'] = '(unknown)'
|
||||
neighbor['device_type'] = '(unknown)'
|
||||
|
||||
neighbors.append(neighbor)
|
||||
|
||||
return neighbors
|
||||
|
||||
|
||||
def is_multicast(ip):
|
||||
prefixes = ['ff', '224', '231', '232', '233', '234', '238', '239']
|
||||
return reduce(lambda acc, prefix: acc or ip.startswith(prefix), prefixes, False)
|
||||
|
||||
# retrieve data
|
||||
def get_neighbors(interfaces):
|
||||
|
||||
results = []
|
||||
|
||||
for interface in interfaces.split(","):
|
||||
try:
|
||||
|
||||
# Ping all IPv6 devices in multicast to trigger NDP
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Pinging on interface: "{interface}"'])
|
||||
command = f"ping ff02::1%{interface} -c 2".split()
|
||||
subprocess.run(command)
|
||||
mylog('verbose', [f'[{pluginName}] Pinging completed: "{interface}"'])
|
||||
|
||||
# Check the neighbourhood tables
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Scanning interface: "{interface}"'])
|
||||
command = f"ip neighbor show nud all dev {interface}".split()
|
||||
output = subprocess.check_output(command, universal_newlines=True)
|
||||
results += output.split("\n")
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Scanning interface succeded: "{interface}"'])
|
||||
except subprocess.CalledProcessError as e:
|
||||
# An error occurred, handle it
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] Scanning interface failed: "{interface}"'])
|
||||
error_type = type(e).__name__ # Capture the error type
|
||||
|
||||
return results
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
@@ -265,6 +265,34 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "replace_preset_icon",
|
||||
"type": {
|
||||
"dataType": "boolean",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "type": "checkbox" }],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": false,
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Overwrite Preset Icon"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "If checked, the application replaces the preset icon in <code>NEWDEV_devIcon</code> with a pre-assigned vendor or device icon if found. If this is checked, avoid manually assigning this icon to devices, as it may be replaced."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "devMac",
|
||||
"type": {
|
||||
@@ -284,7 +312,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device MAC"
|
||||
"string": "MAC"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -313,18 +341,19 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Name"
|
||||
"string": "Name"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The name of the device. Uneditable as internal functionality is dependent on specific new device names."
|
||||
"string": "The name of the device. If the value is set to <code>(unknown)</code> or <code>(name not found)</code> the application will try to discover the name of the device."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "devOwner",
|
||||
"events": ["add_option"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -345,7 +374,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Owner"
|
||||
"string": "Owner"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -357,6 +386,7 @@
|
||||
},
|
||||
{
|
||||
"function": "devType",
|
||||
"events": ["add_option"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -382,7 +412,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Type"
|
||||
"string": "Type"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -399,7 +429,7 @@
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "readonly": "true" }],
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
@@ -411,13 +441,13 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Vendor"
|
||||
"string": "Vendor"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The vendor of the device. Uneditable - Autodetected."
|
||||
"string": "The vendor of the device. If set to empty or <code>(unknown)</code> teh app will try to auto-detect it."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -451,6 +481,7 @@
|
||||
},
|
||||
{
|
||||
"function": "devGroup",
|
||||
"events": ["add_option"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -471,7 +502,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Group"
|
||||
"string": "Group"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -486,7 +517,7 @@
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{ "elementType": "input", "elementOptions": [], "transformers": [] }
|
||||
{ "elementType": "textarea", "elementOptions": [], "transformers": [] }
|
||||
]
|
||||
},
|
||||
"default_value": "",
|
||||
@@ -495,7 +526,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Comments"
|
||||
"string": "Comments"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -570,7 +601,7 @@
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "readonly": "true" }],
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
@@ -638,13 +669,13 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Scan Cycle"
|
||||
"string": "Scan device"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The default value of the <code>Scan device</code> dropdown. Enable if newly discovered devices should be scanned."
|
||||
"string": "Select if the device should be scanned."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -722,13 +753,13 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Alert Device Down"
|
||||
"string": "Alert Down"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Indicates whether an alert should be triggered when the device goes down. The default value of the <code>Alert Down</code> checkbox."
|
||||
"string": "Indicates whether an alert should be triggered when the device goes down. The device has to be down for longet than the time set in the <b>Alert Down After</b> <code>NTFPRCS_alert_down_time</code> setting."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -759,7 +790,7 @@
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The default value of the <code>Skip repeated notifications for</code> dropdown. Enter number of <b>hours</b> for which repeated notifications should be ignored for. If you enter <code>0</code> then you get notified on all events."
|
||||
"string": "Enter number of <b>hours</b> for which repeated notifications should be ignored for. If you select <code>0</code> then you get notified on all events."
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -850,6 +881,7 @@
|
||||
},
|
||||
{
|
||||
"function": "devLocation",
|
||||
"events": ["add_option"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -870,7 +902,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Location"
|
||||
"string": "Location"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -910,6 +942,7 @@
|
||||
},
|
||||
{
|
||||
"function": "devParentMAC",
|
||||
"events": ["go_to_node"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -934,7 +967,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Network Node MAC Address"
|
||||
"string": "Network Node"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
@@ -951,7 +984,7 @@
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [{ "readonly": "true" }],
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
@@ -968,12 +1001,69 @@
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The port number of the network node. Uneditable."
|
||||
"string": "The port number of the network node."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "devSSID",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "SSID"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The network SSID."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "devSite",
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
{
|
||||
"elementType": "input",
|
||||
"elementOptions": [],
|
||||
"transformers": []
|
||||
}
|
||||
]
|
||||
},
|
||||
"default_value": "",
|
||||
"options": [],
|
||||
"localized": ["name", "description"],
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Network Site"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "The network site."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"function": "devIcon",
|
||||
"events": ["copy_icons", "add_icon"],
|
||||
"type": {
|
||||
"dataType": "string",
|
||||
"elements": [
|
||||
@@ -1013,7 +1103,7 @@
|
||||
"name": [
|
||||
{
|
||||
"language_code": "en_us",
|
||||
"string": "Device Icon"
|
||||
"string": "Icon"
|
||||
}
|
||||
],
|
||||
"description": [
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
__author__ = "ffsb"
|
||||
__version__ = "0.1" #initial
|
||||
__version__ = "0.1" # initial
|
||||
__version__ = "0.2" # added logic to retry omada api call once as it seems to sometimes fail for some reasons, and error handling logic...
|
||||
__version__ = "0.3" # split devices API calls to allow multithreading but had to stop due to concurency issues.
|
||||
__version__ = "0.6" # found issue with multithreading - my omada calls redirect stdout which gets clubbered by normal stdout... not sure how to fix for now...
|
||||
@@ -8,6 +8,7 @@ __version__ = "0.7" # avoid updating omada sdn client name when it is the MAC,
|
||||
__version__ = "1.0" # fixed the timzone mylog issue by resetting the tz value at the begining of the script... I suspect it doesn't inherit the tz from the main.
|
||||
__version__ = "1.1" # added logic to handle gracefully a failure of omada devices so it won't try to populate uplinks on non-existent switches and AP.
|
||||
__version__ = "1.2" # finally got multiprocessing to work to parse devices AND to update names! yeah!
|
||||
__version__ = "1.3" # fix detection of the default gateway IP address that would pick loopback address instead of the actual gateway.
|
||||
|
||||
|
||||
# query OMADA SDN to populate NetAlertX witch omada switches, access points, clients.
|
||||
@@ -29,12 +30,13 @@ import importlib.util
|
||||
import time
|
||||
import io
|
||||
import re
|
||||
#import concurrent.futures
|
||||
|
||||
# import concurrent.futures
|
||||
import subprocess
|
||||
import multiprocessing
|
||||
|
||||
|
||||
#import netifaces
|
||||
# import netifaces
|
||||
|
||||
# Define the installation path and extend the system path for plugin imports
|
||||
INSTALL_PATH = "/app"
|
||||
@@ -48,21 +50,22 @@ from helper import timeNowTZ, get_setting_value
|
||||
from notification import write_notification
|
||||
from pytz import timezone
|
||||
import conf
|
||||
conf.tz = timezone(get_setting_value('TIMEZONE'))
|
||||
|
||||
conf.tz = timezone(get_setting_value("TIMEZONE"))
|
||||
PARALLELISM = 4
|
||||
|
||||
# Define the current path and log file paths
|
||||
CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
|
||||
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
|
||||
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
|
||||
OMADA_API_RETURN_FILE = os.path.join(CUR_PATH, 'omada_api_return')
|
||||
LOG_FILE = os.path.join(CUR_PATH, "script.log")
|
||||
RESULT_FILE = os.path.join(CUR_PATH, "last_result.log")
|
||||
OMADA_API_RETURN_FILE = os.path.join(CUR_PATH, "omada_api_return")
|
||||
|
||||
# Initialize the Plugin obj output file
|
||||
plugin_objects = Plugin_Objects(RESULT_FILE)
|
||||
#
|
||||
# sample target output:
|
||||
# 0 MAC, 1 IP, 2 Name, 3 switch/AP, 4 port/SSID, 5 TYPE
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', '17', '40-AE-30-A5-A7-50, 'Switch']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', '17', '40-AE-30-A5-A7-50, 'Switch']"
|
||||
|
||||
# Constants for array indices
|
||||
MAC, IP, NAME, SWITCH_AP, PORT_SSID, TYPE = range(6)
|
||||
@@ -70,59 +73,72 @@ MAC, IP, NAME, SWITCH_AP, PORT_SSID, TYPE = range(6)
|
||||
# sample omada devices input format:
|
||||
#
|
||||
# 0.MAC 1.IP 2.type 3.status 4.name 5.model
|
||||
#40-AE-30-A5-A7-50 192.168.0.11 ap CONNECTED office_Access_point EAP773(US) v1.0
|
||||
#B0-95-75-46-0C-39 192.168.0.4 switch CONNECTED pantry12 T1600G-52PS v4.0
|
||||
# 40-AE-30-A5-A7-50 192.168.0.11 ap CONNECTED office_Access_point EAP773(US) v1.0
|
||||
# B0-95-75-46-0C-39 192.168.0.4 switch CONNECTED pantry12 T1600G-52PS v4.0
|
||||
dMAC, dIP, dTYPE, dSTATUS, dNAME, dMODEL = range(6)
|
||||
|
||||
# sample omada clients input format:
|
||||
# 0 MAC, 1 IP, 2 Name, 3 switch/AP, 4 port/SSID,
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', 'myssid_name2', '(office_Access_point)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-01', '192.168.0.153', 'frontyard_ESP_29E753', 'pantry12', '(48)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-02', '192.168.0.1', 'bastion', 'office24', '(23)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-03', '192.168.0.226', 'brick', 'myssid_name3', '(office_Access_point)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', 'myssid_name2', '(office_Access_point)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-01', '192.168.0.153', 'frontyard_ESP_29E753', 'pantry12', '(48)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-02', '192.168.0.1', 'bastion', 'office24', '(23)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-03', '192.168.0.226', 'brick', 'myssid_name3', '(office_Access_point)']"
|
||||
cMAC, cIP, cNAME, cSWITCH_AP, cPORT_SSID = range(5)
|
||||
|
||||
OMDLOGLEVEL = 'debug'
|
||||
pluginName = 'OMDSDN'
|
||||
OMDLOGLEVEL = "debug"
|
||||
pluginName = "OMDSDN"
|
||||
|
||||
|
||||
#
|
||||
# translate MAC address from standard ieee model to ietf draft
|
||||
# AA-BB-CC-DD-EE-FF to aa:bb:cc:dd:ee:ff
|
||||
# tplink adheres to ieee, Nax adheres to ietf
|
||||
def ieee2ietf_mac_formater(inputmac):
|
||||
return(inputmac.lower().replace('-',':'))
|
||||
return inputmac.lower().replace("-", ":")
|
||||
|
||||
|
||||
def ietf2ieee_mac_formater(inputmac):
|
||||
return(inputmac.upper().replace(':','-'))
|
||||
if not inputmac or not isinstance(inputmac, str):
|
||||
mylog(
|
||||
"minimal",
|
||||
[
|
||||
f"[{pluginName}] ietf2ieee_mac_formater ERROR: inputmac is not a string: {inputmac}"
|
||||
],
|
||||
)
|
||||
return None
|
||||
return inputmac.upper().replace(":", "-")
|
||||
|
||||
|
||||
def get_mac_from_IP(target_IP):
|
||||
from scapy.all import ARP, Ether, srp
|
||||
|
||||
try:
|
||||
arp_request = ARP(pdst=target_IP)
|
||||
ether = Ether(dst="ff:ff:ff:ff:ff:ff")
|
||||
packet = ether/arp_request
|
||||
packet = ether / arp_request
|
||||
result = srp(packet, timeout=3, verbose=0)[0]
|
||||
if result:
|
||||
return result[0][1].hwsrc
|
||||
else:
|
||||
return None
|
||||
except Exception as e:
|
||||
mylog('minimal', [f'[{pluginName}] get_mac_from_IP ERROR:{e}'])
|
||||
mylog("minimal", [f"[{pluginName}] get_mac_from_IP ERROR:{e}"])
|
||||
return None
|
||||
|
||||
|
||||
|
||||
#
|
||||
# wrapper to call the omada python library's own wrapper
|
||||
# it returns the output as a multiline python string
|
||||
#
|
||||
def callomada(myargs):
|
||||
arguments=" ".join(myargs)
|
||||
mylog('verbose', [f'[{pluginName}] callomada:{arguments}'])
|
||||
arguments = " ".join(myargs)
|
||||
mylog("verbose", [f"[{pluginName}] callomada:{arguments}"])
|
||||
from tplink_omada_client.cli import main as omada
|
||||
from contextlib import redirect_stdout
|
||||
omada_output = ''
|
||||
|
||||
omada_output = ""
|
||||
retries = 2
|
||||
while omada_output == '' and retries > 1:
|
||||
while omada_output == "" and retries > 1:
|
||||
retries = retries - 1
|
||||
try:
|
||||
mf = io.StringIO()
|
||||
@@ -130,9 +146,13 @@ def callomada(myargs):
|
||||
bar = omada(myargs)
|
||||
omada_output = mf.getvalue()
|
||||
except Exception as e:
|
||||
mylog('minimal', [f'[{pluginName}] ERROR WHILE CALLING callomada:{arguments}\n {mf}'])
|
||||
omada_output= ''
|
||||
return(omada_output)
|
||||
mylog(
|
||||
"minimal",
|
||||
[f"[{pluginName}] ERROR WHILE CALLING callomada:{arguments}\n {mf}"],
|
||||
)
|
||||
omada_output = ""
|
||||
return omada_output
|
||||
|
||||
|
||||
#
|
||||
# extract all the mac addresses from a multilines text...
|
||||
@@ -143,34 +163,56 @@ def extract_mac_addresses(text):
|
||||
mac_addresses = re.findall(mac_pattern, text)
|
||||
return ["".join(parts) for parts in mac_addresses]
|
||||
|
||||
def find_default_gateway_ip ():
|
||||
#import netifaces
|
||||
#gw = netifaces.gateways()
|
||||
#return(gw['default'][netifaces.AF_INET][0])
|
||||
|
||||
def find_default_gateway_ip():
|
||||
# Get the routing table
|
||||
from scapy.all import conf, Route, sr1, IP, ICMP
|
||||
default_route = conf.route.route("0.0.0.0")
|
||||
return default_route[2] if default_route[2] else None
|
||||
|
||||
routing_table = conf.route.routes
|
||||
for route in routing_table:
|
||||
# Each route is a tuple: (destination, netmask, gateway, iface, output_ip, metric)
|
||||
destination, netmask, gateway, iface, output_ip, metric = route
|
||||
# Look for the default route (destination and netmask are both 0.0.0.0)
|
||||
if destination == 0 and netmask == 0 and gateway != "0.0.0.0":
|
||||
mylog("verbose", [f"[DEBUG] Default Gateway IP: {gateway}"])
|
||||
return gateway # Found the default gateway
|
||||
|
||||
return None # Default gateway not found
|
||||
|
||||
|
||||
#return('192.168.0.1')
|
||||
|
||||
|
||||
def add_uplink (uplink_mac, switch_mac, device_data_bymac, sadevices_linksbymac,port_byswitchmac_byclientmac):
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] trying to add uplink="{uplink_mac}" to switch="{switch_mac}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] before adding:"{device_data_bymac[switch_mac]}"'])
|
||||
if device_data_bymac[switch_mac][SWITCH_AP] == 'null':
|
||||
def add_uplink(
|
||||
uplink_mac,
|
||||
switch_mac,
|
||||
device_data_bymac,
|
||||
sadevices_linksbymac,
|
||||
port_byswitchmac_byclientmac,
|
||||
):
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] trying to add uplink="{uplink_mac}" to switch="{switch_mac}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] before adding:"{device_data_bymac[switch_mac]}"'])
|
||||
if device_data_bymac[switch_mac][SWITCH_AP] == "null":
|
||||
device_data_bymac[switch_mac][SWITCH_AP] = uplink_mac
|
||||
if device_data_bymac[switch_mac][TYPE] == 'Switch' and device_data_bymac[uplink_mac][TYPE] == 'Switch':
|
||||
if (
|
||||
device_data_bymac[switch_mac][TYPE] == "Switch"
|
||||
and device_data_bymac[uplink_mac][TYPE] == "Switch"
|
||||
):
|
||||
port_to_uplink = port_byswitchmac_byclientmac[switch_mac][uplink_mac]
|
||||
#find_port_of_uplink_switch(switch_mac, uplink_mac)
|
||||
# find_port_of_uplink_switch(switch_mac, uplink_mac)
|
||||
else:
|
||||
port_to_uplink=device_data_bymac[uplink_mac][PORT_SSID]
|
||||
port_to_uplink = device_data_bymac[uplink_mac][PORT_SSID]
|
||||
device_data_bymac[switch_mac][PORT_SSID] = port_to_uplink
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] after adding:"{device_data_bymac[switch_mac]}"'])
|
||||
for link in sadevices_linksbymac[switch_mac]:
|
||||
if device_data_bymac[link][SWITCH_AP] == 'null' and device_data_bymac[switch_mac][TYPE] == 'Switch':
|
||||
add_uplink(switch_mac, link, device_data_bymac, sadevices_linksbymac,port_byswitchmac_byclientmac)
|
||||
|
||||
if (
|
||||
device_data_bymac[link][SWITCH_AP] == "null"
|
||||
and device_data_bymac[switch_mac][TYPE] == "Switch"
|
||||
):
|
||||
add_uplink(
|
||||
switch_mac,
|
||||
link,
|
||||
device_data_bymac,
|
||||
sadevices_linksbymac,
|
||||
port_byswitchmac_byclientmac,
|
||||
)
|
||||
|
||||
|
||||
# ----------------------------------------------
|
||||
@@ -178,9 +220,10 @@ def add_uplink (uplink_mac, switch_mac, device_data_bymac, sadevices_linksbymac,
|
||||
def main():
|
||||
start_time = time.time()
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] starting execution'])
|
||||
mylog("verbose", [f"[{pluginName}] starting execution"])
|
||||
from database import DB
|
||||
from device import Device_obj
|
||||
|
||||
db = DB() # instance of class DB
|
||||
db.open()
|
||||
# Create a Device_obj instance
|
||||
@@ -188,41 +231,58 @@ def main():
|
||||
# Retrieve configuration settings
|
||||
# these should be self-explanatory
|
||||
omada_sites = []
|
||||
omada_username = get_setting_value('OMDSDN_username')
|
||||
omada_password = get_setting_value('OMDSDN_password')
|
||||
omada_sites = get_setting_value('OMDSDN_sites')
|
||||
omada_username = get_setting_value("OMDSDN_username")
|
||||
omada_password = get_setting_value("OMDSDN_password")
|
||||
omada_sites = get_setting_value("OMDSDN_sites")
|
||||
omada_site = omada_sites[0]
|
||||
omada_url = get_setting_value('OMDSDN_url')
|
||||
omada_url = get_setting_value("OMDSDN_url")
|
||||
|
||||
omada_login = callomada(['-t','myomada','target','--url',omada_url,'--user',omada_username,
|
||||
'--password',omada_password,'--site',omada_site,'--set-default'])
|
||||
mylog('verbose', [f'[{pluginName}] login to omada result is: {omada_login}'])
|
||||
omada_login = callomada(
|
||||
[
|
||||
"-t",
|
||||
"myomada",
|
||||
"target",
|
||||
"--url",
|
||||
omada_url,
|
||||
"--user",
|
||||
omada_username,
|
||||
"--password",
|
||||
omada_password,
|
||||
"--site",
|
||||
omada_site,
|
||||
"--set-default",
|
||||
]
|
||||
)
|
||||
mylog("verbose", [f"[{pluginName}] login to omada result is: {omada_login}"])
|
||||
|
||||
clients_list = callomada(['-t','myomada','clients'])
|
||||
mylog('verbose', [f'[{pluginName}] clients found:"{clients_list.count("\n")}"\n{clients_list}'])
|
||||
|
||||
switches_and_aps = callomada(['-t','myomada','devices'])
|
||||
mylog('verbose', [f'[{pluginName}] omada devices (switches, access points) found:"{switches_and_aps.count("\n")}" \n {switches_and_aps}'])
|
||||
|
||||
|
||||
#some_setting = get_setting_value('OMDSDN_url')
|
||||
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] some_setting value {some_setting}'])
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] ffsb'])
|
||||
clients_list = callomada(["-t", "myomada", "clients"])
|
||||
mylog(
|
||||
"verbose",
|
||||
[f'[{pluginName}] clients found:"{clients_list.count("\n")}"\n{clients_list}'],
|
||||
)
|
||||
|
||||
switches_and_aps = callomada(["-t", "myomada", "devices"])
|
||||
mylog(
|
||||
"verbose",
|
||||
[
|
||||
f'[{pluginName}] omada devices (switches, access points) found:"{switches_and_aps.count("\n")}" \n {switches_and_aps}'
|
||||
],
|
||||
)
|
||||
|
||||
# some_setting = get_setting_value('OMDSDN_url')
|
||||
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] some_setting value {some_setting}'])
|
||||
mylog(OMDLOGLEVEL, [f"[{pluginName}] ffsb"])
|
||||
|
||||
# retrieve data
|
||||
device_data = get_device_data(clients_list, switches_and_aps, device_handler)
|
||||
|
||||
# Process the data into native application tables
|
||||
mylog('verbose', [f'[{pluginName}] New entries to create: "{len(device_data)}"'])
|
||||
mylog("verbose", [f'[{pluginName}] New entries to create: "{len(device_data)}"'])
|
||||
if len(device_data) > 0:
|
||||
|
||||
# insert devices into the lats_result.log
|
||||
# make sure the below mapping is mapped in config.json, for example:
|
||||
#"database_column_definitions": [
|
||||
# "database_column_definitions": [
|
||||
# {
|
||||
# "column": "Object_PrimaryID", <--------- the value I save into primaryId
|
||||
# "mapped_to_column": "cur_MAC", <--------- gets unserted into the CurrentScan DB table column cur_MAC
|
||||
@@ -231,90 +291,114 @@ def main():
|
||||
|
||||
for device in device_data:
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] main parsing device: "{device}"'])
|
||||
myport = device[PORT_SSID] if device[PORT_SSID].isdigit() else ''
|
||||
myssid = device[PORT_SSID] if not device[PORT_SSID].isdigit() else ''
|
||||
ParentNetworkNode = ieee2ietf_mac_formater(device[SWITCH_AP]) if device[SWITCH_AP] != 'Internet' else 'Internet'
|
||||
myport = device[PORT_SSID] if device[PORT_SSID].isdigit() else ""
|
||||
myssid = device[PORT_SSID] if not device[PORT_SSID].isdigit() else ""
|
||||
ParentNetworkNode = (
|
||||
ieee2ietf_mac_formater(device[SWITCH_AP])
|
||||
if device[SWITCH_AP] != "Internet"
|
||||
else "Internet"
|
||||
)
|
||||
mymac = ieee2ietf_mac_formater(device[MAC])
|
||||
plugin_objects.add_object(
|
||||
primaryId = mymac, # MAC
|
||||
secondaryId = device[IP], # IP
|
||||
watched1 = device[NAME], # NAME/HOSTNAME
|
||||
watched2 = ParentNetworkNode, # PARENT NETWORK NODE MAC
|
||||
watched3 = myport, # PORT
|
||||
watched4 = myssid, # SSID
|
||||
extra = device[TYPE],
|
||||
#omada_site, # SITENAME (cur_NetworkSite) or VENDOR (cur_Vendor) (PICK one and adjust config.json -> "column": "Extra")
|
||||
foreignKey = device[MAC].lower().replace('-',':')) # usually MAC
|
||||
primaryId=mymac, # MAC
|
||||
secondaryId=device[IP], # IP
|
||||
watched1=device[NAME], # NAME/HOSTNAME
|
||||
watched2=ParentNetworkNode, # PARENT NETWORK NODE MAC
|
||||
watched3=myport, # PORT
|
||||
watched4=myssid, # SSID
|
||||
extra=device[TYPE],
|
||||
# omada_site, # SITENAME (cur_NetworkSite) or VENDOR (cur_Vendor) (PICK one and adjust config.json -> "column": "Extra")
|
||||
foreignKey=device[MAC].lower().replace("-", ":"),
|
||||
) # usually MAC
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] New entries: "{mymac:<18}, {device[IP]:<16}, {device[NAME]:<63}, {ParentNetworkNode:<18}, {myport:<4}, {myssid:<32}, {device[TYPE]}"'])
|
||||
mylog('verbose', [f'[{pluginName}] New entries: "{len(device_data)}"'])
|
||||
mylog(
|
||||
"verbose",
|
||||
[
|
||||
f'[{pluginName}] New entries: "{mymac:<18}, {device[IP]:<16}, {device[NAME]:<63}, {ParentNetworkNode:<18}, {myport:<4}, {myssid:<32}, {device[TYPE]}"'
|
||||
],
|
||||
)
|
||||
mylog("verbose", [f'[{pluginName}] New entries: "{len(device_data)}"'])
|
||||
|
||||
# log result
|
||||
plugin_objects.write_result_file()
|
||||
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] TEST name from MAC: {device_handler.getValueWithMac('devName','00:e2:59:00:a0:8e')}'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] TEST MAC from IP: {get_mac_from_IP('192.168.0.1')} also {ietf2ieee_mac_formater(get_mac_from_IP('192.168.0.1'))}'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] TEST name from MAC: {device_handler.getValueWithMac('devName','00:e2:59:00:a0:8e')}'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] TEST MAC from IP: {get_mac_from_IP('192.168.0.1')} also {ietf2ieee_mac_formater(get_mac_from_IP('192.168.0.1'))}'])
|
||||
end_time = time.time()
|
||||
mylog('verbose', [f'[{pluginName}] execution completed in {end_time - start_time:.2f} seconds'])
|
||||
|
||||
mylog(
|
||||
"verbose",
|
||||
[f"[{pluginName}] execution completed in {end_time - start_time:.2f} seconds"],
|
||||
)
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
def get_omada_devices_details(msadevice_data):
|
||||
mthisswitch = msadevice_data[dMAC]
|
||||
mtype = msadevice_data[dTYPE]
|
||||
mswitch_detail = ''
|
||||
mswitch_dump = ''
|
||||
if mtype == 'ap':
|
||||
mswitch_detail = callomada(['access-point', mthisswitch])
|
||||
elif mtype == 'switch':
|
||||
mswitch_detail = callomada(['switch', mthisswitch])
|
||||
mswitch_dump = callomada(['-t','myomada','switch','-d',mthisswitch])
|
||||
mswitch_detail = ""
|
||||
mswitch_dump = ""
|
||||
if mtype == "ap":
|
||||
mswitch_detail = callomada(["access-point", mthisswitch])
|
||||
elif mtype == "switch":
|
||||
mswitch_detail = callomada(["switch", mthisswitch])
|
||||
mswitch_dump = callomada(["-t", "myomada", "switch", "-d", mthisswitch])
|
||||
else:
|
||||
mswitch_detail = ''
|
||||
nswitch_dump = ''
|
||||
mswitch_detail = ""
|
||||
nswitch_dump = ""
|
||||
return mswitch_detail, mswitch_dump
|
||||
|
||||
|
||||
def get_omada_devices_details_parallel(msadevice_data):
|
||||
mthisswitch = msadevice_data[dMAC]
|
||||
mtype = msadevice_data[dTYPE]
|
||||
mswitch_detail = ''
|
||||
mswitch_dump = ''
|
||||
if mtype == 'ap':
|
||||
mswitch_detail = subprocess.run('omada access-point '+mthisswitch, capture_output=True, text=True, shell=True).stdout
|
||||
elif mtype == 'switch':
|
||||
mswitch_detail = subprocess.run('omada switch '+mthisswitch, capture_output=True, text=True, shell=True).stdout
|
||||
mswitch_dump = subprocess.run('omada access-point '+mthisswitch, capture_output=True, text=True, shell=True).stdout
|
||||
mswitch_detail = ""
|
||||
mswitch_dump = ""
|
||||
if mtype == "ap":
|
||||
mswitch_detail = subprocess.run(
|
||||
"omada access-point " + mthisswitch,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
shell=True,
|
||||
).stdout
|
||||
elif mtype == "switch":
|
||||
mswitch_detail = subprocess.run(
|
||||
"omada switch " + mthisswitch, capture_output=True, text=True, shell=True
|
||||
).stdout
|
||||
mswitch_dump = subprocess.run(
|
||||
"omada access-point " + mthisswitch,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
shell=True,
|
||||
).stdout
|
||||
else:
|
||||
mswitch_detail = ''
|
||||
mswitch_dump = ''
|
||||
mswitch_detail = ""
|
||||
mswitch_dump = ""
|
||||
return mthisswitch, mswitch_detail, mswitch_dump
|
||||
|
||||
|
||||
# ----------------------------------------------
|
||||
# retrieve data
|
||||
def get_device_data(omada_clients_output,switches_and_aps,device_handler):
|
||||
|
||||
|
||||
def get_device_data(omada_clients_output, switches_and_aps, device_handler):
|
||||
# sample omada devices input format:
|
||||
# 0.MAC 1.IP 2.type 3.status 4.name 5.model
|
||||
#40-AE-30-A5-A7-50 192.168.0.11 ap CONNECTED office_Access_point EAP773(US) v1.0
|
||||
#B0-95-75-46-0C-39 192.168.0.4 switch CONNECTED pantry12 T1600G-52PS v4.0
|
||||
# 40-AE-30-A5-A7-50 192.168.0.11 ap CONNECTED office_Access_point EAP773(US) v1.0
|
||||
# B0-95-75-46-0C-39 192.168.0.4 switch CONNECTED pantry12 T1600G-52PS v4.0
|
||||
#
|
||||
# sample target output:
|
||||
# 0 MAC, 1 IP, 2 Name, 3 switch/AP, 4 port/SSID, 5 TYPE
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', '17', '40-AE-30-A5-A7-50, 'Switch']"
|
||||
#constants
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', '17', '40-AE-30-A5-A7-50, 'Switch']"
|
||||
# constants
|
||||
sadevices_macbyname = {}
|
||||
sadevices_macbymac = {}
|
||||
sadevices_linksbymac = {}
|
||||
port_byswitchmac_byclientmac = {}
|
||||
device_data_bymac = {}
|
||||
device_data_mac_byip = {}
|
||||
omada_force_overwrite = get_setting_value('OMDSDN_force_overwrite')
|
||||
omada_force_overwrite = get_setting_value("OMDSDN_force_overwrite")
|
||||
switch_details = {}
|
||||
switch_dumps = {}
|
||||
'''
|
||||
"""
|
||||
command = 'which omada'
|
||||
def run_command(command, index):
|
||||
result = subprocess.run(command, capture_output=True, text=True, shell=True)
|
||||
@@ -322,108 +406,125 @@ def get_device_data(omada_clients_output,switches_and_aps,device_handler):
|
||||
|
||||
myindex, command_output= run_command(command, 2)
|
||||
mylog('verbose', [f'[{pluginName}] command={command} index={myindex} results={command_output}'])
|
||||
'''
|
||||
"""
|
||||
sadevices = switches_and_aps.splitlines()
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] switches_and_aps rows: "{len(sadevices)}"'])
|
||||
|
||||
with multiprocessing.Pool(processes = PARALLELISM) as mypool:
|
||||
oresults = mypool.map(get_omada_devices_details_parallel, [sadevice.split() for sadevice in sadevices])
|
||||
with multiprocessing.Pool(processes=PARALLELISM) as mypool:
|
||||
oresults = mypool.map(
|
||||
get_omada_devices_details_parallel,
|
||||
[sadevice.split() for sadevice in sadevices],
|
||||
)
|
||||
|
||||
for thisswitch, details, dump in oresults:
|
||||
switch_details[thisswitch] = details
|
||||
switch_dumps[thisswitch] = dump
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] switch={thisswitch} details={details}'])
|
||||
mylog(OMDLOGLEVEL, [f"[{pluginName}] switch={thisswitch} details={details}"])
|
||||
|
||||
'''
|
||||
"""
|
||||
for sadevice in sadevices:
|
||||
sadevice_data = sadevice.split()
|
||||
thisswitch = sadevice_data[dMAC]
|
||||
thistype = sadevice_data[dTYPE]
|
||||
switch_details[thisswitch], switch_dumps[thisswitch] = get_omada_devices_details(sadevice_data)
|
||||
'''
|
||||
"""
|
||||
|
||||
mylog('verbose', [f'[{pluginName}] switches details collected "{len(switch_details)}"'])
|
||||
mylog('verbose', [f'[{pluginName}] dump details collected "{len(switch_details)}"'])
|
||||
mylog(
|
||||
"verbose",
|
||||
[f'[{pluginName}] switches details collected "{len(switch_details)}"'],
|
||||
)
|
||||
mylog("verbose", [f'[{pluginName}] dump details collected "{len(switch_details)}"'])
|
||||
|
||||
for sadevice in sadevices:
|
||||
sadevice_data = sadevice.split()
|
||||
thisswitch = sadevice_data[dMAC]
|
||||
sadevices_macbyname[sadevice_data[4]] = thisswitch
|
||||
if sadevice_data[dTYPE] == 'ap':
|
||||
sadevice_type = 'AP'
|
||||
#sadevice_details = callomada(['access-point', thisswitch])
|
||||
if sadevice_data[dTYPE] == "ap":
|
||||
sadevice_type = "AP"
|
||||
# sadevice_details = callomada(['access-point', thisswitch])
|
||||
sadevice_details = switch_details[thisswitch]
|
||||
if sadevice_details == '':
|
||||
if sadevice_details == "":
|
||||
sadevice_links = [thisswitch]
|
||||
else:
|
||||
sadevice_links = extract_mac_addresses(sadevice_details)
|
||||
sadevices_linksbymac[thisswitch] = sadevice_links[1:]
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]adding switch details: "{sadevice_details}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]links are: "{sadevice_links}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]linksbymac are: "{sadevices_linksbymac[thisswitch]}"'])
|
||||
elif sadevice_data[dTYPE] == 'switch':
|
||||
sadevice_type = 'Switch'
|
||||
#sadevice_details=callomada(['switch', thisswitch])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]adding switch details: "{sadevice_details}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]links are: "{sadevice_links}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]linksbymac are: "{sadevices_linksbymac[thisswitch]}"'])
|
||||
elif sadevice_data[dTYPE] == "switch":
|
||||
sadevice_type = "Switch"
|
||||
# sadevice_details=callomada(['switch', thisswitch])
|
||||
sadevice_details = switch_details[thisswitch]
|
||||
if sadevice_details == '':
|
||||
if sadevice_details == "":
|
||||
sadevice_links = [thisswitch]
|
||||
else:
|
||||
sadevice_links=extract_mac_addresses(sadevice_details)
|
||||
sadevice_links = extract_mac_addresses(sadevice_details)
|
||||
sadevices_linksbymac[thisswitch] = sadevice_links[1:]
|
||||
# recovering the list of switches connected to sadevice switch and on which port...
|
||||
#switchdump = callomada(['-t','myomada','switch','-d',thisswitch])
|
||||
# switchdump = callomada(['-t','myomada','switch','-d',thisswitch])
|
||||
switchdump = switch_dumps[thisswitch]
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] switchdump: {switchdump}'])
|
||||
mylog(OMDLOGLEVEL, [f"[{pluginName}] switchdump: {switchdump}"])
|
||||
port_byswitchmac_byclientmac[thisswitch] = {}
|
||||
for link in sadevices_linksbymac[thisswitch]:
|
||||
port_pattern = r"(?:{[^}]*\"port\"\: )([0-9]+)(?=[^}]*"+re.escape(link)+r")"
|
||||
myport = re.findall(port_pattern, switchdump,re.DOTALL)
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}] switchdump: link={link} myport:{myport}'])
|
||||
port_byswitchmac_byclientmac[thisswitch][link] = myport[0] if myport else ''
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]links are: "{sadevice_links}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]linksbymac are: "{sadevices_linksbymac[thisswitch]}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]ports of each links are: "{port_byswitchmac_byclientmac[thisswitch]}"'])
|
||||
#mylog(OMDLOGLEVEL, [f'[{pluginName}]adding switch details: "{sadevice_details}"'])
|
||||
port_pattern = (
|
||||
r"(?:{[^}]*\"port\"\: )([0-9]+)(?=[^}]*" + re.escape(link) + r")"
|
||||
)
|
||||
myport = re.findall(port_pattern, switchdump, re.DOTALL)
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}] switchdump: link={link} myport:{myport}'])
|
||||
port_byswitchmac_byclientmac[thisswitch][link] = (
|
||||
myport[0] if myport else ""
|
||||
)
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]links are: "{sadevice_links}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]linksbymac are: "{sadevices_linksbymac[thisswitch]}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]ports of each links are: "{port_byswitchmac_byclientmac[thisswitch]}"'])
|
||||
# mylog(OMDLOGLEVEL, [f'[{pluginName}]adding switch details: "{sadevice_details}"'])
|
||||
else:
|
||||
sadevice_type = 'null'
|
||||
sadevice_details='null'
|
||||
device_data_bymac[thisswitch] = [thisswitch, sadevice_data[dIP], sadevice_data[dNAME], 'null', 'null',sadevice_type]
|
||||
sadevice_type = "null"
|
||||
sadevice_details = "null"
|
||||
device_data_bymac[thisswitch] = [
|
||||
thisswitch,
|
||||
sadevice_data[dIP],
|
||||
sadevice_data[dNAME],
|
||||
"null",
|
||||
"null",
|
||||
sadevice_type,
|
||||
]
|
||||
device_data_mac_byip[sadevice_data[dIP]] = thisswitch
|
||||
foo=[thisswitch, sadevice_data[1], sadevice_data[4], 'null', 'null']
|
||||
foo = [thisswitch, sadevice_data[1], sadevice_data[4], "null", "null"]
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}]adding switch: "{foo}"'])
|
||||
|
||||
|
||||
|
||||
|
||||
# sadevices_macbymac[thisswitch] = thisswitch
|
||||
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] switch_macbyname: "{sadevices_macbyname}"'])
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] switches: "{device_data_bymac}"'])
|
||||
|
||||
|
||||
# do some processing, call exteranl APIs, and return a device list
|
||||
# ...
|
||||
# sample omada clients input format:
|
||||
# 0 MAC, 1 IP, 2 Name, 3 switch/AP, 4 port/SSID,
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', 'myssid_name2', '(office_Access_point)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-01', '192.168.0.153', 'frontyard_ESP_29E753', 'pantry12', '(48)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-02', '192.168.0.1', 'bastion', 'office24', '(23)']"
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-03', '192.168.0.226', 'brick', 'myssid_name3', '(office_Access_point)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', '1A-2B-3C-4D-5E-6F', 'myssid_name2', '(office_Access_point)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-01', '192.168.0.153', 'frontyard_ESP_29E753', 'pantry12', '(48)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-02', '192.168.0.1', 'bastion', 'office24', '(23)']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-03', '192.168.0.226', 'brick', 'myssid_name3', '(office_Access_point)']"
|
||||
|
||||
# sample target output:
|
||||
# 0 MAC, 1 IP, 2 Name, 3 MAC of switch/AP, 4 port/SSID, 5 TYPE
|
||||
#17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', 'brick', 'office_Access_point','myssid_name2', , 'Switch']"
|
||||
# 17:27:10 [<unique_prefix>] token: "['1A-2B-3C-4D-5E-6F', '192.168.0.217', 'brick', 'office_Access_point','myssid_name2', , 'Switch']"
|
||||
|
||||
odevices = omada_clients_output.splitlines()
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] omada_clients_outputs rows: "{len(odevices)}"'])
|
||||
mylog(
|
||||
OMDLOGLEVEL, [f'[{pluginName}] omada_clients_outputs rows: "{len(odevices)}"']
|
||||
)
|
||||
omada_clients_to_rename = []
|
||||
|
||||
for odevice in odevices:
|
||||
odevice_data = odevice.split()
|
||||
odevice_data_reordered = [ MAC, IP, NAME, SWITCH_AP, PORT_SSID, TYPE]
|
||||
odevice_data_reordered[MAC]=odevice_data[cMAC]
|
||||
odevice_data_reordered[IP]=odevice_data[cIP]
|
||||
real_naxname = device_handler.getValueWithMac('devName',ieee2ietf_mac_formater(odevice_data[cMAC]))
|
||||
odevice_data_reordered = [MAC, IP, NAME, SWITCH_AP, PORT_SSID, TYPE]
|
||||
odevice_data_reordered[MAC] = odevice_data[cMAC]
|
||||
odevice_data_reordered[IP] = odevice_data[cIP]
|
||||
real_naxname = device_handler.getValueWithMac(
|
||||
"devName", ieee2ietf_mac_formater(odevice_data[cMAC])
|
||||
)
|
||||
|
||||
#
|
||||
# if the name stored in Nax for a device is empty or the MAC addres or has some parenthhesis or is the same as in omada
|
||||
@@ -432,38 +533,59 @@ def get_device_data(omada_clients_output,switches_and_aps,device_handler):
|
||||
|
||||
naxname = real_naxname
|
||||
if real_naxname != None:
|
||||
if '(' in real_naxname:
|
||||
if "(" in real_naxname:
|
||||
# removing parenthesis and domains from the name
|
||||
naxname = real_naxname.split('(')[0]
|
||||
if naxname != None and '.' in naxname:
|
||||
naxname = naxname.split('.')[0]
|
||||
if naxname in ( None, 'null', '' ):
|
||||
naxname = odevice_data[cNAME] if odevice_data[cNAME] != '' else odevice_data[cMAC]
|
||||
naxname = real_naxname.split("(")[0]
|
||||
if naxname != None and "." in naxname:
|
||||
naxname = naxname.split(".")[0]
|
||||
if naxname in (None, "null", ""):
|
||||
naxname = (
|
||||
odevice_data[cNAME] if odevice_data[cNAME] != "" else odevice_data[cMAC]
|
||||
)
|
||||
naxname = naxname.strip()
|
||||
mylog('debug', [f'[{pluginName}] TEST name from MAC: {naxname}'])
|
||||
if odevice_data[cNAME] in ('null', ''):
|
||||
mylog('verbose', [f'[{pluginName}] updating omada server because odevice_data is: {odevice_data[cNAME]} and naxname is: "{naxname}"'])
|
||||
omada_clients_to_rename.append(['set-client-name',odevice_data[cMAC], naxname])
|
||||
#callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
mylog("debug", [f"[{pluginName}] TEST name from MAC: {naxname}"])
|
||||
if odevice_data[cNAME] in ("null", ""):
|
||||
mylog(
|
||||
"verbose",
|
||||
[
|
||||
f'[{pluginName}] updating omada server because odevice_data is: {odevice_data[cNAME]} and naxname is: "{naxname}"'
|
||||
],
|
||||
)
|
||||
omada_clients_to_rename.append(
|
||||
["set-client-name", odevice_data[cMAC], naxname]
|
||||
)
|
||||
# callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
odevice_data_reordered[NAME] = naxname
|
||||
elif odevice_data[cNAME] == odevice_data[cMAC] and ieee2ietf_mac_formater(naxname) != ieee2ietf_mac_formater(odevice_data[cNAME]) :
|
||||
mylog('verbose', [f'[{pluginName}] updating omada server because odevice_data is: "{odevice_data[cNAME]} and naxname is: "{naxname}"'])
|
||||
omada_clients_to_rename.append(['set-client-name',odevice_data[cMAC], naxname])
|
||||
#callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
elif odevice_data[cNAME] == odevice_data[cMAC] and ieee2ietf_mac_formater(
|
||||
naxname
|
||||
) != ieee2ietf_mac_formater(odevice_data[cNAME]):
|
||||
mylog(
|
||||
"verbose",
|
||||
[
|
||||
f'[{pluginName}] updating omada server because odevice_data is: "{odevice_data[cNAME]} and naxname is: "{naxname}"'
|
||||
],
|
||||
)
|
||||
omada_clients_to_rename.append(
|
||||
["set-client-name", odevice_data[cMAC], naxname]
|
||||
)
|
||||
# callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
odevice_data_reordered[NAME] = naxname
|
||||
else:
|
||||
if omada_force_overwrite and naxname != odevice_data[cNAME] :
|
||||
mylog('verbose', [f'[{pluginName}] updating omada server because odevice_data is: "{odevice_data[cNAME]} and naxname is: "{naxname}"'])
|
||||
omada_clients_to_rename.append(['set-client-name',odevice_data[cMAC], naxname])
|
||||
#callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
if omada_force_overwrite and naxname != odevice_data[cNAME]:
|
||||
mylog(
|
||||
"verbose",
|
||||
[
|
||||
f'[{pluginName}] updating omada server because odevice_data is: "{odevice_data[cNAME]} and naxname is: "{naxname}"'
|
||||
],
|
||||
)
|
||||
omada_clients_to_rename.append(
|
||||
["set-client-name", odevice_data[cMAC], naxname]
|
||||
)
|
||||
# callomada(['set-client-name', odevice_data[cMAC], naxname])
|
||||
odevice_data_reordered[NAME] = naxname
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mightbeport = odevice_data[cPORT_SSID].lstrip('(')
|
||||
mightbeport = mightbeport.rstrip(')')
|
||||
mightbeport = odevice_data[cPORT_SSID].lstrip("(")
|
||||
mightbeport = mightbeport.rstrip(")")
|
||||
if mightbeport.isdigit():
|
||||
odevice_data_reordered[SWITCH_AP] = odevice_data[cSWITCH_AP]
|
||||
odevice_data_reordered[PORT_SSID] = mightbeport
|
||||
@@ -476,22 +598,30 @@ def get_device_data(omada_clients_output,switches_and_aps,device_handler):
|
||||
mightbemac = sadevices_macbyname[odevice_data_reordered[SWITCH_AP]]
|
||||
odevice_data_reordered[SWITCH_AP] = mightbemac
|
||||
except KeyError:
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] could not find the mac adddress for: "{odevice_data_reordered[SWITCH_AP]}"'])
|
||||
mylog(
|
||||
OMDLOGLEVEL,
|
||||
[
|
||||
f'[{pluginName}] could not find the mac adddress for: "{odevice_data_reordered[SWITCH_AP]}"'
|
||||
],
|
||||
)
|
||||
# adding the type
|
||||
odevice_data_reordered[TYPE] = 'null'
|
||||
odevice_data_reordered[TYPE] = "null"
|
||||
device_data_bymac[odevice_data_reordered[MAC]] = odevice_data_reordered
|
||||
device_data_mac_byip[odevice_data_reordered[IP]] = odevice_data_reordered[MAC]
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] tokens: "{odevice_data}"'])
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] tokens_reordered: "{odevice_data_reordered}"'])
|
||||
mylog(
|
||||
OMDLOGLEVEL,
|
||||
[f'[{pluginName}] tokens_reordered: "{odevice_data_reordered}"'],
|
||||
)
|
||||
# RENAMING
|
||||
#for omada_client_to_rename in omada_clients_to_rename:
|
||||
# for omada_client_to_rename in omada_clients_to_rename:
|
||||
# mylog('verbose', [f'[{pluginName}] calling omada: "{omada_client_to_rename}"'])
|
||||
#callomada(omada_client_to_rename)
|
||||
# callomada(omada_client_to_rename)
|
||||
|
||||
# populating the uplinks nodes of the omada switches and access points manually
|
||||
# since OMADA SDN makes is unreliable if the gateway is not their own tplink hardware...
|
||||
#
|
||||
with multiprocessing.Pool(processes = PARALLELISM) as mypool2:
|
||||
with multiprocessing.Pool(processes=PARALLELISM) as mypool2:
|
||||
oresults = mypool2.map(callomada, omada_clients_to_rename)
|
||||
mylog(OMDLOGLEVEL, [f'[{pluginName}] results are: "{oresults}"'])
|
||||
|
||||
@@ -499,19 +629,26 @@ def get_device_data(omada_clients_output,switches_and_aps,device_handler):
|
||||
#
|
||||
default_router_ip = find_default_gateway_ip()
|
||||
default_router_mac = ietf2ieee_mac_formater(get_mac_from_IP(default_router_ip))
|
||||
device_data_bymac[default_router_mac][TYPE] = 'Firewall'
|
||||
device_data_bymac[default_router_mac][TYPE] = "Firewall"
|
||||
# step2 let's find the first switch and set the default router parent to internet
|
||||
first_switch=device_data_bymac[default_router_mac][SWITCH_AP]
|
||||
device_data_bymac[default_router_mac][SWITCH_AP] = 'Internet'
|
||||
first_switch = device_data_bymac[default_router_mac][SWITCH_AP]
|
||||
device_data_bymac[default_router_mac][SWITCH_AP] = "Internet"
|
||||
# step3 let's set the switch connected to the default gateway uplink to the default gateway and hardcode port to 1 for now:
|
||||
#device_data_bymac[first_switch][SWITCH_AP]=default_router_mac
|
||||
#device_data_bymac[first_switch][SWITCH_AP][PORT_SSID] = '1'
|
||||
# device_data_bymac[first_switch][SWITCH_AP]=default_router_mac
|
||||
# device_data_bymac[first_switch][SWITCH_AP][PORT_SSID] = '1'
|
||||
# step4, let's go recursively through switches other links to mark update their uplinks
|
||||
# and pray it ends one day...
|
||||
#
|
||||
if len(sadevices) > 0:
|
||||
add_uplink(default_router_mac,first_switch, device_data_bymac,sadevices_linksbymac,port_byswitchmac_byclientmac)
|
||||
add_uplink(
|
||||
default_router_mac,
|
||||
first_switch,
|
||||
device_data_bymac,
|
||||
sadevices_linksbymac,
|
||||
port_byswitchmac_byclientmac,
|
||||
)
|
||||
return device_data_bymac.values()
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -236,8 +236,9 @@ def main():
|
||||
# Prepare the insert statement
|
||||
if new_devices:
|
||||
|
||||
columns = ', '.join(k for k in new_devices[0].keys() if k != 'rowid')
|
||||
placeholders = ', '.join('?' for k in new_devices[0] if k != 'rowid')
|
||||
# creating insert statement, removing 'rowid', 'devStatus' as handled on the target and devStatus is resolved on the fly
|
||||
columns = ', '.join(k for k in new_devices[0].keys() if k not in ['rowid', 'devStatus'])
|
||||
placeholders = ', '.join('?' for k in new_devices[0] if k not in ['rowid', 'devStatus'])
|
||||
sql = f'INSERT INTO Devices ({columns}) VALUES ({placeholders})'
|
||||
|
||||
# Extract values for the new devices
|
||||
@@ -255,8 +256,6 @@ def main():
|
||||
write_notification(message, 'info', timeNowTZ())
|
||||
|
||||
|
||||
|
||||
|
||||
# Commit and close the connection
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
<?php
|
||||
//------------------------------------------------------------------------------
|
||||
// check if authenticated
|
||||
require_once $_SERVER['DOCUMENT_ROOT'] . '/php/templates/security.php';
|
||||
?>
|
||||
|
||||
<!-- ----------------------------------------------------------------------- -->
|
||||
<!-- Datatable -->
|
||||
|
||||
@@ -464,151 +464,10 @@ $settingsJSON_DB = json_encode($settings, JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX
|
||||
}
|
||||
|
||||
// INPUT
|
||||
|
||||
// Parse the setType JSON string into an object
|
||||
let inputHtml = '';
|
||||
|
||||
console.log(setKey);
|
||||
console.log(setType);
|
||||
|
||||
const setTypeObject = JSON.parse(setType.replace(/'/g, '"'));
|
||||
|
||||
const dataType = setTypeObject.dataType;
|
||||
const elements = setTypeObject.elements || [];
|
||||
|
||||
// Iterate through each element in elements array
|
||||
elements.forEach(elementObj => {
|
||||
const { elementType, elementOptions = [], transformers = [] } = elementObj;
|
||||
const {
|
||||
inputType,
|
||||
readOnly,
|
||||
isMultiSelect,
|
||||
isOrdeable,
|
||||
cssClasses,
|
||||
placeholder,
|
||||
suffix,
|
||||
sourceIds,
|
||||
separator,
|
||||
editable,
|
||||
valRes,
|
||||
getStringKey,
|
||||
onClick,
|
||||
onChange,
|
||||
customParams,
|
||||
customId
|
||||
} = handleElementOptions(setKey, elementOptions, transformers, valIn);
|
||||
|
||||
// override
|
||||
val = valRes;
|
||||
|
||||
// Generate HTML based on dataType and elementType
|
||||
switch (elementType) {
|
||||
case 'select':
|
||||
let multi = isMultiSelect ? "multiple" : "";
|
||||
let addCss = isOrdeable ? "select2 select2-hidden-accessible" : "";
|
||||
|
||||
|
||||
inputHtml += `<select onChange="settingsChanged();${onChange}"
|
||||
my-data-type="${dataType}"
|
||||
my-editable="${editable}"
|
||||
class="form-control ${addCss}"
|
||||
name="${setKey}"
|
||||
id="${setKey}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
${multi}>
|
||||
<option value="" id="${setKey + "_temp_"}"></option>
|
||||
</select>`;
|
||||
|
||||
generateOptionsOrSetOptions(setKey, createArray(val), `${setKey}_temp_`, generateOptions, targetField = null, transformers);
|
||||
|
||||
break;
|
||||
|
||||
case 'input':
|
||||
let checked = val === 'True' || val === '1' ? 'checked' : '';
|
||||
inputType === 'checkbox' ? inputClass = 'checkbox' : inputClass = 'form-control';
|
||||
|
||||
inputHtml += `
|
||||
<input
|
||||
class="${inputClass} ${cssClasses}"
|
||||
onChange="settingsChanged();${onChange}"
|
||||
my-data-type="${dataType}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
id="${setKey}${suffix}"
|
||||
type="${inputType}"
|
||||
value="${val}"
|
||||
${readOnly}
|
||||
${checked}
|
||||
placeholder="${placeholder}"
|
||||
/>`;
|
||||
break;
|
||||
|
||||
case 'button':
|
||||
|
||||
inputHtml += `
|
||||
<button
|
||||
class="btn btn-primary ${cssClasses}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
my-input-from="${sourceIds}"
|
||||
my-input-to="${setKey}"
|
||||
onclick="${onClick}">
|
||||
${getString(getStringKey)}
|
||||
</button>`;
|
||||
break;
|
||||
case 'textarea':
|
||||
inputHtml += `
|
||||
<textarea
|
||||
class="form-control input"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
my-data-type="${dataType}"
|
||||
id="${setKey}"
|
||||
${readOnly}>
|
||||
${val}
|
||||
</textarea>`;
|
||||
break;
|
||||
case 'span':
|
||||
inputHtml += `
|
||||
<span
|
||||
class="${cssClasses}"
|
||||
my-data-type="${dataType}"
|
||||
my-customparams="${customParams}"
|
||||
my-customid="${customId}"
|
||||
>
|
||||
${getString(getStringKey)}
|
||||
</span>`;
|
||||
break;
|
||||
|
||||
default:
|
||||
console.warn(`🟥Unknown element type: ${elementType}`);
|
||||
}
|
||||
});
|
||||
|
||||
// EVENTS
|
||||
// process events (e.g. run a scan, or test a notification) if associated with the setting
|
||||
let eventsHtml = "";
|
||||
|
||||
const eventsList = createArray(set['setEvents']);
|
||||
|
||||
if (eventsList.length > 0) {
|
||||
// console.log(eventsList)
|
||||
eventsList.forEach(event => {
|
||||
eventsHtml += `<span class="input-group-addon pointer"
|
||||
data-myparam="${setKey}"
|
||||
data-myparam-plugin="${prefix}"
|
||||
data-myevent="${event}"
|
||||
onclick="addToExecutionQueue_settingEvent(this)"
|
||||
>
|
||||
<i title="${getString(event + "_event_tooltip")}" class="fa ${getString(event + "_event_icon")}">
|
||||
</i>
|
||||
</span>`;
|
||||
});
|
||||
}
|
||||
inputFormHtml = generateFormHtml(set, valIn);
|
||||
|
||||
// construct final HTML for the setting
|
||||
setHtml += inputHtml + eventsHtml + overrideHtml + `
|
||||
setHtml += inputFormHtml + overrideHtml + `
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
@@ -100,6 +100,7 @@ sql_devices_tiles = """
|
||||
(SELECT COUNT(*) FROM Devices WHERE devPresentLastScan = 0 AND devAlertDown = 1) AS down,
|
||||
(SELECT COUNT(*) FROM Devices WHERE devIsNew = 1) AS new,
|
||||
(SELECT COUNT(*) FROM Devices WHERE devIsArchived = 1) AS archived,
|
||||
(SELECT COUNT(*) FROM Devices WHERE devFavorite = 1) AS favorites,
|
||||
-- My Devices count
|
||||
(SELECT COUNT(*) FROM MyDevicesFilter) AS my_devices
|
||||
FROM Statuses;
|
||||
|
||||
@@ -452,10 +452,17 @@ def update_devices_data_from_scan (db):
|
||||
|
||||
# Guess ICONS
|
||||
recordsToUpdate = []
|
||||
|
||||
default_icon = get_setting_value('NEWDEV_devIcon')
|
||||
|
||||
if get_setting_value('NEWDEV_replace_preset_icon'):
|
||||
query = f"""SELECT * FROM Devices
|
||||
WHERE devIcon in ('', 'null', '{default_icon}')
|
||||
OR devIcon IS NULL"""
|
||||
else:
|
||||
query = """SELECT * FROM Devices
|
||||
WHERE devIcon in ('', 'null')
|
||||
OR devIcon IS NULL"""
|
||||
default_icon = get_setting_value('NEWDEV_devIcon')
|
||||
|
||||
for device in sql.execute (query) :
|
||||
# Conditional logic for devIcon guessing
|
||||
|
||||
@@ -372,7 +372,7 @@ def setting_value_to_python_type(set_type, set_value):
|
||||
transformers = element_with_input_value.get('transformers', [])
|
||||
|
||||
# Convert value based on dataType and elementType
|
||||
if dataType == 'string' and elementType in ['input', 'select']:
|
||||
if dataType == 'string' and elementType in ['input', 'select', 'textarea']:
|
||||
value = reverseTransformers(str(set_value), transformers)
|
||||
|
||||
elif dataType == 'integer' and (elementType == 'input' or elementType == 'select'):
|
||||
|
||||
Reference in New Issue
Block a user