mirror of
https://github.com/ntop/ntopng.git
synced 2026-05-02 00:40:10 +00:00
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:
parent
8218c447df
commit
25bc51a7e8
9 changed files with 292 additions and 95 deletions
|
|
@ -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,
|
||||
};
|
||||
}();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue