<commit_before>
use strict;
use warnings;
require 'system-status-lib.pl';
our (%text, %gconfig, $module_name, %config);

# list_system_info(&data, &in)
# Returns general information about the system, such as available disk space
sub list_system_info
{
my $info = &get_collected_info();
my @rv;
my @table;

# Refresh button for root
if (&foreign_available($module_name) && $config{'collect_interval'} ne 'none') {
	push(@rv, { 'type' => 'link',
		    'id' => 'recollect',
		    'priority' => 100,
		    'desc' => $text{'right_recollect'},
		    'link' => '/'.$module_name.'/recollect.cgi' });
	}

# Table of system info
my $table = { 'type' => 'table',
	      'id' => 'sysinfo',
	      'desc' => $text{'right_header'},
	      'priority' => 100,
	      'table' => \@table };
push(@rv, $table);

if (&show_section('host')) {
	# Hostname
	my $ip = $info && $info->{'ips'} ? $info->{'ips'}->[0]->[0]
					 : &to_ipaddress(get_system_hostname());
	$ip = " ($ip)" if ($ip);
	push(@table, { 'desc' => $text{'right_host'},
		       'value' => &get_system_hostname().$ip });

	# Operating system
	push(@table, { 'desc' => $text{'right_os'},
		       'value' => &html_escape($gconfig{'os_version'} eq '*' ?
				$gconfig{'real_os_type'} :
				$gconfig{'real_os_type'}.' '.
				  $gconfig{'real_os_version'})
		     });

	# Webmin version
	push(@table, { 'desc' => $text{'right_webmin'},
		       'value' => &get_webmin_version() });

	# Versions of other important modules, where available
	# I fully admit that putting this here rather than in module-specific
	# code is a hack, but the current API doesn't offer good alternative.
	foreach my $v ([ "virtual-server", $text{'right_vvirtualmin'} ],
		       [ "server-manager", $text{'right_vvm2'} ]) {
		if (&foreign_available($v->[0])) {
			my %vinfo = &get_module_info($v->[0]);
			push(@table, { 'desc' => $v->[1],
				       'value' => $vinfo{'version'} });
			}
		}

	# System time
	my $tm = localtime(time());
	if (&foreign_available("time")) {
		$tm = &ui_link($gconfig{'webprefix'}.'/time/', $tm);
		}
	push(@table, { 'desc' => $text{'right_time'},
		       'value' => $tm });
	}

if (&show_section('cpu')) {
	# Kernel and architecture<commit_msg>Add collected info to output as it is<commit_after>
use strict;
use warnings;
require 'system-status-lib.pl';
our (%text, %gconfig, $module_name, %config);

# list_system_info(&data, &in)
# Returns general information about the system, such as available disk space
sub list_system_info
{
my $info = &get_collected_info();
my @rv;
my @table;
my @raw = \$info;

# Refresh button for root
if (&foreign_available($module_name) && $config{'collect_interval'} ne 'none') {
	push(@rv, { 'type' => 'link',
		    'id' => 'recollect',
		    'priority' => 100,
		    'desc' => $text{'right_recollect'},
		    'link' => '/'.$module_name.'/recollect.cgi' });
	}

# Table of system info
my $table = { 'type' => 'table',
	      'id' => 'sysinfo',
	      'desc' => $text{'right_header'},
	      'priority' => 100,
	      'table' => \@table,
	      'raw' => \@raw };
push(@rv, $table);

if (&show_section('host')) {
	# Hostname
	my $ip = $info && $info->{'ips'} ? $info->{'ips'}->[0]->[0]
					 : &to_ipaddress(get_system_hostname());
	$ip = " ($ip)" if ($ip);
	push(@table, { 'desc' => $text{'right_host'},
		       'value' => &get_system_hostname().$ip });

	# Operating system
	my $os = &html_escape($gconfig{'os_version'} eq '*' ?
				$gconfig{'real_os_type'} :
				$gconfig{'real_os_type'}.' '.
				  $gconfig{'real_os_version'});
	push(@table, { 'desc' => $text{'right_os'},
		       'value' => $os
		     });

	# Webmin version
	my $webmin_version = &get_webmin_version();
	push(@table, { 'desc' => $text{'right_webmin'},
		       'value' => $webmin_version });
	push(@raw, { 'webmin_version' => $webmin_version });

	# Versions of other important modules, where available
	# I fully admit that putting this here rather than in module-specific
	# code is a hack, but the current API doesn't offer good alternative.
	foreach my $v ([ "virtual-server", $text{'right_vvirtualmin'} ],
		       [ "server-manager", $text{'right_vvm2'} ]) {
		if (&foreign_available($v->[0])) {
			my %vinfo = &get_module_info($v->[0]);
			push(@table, { 'desc' => $v->[1],
				       'value' => $vinfo{'version'} });
			push(@raw, { ($v->[0] eq 'virtual-server' ? 
				'vm_version' : 'cm_version') => $vinfo{'version'} });
			}
		}

	# System time
	my $tm = localtime(time());
	if (&foreign_available("time")) {
		$tm = &ui_link($gconfig{'webprefix'}.'/time/', $tm);
		}
	push(@table, { 'desc' => $text{'right_time'},
		       'value' => $tm });
	}

if (&show_section('cpu')) {
	# Kernel and architecture
{'fraction_non_alphanumeric': 0.2135048231511254, 'fraction_numerical': 0.0053590568060021436, 'mean_word_length': 3.7563710499490317, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2986106', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1647, 'n_words': 377}