Show name instead of MAC in drp

This commit is contained in:
Jokob-sk
2023-01-15 16:23:14 +11:00
parent f5546b6a49
commit e0d8ade2d0
4 changed files with 63 additions and 49 deletions

View File

@@ -357,15 +357,14 @@ function getDevicesFromTable(table)
{
rowIDs = table.column(12, { 'search': 'applied' }).data().toArray() // rowID is in hidden column 12
rowMACs = table.column(10, { 'search': 'applied' }).data().toArray() // MAC is in hidden column 10
rowNames = table.column(0, { 'search': 'applied' }).data().toArray() //
rowTypes = table.column(2, { 'search': 'applied' }).data().toArray() //
result = []
rowIDs.map(function(rowID, index){
result.push({"rowid": rowID, "mac":rowMACs[index]})
result.push({"rowid": rowID, "mac":rowMACs[index], "name" : rowNames[index],"type" : rowTypes[index] })
})
// console.log(rowIDs)
// console.log(result)
return JSON.stringify (result)
}