mirror of https://github.com/aredn/aredn.git
Display all the antenna information on the front page (#1028)
This commit is contained in:
parent
cc5c7cafd0
commit
7e9137417e
|
@ -1537,7 +1537,7 @@ if wifi_enable == "1" then
|
|||
if not changeh then
|
||||
html.print("<tr><td align=left>Azimuth</td><td>-</td>")
|
||||
else
|
||||
html.print("<tr><td align=left>Azimuth</td><td><input type=text name=azimuth size=10 value='" .. azimuth .. "' title='azimuth (degrees)' /></td>")
|
||||
html.print("<tr><td align=left>Azimuth</td><td><input type=text name=azimuth size=10 value='" .. azimuth .. "' title='azimuth (degrees)' /> °</td>")
|
||||
end
|
||||
if not changea then
|
||||
html.print("<td align=left>Antenna " .. antenna .. "</td>")
|
||||
|
@ -1552,9 +1552,9 @@ if wifi_enable == "1" then
|
|||
if not changeh then
|
||||
html.print("</tr><tr><td align=left>Elevation</td><td>-</td>")
|
||||
else
|
||||
html.print("</tr><tr><td align=left>Elevation</td><td><input type=text name=elevation size=10 value='" .. elevation .. "' title='elevation above ground level (degrees)' /></td>")
|
||||
html.print("</tr><tr><td align=left>Elevation</td><td><input type=text name=elevation size=10 value='" .. elevation .. "' title='elevation above ground level (degrees)' /> °</td>")
|
||||
end
|
||||
html.print("<td align=left>Height <input type=text name=height size=10 value='" .. height .. "' title='height above ground level (feet)' /></tr>")
|
||||
html.print("<td align=left>Height <input type=text name=height size=10 value='" .. height .. "' title='height above ground level (meters)' /> m</tr>")
|
||||
end
|
||||
html.print("<tr><td colspan=4><div id='map' style='height: 200px; display: none;'></div></td></tr><tr><td colspan=4><hr /></td></tr>")
|
||||
html.print("<tr><td>Timezone </td><td><select name=time_zone_name tabindex=10>")
|
||||
|
|
|
@ -452,6 +452,18 @@ if tonumber(azimuth) then
|
|||
else
|
||||
azimuth = nil
|
||||
end
|
||||
local elevation = cursor:get("aredn", "@location[0]", "elevation")
|
||||
if tonumber(elevation) then
|
||||
elevation = elevation .. "°"
|
||||
else
|
||||
elevation = nil
|
||||
end
|
||||
local height = cursor:get("aredn", "@location[0]", "height")
|
||||
if tonumber(height) then
|
||||
height = height .. "m"
|
||||
else
|
||||
height = nil
|
||||
end
|
||||
local antenna
|
||||
if not wifi_disabled then
|
||||
antenna = aredn.hardware.get_current_antenna(wifi_iface)
|
||||
|
@ -459,7 +471,18 @@ if not wifi_disabled then
|
|||
antenna = antenna.description
|
||||
end
|
||||
end
|
||||
col2[#col2 + 1] = "<th align=right><nobr>firmware version:</nobr><br><nobr>model:</nobr>" .. (antenna and "<br><nobr>antenna:</nobr>" or "") .. (azimuth and "<br><nobr>azimuth:</nobr>" or "") .. "</th><td>" .. read_all("/etc/mesh-release") .. "<br>" .. (aredn.hardware.get_radio() or { name = "unknown" }).name .. "<br>" .. (antenna and antenna .. "<br>" or "") .. (azimuth or "") .. "</td>"
|
||||
col2[#col2 + 1] = "<th align=right><nobr>firmware version:</nobr><br><nobr>model:</nobr><br>" ..
|
||||
(antenna and "<br><nobr>antenna:</nobr>" or "") ..
|
||||
(azimuth and "<br><nobr>azimuth:</nobr>" or "") ..
|
||||
(elevation and "<br><nobr>elevation:</nobr>" or "") ..
|
||||
(height and "<br><nobr>height:</nobr>" or "") ..
|
||||
"</th><td>" ..
|
||||
read_all("/etc/mesh-release") .. "<br>" .. (aredn.hardware.get_radio() or { name = "unknown" }).name .. "<br><br>" ..
|
||||
(antenna and antenna .. "<br>" or "") ..
|
||||
(azimuth and azimuth .. "<br>" or "") ..
|
||||
(elevation and elevation .. "<br>" or "") ..
|
||||
(height or "") ..
|
||||
"</td>"
|
||||
|
||||
local sysinfo = nixio.sysinfo()
|
||||
local uptime = string.format("%d:%02d", math.floor(sysinfo.uptime / 3600) % 24, math.floor(sysinfo.uptime / 60) % 60)
|
||||
|
|
Loading…
Reference in New Issue