immortalwrt/package/lean/luci-app-flowoffload/luasrc/view/flow/status.htm
2019-07-02 18:06:49 +08:00

28 lines
1.9 KiB
HTML
Executable File

<fieldset class="cbi-section">
<legend><%:Running Status%></legend>
<table width="100%" cellspacing="10" id="_xlnetacc_status_table">
<tr><td width="33%">FLOW 加速状态</td><td id="_run_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%">TCP拥塞控制算法</td><td id="_down_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%">FULLCONE NAT加速</td><td id="_up_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%">DNS 加速</td><td id="_dns_state"><em><%:Collecting data...%></em></td></tr>
<tr><td width="33%">AdGuardHome 去广告</td><td id="_ad_state"><em><%:Collecting data...%></em></td></tr>
</table>
</fieldset>
<script type="text/javascript">//<![CDATA[
var run_state = document.getElementById('_run_state');
var down_state = document.getElementById('_down_state');
var up_state = document.getElementById('_up_state');
var dns_state = document.getElementById('_dns_state');
var ad_state = document.getElementById('_ad_state');
XHR.poll(5, '<%=luci.dispatcher.build_url("admin", "network", "flowoffload", "status")%>', null, function(x, status) {
if ( x && x.status == 200 ) {
run_state.innerHTML = status.run_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
down_state.innerHTML = status.down_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
up_state.innerHTML = status.up_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
dns_state.innerHTML = status.dns_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
ad_state.innerHTML = status.ad_state ? '<em><b><font color=green><%:RUNNING%></font></b></em>' : '<em><b><font color=red><%:NOT RUNNING%></font></b></em>';
}
});
//]]></script>