Files
openwrt_packages/luci-app-fan/luasrc/view/luci-fan.htm
2025-11-02 14:26:26 +08:00

30 lines
1.1 KiB
HTML

<div class="cbi-section">
<div class="cbi-section-node">
<h3><%:Status%></h3>
<table class="table">
<tbody>
<tr class="tr"><td class="td"><%:Thermal zone%></td><td class="td"><%=self.thermal_zone%> (<%:type:%> <%=self.thermal_type%>)</td></tr>
<tr class="tr"><td class="td"><%:Trip point%></td><td class="td">trip_point_<%=self.trip_point%></td></tr>
<tr class="tr"><td class="td"><%:Fan start temperature%></td><td class="td" id="fan_on_temp"></td></tr>
<tr class="tr"><td class="td"><%:Current temperature%></td><td class="td" id="zone_temp"></td></tr>
</tbody>
</table>
</div>
</div>
<script type="text/javascript">//<![CDATA[
(function(){
var fan_on_temp = document.getElementById('fan_on_temp');
var zone_temp = document.getElementById('zone_temp');
XHR.poll(3, '<%=url("admin/system/luci-fan/get_fan_info/"..self.thermal_zone.."/"..self.trip_point)%>', null,
function(x, st) {
if (st) {
if (fan_on_temp)
fan_on_temp.innerHTML = st.fan_on_temp + ' &#8451;';
if (zone_temp)
zone_temp.innerHTML = st.zone_temp + ' &#8451;';
}
}
);
})()
//]]></script>