<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',
		    '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);

# 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' => $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() });

# System time<commit_msg>HTML escape OS and version<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;

# Refresh button for root
if (&foreign_available($module_name) && $config{'collect_interval'} ne 'none') {
	push(@rv, { 'type' => 'link',
		    '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);

# 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() });

# System time
{'fraction_non_alphanumeric': 0.21885275849470223, 'fraction_numerical': 0.005845816587504567, 'mean_word_length': 4.1177570093457945, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 41, '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': '7364196', 'n_tokens_mistral': 1032, 'n_tokens_neox': 973, 'n_words': 215}