Skip to content

Commit

Permalink
Version 18.46 [added more details to system information page for rese…
Browse files Browse the repository at this point in the history
…llers]
  • Loading branch information
Ilia Rostovtsev committed Apr 27, 2017
1 parent 7463120 commit 898364a
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 62 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Changelog

#### Version 18.47-beta5 (26 April, 2017)
#### Version 18.47-beta6 (26 April, 2017)
* Added sortable table for Virtualmin/Scheduled Backups [#51970](https://www.virtualmin.com/node/51970)
* Fixed bugs [#731](https://github.com/qooob/authentic-theme/issues/731)

Expand Down
4 changes: 2 additions & 2 deletions extensions/file-manager/file-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ function __f___upd___cr(d, c) {
var b = $("body"),
a = "";
b.find(".breadcrumb").empty();
if (access_level() == 0) {
if (access_level() == 0 || access_level() == 1) {
b.find(".breadcrumb").append('<li class="fm___root__"><a href="index.cgi?path="><i class="fa fa-hdd-o"></i></a></li>')
} else {
b.find(".breadcrumb").append('<li class="fm___root__"><a href="index.cgi?path="><i class="fa fa-user text-light"></i></a></li>')
Expand Down Expand Up @@ -1576,7 +1576,7 @@ function ___f__tw() {
error: function(f) {}
})
});
if (access_level() !== 0) {
if (access_level() !== 0 && access_level() !== 1) {
$("body").find(".breadcrumb li:first-child a").html('<i class="fa fa-fw fa-user text-light">&nbsp;</i>')
}
$("body").find(".breadcrumb li:first-child").addClass("fm___root__");
Expand Down
2 changes: 1 addition & 1 deletion extensions/file-manager/file-manager.min.js

Large diffs are not rendered by default.

133 changes: 76 additions & 57 deletions sysinfo.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ if ( $get_user_level eq '0' || $get_user_level eq '4' ) {
}

#System time
&print_table_row( &Atext('body_time'), $local_time,, 'sysinfo_local_time' );
&print_table_row( &Atext('body_time'), $local_time, 'sysinfo_local_time' );

# Kernel and arch
if ($kernel_arch) {
Expand Down Expand Up @@ -214,10 +214,29 @@ elsif ( $get_user_level eq '1' || $get_user_level eq '2' ) {

print '<table class="table table-hover">' . "\n";

if ( $get_user_level eq '1' ) {

# Host and login info
&print_table_row( &Atext('body_host'), &get_system_hostname() );

# Operating System Info
if ( $gconfig{'os_version'} eq '*' ) {
$os = $gconfig{'real_os_type'};
}
else {
$os = $gconfig{'real_os_type'} . ' ' . $gconfig{'real_os_version'};
}
&print_table_row( &Atext('body_os'), $os );

}

&print_table_row( $Atext{'right_login'}, $remote_user );

&print_table_row( $Atext{'right_from'}, get_env('remote_host') );

# Webmin version
&print_table_row( &Atext('body_webmin'), get_webmin_version(), 'sysinfo_webmin_version' );

# Print Virtualmin version
if ($has_virtualmin) {
my $__virtual_server_version = $virtual_server::module_info{'version'};
Expand Down Expand Up @@ -295,72 +314,72 @@ elsif ( $get_user_level eq '1' || $get_user_level eq '2' ) {
&print_table_row( $Atext{'right_aliases'}, Atext( 'right_of', scalar(@aliases), $atotal ) );
}
}
}

# Users and aliases info
$users = virtual_server::count_domain_feature( "mailboxes", @subs );
( $uleft, $ureason, $utotal, $uhide ) = virtual_server::count_feature("mailboxes");
$msg = @mails ? $Atext{'right_fusers'} : $Atext{'right_fusers2'};
if ( $uleft < 0 || $uhide ) {
&print_table_row( $msg, $users );
}
else {
&print_table_row( $msg, Atext( 'right_of', $users, $utotal ) );
}

if (@mails) {
$aliases = virtual_server::count_domain_feature( "aliases", @subs );
( $aleft, $areason, $atotal, $ahide ) = virtual_server::count_feature("aliases");
if ( $aleft < 0 || $ahide ) {
&print_table_row( $Atext{'right_faliases'}, $aliases );
# Users and aliases info
$users = virtual_server::count_domain_feature( "mailboxes", @subs );
( $uleft, $ureason, $utotal, $uhide ) = virtual_server::count_feature("mailboxes");
$msg = @mails ? $Atext{'right_fusers'} : $Atext{'right_fusers2'};
if ( $uleft < 0 || $uhide ) {
&print_table_row( $msg, $users );
}
else {
&print_table_row( $Atext{'right_faliases'}, Atext( 'right_of', $aliases, $atotal ) );
&print_table_row( $msg, Atext( 'right_of', $users, $utotal ) );
}
}

# Databases
$dbs = virtual_server::count_domain_feature( "dbs", @subs );
( $dleft, $dreason, $dtotal, $dhide ) = virtual_server::count_feature("dbs");
if ( $dleft < 0 || $dhide ) {
&print_table_row( $Atext{'right_fdbs'}, $dbs );
}
else {
&print_table_row( $Atext{'right_fdbs'}, Atext( 'right_of', $dbs, $dtotal ) );
}
if (@mails) {
$aliases = virtual_server::count_domain_feature( "aliases", @subs );
( $aleft, $areason, $atotal, $ahide ) = virtual_server::count_feature("aliases");
if ( $aleft < 0 || $ahide ) {
&print_table_row( $Atext{'right_faliases'}, $aliases );
}
else {
&print_table_row( $Atext{'right_faliases'}, Atext( 'right_of', $aliases, $atotal ) );
}
}

if ( !$sects->{'noquotas'}
&& virtual_server::has_home_quotas() )
{
# Disk usage for all owned domains
$homesize = virtual_server::quota_bsize("home");
$mailsize = virtual_server::quota_bsize("mail");
( $home, $mail, $db ) = virtual_server::get_domain_quota( $d, 1 );
$usage = $home * $homesize + $mail * $mailsize + $db;
$limit = $d->{'quota'} * $homesize;
if ($limit) {
&print_table_row( $Atext{'right_quota'},
Atext( 'right_of', nice_size($usage), &nice_size($limit) ), 3 );
# Databases
$dbs = virtual_server::count_domain_feature( "dbs", @subs );
( $dleft, $dreason, $dtotal, $dhide ) = virtual_server::count_feature("dbs");
if ( $dleft < 0 || $dhide ) {
&print_table_row( $Atext{'right_fdbs'}, $dbs );
}
else {
&print_table_row( $Atext{'right_quota'}, nice_size($usage), 3 );
&print_table_row( $Atext{'right_fdbs'}, Atext( 'right_of', $dbs, $dtotal ) );
}
}

if ( !$sects->{'nobw'}
&& $virtual_server::config{'bw_active'}
&& $d->{'bw_limit'} )
{
# Bandwidth usage and limit
&print_table_row( $Atext{'right_bw'},
&Atext( 'right_of',
&nice_size( $d->{'bw_usage'} ),
&Atext( 'edit_bwpast_' . $virtual_server::config{'bw_past'},
&nice_size( $d->{'bw_limit'} ),
$virtual_server::config{'bw_period'}
)
),
3 );
if ( !$sects->{'noquotas'}
&& virtual_server::has_home_quotas() )
{
# Disk usage for all owned domains
$homesize = virtual_server::quota_bsize("home");
$mailsize = virtual_server::quota_bsize("mail");
( $home, $mail, $db ) = virtual_server::get_domain_quota( $d, 1 );
$usage = $home * $homesize + $mail * $mailsize + $db;
$limit = $d->{'quota'} * $homesize;
if ($limit) {
&print_table_row( $Atext{'right_quota'},
Atext( 'right_of', nice_size($usage), &nice_size($limit) ), 3 );
}
else {
&print_table_row( $Atext{'right_quota'}, nice_size($usage), 3 );
}
}

if ( !$sects->{'nobw'}
&& $virtual_server::config{'bw_active'}
&& $d->{'bw_limit'} )
{
# Bandwidth usage and limit
&print_table_row( $Atext{'right_bw'},
&Atext( 'right_of',
&nice_size( $d->{'bw_usage'} ),
&Atext( 'edit_bwpast_' . $virtual_server::config{'bw_past'},
&nice_size( $d->{'bw_limit'} ),
$virtual_server::config{'bw_period'}
)
),
3 );
}
}

print '</table>' . "\n";
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.46-git-201704271324
18.46-git-201704271541

0 comments on commit 898364a

Please sign in to comment.