Fixed network discovery table and REST, added MAC address sorting function in JS utility class (#8480)

* Added page as stats

* Fixed network discovery table and REST, added MAC address sorting function in JS utility class

---------

Co-authored-by: DGabri <gabriele.deri@gmail.com>
This commit is contained in:
GabrieleDeri 2024-06-27 18:44:34 +02:00 committed by GitHub
parent 8218c447df
commit 25bc51a7e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 292 additions and 95 deletions

View file

@ -61,6 +61,18 @@ const sortByIP = function(val_1, val_2, sort) {
/* ******************************************************************** */
/* Sort by MAC Addresses */
const sortByMacAddress = function(val_1, val_2, sort) {
val_1 = NtopUtils.convertMACAddress(val_1);
val_2 = NtopUtils.convertMACAddress(val_2);
if (sort == 1) {
return val_1.localeCompare(val_2);
}
return val_2.localeCompare(val_1);
}
/* ******************************************************************** */
/* Sort by Number */
const sortByNumber = function(val_1, val_2, sort) {
/* It's an array */
@ -90,6 +102,7 @@ const sortingFunctions = function () {
sortByIP,
sortByName,
sortByNumber,
sortByMacAddress,
sortByNumberWithNormalizationValue,
};
}();