mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-15 22:51:37 -07:00
Docs + Device list rework 🔨
This commit is contained in:
+99
-7
@@ -325,8 +325,48 @@ function initializeDatatable () {
|
||||
}
|
||||
}
|
||||
|
||||
$.get('api/table_devices.json', function(result) {
|
||||
// var list = data["data"];
|
||||
|
||||
// Convert JSON data into the desired format
|
||||
var dataArray = {
|
||||
data: result.data.map(function(item) {
|
||||
return [
|
||||
item.dev_Icon || "",
|
||||
item.dev_Name || "",
|
||||
item.dev_Status || "",
|
||||
item.dev_MAC || "",
|
||||
item.dev_LastIP || "",
|
||||
item.dev_Group || "",
|
||||
item.dev_DeviceType || "",
|
||||
item.dev_StaticIP || 0,
|
||||
item.dev_Favorite || "",
|
||||
item.dev_FirstConnection || "",
|
||||
item.dev_LastConnection || "",
|
||||
item.dev_NewDevice || 0,
|
||||
item.dev_MAC_full || "",
|
||||
item.connected_devices || 0,
|
||||
item.dev_Network_Node_MAC_ADDR || "",
|
||||
item.dev_Network_Node_port || 0,
|
||||
item.dev_Network_Node_MAC_ADDR || "",
|
||||
item.dev_Vendor || "",
|
||||
item.dev_Network_Node_port || ""
|
||||
];
|
||||
})
|
||||
};
|
||||
|
||||
console.log("aaaaa")
|
||||
console.log(JSON.stringify(dataArray))
|
||||
console.log(dataArray)
|
||||
console.log()
|
||||
|
||||
// TODO Filter
|
||||
// TODO displayed columns
|
||||
// TODO columns order
|
||||
|
||||
var table=
|
||||
$('#tableDevices').DataTable({
|
||||
'data' : dataArray["data"],
|
||||
'paging' : true,
|
||||
'lengthChange' : true,
|
||||
'lengthMenu' : [[10, 25, 50, 100, 500, -1], [10, 25, 50, 100, 500, '<?= lang('Device_Tablelenght_all');?>']],
|
||||
@@ -351,6 +391,8 @@ function initializeDatatable () {
|
||||
// Device Name
|
||||
{targets: [mapIndx(0)],
|
||||
'createdCell': function (td, cellData, rowData, row, col) {
|
||||
|
||||
console.log(cellData)
|
||||
$(td).html ('<b class="anonymizeDev"><a href="deviceDetails.php?mac='+ rowData[mapIndx(11)] +'" class="">'+ cellData +'</a></b>');
|
||||
} },
|
||||
|
||||
@@ -461,6 +503,10 @@ function initializeDatatable () {
|
||||
setCache ('devicesList', getDevicesFromTable(table) );
|
||||
} );
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -513,11 +559,6 @@ function getDevicesTotals () {
|
||||
} );
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
function getDeviceColumns () {
|
||||
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
function getDevicesList (status) {
|
||||
// Save status selected
|
||||
@@ -539,9 +580,60 @@ function getDevicesList (status) {
|
||||
$('#tableDevicesBox')[0].className = 'box box-'+ color;
|
||||
$('#tableDevicesTitle').html (tableTitle);
|
||||
|
||||
|
||||
|
||||
$.get('api/table_devices.json', function(result_1) {
|
||||
// var list = data["data"];
|
||||
|
||||
// Convert JSON data into the desired format
|
||||
var dataArray = {
|
||||
data: result_1.data.map(function(item) {
|
||||
return [
|
||||
item.dev_Icon || "",
|
||||
item.dev_Name || "",
|
||||
item.dev_Status || "",
|
||||
item.dev_MAC || "",
|
||||
item.dev_LastIP || "",
|
||||
item.dev_Group || "",
|
||||
item.dev_DeviceType || "",
|
||||
item.dev_StaticIP || 0,
|
||||
item.dev_Favorite || "",
|
||||
item.dev_FirstConnection || "",
|
||||
item.dev_LastConnection || "",
|
||||
item.dev_NewDevice || 0,
|
||||
item.dev_MAC_full || "",
|
||||
item.connected_devices || 0,
|
||||
item.dev_Network_Node_MAC_ADDR || "",
|
||||
item.dev_Network_Node_port || 0,
|
||||
item.dev_Network_Node_MAC_ADDR || "",
|
||||
item.dev_Vendor || "",
|
||||
item.dev_Network_Node_port || ""
|
||||
];
|
||||
})
|
||||
};
|
||||
|
||||
console.log("aaaaa")
|
||||
console.log(JSON.stringify(dataArray))
|
||||
console.log(dataArray)
|
||||
console.log(dataArray["data"])
|
||||
// console.log(result_2)
|
||||
|
||||
// $('#tableDevices').DataTable();
|
||||
|
||||
// TODO Filter
|
||||
// TODO displayed columns
|
||||
// TODO columns order
|
||||
|
||||
// Initialize DataTable with your data
|
||||
// $('#tableDevices').DataTable(dataArray);
|
||||
|
||||
|
||||
});
|
||||
|
||||
// Define new datasource URL and reload
|
||||
$('#tableDevices').DataTable().ajax.url(
|
||||
'php/server/devices.php?action=getDevicesList&status=' + deviceStatus).load();
|
||||
// $('#tableDevices').DataTable().ajax.url(
|
||||
// 'php/server/devices.php?action=getDevicesList&status=' + deviceStatus
|
||||
// ).load();
|
||||
};
|
||||
|
||||
function handleLoadingDialog()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Overview
|
||||
|
||||
[Apprise](front/plugins/arp_scan/README.md) is a notification gateway/publisher that allows you to push notifications to 80+ different services.
|
||||
[Apprise](https://hub.docker.com/r/caronc/apprise) is a notification gateway/publisher that allows you to push notifications to 80+ different services.
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Overview
|
||||
|
||||
[Apprise](front/plugins/arp_scan/README.md) is a notification gateway/publisher that allows you to push notifications to 80+ different services.
|
||||
A simple EMail (SMTP) notification gateway publisher. Check the [SMTP docs](/docs/SMTP.md) for additional help.
|
||||
|
||||
### Usage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user