diff --git a/showsubnet.cgi b/showsubnet.cgi index 6666bf8..30781a7 100755 --- a/showsubnet.cgi +++ b/showsubnet.cgi @@ -9,7 +9,7 @@ use strict; use Config::IniFiles; use HOSTDB; -my $table_cols = 4; +my $table_cols = 5; ## Generic Stockholm university HOSTDB CGI initialization my ($table_blank_line, $table_hr_line, $empty_td) = HOSTDB::StdCGI::get_table_variables ($table_cols); @@ -110,17 +110,18 @@ sub list_subnet - - - - + + + + + - @@ -129,7 +130,7 @@ EOH if ($edit_link) { $q->print (< - @@ -140,7 +141,7 @@ EOH $q->print (< - + EOH @@ -165,7 +166,8 @@ EOH - + + EOH for $i (1 .. $subnet->addresses () - 2) { @@ -180,7 +182,7 @@ EOH - @@ -219,11 +221,11 @@ EOH $q->print (< - + - + $table_blank_line @@ -233,19 +235,21 @@ EOH + + $table_blank_line - + $table_blank_line EOH @@ -274,10 +278,20 @@ sub print_host my $hostname = $host->hostname () || 'NULL'; my $mac = $host->mac_address () || ''; my $mac_ts = $host->mac_address_ts () || ''; + my $comment = $host->comment () || ''; # split at space to only get date and not time $mac_ts = (split (/\s/, $mac_ts))[0] || ''; + $comment = '' if ($comment eq 'dns-import'); + if (length ($comment) > 17) { + if (length ($comment) <= 20) { + $comment = substr ($comment, 0, 20); + } else { + $comment = substr ($comment, 0, 17) . '...'; + } + } + my $ip_align = 'left'; if ($dup) { @@ -338,10 +352,11 @@ sub print_host push (@$o, < - - - + + + + EOH @@ -399,7 +414,7 @@ sub print_hostaliases push (@$o, < - + EOH @@ -425,7 +440,7 @@ sub error_line chomp ($error); $q->print (< -
         
$subnet_name +   $h_desc
+ $edit_link
Owner  $owner  $owner
  IP  Hostname  MAC address Last used  Last used Comment 
$ip +  
Netmask$netmask$netmask
Hosts registered$num_hosts/$num_addrs ($host_object_usage_percent%)$num_hosts/$num_addrs ($host_object_usage_percent%)
$static_hosts/$num_addrs ($static_percent%) in use $static_in_use/$static_hosts ($static_usage_percent%) 
Dynamic hosts $dynamic_hosts/$num_addrs ($dynamic_percent%) in use $dynamic_in_use/$dynamic_hosts ($dynamic_usage_percent%) 
Addresses needed$static_in_use + $dynamic_hosts = $addresses_needed/$num_addrs ($needed_percent%)$static_in_use + $dynamic_hosts = $addresses_needed/$num_addrs ($needed_percent%)
$ip$hostname$mac$ip$hostname$mac $mac_ts$comment
alias$alias_link $a_dnsstatus$alias_link $a_dnsstatus
+ $error