Comparison

plugins/mod_admin_telnet.lua @ 9756:38f7bde4cfe0

mod_admin_telnet: Sort stats by name
author Kim Alvefur <zash@zash.se>
date Fri, 04 Jan 2019 15:13:52 +0100
parent 9755:fd4d516556aa
child 9786:00f7af0be849
comparison
equal deleted inserted replaced
9755:fd4d516556aa 9756:38f7bde4cfe0
1541 1541
1542 function def_env.stats:show(filter) 1542 function def_env.stats:show(filter)
1543 local stats, changed, extra = require "core.statsmanager".get_stats(); 1543 local stats, changed, extra = require "core.statsmanager".get_stats();
1544 local available, displayed = 0, 0; 1544 local available, displayed = 0, 0;
1545 local displayed_stats = new_stats_context(self); 1545 local displayed_stats = new_stats_context(self);
1546 for name, value in pairs(stats) do 1546 for name, value in iterators.sorted_pairs(stats) do
1547 available = available + 1; 1547 available = available + 1;
1548 if not filter or name:match(filter) then 1548 if not filter or name:match(filter) then
1549 displayed = displayed + 1; 1549 displayed = displayed + 1;
1550 local type = name:match(":(%a+)$"); 1550 local type = name:match(":(%a+)$");
1551 table.insert(displayed_stats, { 1551 table.insert(displayed_stats, {