puppetboard
puppetboard copied to clipboard
Sorting IP adresses and uptime in tables
I have added code in tables.js that will sort the IP adresses in inventory table. Right now, the function does not work properly, most likely because I don't use the right name of the variable with IP Adresses
Coverage remained the same at 81.76% when pulling 663d996d13b7e2fca45848e1a11b2a8b0d7b34f3 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling 2a76ab0b9a7d2af8a6c9067621ddb09a84857d46 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling e2f37be89796c3aadc61811af74ead7a326ad1f1 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling f005be35b52a82f340ccdafe773b4e6d6a427277 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling f713a09a78745c5266077839e08efa8257b8b858 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Update: Now the ip sorter finally works 😃
All you have to do is to write column number in _macros.html which is set to 2nd column by default:
{ type: 'ip-address', targets: 1 }
Coverage remained the same at 81.76% when pulling 06349e9e53818b2c3d755aeddfe48b377fc52042 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
I'm testing this now.
Everything seems to be working. On the Inventory page IP X.X.0.10 is now considered greater than X.X.0.2 for sorting.
Good work @emlun007
Coverage remained the same at 81.76% when pulling 6e5305572653a297bee88f735deba8e602313f29 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
Coverage remained the same at 81.76% when pulling 2fe362ad20b0fdfe619f31a9551a5bc9dec63b07 on emlun007:patch-1 into d456d19bb4125bdb570c4d7f037edc84f100517d on voxpupuli:master.
@kirkins , I have added code for sorting uptime (xxx days) and memory (xxx GiB). The code parses strings to integer (9.99 GiB = 9) and checks in the result is NaN. If the sourse is NaN (e.g. ip address), the original data is shown, if the source is not NaN, it is parsed to integer
Can this be merged, including @vchepkov 's changes? :-)
Sadly, it cannot be merged. This branch has merge conflicts. You can checkout the branch, resolve the conflicts and submit it as a new PR. I'm happy to review and merge it afterwards.