<%# Copyright 2019-2020 Michael BD7MQB This is free software, licensed under the GNU GENERAL PUBLIC LICENSE, Version 2.0 -%> <% if lastheard and #lastheard > 0 then %>
<% local lh = lastheard[1] local callsign = lh.callsign if not tonumber(callsign) then if string.find(callsign, "/") then callsign = string.sub(callsign, 1, string.find(callsign, "/")-1) elseif string.find(callsign, "-") then callsign = string.sub(callsign, 1, string.find(callsign, "-")-1) end end local user = luci.util.ubus("dmrid", "get_by_callsign", {callsign = callsign}) or { name="Unknown", country="Somewhere" } if string.find(lh.mode, "DMR") then local tg = tonumber(string.sub(lh.target, 4)) if tg and tg > 90 then %> <% end end %>

<%=lh.callsign%>

<%=user.name or "Unknown" %>

<%=user.country or "Somewhere" %>

Source - <%=lh.source%>

<%=lh.mode%> - <%=lh.target%>

<% if lh.duration then %>

Duration <%=lh.duration%>s

Loss <%="%0.1f" % {lh.loss} %>%    BER <%="%0.1f" % {lh.ber}%>%

<% else local mmdvm = require("luci.model.mmdvm") local t = os.time() - mmdvm.s2t(lh.timestamp) %>

Duration <%=t%>s

Transmiting ...

<% end %>

<% end %>

<%:Gateway Activity%>

<% luci.template.render("mmdvm/lh", {lastheard = lastheard} ) %>

<%:Local RF%>

<% luci.template.render("mmdvm/lh", {lastheard = lastheard, localtx = 1} ) %>