Handle hostnames with upper-case letters
[webmin.git] / proc / index_zone.cgi
1 #!/usr/local/bin/perl
2 # index_user.cgi
3
4 require './proc-lib.pl';
5 &ui_print_header(undef, $text{'index_title'}, "", "zone", !$no_module_config, 1);
6
7 &index_links("zone");
8 @procs = sort { $b->{'cpu'} <=> $a->{'cpu'} } &list_processes();
9 @procs = grep { &can_view_process($_->{'user'}) } @procs;
10 @zones = &unique(map { $_->{'_zone'} } @procs);
11 foreach $z (@zones) {
12         print "<dt><font size=+1>",&text('index_inzone', "<tt>$z</tt>"),"</font><br>\n";
13         print "<dd><table border width=90%>\n";
14         print "<tr $tb> <td width=1% nowrap><b>$text{'pid'}</b></td>\n";
15         print "         <td width=1%><b>$text{'cpu'}</b></td>\n";
16         if ($info_arg_map{'_stime'}) {
17                 print "         <td width=1%><b>$text{'stime'}</b></td>\n";
18                 }
19         print "         <td width=98%><b>$text{'command'}</b></td> </tr>\n";
20         foreach $pr (grep { $_->{'_zone'} eq $z } @procs) {
21                 $p = $pr->{'pid'};
22                 print "<tr $cb>\n";
23                 if (&can_edit_process($pr->{'user'})) {
24                         print "<td><a href=\"edit_proc.cgi?$p\">$p</a></td>\n";
25                         }
26                 else {
27                         print "<td>$p</td>\n";
28                         }
29                 print "<td nowrap>$pr->{'cpu'}</td>\n";
30                 if ($info_arg_map{'_stime'}) {
31                         print "<td nowrap>",$pr->{'_stime'} || "<br>","</td>\n";
32                         }
33                 print "<td>",&html_escape(&cut_string($pr->{'args'})),
34                       "</td>\n";
35                 print "</tr>\n";
36                 }
37         print "</table><p>\n";
38         }
39 print "</dl>\n";
40
41 &ui_print_footer("/", $text{'index'});
42