small-packages/luci-app-nvr/luasrc/view/nvr_status.htm
2026-05-10 09:48:30 +08:00

27 lines
1.0 KiB
HTML

<script type="text/javascript">//<![CDATA[
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "services", "nvr", "status")%>', null,
function(x, data) {
var tb = document.getElementById('nvr_status');
if ( data && tb) {
if ( data.nvrrecord && data.pushpid ) {
tb.innerHTML = '<font color=green><%:正在录像!%><%: PID: %>' + data.nvrrecord + '</br>' +'<%:正在推流!%><%: PID : %>' + data.pushpid + '</font>';
} else if ( data.nvrrecord ) {
tb.innerHTML = '<font color=green><%:正在录像!%><%: PID: %>' + data.nvrrecord + '</font></br>' + '<font color=red><%:未推送!!%></font>';
} else if ( data.pushpid ) {
tb.innerHTML = '<font color=red><%:未录像!%></font></br>' + '<font color=green><%:正在推流!%><%: PID: %>' + data.pushpid + '</font>';
} else {
tb.innerHTML = '<font color=red><%:未运行!%></font>';
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="nvr_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>