X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fshow%2Fconfiguration.pl;h=a49ffeec990317d55cafc473b502627d150a785d;hb=24bfcc3275f8a8be7e9cdde2acfb46e27e3d875a;hp=4cd50e2668a371e090cbf961f0cc8e5ad350a25b;hpb=a9b7071fedfdb2150f3ef3d74e0d626b4f2dc0ea;p=spider.git diff --git a/cmd/show/configuration.pl b/cmd/show/configuration.pl index 4cd50e26..a49ffeec 100644 --- a/cmd/show/configuration.pl +++ b/cmd/show/configuration.pl @@ -9,18 +9,18 @@ my ($self, $line) = @_; my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes my @out; -my @nodes = (DXNode::get_all()); +my @nodes = sort {$a->call cmp $b->call} (Route::Node::get_all()); my $node; my @l; my @val; push @out, "Node Callsigns"; -if ($list[0] =~ /^NOD/) { - my @ch = DXProt::get_all_ak1a(); +if ($list[0] && $list[0] =~ /^NOD/) { + my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes(); my $dxchan; foreach $dxchan (@ch) { - @val = grep { $_->dxchan == $dxchan } @nodes; + @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes; my $call = $dxchan->call; $call = "($call)" if $dxchan->here == 0; @l = (); @@ -34,8 +34,8 @@ if ($list[0] =~ /^NOD/) { push @l, ""; $i = 0; } - my $s = $call->{call}; - $s = sprintf "(%s)", $s if $call->{here} == 0; + my $s = $call->call; + $s = sprintf "(%s)", $s unless $call->here; push @l, $s; $i++; } @@ -44,15 +44,17 @@ if ($list[0] =~ /^NOD/) { } else { # build up the screen from the Node table foreach $node (@nodes) { - next if scalar @list && !grep $node->call eq $_, @list; + next if scalar @list && !grep $node->call =~ /^$_/, @list; my $call = $node->call; - $call = "($call)" if $node->here == 0; + $call = "($call)" unless $node->here; @l = (); push @l, $call; - my $nlist = $node->list; - @val = values %{$nlist}; + @val = sort $node->users; my $i = 0; + if (@val == 0 && $node->usercount) { + push @l, sprintf "(%d users)", $node->usercount; + } foreach $call (@val) { if ($i >= 5) { push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l; @@ -60,8 +62,13 @@ if ($list[0] =~ /^NOD/) { push @l, ""; $i = 0; } - my $s = $call->{call}; - $s = sprintf "(%s)", $s if $call->{here} == 0; + my $uref = Route::User::get($call); + my $s = $call; + if ($uref) { + $s = sprintf "(%s)", $call unless $uref->here; + } else { + $s = "$call?"; + } push @l, $s; $i++; }