diff options
Diffstat (limited to 'modules/admin-full/luasrc/model')
13 files changed, 550 insertions, 0 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua b/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua new file mode 100644 index 0000000000..3fdccbf802 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua @@ -0,0 +1,44 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +require("luci.config") +m = Map("luci", translate("webui"), translate("a_i_luci1", + "Hier können Eigenschaften und die Funktionalität der Oberfläche angepasst werden.")) + +c = m:section(NamedSection, "main", "core", translate("general")) + +l = c:option(ListValue, "lang", translate("language")) + +local i18ndir = luci.i18n.i18ndir .. "default." +for k, v in pairs(luci.config.languages) do + if k:sub(1, 1) ~= "." and luci.fs.isfile(i18ndir .. k .. ".lua") then + l:value(k, v) + end +end + +t = c:option(ListValue, "mediaurlbase", translate("design")) +for k, v in pairs(luci.config.themes) do + if k:sub(1, 1) ~= "." then + t:value(v, k) + end +end + +u = m:section(NamedSection, "uci_oncommit", "event", translate("a_i_ucicommit"), + translate("a_i_ucicommit1")) +u.dynamic = true + +f = m:section(NamedSection, "flash_keep", "extern", translate("a_i_keepflash"), + translate("a_i_keepflash1")) +f.dynamic = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua new file mode 100644 index 0000000000..b22f7354ae --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua @@ -0,0 +1,53 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +require("luci.model.uci") +require("luci.sys") + +m = Map("dhcp", "DHCP") + +s = m:section(TypedSection, "dhcp", "") +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "interface", translate("interface")) +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + s:depends("interface", section[".name"]) + end + end) + +s:option(Value, "start", translate("start")).rmempty = true + +s:option(Value, "limit", translate("limit")).rmempty = true + +s:option(Value, "leasetime").rmempty = true + +s:option(Flag, "dynamicdhcp").rmempty = true + +s:option(Value, "name", translate("name")).optional = true + +s:option(Flag, "ignore").optional = true + +s:option(Value, "netmask", translate("netmask")).optional = true + +s:option(Flag, "force").optional = true + +for i, line in pairs(luci.sys.execl("dnsmasq --help dhcp")) do + k, v = line:match("([^ ]+) +([^ ]+)") + s:option(Value, "dhcp"..k, v).optional = true +end + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua new file mode 100644 index 0000000000..2851f3ad54 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua @@ -0,0 +1,52 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("network", translate("interfaces"), translate("a_n_ifaces1")) + +s = m:section(TypedSection, "interface", "") +s.addremove = true +s:exclude("loopback") +s:depends("proto", "static") +s:depends("proto", "dhcp") + +p = s:option(ListValue, "proto", translate("protocol")) +p:value("static", translate("static")) +p:value("dhcp", "DHCP") +p.default = "static" + +br = s:option(Flag, "type", translate("a_n_i_bridge"), translate("a_n_i_bridge1")) +br.enabled = "bridge" +br.rmempty = true + +s:option(Value, "ifname", translate("interface")) + +s:option(Value, "ipaddr", translate("ipaddress")) + +s:option(Value, "netmask", translate("netmask")):depends("proto", "static") + +gw = s:option(Value, "gateway", translate("gateway")) +gw:depends("proto", "static") +gw.rmempty = true + +dns = s:option(Value, "dns", translate("dnsserver")) +dns:depends("proto", "static") +dns.optional = true + +mtu = s:option(Value, "mtu", "MTU") +mtu.optional = true +mtu.isinteger = true + +mac = s:option(Value, "macaddr", translate("macaddress")) +mac.optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua new file mode 100644 index 0000000000..565edb7fd7 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_network/ptp.lua @@ -0,0 +1,43 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("network", translate("a_n_ptp"), translate("a_n_ptp1")) + +s = m:section(TypedSection, "interface", "") +s.addremove = true +s:depends("proto", "pppoe") +s:depends("proto", "pptp") + +p = s:option(ListValue, "proto", translate("protocol")) +p:value("pppoe", "PPPoE") +p:value("pptp", "PPTP") +p.default = "pppoe" + +s:option(Value, "ifname", translate("interface")) + +s:option(Value, "username", translate("username")) +s:option(Value, "password", translate("password")) + +s:option(Value, "keepalive").optional = true + +s:option(Value, "demand").optional = true + +srv = s:option(Value, "server") +srv:depends("proto", "pptp") +srv.optional = true + +mtu = s:option(Value, "mtu", "MTU") +mtu.optional = true +mtu.isinteger = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua new file mode 100644 index 0000000000..15f994c160 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_network/routes.lua @@ -0,0 +1,35 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("network", translate("a_n_routes"), translate("a_n_routes1")) + +s = m:section(TypedSection, "route", "") +s.addremove = true +s.anonymous = true +s.template = "cbi/tblsection" + +iface = s:option(ListValue, "interface", translate("interface")) +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + iface:value(section[".name"]) + end + end) + +s:option(Value, "target", translate("target"), translate("a_n_r_target1")) + +s:option(Value, "netmask", translate("netmask"), translate("a_n_r_netmask1")).rmemepty = true + +s:option(Value, "gateway", translate("gateway")) + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua new file mode 100644 index 0000000000..8cae7f94b8 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_network/vlan.lua @@ -0,0 +1,22 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("network", translate("a_n_switch"), translate("a_n_switch1")) + +s = m:section(TypedSection, "switch", "") + +for i = 0, 15 do + s:option(Value, "vlan"..i, "vlan"..i).optional = true +end + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_services/dnsmasq.lua b/modules/admin-full/luasrc/model/cbi/admin_services/dnsmasq.lua new file mode 100644 index 0000000000..e853064715 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_services/dnsmasq.lua @@ -0,0 +1,42 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("dhcp", "Dnsmasq") + +s = m:section(TypedSection, "dnsmasq", translate("settings")) +s.anonymous = true + +s:option(Flag, "domainneeded") +s:option(Flag, "authoritative") +s:option(Flag, "boguspriv") +s:option(Flag, "filterwin2k") +s:option(Flag, "localise_queries") +s:option(Value, "local") +s:option(Value, "domain") +s:option(Flag, "expandhosts") +s:option(Flag, "nonegcache") +s:option(Flag, "readethers") +s:option(Value, "leasefile") +s:option(Value, "resolvfile") +s:option(Flag, "nohosts").optional = true +s:option(Flag, "strictorder").optional = true +s:option(Flag, "logqueries").optional = true +s:option(Flag, "noresolv").optional = true +s:option(Value, "dnsforwardmax").optional = true +s:option(Value, "port").optional = true +s:option(Value, "ednspacket_max").optional = true +s:option(Value, "dhcpleasemax").optional = true +s:option(Value, "addnhosts").optional = true +s:option(Value, "queryport").optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_services/dropbear.lua b/modules/admin-full/luasrc/model/cbi/admin_services/dropbear.lua new file mode 100644 index 0000000000..a8ce2694a5 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_services/dropbear.lua @@ -0,0 +1,26 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("dropbear", "Dropbear SSHd", translate("a_srv_dropbear1")) + +s = m:section(TypedSection, "dropbear", "") +s.anonymous = true + +port = s:option(Value, "Port", translate("port")) +port.isinteger = true + +pwauth = s:option(Flag, "PasswordAuth", translate("a_srv_d_pwauth"), translate("a_srv_d_pwauth1")) +pwauth.enabled = 'on' +pwauth.disabled = 'off' + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_services/httpd.lua b/modules/admin-full/luasrc/model/cbi/admin_services/httpd.lua new file mode 100644 index 0000000000..44beb9c9ef --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_services/httpd.lua @@ -0,0 +1,30 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("httpd", "Busybox HTTPd", translate("a_srv_http1")) + +s = m:section(TypedSection, "httpd", "") +s.anonymous = true + +port = s:option(Value, "port", translate("port")) +port.isinteger = true + +s:option(Value, "home", translate("a_srv_http_root")) + +config = s:option(Value, "c_file", translate("configfile"), translate("a_srv_http_config1")) +config.rmempty = true + +realm = s:option(Value, "realm", translate("a_srv_http_authrealm"), translate("a_srv_http_authrealm1")) +realm.rmempty = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/fstab.lua b/modules/admin-full/luasrc/model/cbi/admin_system/fstab.lua new file mode 100644 index 0000000000..be2562ca0f --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_system/fstab.lua @@ -0,0 +1,34 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("fstab", translate("a_s_fstab")) + +mount = m:section(TypedSection, "mount", translate("a_s_fstab_mountpoints"), translate("a_s_fstab_mountpoints1")) +mount.anonymous = true +mount.addremove = true + +mount:option(Flag, "enabled", translate("enable")) +mount:option(Value, "device", translate("device"), translate("a_s_fstab_device1")) +mount:option(Value, "target", translate("a_s_fstab_mountpoint")) +mount:option(Value, "fstype", translate("filesystem"), translate("a_s_fstab_fs1")) +mount:option(Value, "options", translate("options"), translatef("manpage", "siehe '%s' manpage", "mount")) + + +swap = m:section(TypedSection, "swap", "SWAP", translate("a_s_fstab_swap1")) +swap.anonymous = true +swap.addremove = true + +swap:option(Flag, "enabled", translate("enable")) +swap:option(Value, "device", translate("device"), translate("a_s_fstab_device1")) + +return m diff --git a/modules/admin-full/luasrc/model/cbi/admin_system/system.lua b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua new file mode 100644 index 0000000000..dd59d8c010 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_system/system.lua @@ -0,0 +1,22 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("system", translate("system")) + +s = m:section(TypedSection, "system", "") +s.anonymous = true + +s:option(Value, "hostname", translate("hostname")) +s:option(Value, "timezone", translate("timezone")) + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_wifi/devices.lua b/modules/admin-full/luasrc/model/cbi/admin_wifi/devices.lua new file mode 100644 index 0000000000..b4e0e2915b --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_wifi/devices.lua @@ -0,0 +1,64 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("wireless", translate("devices"), translate("a_w_devices1", + "An dieser Stelle können eingebaute WLAN-Geräte konfiguriert werden.")) + +s = m:section(TypedSection, "wifi-device", "") +--s.addremove = true + +en = s:option(Flag, "disabled", translate("enable")) +en.enabled = "0" +en.disabled = "1" + +t = s:option(ListValue, "type", translate("type")) +t:value("broadcom") +t:value("atheros") +t:value("mac80211") +t:value("prism2") +--[[ +require("luci.sys") +local c = ". /etc/functions.sh;for i in /lib/wifi/*;do . $i;done;echo $DRIVERS" +for driver in luci.sys.execl(c)[1]:gmatch("[^ ]+") do + t:value(driver) +end +]]-- + +mode = s:option(ListValue, "mode", translate("mode")) +mode:value("", "standard") +mode:value("11b", "802.11b") +mode:value("11g", "802.11g") +mode:value("11a", "802.11a") +mode:value("11bg", "802.11b+g") +mode.rmempty = true + +s:option(Value, "channel", translate("a_w_channel")) + +s:option(Value, "txantenna", translate("a_w_txantenna")).rmempty = true + +s:option(Value, "rxantenna", translate("a_w_rxantenna")).rmempty = true + +s:option(Value, "distance", translate("distance"), + translate("a_w_distance1")).rmempty = true + +s:option(Value, "diversity", translate("a_w_diversity")):depends("type", "atheros") + +country = s:option(Value, "country", translate("a_w_countrycode")) +country.optional = true +country:depends("type", "broadcom") + +maxassoc = s:option(Value, "maxassoc", translate("a_w_connlimit")) +maxassoc:depends("type", "broadcom") +maxassoc.optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua b/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua new file mode 100644 index 0000000000..f0379b3708 --- /dev/null +++ b/modules/admin-full/luasrc/model/cbi/admin_wifi/networks.lua @@ -0,0 +1,83 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth <steven@midlink.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 + +$Id$ +]]-- +m = Map("wireless", translate("networks"), translate("a_w_networks1")) + +s = m:section(TypedSection, "wifi-iface", "") +s.addremove = true +s.anonymous = true + +s:option(Value, "ssid", translate("a_w_netid")).maxlength = 32 + +device = s:option(ListValue, "device", translate("device")) +luci.model.uci.foreach("wireless", "wifi-device", + function (section) + device:value(section[".name"]) + end) + +network = s:option(ListValue, "network", translate("network"), translate("a_w_network1")) +network:value("") +luci.model.uci.foreach("network", "interface", + function (section) + if section[".name"] ~= "loopback" then + network:value(section[".name"]) + end + end) + +mode = s:option(ListValue, "mode", translate("mode")) +mode:value("ap", "Access Point") +mode:value("adhoc", "Ad-Hoc") +mode:value("sta", "Client") +mode:value("wds", "WDS") + +s:option(Value, "bssid", "BSSID").optional = true + +s:option(Value, "txpower", translate("a_w_txpwr"), "dbm").rmempty = true + +s:option(Flag, "frameburst", translate("a_w_brcmburst")).optional = true +s:option(Flag, "bursting", translate("a_w_athburst")).optional = true + + +encr = s:option(ListValue, "encryption", translate("encryption")) +encr:value("none", "keine") +encr:value("wep", "WEP") +encr:value("psk", "WPA-PSK") +encr:value("wpa", "WPA-Radius") +encr:value("psk2", "WPA2-PSK") +encr:value("wpa2", "WPA2-Radius") + +key = s:option(Value, "key", translate("key")) +key:depends("encryption", "wep") +key:depends("encryption", "psk") +key:depends("encryption", "wpa") +key:depends("encryption", "psk2") +key:depends("encryption", "wpa2") +key.rmempty = true + +server = s:option(Value, "server", translate("a_w_radiussrv")) +server:depends("encryption", "wpa") +server:depends("encryption", "wpa2") +server.rmempty = true + +port = s:option(Value, "port", translate("a_w_radiusport")) +port:depends("encryption", "wpa") +port:depends("encryption", "wpa2") +port.rmempty = true + +s:option(Flag, "isolate", translate("a_w_apisolation"), translate("a_w_apisolation1")).optional = true + +s:option(Flag, "hidden", translate("a_w_hideessid")).optional = true + + + +return m
\ No newline at end of file |