@@ -6,6 +6,7 @@ import { GenericNodeFilter } from "./filters/genericnode.js";
66import * as helper from "./utils/helper.js" ;
77import { _ } from "./utils/language.js" ;
88import { Node } from "./utils/node.js" ;
9+ import { compare } from "./utils/version.js" ;
910
1011type TableNode = {
1112 element : HTMLTableElement ;
@@ -111,6 +112,14 @@ export const Proportions = function (filterManager: ReturnType<typeof DataDistri
111112 return null ;
112113 }
113114
115+ function sortVersionCountAndName ( a , b ) {
116+ // descending by count
117+ if ( b [ 1 ] !== a [ 1 ] ) {
118+ return b [ 1 ] - a [ 1 ] ;
119+ }
120+ return compare ( a [ 0 ] , b [ 0 ] ) ;
121+ }
122+
114123 let gatewayDict = count ( nodes , [ "gateway" ] , hostnameOfNodeID ) ;
115124 let gateway6Dict = count ( nodes , [ "gateway6" ] , hostnameOfNodeID ) ;
116125
@@ -154,21 +163,9 @@ export const Proportions = function (filterManager: ReturnType<typeof DataDistri
154163 } ) ,
155164 ) ;
156165
157- tables . firmware = fillTable (
158- "node.firmware" ,
159- tables . firmware ,
160- fwDict . sort ( function ( a , b ) {
161- return b [ 1 ] - a [ 1 ] ;
162- } ) ,
163- ) ;
166+ tables . firmware = fillTable ( "node.firmware" , tables . firmware , fwDict . sort ( sortVersionCountAndName ) ) ;
164167
165- tables . baseversion = fillTable (
166- "node.baseversion" ,
167- tables . baseversion ,
168- baseDict . sort ( function ( a , b ) {
169- return b [ 1 ] - a [ 1 ] ;
170- } ) ,
171- ) ;
168+ tables . baseversion = fillTable ( "node.baseversion" , tables . baseversion , baseDict . sort ( sortVersionCountAndName ) ) ;
172169
173170 tables . deprecationStatus = fillTable (
174171 "node.deprecationStatus" ,
0 commit comments