diff --git a/sysinfo.cgi b/sysinfo.cgi index 9cde65b7f..da746ce51 100755 --- a/sysinfo.cgi +++ b/sysinfo.cgi @@ -66,15 +66,6 @@ my ($cpu_percent, if ($get_user_level ne '3') { my $sysinfo = grep { $_->{'id'} eq 'sysinfo' } @info; - - # Print sysinfo panel start - print_sysstats_panel_start(\@info) if ($sysinfo); - - # Easypie charts - if ($sysinfo && $theme_config{'settings_sysinfo_easypie_charts'} ne 'false') { - print_easypie_charts($cpu_percent, $mem_percent, $virt_percent, $disk_percent); - } - my @table_data; # Hostname @@ -185,10 +176,20 @@ if ($get_user_level ne '3') { # Pre-load history data print '' . "\n" if ($sysinfo); + convert_to_json(get_stats_history()) . ';' . "\n" + if ($sysinfo && webmin_user_is_admin()); # Print system info table if (@table_data) { + # Print sysinfo panel start + print_sysstats_panel_start(\@info) + if ($sysinfo); + + # Easypie charts + if ($sysinfo && $theme_config{'settings_sysinfo_easypie_charts'} ne 'false') { + print_easypie_charts($cpu_percent, $mem_percent, $virt_percent, $disk_percent); + } + print '' . "\n"; while (scalar(@table_data) > 0) { my $left = shift(@table_data); @@ -196,13 +197,14 @@ if ($get_user_level ne '3') { print_table_row_responsive(@$left, @$right); } print '
' . "\n"; - } + + # Print System Warning + print get_sysinfo_warning(\@info) if ($sysinfo); - # Print System Warning - print get_sysinfo_warning(\@info) if ($sysinfo); + # Print sysinfo panel end + print_sysstats_panel_end() if ($sysinfo); + } - # Print sysinfo panel end - print_sysstats_panel_end() if ($sysinfo); print get_extended_sysinfo(\@info, '-1'); print '' . "\n" if ($sysinfo);