Changeset 186 for server


Ignore:
Timestamp:
12/24/10 21:20:31 (13 years ago)
Author:
nanardon
Message:
  • update admin client according new admin functions
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/trunk/admin/lib/Sophie/Cli.pm

    r81 r186  
    114114            completion => sub { 
    115115                my ($self, $start) = @_; 
     116                my $res = $self->xmlreq('distrib.struct', 
     117                    $self->{dist}, 
     118                ); 
     119                return map { $_->{label} } @{ $res->value }; 
     120            }, 
     121        } 
     122    ); 
     123    $env->add_func('replace_path', 
     124        { 
     125            help => '', 
     126            code => sub { 
     127                my ($self, $path, $newpath) = @_; 
     128                my $res = $self->xmlreq( 
     129                    '/admin/replace_path', $path, $newpath); 
     130                print $OUT join (' ', map { $_ } @{ $res->value }); 
     131                print $OUT "\n"; 
     132            }, 
     133            completion => sub { 
     134                my ($self, $start, $oldpath) = @_; 
     135                if ($oldpath) { 
     136                    my $res = $self->xmlreq('admin.ls_local', $start); 
     137                    return @{ $res->value }; 
     138                } else { 
     139                    my $res = $self->xmlreq('admin.list_path', 
     140                        $self->{dist}, 
     141                    ); 
     142                    return @{ $res->value }; 
     143                } 
     144            }, 
     145        } 
     146    ); 
     147    $env->add_func('remove_media', 
     148        { 
     149            help => '', 
     150            code => sub { 
     151                my ($self, $media) = @_; 
     152                my $res = $self->xmlreq( 
     153                    '/admin/remove_media', $self->{dist}, $media); 
     154                print $OUT join (' ', map { $_ } @{ $res->value }); 
     155                print $OUT "\n"; 
     156            }, 
     157            completion => sub { 
     158                my ($self) = @_; 
    116159                my $res = $self->xmlreq('distrib.struct', 
    117160                    $self->{dist}, 
Note: See TracChangeset for help on using the changeset viewer.