2 # show the cluster routing tables to the user
4 # Copyright (c) 1998 Dirk Koopman G1TLH
9 my ($self, $line) = @_;
10 my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes
12 my @nodes = sort {$a->call cmp $b->call} (Route::Node::get_all());
17 push @out, "Node Callsigns";
18 if ($list[0] && $list[0] =~ /^NOD/) {
19 my @ch = sort {$a->call cmp $b->call} DXChannel::get_all_nodes();
22 foreach $dxchan (@ch) {
23 @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes;
25 my $call = $dxchan->call;
27 $call = "($call)" unless $dxchan->here;
31 foreach my $ref (@val) {
33 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
40 $s = sprintf "(%s)", $s unless $ref->here;
44 push @l, "" while ($i++ < 5);
45 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
48 # build up the screen from the Node table
49 foreach $node (@nodes) {
50 next if scalar @list && !grep $node->call =~ /^$_/, @list;
51 my $call = $node->call;
54 $call = "($call)" unless $node->here;
56 @val = sort $node->users;
59 if (@val == 0 && $node->usercount) {
60 push @l, sprintf "(%d users)", $node->usercount;
62 foreach $call (@val) {
64 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
69 my $uref = Route::User::get($call);
72 $s = sprintf "(%s)", $call unless $uref->here;
79 push @l, "" while ($i++ < 5);
80 push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;