X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-app-olsr%2Fluasrc%2Fview%2Fstatus-olsr%2Foverview.htm;h=61e17b3b2df61b2c940505659f271f28b42daebb;hp=0a81d17b461391b02154c8d57b57d8e55b92beb6;hb=1cb3adb619bdd876867f4c4da615ea850464e711;hpb=41d2b33087da393453c45f5d923d690c88ee5474 diff --git a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm index 0a81d17b4..61e17b3b2 100644 --- a/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm +++ b/applications/luci-app-olsr/luasrc/view/status-olsr/overview.htm @@ -6,7 +6,9 @@ -%> <% -local ipv = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion", "4") + +has_ipv4_conf = luci.model.uci.cursor():get_first("olsrd", "olsrd", "IpVersion") +has_ipv6_conf = luci.model.uci.cursor():get_first("olsrd6", "olsrd", "IpVersion") function write_conf(conf, file) local fs = require "nixio.fs" @@ -19,23 +21,23 @@ end conf = luci.http.formvalue() -if conf.openwrt then +if conf.openwrt_v4 then write_conf("/etc/config/olsrd", "olsrd") return false end -if conf.conf_v4 then - write_conf("/var/etc/olsrd.conf.ipv4", "olsrd.conf.ipv4") +if conf.openwrt_v6 then + write_conf("/etc/config/olsrd6", "olsrd6") return false end -if conf.conf_v6 then - write_conf("/var/etc/olsrd.conf.ipv6", "olsrd.conf.ipv6") +if conf.conf_v4 then + write_conf("/var/etc/olsrd.conf", "olsrd.conf") return false end -if conf.conf then - write_conf("/var/etc/olsrd.conf", "olsrd.conf") +if conf.conf_v6 then + write_conf("/var/etc/olsrd6.conf", "olsrd6.conf") return false end @@ -153,7 +155,7 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { },
-

OLSR <%:Overview%>

+

OLSR <%:Overview%>

<%:Network%> @@ -200,13 +202,18 @@ XHR.poll(10, '<%=REQUEST_URI%>/json', { }, - <%:Download Config%> - OpenWrt, - <% if ipv == "6and4" then %> - OLSRD IPv4, - OLSRD IPv6 - <% else %> - OLSRD - <% end %> + <% if has_ipv4_conf then %> + OpenWrt (IPv4), + <% end %> + <% if has_ipv6_conf then %> + OpenWrt (IPv6), + <% end %> + <% if has_ipv4_conf then %> + OLSRD (IPv4), + <% end %> + <% if has_ipv6_conf then %> + OLSRD (IPv6) + <% end %>