70 |
my ($ip,$conf,$format) = @_; |
my ($ip,$conf,$format) = @_; |
71 |
my @editable = splice(@_,3); |
my @editable = splice(@_,3); |
72 |
|
|
73 |
warn "# conf ",dump( $ip, $conf, $format, [ @editable ] ); |
# warn "# conf ",dump( $ip, $conf, $format, [ @editable ] ); |
74 |
|
|
75 |
$format ||= 'inline'; |
$format ||= 'inline'; |
76 |
|
|
84 |
} else { |
} else { |
85 |
if ( $name eq 'amt' ) { |
if ( $name eq 'amt' ) { |
86 |
my $amt_ip = amt::ip($ip,$html); |
my $amt_ip = amt::ip($ip,$html); |
87 |
$html = qq|<a title="$html" href=http://$amt_ip:16992/logon.htm target=$amt_ip>$amt_ip</a>|; |
# $html contains password! |
88 |
|
$html = qq|<a href=http://$amt_ip:16992/logon.htm target=$amt_ip>$amt_ip</a>|; |
89 |
|
|
90 |
if ( $format ne 'inline' ) { |
if ( $format ne 'inline' ) { |
91 |
my $power = amt::power_on($ip); |
my $power = amt::power_on($ip); |
101 |
chomp($html); |
chomp($html); |
102 |
} elsif ( $name eq 'kvm' ) { |
} elsif ( $name eq 'kvm' ) { |
103 |
$html = qq|<a href="/start_stop/kvm?nr=$html">$html</a>|; |
$html = qq|<a href="/start_stop/kvm?nr=$html">$html</a>|; |
104 |
} |
} elsif ( $name eq 'munin' ) { |
105 |
$html = qq|<tt>$html</tt>| |
$html = join("\n", map { my $url = $_; $url =~ s/-d\w+\.\w+$/.html/; qq|<a href="$url"><div style="float:left;overflow:hidden;width:415px;height:180px"><img src="$_" style="margin: -30px 0 0 -60px"></div></a>| } split(/\s+/s,$html)); |
106 |
unless |
} elsif ( $name eq 'ports' ) { |
107 |
$html =~ s{\b(\S+)\t(\S+)\t(\S+)\b}{<b title="$1/$2">$3</b> }gs; |
$html =~ s{\b(\S+)\t(\S+)\t(\S+)\b}{<b title="$1/$2">$3</b> }gs; |
108 |
|
} else { |
109 |
|
$html = qq|<tt>$html</tt>|; |
110 |
|
}; |
111 |
|
|
112 |
if ( $format =~ /edit|table/ ) { |
if ( $format =~ /edit|table/ ) { |
113 |
( $name, $html ); |
( $name, $html ); |