rename deploy to config to be same as package name which is invoked
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Aug 2009 17:03:35 +0000 (17:03 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sat, 29 Aug 2009 17:03:35 +0000 (17:03 +0000)
one less reference to remember

lib/PXElator/httpd.pm

index cf1edc3..25e6d5a 100644 (file)
@@ -240,33 +240,25 @@ warn "XXX pids = ", dump( $daemons::pids );
 
                if ( $ip && $ip ne $server::ip ) {
 
-                       my @editable = ( qw/hostname deploy homepage/ );
+                       my @editable = ( qw/hostname config homepage/ );
 
                        client::conf( $ip, $_ => $param->{$_} ) foreach @editable;
 
                        my $conf = client::all_conf( $ip );
-                       my $deploy = delete $conf->{deploy};
+                       my $config = delete $conf->{config};
 
                        my $nmap = qq|<a href=/nmap?scan=$ip>nmap</a>|;
                        my @table = (
+                               'ping' => ping::host($ip) ? qq|<span style="color:green">up</span> $nmap| : qq|<span style="color: red">down</span> <a href=/wol/$ip>wol</a> $nmap|,
                                'ip' => qq|<input type=text name=change_ip value="$ip" onChange="document.getElementById('old_ip').style.display = '';"><span id=old_ip style="display: none; color: #888;">old: $ip<span>|,
                                'mac' => format::mac( delete $conf->{mac}, 'html' ),
                                'hostname' => qq|<input type=text name=hostname value="| . delete($conf->{hostname}) . qq|">|,
-                               'ping' => ping::host($ip) ? qq|<span style="color:green">up</span> $nmap| : qq|<span style="color: red">down</span> <a href=/wol/$ip>wol</a> $nmap|,
-                               'deploy' => html::select( 'deploy', $deploy, config::available ),
+                               'config' => html::select( 'config', $config, config::available ),
                                html::conf( $ip, $conf, 'edit', @editable )
                        );
 
 warn "XX conf ",dump( $conf );
 
-                       my $config = '';
-
-                       if ( $deploy ) {
-                               if ( $config = config::for_ip( $ip ) ) {
-                                       $config = qq|<h2>config</h2>| . html::pre( $config );
-                               }
-                       }
-
                        print $client ok
                                , qq|<form method=get>|
                                , html::table( 2, @table ),
@@ -274,9 +266,14 @@ warn "XX conf ",dump( $conf );
                                        <input type=submit name=action value=change>
                                        <input type=submit name=action value=remove style="color: red">
                                        </form>|
-                               , $config
                                ;
 
+                       if ( $config ) {
+                               if ( my $for_ip = config::for_ip( $ip ) ) {
+                                       print $client qq|<h2>config::for_ip</h2>| . html::pre( $for_ip );
+                               }
+                       }
+
                        if ( my $amt = client::conf( $ip, 'amt' ) ) {
                                print $client qq|<h2>AMT</h2>|, amt::info( $amt, $ip );
                        }