Files
openwrt_packages/luci-app-adguardhome/luasrc/view/AdGuardHome/AdGuardHome_status.htm
2025-11-12 00:12:28 +08:00

27 lines
1.1 KiB
HTML

<script type="text/javascript">//<![CDATA[
XHR.poll(3, '<%=url([[admin]], [[services]], [[AdGuardHome]], [[status]])%>', null,
function(x, data) {
var tb = document.getElementById('AdGuardHome_status');
if (data && tb) {
if (data.running) {
tb.innerHTML = '<em><b style=color:green>AdGuardHome <%:RUNNING%></b></em>';
URL = window.location.protocol.toLowerCase() + "//" + window.location.hostname + ":<%=luci.model.uci.cursor():get("AdGuardHome", "AdGuardHome", "httpport") %>";
tb.innerHTML+='<em> <b style=color:green><%:Redirected%></b> </em> '
tb.innerHTML += "<input class=\"cbi-button cbi-button-reload \" type=\"button\" value=\" <%: Open Web Interface%>\" onclick=\"window.open('"+URL+"')\"/>";
} else {
tb.innerHTML = '<em><b style=color:red>AdGuardHome <%:NOT RUNNING%></b></em>';
tb.innerHTML+='<em><b style=color:red><%:Not redirect%></b></em>'
}
}
}
);
//]]>
</script>
<style>.mar-10 {margin-left: 50px; margin-right: 10px;}</style>
<fieldset class="cbi-section">
<p id="AdGuardHome_status">
<em><%:Collecting data...%></em>
</p>
</fieldset>