luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / protocols / luci-proto-ppp / luasrc / model / cbi / admin_network / proto_pppoe.lua
index ec258a528259dbd1b2aa519a10e1012d25cbbad1..063d8c07ebdb941ee5573874bc0d442f10b978a0 100644 (file)
@@ -1,14 +1,5 @@
---[[
-LuCI - Lua Configuration Interface
-
-Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-]]--
+-- Copyright 2011 Jo-Philipp Wich <jow@openwrt.org>
+-- Licensed to the public under the Apache License 2.0.
 
 local map, section, net = ...
 
@@ -39,12 +30,13 @@ service.placeholder = translate("auto")
 
 
 if luci.model.network:has_ipv6() then
-
-       ipv6 = section:taboption("advanced", Flag, "ipv6",
+       ipv6 = section:taboption("advanced", ListValue, "ipv6",
+               translate("Obtain IPv6-Address"),
                translate("Enable IPv6 negotiation on the PPP link"))
-
-       ipv6.default = ipv6.disabled
-
+       ipv6:value("auto", translate("Automatic"))
+       ipv6:value("0", translate("Disabled"))
+       ipv6:value("1", translate("Manual"))
+       ipv6.default = "auto"
 end
 
 
@@ -89,9 +81,6 @@ function keepalive_failure.cfgvalue(self, section)
        end
 end
 
-function keepalive_failure.write() end
-function keepalive_failure.remove() end
-
 keepalive_failure.placeholder = "0"
 keepalive_failure.datatype    = "uinteger"
 
@@ -114,15 +103,25 @@ function keepalive_interval.write(self, section, value)
        if f > 0 then
                m:set(section, "keepalive", "%d %d" %{ f, i })
        else
-               m:del(section, "keepalive")
+               m:set(section, "keepalive", "0")
        end
 end
 
 keepalive_interval.remove      = keepalive_interval.write
+keepalive_failure.write        = keepalive_interval.write
+keepalive_failure.remove       = keepalive_interval.write
 keepalive_interval.placeholder = "5"
 keepalive_interval.datatype    = "min(1)"
 
 
+host_uniq = section:taboption("advanced", Value, "host_uniq",
+       translate("Host-Uniq tag content"),
+       translate("Raw hex-encoded bytes. Leave empty unless your ISP require this"))
+
+host_uniq.placeholder = translate("auto")
+host_uniq.datatype    = "hexstring"
+
+
 demand = section:taboption("advanced", Value, "demand",
        translate("Inactivity timeout"),
        translate("Close inactive connection after the given amount of seconds, use 0 to persist connection"))