⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index_tree.cgi

📁 Unix下基于Web的管理工具
💻 CGI
字号:
#!/usr/local/bin/perl# index.cgi# Display a list of all existing processesrequire './proc-lib.pl';&header($text{'index_title'}, "", "tree", "proc", 1);print "<hr>\n";&index_links("tree");print "<table border width=100%>\n";print "<tr $tb> <td><b>$text{'pid'}</b></td> <td><b>$text{'owner'}</b></td>\n";print "         <td><b>$text{'command'}</b></td> </tr>\n";@procs = sort { $a->{'pid'} <=> $b->{'pid'} } &list_processes();$min = 999;foreach $pr (@procs) {	$p = $pr->{'pid'}; $pp = $pr->{'ppid'};	$argmap{$p} = $pr->{'args'};	$usermap{$p} = $pr->{'user'};	push(@{$children{$pp}}, $p);	$min = $p if ($p < $min);	}&walk_procs("", $min);print "</table><p>\n";print "<hr>\n";&footer("/", $text{'index'});# walk_procs(indent, pid)sub walk_procs{local(@ch, $_, $args);print "<tr $cb><td><tt>$_[0]<a href=\"edit_proc.cgi?$_[1]\">",      "$_[1]</a></tt></td> <td>$usermap{$_[1]}</td>\n";$args = &cut_string($argmap{$_[1]}, 70);print "<td>$args</td> </tr>\n";foreach (@{$children{$_[1]}}) {	&walk_procs("$_[0]&nbsp;", $_) if ($_ != $_[1]);	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -