summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/luasrc/view/lease_status.htm
diff options
context:
space:
mode:
authorRosy Song <rosysong@rosinson.com>2018-09-23 15:38:38 +0800
committerRosy Song <rosysong@rosinson.com>2018-09-23 15:38:38 +0800
commit8c57f886fc1e466cccb22e1f28e65d8d6fccc505 (patch)
tree4c626b80d513c4db5e0dc289288362e7fc27e99f /modules/luci-base/luasrc/view/lease_status.htm
parent89a4fdd1a8c899c901c75a769b40f8704bf798b3 (diff)
luci-base: drop ipv6 lease status when IPV6 is not support
Signed-off-by: Rosy Song <rosysong@rosinson.com>
Diffstat (limited to 'modules/luci-base/luasrc/view/lease_status.htm')
-rw-r--r--modules/luci-base/luasrc/view/lease_status.htm31
1 files changed, 19 insertions, 12 deletions
diff --git a/modules/luci-base/luasrc/view/lease_status.htm b/modules/luci-base/luasrc/view/lease_status.htm
index 15b6b6908e..658bcfc1bb 100644
--- a/modules/luci-base/luasrc/view/lease_status.htm
+++ b/modules/luci-base/luasrc/view/lease_status.htm
@@ -79,17 +79,24 @@
</div>
</div>
-<div class="cbi-section" style="display:none">
- <h3><%:Active DHCPv6 Leases%></h3>
- <div class="table" id="lease6_status_table">
- <div class="tr table-titles">
- <div class="th"><%:Host%></div>
- <div class="th"><%:IPv6-Address%></div>
- <div class="th"><%:DUID%></div>
- <div class="th"><%:Leasetime remaining%></div>
- </div>
- <div class="tr placeholder">
- <div class="td"><em><%:Collecting data...%></em></div>
+<%
+ local fs = require "nixio.fs"
+ local has_ipv6 = fs.access("/proc/net/ipv6_route")
+
+ if has_ipv6 then
+-%>
+ <div class="cbi-section" style="display:none">
+ <h3><%:Active DHCPv6 Leases%></h3>
+ <div class="table" id="lease6_status_table">
+ <div class="tr table-titles">
+ <div class="th"><%:Host%></div>
+ <div class="th"><%:IPv6-Address%></div>
+ <div class="th"><%:DUID%></div>
+ <div class="th"><%:Leasetime remaining%></div>
+ </div>
+ <div class="tr placeholder">
+ <div class="td"><em><%:Collecting data...%></em></div>
+ </div>
</div>
</div>
-</div>
+<% end -%>