diff options
author | Florian Eckert <fe@dev.tdt.de> | 2019-05-25 21:43:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-25 21:43:50 +0200 |
commit | d1d5471137c4e2686b58de2499a64e0b259704b7 (patch) | |
tree | 443a600ed4b2d0e7564aa9523a20d7b602358c81 /modules/luci-base | |
parent | 2cdc5f160a221121d0e06a638db3d2d0559bf6ca (diff) | |
parent | 8c57f886fc1e466cccb22e1f28e65d8d6fccc505 (diff) |
Merge pull request #2174 from rosysong/lease-status
luci-base: drop ipv6 lease status when IPV6 is not support
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/view/lease_status.htm | 31 |
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 bf2a8968d1..bbaf5986ba 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 -%> |