mirror of https://github.com/aredn/aredn.git
feature: add channel and bandwidth to status page (resolves #28)
This commit is contained in:
parent
0d95d4d708
commit
41559da318
|
@ -39,6 +39,8 @@
|
|||
$debug = 0;
|
||||
BEGIN {push @INC, '/www/cgi-bin'};
|
||||
use perlfunc;
|
||||
use ucifunc;
|
||||
|
||||
# collect some variables
|
||||
$node = nvram_get("node");
|
||||
$node = "NOCALL" if $node eq "";
|
||||
|
@ -46,6 +48,9 @@ $tactical = nvram_get("tactical");
|
|||
$config = nvram_get("config");
|
||||
$config = "not set" if $config eq "" or not -d "/etc/config.mesh";
|
||||
|
||||
($junk, $wifi_channel) = &uci_get_named_option("wireless", "radio0", "channel");
|
||||
($junk, $wifi_chanbw) = &uci_get_named_option("wireless", "radio0", "chanbw");
|
||||
|
||||
read_postdata();
|
||||
|
||||
if($parms{css} and -f "/www/$parms{css}" and $parms{css} =~ /\.css$/i) {
|
||||
|
@ -180,6 +185,12 @@ if($browser_ip)
|
|||
push @col1, $str . "</td>";
|
||||
}
|
||||
|
||||
$str = "<th align=right><nobr>Channel</nobr></th><td>$wifi_channel";
|
||||
push @col1, $str . "</td>";
|
||||
|
||||
$str = "<th align=right><nobr>Bandwidth</nobr></th><td>$wifi_chanbw Mhz";
|
||||
push @col1, $str . "</td>";
|
||||
|
||||
|
||||
# right column - system info
|
||||
|
||||
|
|
|
@ -65,6 +65,16 @@ sub uci_get_indexed_sectiontype()
|
|||
return ($rc, @res);
|
||||
}
|
||||
|
||||
sub uci_get_named_option()
|
||||
{
|
||||
my ($config,$sname,$option)=@_;
|
||||
my $cmd=sprintf('uci get %s.%s.%s',$config,$sname,$option);
|
||||
my @res=`$cmd`;
|
||||
my $rc=$?;
|
||||
chomp($res);
|
||||
return ($rc, @res);
|
||||
}
|
||||
|
||||
# Returns an array of section names
|
||||
sub uci_get_names_by_sectiontype()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue