projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated the windows links and stuff in the intro
[spider.git]
/
cmd
/
show
/
configuration.pl
diff --git
a/cmd/show/configuration.pl
b/cmd/show/configuration.pl
index a7a1773b1391acc722d53d8d4be5217c04a01cee..3386a1716e5a65404ce7398a0d59378a6e712dd9 100644
(file)
--- a/
cmd/show/configuration.pl
+++ b/
cmd/show/configuration.pl
@@
-9,50
+9,66
@@
my ($self, $line) = @_;
my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes
my @out;
my ($self, $line) = @_;
my @list = map { uc } split /\s+/, $line; # list of callsigns of nodes
my @out;
-my @nodes =
(DX
Node::get_all());
+my @nodes =
sort {$a->call cmp $b->call} (Route::
Node::get_all());
my $node;
my @l;
my @val;
my $node;
my @l;
my @val;
-push @out,
"Node Callsigns"
;
+push @out,
$self->msg('showconf')
;
if ($list[0] && $list[0] =~ /^NOD/) {
if ($list[0] && $list[0] =~ /^NOD/) {
- my @ch =
DXProt::get_all_ak1a
();
+ my @ch =
sort {$a->call cmp $b->call} DXChannel::get_all_nodes
();
my $dxchan;
foreach $dxchan (@ch) {
my $dxchan;
foreach $dxchan (@ch) {
- @val = grep { $_->dxchan == $dxchan } @nodes;
- my $call = $dxchan->call;
- $call = "($call)" if $dxchan->here == 0;
+ @val = sort {$a->call cmp $b->call} grep { $_->dxchan == $dxchan } @nodes;
@l = ();
@l = ();
+ my $call = $dxchan->call;
+ $call ||= '???';
+ $call = "($call)" unless $dxchan->here;
push @l, $call;
my $i = 0;
push @l, $call;
my $i = 0;
- foreach
$call
(@val) {
+ foreach
my $ref
(@val) {
if ($i >= 5) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
@l = ();
push @l, "";
$i = 0;
}
if ($i >= 5) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
@l = ();
push @l, "";
$i = 0;
}
- my $s = $call->{call};
- $s = sprintf "(%s)", $s if $call->{here} == 0;
+ my $s = $ref->call;
+ $s ||= '???';
+ $s = sprintf "(%s)", $s unless $ref->here;
push @l, $s;
$i++;
}
push @l, $s;
$i++;
}
+ push @l, "" while ($i++ < 5);
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
} else {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
} else {
+ my $printall;
+
+ $printall = 1 if @list && $list[0] =~ /^ALL/i;
+
# build up the screen from the Node table
foreach $node (@nodes) {
# build up the screen from the Node table
foreach $node (@nodes) {
- next if scalar @list && !grep $node->call eq $_, @list;
+ unless ($printall) {
+ if (@list) {
+ next unless grep $node->call =~ /^$_/, @list;
+ } else {
+ next unless grep $node->dxcc == $_, @main::my_cc;
+ }
+ }
my $call = $node->call;
my $call = $node->call;
- $call = "($call)" if $node->here == 0;
@l = ();
@l = ();
+ $call ||= '???';
+ $call = "($call)" unless $node->here;
push @l, $call;
push @l, $call;
- my $nlist = $node->list;
- @val = values %{$nlist};
+ @val = sort $node->users;
my $i = 0;
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;
foreach $call (@val) {
if ($i >= 5) {
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
@@
-60,11
+76,17
@@
if ($list[0] && $list[0] =~ /^NOD/) {
push @l, "";
$i = 0;
}
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++;
}
push @l, $s;
$i++;
}
+ push @l, "" while ($i++ < 5);
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
}
push @out, sprintf "%-12s %-12s %-12s %-12s %-12s %-12s", @l;
}
}