Skip to content

Commit

Permalink
Improved display of the "About this RT" page
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Loos authored and obra committed Feb 26, 2010
1 parent 21ede95 commit 59296a2
Showing 1 changed file with 71 additions and 47 deletions.
118 changes: 71 additions & 47 deletions share/html/Admin/Tools/Configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,23 @@
my $title = loc('System Configuration');
unless ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
Abort(loc('This feature is only available to system administrators'));
}


}
</%init>
<& /Admin/Elements/Header, Title => $title &>
<& /Admin/Elements/ToolTabs,
current_tab => 'Admin/Tools/Configuration.html',
current_subtab => 'Admin/Tools/Configuration.html',
Title => $title &>



<h2><&|/l&>Loaded perl modules</&></h2>
% my $report = Module::Versions::Report::report();
% my @report = grep /v\d/, split("\n",$report);
<pre>
<% join('<br />', @report) |n %>
</pre>

<h2><&|/l&>RT Config</&></h2>
<table>
<table border="0" cellspacing="0" cellpadding="1" width="100%" class="collection">
<tr class="collection-as-table">
<th class="collection-as-table"><&|/l&>Option</&></th>
<th class="collection-as-table"><&|/l&>Value</&></th>
<th class="collection-as-table"><&|/l&>Source</&></th>
</tr>
<%PERL>
my $index_conf;
foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
my $val = RT->Config->Get( $key );
next unless defined $val;
Expand All @@ -90,9 +85,11 @@ <h2><&|/l&>RT Config</&></h2>
else {
$description = loc("core config");
}
$index_conf++;
</%PERL>
<tr><th><% $key %></th>
<td rowspan="2">\
<tr class="<% $index_conf%2 ? 'oddline' : 'evenline'%>">
<td class="collection-as-table"><% $key %></td>
<td class="collection-as-table">
% if ( $key =~ /Password(?!Length)/i ) {
<em>Password not printed</em>\
% } elsif ( !ref $val ) {
Expand All @@ -104,19 +101,35 @@ <h2><&|/l&>RT Config</&></h2>
% } else {
<% ref $val %>\
% }
</td></tr>
<tr><td><% $description %></td></tr>
</td>
<td class="collection-as-table" style="white-space: nowrap">
% if ( $description =~ /^.*site config$/ ) {
<span style="font-weight: bold"><% $description %></span>
% } else {
<% $description %>
% }
</td>
</tr>
% }
</table>

<h2><&|/l&>RT Variables</&></h2>
<table>
% { no strict qw/refs/;
% my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
% foreach my $key ( sort keys %{*RT::} ) {
% next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
<tr><th>RT::<% $key %></th>
<td>
<table border="0" cellspacing="0" cellpadding="1" class="collection">
<tr class="collection-as-table">
<th class="collection-as-table"><&|/l&>Variable</&></th>
<th class="collection-as-table"><&|/l&>Value</&></th>
</tr>
<%PERL>
{ no strict qw/refs/;
my %config_opt = map { $_ => 1 } RT->Config->Options( Overridable => undef );
my $index_var;
foreach my $key ( sort keys %{*RT::} ) {
next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
$index_var++;
</%PERL>
<tr class="<% $index_var%2 ? 'oddline' : 'evenline'%>">
<td class="collection-as-table">RT::<% $key %></td>
<td class="collection-as-table">
% if ( $key =~ /Password(?!Length)/i ) {
<em>Password not printed</em>
% } else {
Expand All @@ -129,40 +142,51 @@ <h2><&|/l&>RT Variables</&></h2>
</table>

<h3><&|/l&>Plugin Mason Component Path Order</&></h3>
<table>
<ol>
% foreach my $path ( map { $_->[1] } $m->interp->comp_root_array ) {
<tr><td><% $path %></td></tr>
<li><% $path %></li>
% }
</table>
</ol>

<h2><&|/l&>RT Size</&></h2>
<table>
<table border="0" cellspacing="0" cellpadding="1" class="collection">
<tr class="collection-as-table">
<th class="collection-as-table"><&|/l&>Object</&></th>
<th class="collection-as-table"><&|/l&>Size</&></th>
</tr>
<%PERL>
for my $type (qw/Ticket Queue Transaction Group/) {
my $class = 'RT::' . $type . 's';
my ($index_size, $user_count, $privileged_count);
for my $type (qw/Tickets Queues Transactions Groups PrivilegedUsers UnprivilegedUsers/) {
my $count;
my $class = 'RT::' . $type;
$class =~ s/Privileged|Unprivileged//;
my $collection = $class->new($RT::SystemUser);
$collection->UnLimit;
my $count = $collection->CountAll;
if ($type =~ /PrivilegedUsers/) {
$user_count = $collection->CountAll;
$collection->LimitToPrivileged;
$count = $privileged_count = $collection->CountAll;
} elsif ($type =~ /UnprivilegedUsers/) {
$count = $user_count - $privileged_count;
} else {
$count = $collection->CountAll;
}
$index_size++;
</%PERL>
<tr><th><% $type %>s</th>
<td><% $count %></td></tr>
<tr class="<% $index_size%2 ? 'oddline' : 'evenline'%>">
<td class="collection-as-table"><% $type %></td>
<td class="collection-as-table"><% $count %></td>
</tr>
% }

<%PERL>
my $users = RT::Users->new($RT::SystemUser);
$users->UnLimit;
my $user_count = $users->CountAll;

$users->LimitToPrivileged;
my $privileged_count = $users->CountAll;
my $unprivileged_count = $user_count - $privileged_count;
</%PERL>
<tr><th>Privileged Users</th>
<td><% $privileged_count %></td></tr>
<tr><th>Unprivileged Users</th>
<td><% $unprivileged_count %></td></tr>
</table>

<h2><&|/l&>Loaded perl modules</&></h2>
% my $report = Module::Versions::Report::report();
% my @report = grep /v\d/, split("\n",$report);
<pre>
<% join('<br />', @report) |n %>
</pre>

<h2><&|/l&>Perl configuration</&></h2>
% require Config;
<pre>
Expand Down

0 comments on commit 59296a2

Please sign in to comment.