'access' => 'Access',
'sponsor' => 'Sponsor',
'sponsor-admin' => 'Sponsor admin',
- 'location' => 'Location',
+ 'l' => 'Location',
'machine' => 'Processor',
'memory' => 'Memory',
'disk' => 'Disk space',
'status' => 'Status',
'notes' => 'Notes',
'sshrsahostkey' => 'SSH host key',
- 'sshrsahostfprint' => 'SSH host fingerprint',
'description' => 'Description',
- 'purpose' => 'purposes of this server',
+ 'purpose' => 'Purposes of this server',
# 'createtimestamp' => 'Entry created',
# 'modifytimestamp' => 'Entry modified'
);
# This defines what fields are displayed, and in what order
@attrorder = qw(hostname admin architecture distribution access
- sponsor sponsor-admin location machine memory
+ sponsor sponsor-admin l machine memory
disk bandwidth status notes sshrsahostkey sshrsahostfprint
description purpose);
$ldap->unbind if (defined($ldap));
}
-# human readable fingerprint
-sub sshfingerprint {
- my $key = shift;
-
- return '' if (!$key);
-
- my @field = split(/ /, $key);
- my %keytypes = map {$_=>1} (qw{ssh-dss ssh-rsa ecdsa-sha2-nistp256 ssh-ed25519});
- return '' unless $keytypes{$field[0]};
- return '' if !$field[1];
- my $fpr = md5_hex(decode_base64($field[1]));
- my $hrfpr = $field[0] . " " . substr($fpr,0,2,"");
- while (length $fpr > 0) {
- $hrfpr .= ':' . substr($fpr,0,2,"");
- }
- return $hrfpr;
-}
-
sub wiki_link($) {
my ($in) = @_;
# [[hostname|text]] makes a link
$out = "<ul>".
join("", map {
"<li>".wiki_link($_)."</li>\n";
- } sort {my $A=$a; my $B=$b; $A =~ s/[\[\]\*]//g; $B =~ s/[\[\]\*]//g; $A cmp $B} @tmp
+ } sort {my $A=$a; my $B=$b; $A =~ s/\[\[[-*]?(.*?)\]\]/\1/g; $B =~ s/\[\[[-*]?(.*?)\]\]/\1/g; $A cmp $B} @tmp
).
"</ul>";
}
# Format email addresses
$output{admin} = sprintf("<a href=\"mailto:%s\">%s</a>", $output{admin}, $output{admin});
- $output{'sponsor-admin'} = sprintf("<a href=\"mailto:%s\">%s</a>", $output{'sponsor-admin'}, $output{'sponsor-admin'});
+ $output{'sponsor-admin'} = sprintf("<a href=\"mailto:%s\">%s</a>", $output{'sponsor-admin'}, $output{'sponsor-admin'})
+ if defined $output{'sponsor-admin'};
$output{sshrsahostkey} = undef;
foreach $key (@{$data->{sshrsahostkey}}) {
$output{sshrsahostkey} .= $key . "<br>";
}
- foreach $key (@{$data->{sshrsahostkey}}) {
- $output{sshrsahostfprint} .= sshfingerprint($key) . "<br>";
- }
-
my $sponsor = item_uplist($data->{sponsor});
$output{sponsor} = $sponsor if defined $sponsor;
my $purpose = item_uplist($data->{purpose});
} else {
# display summary info
$hostdetails = "<h1>Summary</h1>\n";
- $hostdetails .= "<table id=\"machines\" class=\"tablesorter\" border=\"1\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>\n<tr>";
+ $hostdetails .= "<table id=\"machines\" class=\"display compact cell-border\" border=\"1\" cellpadding=\"0\" cellspacing=\"1\">\n<thead>\n<tr>";
foreach $key (@summaryorder) {
if ($sortby ne $key) {
$hostdetails .= "<th><a class=\"sort\" href=\"machines.cgi?sortby=$key&sortorder=asc\">$summaryattrs{$key}</a></th>";