* luci/app-olsr: fix layout of IpcConnect section
[project/luci.git] / applications / luci-olsr / luasrc / model / cbi / olsr / olsrd.lua
index 3e3c68d..0f8bc42 100644 (file)
--- ToDo: Autodetect things, Translate, Add descriptions
-require("luci.fs")
+--[[
+LuCI - Lua Configuration Interface
 
-m = Map("olsr", "OLSR", [[OLSR ist ein flexibles Routingprotokoll, 
-dass den Aufbau von mobilen Ad-Hoc Netzen unterstützt.]])
+Copyright 2008 Steven Barth <steven@midlink.org>
 
-s = m:section(NamedSection, "general", "olsr", "Allgemeine Einstellungen")
+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
 
-debug = s:option(ListValue, "DebugLevel", "Debugmodus")
+       http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+]]--
+
+require("luci.tools.webadmin")
+
+m = Map("olsrd", translate("olsrd", "OLSR Daemon"))
+
+s = m:section(TypedSection, "olsrd", translate("olsrd_general"))
+s.dynamic = true
+s.anonymous = true
+
+debug = s:option(ListValue, "DebugLevel")
 for i=0, 9 do
        debug:value(i)
 end
+debug.optional = true
 
-ipv = s:option(ListValue, "IpVersion", "Internet Protokoll")
+ipv = s:option(ListValue, "IpVersion")
 ipv:value("4", "IPv4")
 ipv:value("6", "IPv6")
 
-noint = s:option(Flag, "AllowNoInt", "Start ohne Netzwerk")
+noint = s:option(Flag, "AllowNoInt")
 noint.enabled = "yes"
 noint.disabled = "no"
+noint.optional = true
+
+s:option(Value, "Pollrate").optional = true
 
-s:option(Value, "Pollrate", "Abfragerate (Pollrate)", "s")
+tcr = s:option(ListValue, "TcRedundancy")
+tcr:value("0", translate("olsrd_olsrd_tcredundancy_0"))
+tcr:value("1", translate("olsrd_olsrd_tcredundancy_1"))
+tcr:value("2", translate("olsrd_olsrd_tcredundancy_2"))
+tcr.optional = true
 
-tcr = s:option(ListValue, "TcRedundancy", "TC-Redundanz")
-tcr:value("0", "MPR-Selektoren")
-tcr:value("1", "MPR-Selektoren und MPR")
-tcr:value("2", "Alle Nachbarn")
+s:option(Value, "MprCoverage").optional = true
 
-s:option(Value, "MprCoverage", "MPR-Erfassung")
+lql = s:option(ListValue, "LinkQualityLevel")
+lql:value("0", translate("disable"))
+lql:value("1", translate("olsrd_olsrd_linkqualitylevel_1"))
+lql:value("2", translate("olsrd_olsrd_linkqualitylevel_2"))
+lql.optional = true
 
-lql = s:option(ListValue, "LinkQualityLevel", "VQ-Level")
-lql:value("0", "deaktiviert")
-lql:value("1", "MPR-Auswahl")
-lql:value("2", "MPR-Auswahl und Routing")
+s:option(Value, "LinkQualityAging").optional = true
 
-lqfish = s:option(Flag, "LinkQualityFishEye", "VQ-Fisheye")
+lqa = s:option(ListValue, "LinkQualityAlgorithm")
+lqa.optional = true
+lqa:value("etx_fpm", translate("olsrd_etx_fpm"))
+lqa:value("etx_float", translate("olsrd_etx_float"))
+lqa:value("etx_ff", translate("olsrd_etx_ff"))
+lqa.optional = true
 
-s:option(Value, "LinkQualityWinSize", "VQ-Fenstergröße")
+lqfish = s:option(Flag, "LinkQualityFishEye")
+lqfish.optional = true
 
-s:option(Value, "LinkQualityDijkstraLimit", "VQ-Dijkstralimit")
+s:option(Value, "LinkQualityWinSize").optional = true
 
-hyst = s:option(Flag, "UseHysteresis", "Hysterese aktivieren")
+s:option(Value, "LinkQualityDijkstraLimit").optional = true
+
+hyst = s:option(Flag, "UseHysteresis")
 hyst.enabled = "yes"
 hyst.disabled = "no"
+hyst.optional = true
+
+fib = s:option(ListValue, "FIBMetric")
+fib.optional = true
+fib:value("flat")
+fib:value("correct")
+fib:value("approx")
+fib.optional = true
+
+clrscr = s:option(Flag, "ClearScreen")
+clrscr.enabled = "yes"
+clrscr.disabled = "no"
+clrscr.optional = true
+
+willingness = s:option(ListValue, "Willingness")
+for i=0,7 do
+       willingness:value(i)
+end
+willingness.optional = true
+
 
 
-i = m:section(TypedSection, "Interface", "Schnittstellen")
+i = m:section(TypedSection, "Interface", translate("interfaces"))
 i.anonymous = true
 i.addremove = true
 i.dynamic = true
 
-network = i:option(ListValue, "Interface", "Netzwerkschnittstellen")
-network:value("")
-luci.model.uci.foreach("network", "interface",
-       function (section)
-               if section[".name"] ~= "loopback" then
-                       network:value(section[".name"])
-               end
-       end)
+ign = i:option(Flag, "ignore", "Enable")
+ign.enabled  = "0"
+ign.disabled = "1"
 
-i:option(Value, "HelloInterval", "Hello-Intervall")
+network = i:option(ListValue, "interface", translate("network"))
+luci.tools.webadmin.cbi_add_networks(network)
 
-i:option(Value, "HelloValidityTime", "Hello-Gültigkeit")
+i:option(Value, "Ip4Broadcast").optional = true
+i:option(Value, "HelloInterval").optional = true
+i:option(Value, "HelloValidityTime").optional = true
+i:option(Value, "TcInterval").optional = true
+i:option(Value, "TcValidityTime").optional = true
+i:option(Value, "MidInterval").optional = true
+i:option(Value, "MidValidityTime").optional = true
+i:option(Value, "HnaInterval").optional = true
+i:option(Value, "HnaValidityTime").optional = true
 
-i:option(Value, "TcInterval", "TC-Intervall")
+adc = i:option(Flag, "AutoDetectChanges")
+adc.enabled  = "yes"
+adc.disabled = "no"
+adc.optional = true
 
-i:option(Value, "TcValidityTime", "TC-Gültigkeit")
 
-i:option(Value, "MidInterval", "MID-Intervall")
+ipc = m:section(TypedSection, "IpcConnect")
+ipc.anonymous = true
 
-i:option(Value, "MidValidityTime", "MID-Gültigkeit")
+conns = ipc:option(Value, "MaxConnections")
+conns.isInteger = true
 
-i:option(Value, "HnaInterval", "HNA-Intervall")
+nets  = ipc:option(Value, "Net")
+nets.optional = true
 
-i:option(Value, "HnaValidityTime", "HNA-Gültigkeit")
+hosts = ipc:option(Value, "Host")
+hosts.optional = true
 
 
-p = m:section(TypedSection, "LoadPlugin", "Plugins")
-p.addremove = true
-p.dynamic = true
-
-lib = p:option(ListValue, "Library", "Bibliothek")
-lib:value("")
-for k, v in pairs(luci.fs.dir("/usr/lib")) do
-       if v:sub(1, 6) == "olsrd_" then
-               lib:value(v)
-       end
-end
-
-return m
\ No newline at end of file
+return m