diff options
author | Steven Barth <steven@midlink.org> | 2008-05-27 12:23:39 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-05-27 12:23:39 +0000 |
commit | d35a620e9f5665a94967f4bd02c93581a1dd7e00 (patch) | |
tree | cbe7a9b9fe71e40d850c649361c87608d56ea48b /modules/admin-core/luasrc | |
parent | 5df565faba5eb0c26a7ce0e2d6e9092bf71cb1e8 (diff) |
commit 4f6198094cf4134179d1f9c9fa8f79759a27c87e
Author: Felix Fietkau <nbd@openwrt.org>
Date: Tue May 27 13:56:12 2008 +0200
rename src/ to luasrc/
Diffstat (limited to 'modules/admin-core/luasrc')
45 files changed, 1475 insertions, 0 deletions
diff --git a/modules/admin-core/luasrc/controller/admin/index.lua b/modules/admin-core/luasrc/controller/admin/index.lua new file mode 100644 index 0000000000..11123c9c94 --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/index.lua @@ -0,0 +1,24 @@ +module("luci.controller.admin.index", package.seeall) + +function index() + local root = node() + if not root.target then + root.target = alias("admin") + end + + local page = node("admin") + page.target = alias("admin", "index") + page.title = "Administration" + page.order = 10 + + local page = node("admin", "index") + page.target = template("admin_index/index") + page.title = "Übersicht" + page.order = 10 + + local page = node("admin", "index", "luci") + page.target = cbi("admin_index/luci") + page.title = "Oberfläche" + + +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/network.lua b/modules/admin-core/luasrc/controller/admin/network.lua new file mode 100644 index 0000000000..397f2e4ca3 --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/network.lua @@ -0,0 +1,39 @@ +module("luci.controller.admin.network", package.seeall) + +function index() + local page = node("admin", "network") + page.target = template("admin_network/index") + page.title = "Netzwerk" + page.order = 50 + + local page = node("admin", "network", "vlan") + page.target = cbi("admin_network/vlan") + page.title = "Switch" + page.order = 10 + + local page = node("admin", "network", "ifaces") + page.target = cbi("admin_network/ifaces") + page.title = "Schnittstellen" + page.order = 20 + + local page = node("admin", "network", "dhcp") + page.target = cbi("admin_network/dhcp") + page.title = "DHCP-Server" + page.order = 30 + + local page = node("admin", "network", "ptp") + page.target = cbi("admin_network/ptp") + page.title = "PPPoE / PPTP" + page.order = 40 + + local page = node("admin", "network", "routes") + page.target = cbi("admin_network/routes") + page.title = "Statische Routen" + page.order = 50 + + if luci.fs.isfile("/etc/config/qos") then + local page = node("admin", "network", "qos") + page.target = cbi("admin_network/qos") + page.title = "Quality of Service" + end +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/services.lua b/modules/admin-core/luasrc/controller/admin/services.lua new file mode 100644 index 0000000000..4dcf837c6f --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/services.lua @@ -0,0 +1,29 @@ +module("luci.controller.admin.services", package.seeall) + +function index() + local page = node("admin", "services") + page.target = template("admin_services/index") + page.title = "Dienste" + page.order = 40 + + local page = node("admin", "services", "httpd") + page.target = cbi("admin_services/httpd") + page.title = "HTTP-Server" + page.order = 10 + + local page = node("admin", "services", "dropbear") + page.target = cbi("admin_services/dropbear") + page.title = "SSH-Server" + page.order = 20 + + local page = node("admin", "services", "dnsmasq") + page.target = cbi("admin_services/dnsmasq") + page.title = "Dnsmasq" + page.order = 30 + + if luci.fs.isfile("/etc/config/olsr") then + local page = node("admin", "services", "olsr") + page.target = cbi("admin_services/olsrd") + page.title = "OLSR" + end +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/status.lua b/modules/admin-core/luasrc/controller/admin/status.lua new file mode 100644 index 0000000000..34c210ca6b --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/status.lua @@ -0,0 +1,11 @@ +module("luci.controller.admin.status", package.seeall) + +function index() + entry({"admin", "status"}, template("admin_status/index"), "Status", 20) + entry({"admin", "status", "syslog"}, action_syslog, "Systemprotokoll") +end + +function action_syslog() + local syslog = luci.sys.syslog() + luci.template.render("admin_status/syslog", {syslog=syslog}) +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/system.lua b/modules/admin-core/luasrc/controller/admin/system.lua new file mode 100644 index 0000000000..e44e787fd6 --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/system.lua @@ -0,0 +1,245 @@ +module("luci.controller.admin.system", package.seeall) + +require("luci.sys") +require("luci.http") +require("luci.util") +require("luci.fs") +require("luci.model.ipkg") +require("luci.model.uci") + +function index() + local page = node("admin", "system") + page.target = template("admin_system/index") + page.title = "System" + page.order = 30 + + local page = node("admin", "system", "packages") + page.target = action_packages + page.title = "Paketverwaltung" + page.order = 10 + + local page = node("admin", "system", "packages", "ipkg") + page.target = action_ipkg + page.title = "IPKG-Konfiguration" + + local page = node("admin", "system", "passwd") + page.target = action_passwd + page.title = "Passwort ändern" + page.order = 20 + + local page = node("admin", "system", "sshkeys") + page.target = action_sshkeys + page.title = "SSH-Schlüssel" + page.order = 30 + + local page = node("admin", "system", "hostname") + page.target = cbi("admin_system/hostname") + page.title = "Hostname" + page.order = 40 + + local page = node("admin", "system", "fstab") + page.target = cbi("admin_system/fstab") + page.title = "Einhängepunkte" + page.order = 50 + + local page = node("admin", "system", "upgrade") + page.target = action_upgrade + page.title = "Firmwareupgrade" + page.order = 60 + + local page = node("admin", "system", "reboot") + page.target = action_reboot + page.title = "Neu starten" + page.order = 70 +end + +function action_editor() + local file = luci.http.formvalue("file", "") + local data = luci.http.formvalue("data") + local err = nil + local msg = nil + local stat = true + + if file and data then + stat, err = luci.fs.writefile(file, data) + end + + if not stat then + err = luci.util.split(err, " ") + table.remove(err, 1) + msg = table.concat(err, " ") + end + + local cnt, err = luci.fs.readfile(file) + if cnt then + cnt = luci.util.pcdata(cnt) + end + luci.template.render("admin_system/editor", {fn=file, cnt=cnt, msg=msg}) +end + +function action_ipkg() + local file = "/etc/ipkg.conf" + local data = luci.http.formvalue("data") + local stat = nil + local err = nil + + if data then + stat, err = luci.fs.writefile(file, data) + end + + local cnt = luci.fs.readfile(file) + if cnt then + cnt = luci.util.pcdata(cnt) + end + + luci.template.render("admin_system/ipkg", {cnt=cnt, msg=err}) +end + +function action_packages() + local ipkg = luci.model.ipkg + local void = nil + local submit = luci.http.formvalue("submit") + + + -- Search query + local query = luci.http.formvalue("query") + query = (query ~= '') and query or nil + + + -- Packets to be installed + local install = submit and luci.http.formvaluetable("install") + + -- Install from URL + local url = luci.http.formvalue("url") + if url and url ~= '' and submit then + if not install then + install = {} + end + install[url] = 1 + end + + -- Do install + if install then + for k, v in pairs(install) do + void, install[k] = ipkg.install(k) + end + end + + + -- Remove packets + local remove = submit and luci.http.formvaluetable("remove") + if remove then + for k, v in pairs(remove) do + void, remove[k] = ipkg.remove(k) + end + end + + + -- Update all packets + local update = luci.http.formvalue("update") + if update then + void, update = ipkg.update() + end + + + -- Upgrade all packets + local upgrade = luci.http.formvalue("upgrade") + if upgrade then + void, upgrade = ipkg.upgrade() + end + + + -- Package info + local info = luci.model.ipkg.info(query) + info = info or {} + local pkgs = {} + + -- Sort after status and name + for k, v in pairs(info) do + local x = 0 + for i, j in pairs(pkgs) do + local vins = (v.Status and v.Status.installed) + local jins = (j.Status and j.Status.installed) + if vins ~= jins then + if vins then + break + end + else + if j.Package > v.Package then + break + end + end + x = i + end + table.insert(pkgs, x+1, v) + end + + luci.template.render("admin_system/packages", {pkgs=pkgs, query=query, + install=install, remove=remove, update=update, upgrade=upgrade}) +end + +function action_passwd() + local p1 = luci.http.formvalue("pwd1") + local p2 = luci.http.formvalue("pwd2") + local stat = nil + + if p1 or p2 then + if p1 == p2 then + stat = luci.sys.user.setpasswd("root", p1) + else + stat = 10 + end + end + + luci.template.render("admin_system/passwd", {stat=stat}) +end + +function action_reboot() + local reboot = luci.http.formvalue("reboot") + luci.template.render("admin_system/reboot", {reboot=reboot}) + if reboot then + luci.sys.reboot() + end +end + +function action_sshkeys() + local file = "/etc/dropbear/authorized_keys" + local data = luci.http.formvalue("data") + local stat = nil + local err = nil + + if data then + stat, err = luci.fs.writefile(file, data) + end + + local cnt = luci.fs.readfile(file) + if cnt then + cnt = luci.util.pcdata(cnt) + end + + luci.template.render("admin_system/sshkeys", {cnt=cnt, msg=err}) +end + +function action_upgrade() + local ret = nil + local plat = luci.fs.mtime("/lib/upgrade/platform.sh") + + local image = luci.http.upload("image") + local keepcfg = luci.http.formvalue("keepcfg") + + if plat and image then + local kpattern = nil + if keepcfg then + local files = luci.model.uci.sections("luci").flash_keep + if files.luci and files.luci.flash_keep then + kpattern = "" + for k,v in pairs(files.luci.flash_keep) do + kpattern = kpattern .. " " .. v + end + end + end + ret = luci.sys.flash(image, kpattern) + end + + luci.template.render("admin_system/upgrade", {sysupgrade=plat, ret=ret}) +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/uci.lua b/modules/admin-core/luasrc/controller/admin/uci.lua new file mode 100644 index 0000000000..ca1440bdee --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/uci.lua @@ -0,0 +1,67 @@ +module("luci.controller.admin.uci", package.seeall) +require("luci.util") +require("luci.sys") + +function index() + node("admin", "uci", "changes").target = template("admin_uci/changes") + node("admin", "uci", "revert").target = action_revert + node("admin", "uci", "apply").target = action_apply +end + +-- This function has a higher priority than the admin_uci/apply template +function action_apply() + local changes = luci.model.uci.changes() + local output = "" + + if changes then + local com = {} + local run = {} + + -- Collect files to be applied and commit changes + for i, line in ipairs(luci.util.split(changes)) do + local r = line:match("^-?([^.]+)") + if r then + com[r] = true + + if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then + run[luci.config.uci_oncommit[r]] = true + end + end + end + + -- Apply + for config, i in pairs(com) do + luci.model.uci.commit(config) + end + + -- Search for post-commit commands + for cmd, i in pairs(run) do + output = output .. cmd .. ":" .. luci.sys.exec(cmd) .. "\n" + end + end + + luci.template.render("admin_uci/apply", {changes=changes, output=output}) +end + + +function action_revert() + local changes = luci.model.uci.changes() + if changes then + local revert = {} + + -- Collect files to be reverted + for i, line in ipairs(luci.util.split(changes)) do + local r = line:match("^-?([^.]+)") + if r then + revert[r] = true + end + end + + -- Revert them + for k, v in pairs(revert) do + luci.model.uci.revert(k) + end + end + + luci.template.render("admin_uci/revert", {changes=changes}) +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/controller/admin/wifi.lua b/modules/admin-core/luasrc/controller/admin/wifi.lua new file mode 100644 index 0000000000..0da6b79832 --- /dev/null +++ b/modules/admin-core/luasrc/controller/admin/wifi.lua @@ -0,0 +1,18 @@ +module("luci.controller.admin.wifi", package.seeall) + +function index() + local page = node("admin", "wifi") + page.target = template("admin_wifi/index") + page.title = "Drahtlos" + page.order = 60 + + local page = node("admin", "wifi", "devices") + page.target = cbi("admin_wifi/devices") + page.title = "Geräte" + page.order = 10 + + local page = node("admin", "wifi", "networks") + page.target = cbi("admin_wifi/networks") + page.title = "Netze" + page.order = 20 +end
\ No newline at end of file diff --git a/modules/admin-core/luasrc/i18n/admin_index.en b/modules/admin-core/luasrc/i18n/admin_index.en new file mode 100644 index 0000000000..0831b59f01 --- /dev/null +++ b/modules/admin-core/luasrc/i18n/admin_index.en @@ -0,0 +1,20 @@ +luci = "User Interface" + +hello = "Hello!" +admin1 = "This is the administration area of LuCI." +admin2 = "LuCI is a free, flexible, and user friendly graphical interface for configuring OpenWRT Kamikaze." +admin3 = "On the following pages you can adjust all important settings of your router." +admin4 = "You will find a navigation leading to the different configuration pages on the left side." +admin5 = [[As we are always want to improve this interface we are looking forward +to your feedback and suggestions.]] +admin6 = "And now have fun with your router!" +team = "The LuCI Team" + +luci1 = "Here you can customize the settings and the functionality of LuCI." +language = "Language" +general = "General" +ucicommit = "Post-commit actions" +ucicommit1 = [[These commands will be executed automatically when a given UCI configuration is committed allowing +changes to be applied instantly.]] +keepflash = "Files to be kept when flashing a new firmware" +keepflash1 = "When flashing a new firmware with LuCI these files will be added to the new firmware installation."
\ No newline at end of file diff --git a/modules/admin-core/luasrc/i18n/admin_uci.en b/modules/admin-core/luasrc/i18n/admin_uci.en new file mode 100644 index 0000000000..00ac5f5ff8 --- /dev/null +++ b/modules/admin-core/luasrc/i18n/admin_uci.en @@ -0,0 +1,2 @@ +uci_applied = "The following changes were applied" +uci_reverted = "The following changes were reverted"
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_index/luci.lua b/modules/admin-core/luasrc/model/cbi/admin_index/luci.lua new file mode 100644 index 0000000000..bb6bc18203 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_index/luci.lua @@ -0,0 +1,33 @@ +-- ToDo: Translate +require("luci.config") +m = Map("luci", translate("luci", "Oberfläche"), translate("luci1", + "Hier können Eigenschaften und die Funktionalität der Oberfläche angepasst werden.")) + +c = m:section(NamedSection, "main", "core", translate("general", "Allgemein")) + +l = c:option(ListValue, "lang", translate("language", "Sprache")) +for k, v in pairs(luci.config.languages) do + if k:sub(1, 1) ~= "." then + l:value(k, v) + end +end + +t = c:option(ListValue, "mediaurlbase", translate("design", "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("ucicommit", "UCI-Befehle beim Anwenden"), + translate("ucicommit1", [[Beim Anwenden +der Konfiguration aus der Oberflächliche heraus können automatisch die relevanten Dienste neugestart werden, +sodass Änderungen sofort nach dem Anwenden aktiv werden und der Router nicht erst neugestartet werden muss.]])) +u.dynamic = true + +f = m:section(NamedSection, "flash_keep", "extern", translate("keepflash", "Zu übernehmende Dateien bei Firmwareupgrade"), + translate("keepflash1", [[Die folgenden Dateien und Verzeichnisse werden beim Aktualisieren der Firmware +über die Oberfläche automatisch in die neue Firmware übernommen.]])) +f.dynamic = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_network/dhcp.lua b/modules/admin-core/luasrc/model/cbi/admin_network/dhcp.lua new file mode 100644 index 0000000000..63ef0aa3d7 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/dhcp.lua @@ -0,0 +1,41 @@ +-- ToDo: Translate, Add descriptions and help texts +require("luci.model.uci") +require("luci.sys") + +m = Map("dhcp", "DHCP", [[Mit Hilfe von DHCP können Netzteilnehmer automatisch +ihre Netzwerkkonfiguration (IP-Adresse, Netzmaske, DNS-Server, DHCP, ...) beziehen.]]) + +s = m:section(TypedSection, "dhcp") +s.addremove = true +s.anonymous = true + +iface = s:option(ListValue, "interface", "Schnittstelle") +for k, v in pairs(luci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + s:depends("interface", k) -- Only change sections with existing interfaces + end +end + +s:option(Value, "start", "Start", "Erste vergebene Adresse (letztes Oktett)").rmempty = true + +s:option(Value, "limit", "Limit", "Anzahl zu vergebender Adressen -1").rmempty = true + +s:option(Value, "leasetime", "Laufzeit").rmempty = true + +s:option(Flag, "dynamicdhcp", "Dynamisches DHCP").rmempty = true + +s:option(Value, "name", "Name").optional = true + +s:option(Flag, "ignore", "Schnittstelle ignorieren", "DHCP für dieses Netzwerk deaktivieren").optional = true + +s:option(Value, "netmask", "Netzmaske").optional = true + +s:option(Flag, "force", "Start erzwingen").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-core/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-core/luasrc/model/cbi/admin_network/ifaces.lua new file mode 100644 index 0000000000..2dd1909574 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/ifaces.lua @@ -0,0 +1,43 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("network", "Schnittstellen", [[An dieser Stelle können die einzelnen Schnittstellen +des Netzwerkes konfiguriert werden. Es können mehrere Schnittstellen zu einer Brücke zusammengefasst werden, +indem diese durch Leerzeichen getrennt aufgezählt werden und ein entsprechender Haken im Feld Netzwerkbrücke +gesetzt wird. Es können VLANs in der Notation SCHNITTSTELLE.VLANNR (z.B.: eth0.1) verwendet werden.]]) + +s = m:section(TypedSection, "interface") +s.addremove = true +s:exclude("loopback") +s:depends("proto", "static") +s:depends("proto", "dhcp") + +p = s:option(ListValue, "proto", "Protokoll") +p:value("static", "statisch") +p:value("dhcp", "DHCP") +p.default = "static" + +br = s:option(Flag, "type", "Netzwerkbrücke", "überbrückt angegebene Schnittstelle(n)") +br.enabled = "bridge" +br.rmempty = true + +s:option(Value, "ifname", "Schnittstelle") + +s:option(Value, "ipaddr", "IP-Adresse") + +s:option(Value, "netmask", "Netzmaske"):depends("proto", "static") + +gw = s:option(Value, "gateway", "Gateway") +gw:depends("proto", "static") +gw.rmempty = true + +dns = s:option(Value, "dns", "DNS-Server") +dns:depends("proto", "static") +dns.optional = true + +mtu = s:option(Value, "mtu", "MTU") +mtu.optional = true +mtu.isinteger = true + +mac = s:option(Value, "macaddr", "MAC-Adresse") +mac.optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_network/ptp.lua b/modules/admin-core/luasrc/model/cbi/admin_network/ptp.lua new file mode 100644 index 0000000000..6a627f2687 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/ptp.lua @@ -0,0 +1,33 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("network", "Punkt-zu-Punkt Verbindungen", [[Punkt-zu-Punkt Verbindungen +über PPPoE oder PPTP werden häufig dazu verwendet, um über DSL o.ä. Techniken eine +Verbindung zum Internetgateway eines Internetzugangsanbieters aufzubauen.]]) + +s = m:section(TypedSection, "interface") +s.addremove = true +s:depends("proto", "pppoe") +s:depends("proto", "pptp") + +p = s:option(ListValue, "proto", "Protokoll") +p:value("pppoe", "PPPoE") +p:value("pptp", "PPTP") +p.default = "pppoe" + +s:option(Value, "ifname", "Schnittstelle") + +s:option(Value, "username", "Benutzername") +s:option(Value, "password", "Passwort") + +s:option(Value, "keepalive", "Keep-Alive", "Bei einer Verbindungstrennung automatisch neu verbinden").optional = true + +s:option(Value, "demand", "Dial on Demand (idle time)", "Zeit nach der die Verbindung bei Inaktivität getrennt wird").optional = true + +srv = s:option(Value, "server", "PPTP-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-core/luasrc/model/cbi/admin_network/qos.lua b/modules/admin-core/luasrc/model/cbi/admin_network/qos.lua new file mode 100644 index 0000000000..d58130f10f --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/qos.lua @@ -0,0 +1,56 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("qos", "Quality of Service", [[Mit Hilfe von QoS kann einzelnen Rechnern oder Netzwerkdiensten +eine höhere oder niedrigere Priorität zugewiesen werden.]]) + +s = m:section(TypedSection, "interface", "Schnittstellen") +s.addremove = true + +s:option(Flag, "enabled", "aktiviert") + +c = s:option(ListValue, "classgroup", "Klassifizierung") +c:value("Default", "standard") +c.default = "Default" + +s:option(Flag, "overhead", "Overheadberechnung") + +s:option(Value, "download", "Downlink", "kb/s") + +s:option(Value, "upload", "Uplink", "kb/s") + +s = m:section(TypedSection, "classify", "Klassifizierung") + +s.anonymous = true +s.addremove = true + +t = s:option(ListValue, "target", "Klasse") +t:value("Priority") +t:value("Express") +t:value("Normal") +t:value("Bulk") +t.default = "Normal" + +s:option(Value, "srchost", "Quelladresse", "Quellhost / Quellnetz").optional = true +s:option(Value, "dsthost", "Zieladresse", "Zielhost / Zielnetz").optional = true +s:option(Value, "layer7", "Layer 7").optional = true + +p2p = s:option(ListValue, "ipp2p", "P2P") +p2p:value("") +p2p:value("all", "Alle") +p2p:value("bit", "Bittorrent") +p2p:value("dc", "DirectConnect") +p2p:value("edk", "eDonkey") +p2p:value("gnu", "Gnutella") +p2p:value("kazaa", "Kazaa") +p2p.optional = true + +p = s:option(ListValue, "proto", "Protokoll") +p:value("") +p:value("tcp", "TCP") +p:value("udp", "UDP") +p:value("icmp", "ICMP") +p.optional = true + +s:option(Value, "ports", "Port").optional = true +s:option(Value, "portrange", "Portbereich").optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_network/routes.lua b/modules/admin-core/luasrc/model/cbi/admin_network/routes.lua new file mode 100644 index 0000000000..a2a27eb265 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/routes.lua @@ -0,0 +1,24 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("network", "Statische Routen", [[Statische Routen geben an, +über welche Schnittstelle und welches Gateway ein bestimmter Host +oder ein bestimmtes Netzwerk erreicht werden kann.]]) + +s = m:section(TypedSection, "route") +s.addremove = true +s.anonymous = true +s.template = "cbi/tblsection" + +iface = s:option(ListValue, "interface", "Schnittstelle") +for k, v in pairs(luci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + iface:value(k) + end +end + +s:option(Value, "target", "Ziel", "Host-IP oder Netzwerk") + +s:option(Value, "netmask", "Netzmaske", "falls Ziel ein Netzwerk ist").rmemepty = true + +s:option(Value, "gateway", "Gateway") + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_network/vlan.lua b/modules/admin-core/luasrc/model/cbi/admin_network/vlan.lua new file mode 100644 index 0000000000..7b493643b1 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_network/vlan.lua @@ -0,0 +1,17 @@ +-- ToDo: Autodetect things, maybe use MultiValue instead, Translate, Add descriptions +m = Map("network", "VLAN", [[Die Netzwerkschnittstellen am Router +können zu verschienden VLANs zusammengefasst werden, in denen Geräte miteinander direkt +kommunizieren können. VLANs werden auch häufig dazu genutzt, um Netzwerke voneiander zu trennen. +So ist oftmals eine Schnittstelle als Uplink zu einem größerem Netz, wie dem Internet vorkonfiguriert +und die anderen Schnittstellen bilden ein VLAN für das lokale Netzwerk.]]) + +s = m:section(TypedSection, "switch", nil, [[Die zu einem VLAN gehörenden Schnittstellen +werden durch Leerzeichen getrennt. Die Schnittstelle mit der höchsten Nummer (meistens 5) bildet +in der Regel die Verbindung zur internen Netzschnittstelle des Routers. Bei Geräten mit 5 Schnittstellen +ist in der Regel die Schnittstelle mit der niedrigsten Nummer (0) die standardmäßige Uplinkschnittstelle des Routers.]]) + +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-core/luasrc/model/cbi/admin_services/dnsmasq.lua b/modules/admin-core/luasrc/model/cbi/admin_services/dnsmasq.lua new file mode 100644 index 0000000000..86716ff9f3 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_services/dnsmasq.lua @@ -0,0 +1,29 @@ +m = Map("dhcp", "Dnsmasq", "Dnsmasq ist ein kombinierter DHCP-Server und DNS-Forwarder für NAT-Firewalls.") + +s = m:section(TypedSection, "dnsmasq", "Einstellungen") +s.anonymous = true + +s:option(Flag, "domainneeded", "Anfragen nur mit Domain", "Anfragen ohne Domainnamen nicht weiterleiten") +s:option(Flag, "authoritative", "Authoritativ", "Dies ist der einzige DHCP im lokalen Netz") +s:option(Flag, "boguspriv", "Private Anfragen filtern", "Reverse DNS-Anfragen für lokalen Netze nicht weiterleiten") +s:option(Flag, "filterwin2k", "Windowsanfragen filtern", "nutzlose DNS-Anfragen aktueller Windowssysteme filtern") +s:option(Flag, "localise_queries", "Lokalisiere Anfragen", "Gibt die Adresse eines Hostnamen entsprechend seines Subnetzes zurück") +s:option(Value, "local", "Lokale Server") +s:option(Value, "domain", "Lokale Domain") +s:option(Flag, "expandhosts", "Erweitere Hosts", "Fügt Domainnamen zu einfachen Hosteinträgen in der Resolvdatei hinzu") +s:option(Flag, "nonegcache", "Unbekannte nicht cachen", "Negative DNS-Antworten nicht zwischenspeichern") +s:option(Flag, "readethers", "Verwende /etc/ethers", "Lese Informationen aus /etc/ethers um den DHCP-Server zu konfigurieren") +s:option(Value, "leasefile", "Leasedatei", "Speicherort für vergebenen DHCP-Adressen") +s:option(Value, "resolvfile", "Resolvdatei", "Lokale DNS-Datei") +s:option(Flag, "nohosts", "Ignoriere /etc/hosts").optional = true +s:option(Flag, "strictorder", "Strikte Reihenfolge", "DNS-Server werden strikt der Reihenfolge in der Resolvdatei nach abgefragt").optional = true +s:option(Flag, "logqueries", "Schreibe Abfragelog").optional = true +s:option(Flag, "noresolv", "Ignoriere Resolvdatei").optional = true +s:option(Value, "dnsforwardmax", "gleichzeitige Abfragen").optional = true +s:option(Value, "port", "DNS-Port").optional = true +s:option(Value, "ednspacket_max", "max. EDNS.0 Paketgröße").optional = true +s:option(Value, "dhcpleasemax", "max. DHCP-Leases").optional = true +s:option(Value, "addnhosts", "Zusätzliche Hostdatei").optional = true +s:option(Value, "queryport", "Abfrageport").optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_services/dropbear.lua b/modules/admin-core/luasrc/model/cbi/admin_services/dropbear.lua new file mode 100644 index 0000000000..3ecf953356 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_services/dropbear.lua @@ -0,0 +1,15 @@ +-- ToDo: Translate, Add descriptions +m = Map("dropbear", "SSH-Server", [[Der SSH-Server ermöglicht Shell-Zugriff +über das Netzwerk und bietet einen integrierten SCP-Dienst.]]) + +s = m:section(TypedSection, "dropbear") +s.anonymous = true + +port = s:option(Value, "Port", "Port") +port.isinteger = true + +pwauth = s:option(Flag, "PasswordAuth", "Passwortanmeldung", "Erlaube Anmeldung per Passwort") +pwauth.enabled = 'on' +pwauth.disabled = 'off' + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_services/httpd.lua b/modules/admin-core/luasrc/model/cbi/admin_services/httpd.lua new file mode 100644 index 0000000000..3bd49a2d7d --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_services/httpd.lua @@ -0,0 +1,18 @@ +-- ToDo: Translate, Add descriptions +m = Map("httpd", "HTTP-Server", "Der HTTP-Server ist u.a. für die Bereitstellung dieser Obefläche zuständig.") + +s = m:section(TypedSection, "httpd") +s.anonymous = true + +port = s:option(Value, "port", "Port") +port.isinteger = true + +s:option(Value, "home", "Wurzelverzeichnis") + +config = s:option(Value, "c_file", "Konfigurationsdatei", "/etc/httpd.conf wenn leer") +config.rmempty = true + +realm = s:option(Value, "realm", "Anmeldeaufforderung", "Aufforderungstext zum Anmelden im Administrationsbereich") +realm.rmempty = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_services/olsrd.lua b/modules/admin-core/luasrc/model/cbi/admin_services/olsrd.lua new file mode 100644 index 0000000000..a1a1978086 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_services/olsrd.lua @@ -0,0 +1,89 @@ +-- ToDo: Autodetect things, Translate, Add descriptions +require("luci.fs") + +m = Map("olsr", "OLSR", [[OLSR ist ein flexibles Routingprotokoll, +dass den Aufbau von mobilen Ad-Hoc Netzen unterstützt.]]) + +s = m:section(NamedSection, "general", "olsr", "Allgemeine Einstellungen") + +debug = s:option(ListValue, "DebugLevel", "Debugmodus") +for i=0, 9 do + debug:value(i) +end + +ipv = s:option(ListValue, "IpVersion", "Internet Protokoll") +ipv:value("4", "IPv4") +ipv:value("6", "IPv6") + +noint = s:option(Flag, "AllowNoInt", "Start ohne Netzwerk") +noint.enabled = "yes" +noint.disabled = "no" + +s:option(Value, "Pollrate", "Abfragerate (Pollrate)", "s") + +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", "MPR-Erfassung") + +lql = s:option(ListValue, "LinkQualityLevel", "VQ-Level") +lql:value("0", "deaktiviert") +lql:value("1", "MPR-Auswahl") +lql:value("2", "MPR-Auswahl und Routing") + +lqfish = s:option(Flag, "LinkQualityFishEye", "VQ-Fisheye") + +s:option(Value, "LinkQualityWinSize", "VQ-Fenstergröße") + +s:option(Value, "LinkQualityDijkstraLimit", "VQ-Dijkstralimit") + +hyst = s:option(Flag, "UseHysteresis", "Hysterese aktivieren") +hyst.enabled = "yes" +hyst.disabled = "no" + + +i = m:section(TypedSection, "Interface", "Schnittstellen") +i.anonymous = true +i.addremove = true +i.dynamic = true + +network = i:option(ListValue, "Interface", "Netzwerkschnittstellen") +network:value("") +for k, v in pairs(luci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + network:value(k) + end +end + +i:option(Value, "HelloInterval", "Hello-Intervall") + +i:option(Value, "HelloValidityTime", "Hello-Gültigkeit") + +i:option(Value, "TcInterval", "TC-Intervall") + +i:option(Value, "TcValidityTime", "TC-Gültigkeit") + +i:option(Value, "MidInterval", "MID-Intervall") + +i:option(Value, "MidValidityTime", "MID-Gültigkeit") + +i:option(Value, "HnaInterval", "HNA-Intervall") + +i:option(Value, "HnaValidityTime", "HNA-Gültigkeit") + + +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 diff --git a/modules/admin-core/luasrc/model/cbi/admin_system/fstab.lua b/modules/admin-core/luasrc/model/cbi/admin_system/fstab.lua new file mode 100644 index 0000000000..d705743a0f --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_system/fstab.lua @@ -0,0 +1,25 @@ +m = Map("fstab", "Einhängepunkte") + +mount = m:section(TypedSection, "mount", "Einhängepunkte", [[Einhängepunkte bestimmen, an welcher Stelle des Dateisystems +bestimmte Laufwerke und Speicher zur Verwendung eingebunden werden.]]) +mount.anonymous = true +mount.addremove = true + +mount:option(Flag, "enabled", "aktivieren") +mount:option(Value, "device", "Gerät", "Die Gerätedatei des Speichers oder der Partition (z.B.: /dev/sda)") +mount:option(Value, "target", "Einhängepunkt", "Die Stelle an der der Speicher in das Dateisystem eingehängt wird.") +mount:option(Value, "fstype", "Dateisystem", "Das Dateisystem mit dem der Speicher formatiert ist (z.B.: ext3)") +mount:option(Value, "options", "Optionen", "Weitere Optionen (siehe das Handbuch des Befehls 'mount')") + + +swap = m:section(TypedSection, "swap", "SWAP", [[Falls der Arbeitsspeicher des Routers nicht ausreicht, +kann dieser nicht benutzte Daten zeitweise auf einem SWAP-Laufwerk auslagern um so die +effektive Größe des Arbeitsspeichers zu erhöhen. Die Auslagerung der Daten ist natürlich bedeutend langsamer +als direkte Arbeitsspeicherzugriffe.]]) +swap.anonymous = true +swap.addremove = true + +swap:option(Flag, "enabled", "aktivieren") +swap:option(Value, "device", "Gerät", "Die Gerätedatei des Speichers oder der Partition (z.B.: /dev/sda)") + +return m diff --git a/modules/admin-core/luasrc/model/cbi/admin_system/hostname.lua b/modules/admin-core/luasrc/model/cbi/admin_system/hostname.lua new file mode 100644 index 0000000000..c9e159d05f --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_system/hostname.lua @@ -0,0 +1,9 @@ +m = Map("system", "Hostname", [[Definiert den Hostnamen des Routers. +Der Hostname ist eine im Netzwerk eindeutige Kennung, die dieses Gerät identifiziert.]]) + +s = m:section(TypedSection, "system") +s.anonymous = true + +s:option(Value, "hostname", "Hostname") + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_wifi/devices.lua b/modules/admin-core/luasrc/model/cbi/admin_wifi/devices.lua new file mode 100644 index 0000000000..2931a6e559 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_wifi/devices.lua @@ -0,0 +1,52 @@ +-- ToDo: Translate, Add descriptions and help texts + +m = Map("wireless", "Geräte", [[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", "Aktivieren") +en.enabled = "0" +en.disabled = "1" + +t = s:option(ListValue, "type", "Typ") +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", "Modus") +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", "Funkkanal") + +s:option(Value, "txantenna", "Sendeantenne").rmempty = true + +s:option(Value, "rxantenna", "Empfangsantenne").rmempty = true + +s:option(Value, "distance", "Distanz", + "Distanz zum am weitesten entfernten Funkpartner (m)").rmempty = true + +s:option(Value, "diversity", "Diversität"):depends("type", "atheros") + +country = s:option(Value, "country", "Ländercode") +country.optional = true +country:depends("type", "broadcom") + +maxassoc = s:option(Value, "maxassoc", "Verbindungslimit") +maxassoc:depends("type", "broadcom") +maxassoc.optional = true + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/model/cbi/admin_wifi/networks.lua b/modules/admin-core/luasrc/model/cbi/admin_wifi/networks.lua new file mode 100644 index 0000000000..a5be6f5028 --- /dev/null +++ b/modules/admin-core/luasrc/model/cbi/admin_wifi/networks.lua @@ -0,0 +1,77 @@ +-- ToDo: Translate, Add descriptions and help texts +m = Map("wireless", "Netze", [[Pro WLAN-Gerät können mehrere Netze bereitgestellt werden. +Es sollte beachtet werden, dass es hardware- / treiberspezifische Einschränkungen gibt. +So kann pro WLAN-Gerät in der Regel entweder 1 Ad-Hoc-Zugang ODER bis zu 3 Access-Point und 1 Client-Zugang +gleichzeitig erstellt werden.]]) + +s = m:section(TypedSection, "wifi-iface") +s.addremove = true +s.anonymous = true + +s:option(Value, "ssid", "Netzkennung (ESSID)").maxlength = 32 + +device = s:option(ListValue, "device", "Gerät") +local d = luci.model.uci.sections("wireless") +if d then + for k, v in pairs(d) do + if v[".type"] == "wifi-device" then + device:value(k) + end + end +end + +network = s:option(ListValue, "network", "Netzwerk", "WLAN-Netz zu Netzwerk hinzufügen") +network:value("") +for k, v in pairs(luci.model.uci.sections("network")) do + if v[".type"] == "interface" and k ~= "loopback" then + network:value(k) + end +end + +mode = s:option(ListValue, "mode", "Modus") +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", "Sendeleistung", "dbm").rmempty = true + +s:option(Flag, "frameburst", "Broadcom-Frameburst").optional = true +s:option(Flag, "bursting", "Atheros-Frameburst").optional = true + + +encr = s:option(ListValue, "encryption", "Verschlüsselung") +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", "Schlüssel") +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", "Radius-Server") +server:depends("encryption", "wpa") +server:depends("encryption", "wpa2") +server.rmempty = true + +port = s:option(Value, "port", "Radius-Port") +port:depends("encryption", "wpa") +port:depends("encryption", "wpa2") +port.rmempty = true + +s:option(Flag, "isolate", "AP-Isolation", "Unterbindet Client-Client-Verkehr").optional = true + +s:option(Flag, "hidden", "ESSID verstecken").optional = true + + + +return m
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_index/index.htm b/modules/admin-core/luasrc/view/admin_index/index.htm new file mode 100644 index 0000000000..2e5c7c3745 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_index/index.htm @@ -0,0 +1,11 @@ +<%+header%> +<h1><%:hello Hallo!%></h1> +<p><%:admin1 Dies ist der Administrationsbereich von LuCI.%></p> +<p><%:admin2 LuCI ist eine freie, flexible und benutzerfreundliche grafische Oberfläche zur Konfiguration von OpenWRT Kamikaze.%><br /> +<%:admin3 Auf den folgenden Seiten können alle wichtigen Einstellungen des Routers vorgenommen werden.%></p> +<p><%:admin4 Auf der linken Seite befindet sich eine Navigation, die zu den einzelnen Konfigurationsseiten führt.%></p> +<p><%:admin5 Wir sind natürlich stets darum bemüht, diese Oberfläche +noch besser und intuitiver zu Gestalten und freuen uns über jegliche Art von Feedback oder Verbesserungsvorschlägen.%></p> +<p><%:admin6 Und nun wünschen wir viel Spaß mit dem Router!%></p> +<p><em><strong><a href="http://luci.freifunk-halle.net"><%:team Das LuCI-Team%></a></strong></em></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_network/index.htm b/modules/admin-core/luasrc/view/admin_network/index.htm new file mode 100644 index 0000000000..7fa4f5565e --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_network/index.htm @@ -0,0 +1,11 @@ +<%+header%> +<h1><%:network Netzwerk%></h1> +<p><%:network1 In diesem Bereich finden sich alle netzwerkbezogenen Einstellungen.%></p> +<p><%:network2 Der Netzwerkswitch kann bei den meisten Routern frei konfiguriert +und in mehrere VLANs aufgeteilt werden. %></p> +<p><%:network3 Schnittstellen und PPPoE/PPTP-Einstellungen ermöglichen +die freie Organisation des Netzwerks und die Anbindung an ein WAN.%></p> +<p><%:network4 DHCP ermöglichst die automatische Netzwerkkonfiguration von Rechnern im (W)LAN.%></p> +<p><%:network5 Portweiterleitung und Firewall erlauben eine effektive Absicherung des Netzes, bei gleichzeitiger +Bereitstellung von externen Diensten.%></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_services/index.htm b/modules/admin-core/luasrc/view/admin_services/index.htm new file mode 100644 index 0000000000..a06fe10568 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_services/index.htm @@ -0,0 +1,8 @@ +<%+header%> +<h1><%:services Dienste%></h1> +<p><%:services1 Dienste und Dämonen stellen bestimmte Funktionalitäten auf dem Router zur Verfügung.%></p> +<p><%:services2 Es handelt sich hierbei meist um Netzwerkserver, die verschiedene Aufgaben auf dem Router erfüllen, +beispielsweise Shell-Zugang ermöglichen oder diese Weboberfläche per HTTP anbieten.%></p> +<p><%:servcies3 In diesen Bereich fallen auch die Meshnetzwerkdienste wie OLSR und BATMAN, die dabei helfen, +ein autarkes Ad-Hoc Netzwerk aufzubauen.%></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_status/index.htm b/modules/admin-core/luasrc/view/admin_status/index.htm new file mode 100644 index 0000000000..984093693d --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_status/index.htm @@ -0,0 +1,7 @@ +<%+header%> +<h1><%:status Status%></h1> +<p><%:status1 Hier finden sich Informationen über den aktuellen Status des Systems, beispielsweise +Prozessortakt, Speicherauslastung und Netzwerkschnittstellen.%></p> +<p><%:status2 Zusätzlich können hier Protokolldaten, des Kernels und diverser Systemdienste eingesehen werden, +um deren Zustand zu kontrollieren.%></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_status/syslog.htm b/modules/admin-core/luasrc/view/admin_status/syslog.htm new file mode 100644 index 0000000000..905161be20 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_status/syslog.htm @@ -0,0 +1,5 @@ +<%+header%> +<h1><%:status Status%></h1> +<h2><%:syslog Systemprotokoll%></h2> +<code><%=syslog%></code> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/editor.htm b/modules/admin-core/luasrc/view/admin_system/editor.htm new file mode 100644 index 0000000000..ef3e0d8abd --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/editor.htm @@ -0,0 +1,14 @@ +<%+header%> +<h1><%:texteditor Texteditor%></h1> +<form method="post" action="<%=controller%>/admin/system/editor"> +<div><%:file Datei%>: <input type="text" name="file" size="30" value="<%=fn%>" /> +<% if msg then %><span class="error"><%:error Fehler%>: <%=msg%></span><% end %></div> +<br /> +<div><textarea style="width: 100%" rows="20" name="data"><%=cnt%></textarea></div> +<br /> +<div> + <input type="submit" value="<%:save Speichern%>" /> + <input type="reset" value="<%:reset Zurücksetzen%>" /> +</div> +</form> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/index.htm b/modules/admin-core/luasrc/view/admin_system/index.htm new file mode 100644 index 0000000000..3e9a28221d --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/index.htm @@ -0,0 +1,9 @@ +<%+header%> +<h1><%:system System%></h1> +<p><%:system1 Hier finden sich Einstellungen, die das System selbst, dessen Kennung, +installierte Software und Hardware, Authentifizierung oder eingehängte Speicher betreffen.%></p> +<p><%:system2 Diese Einstellungen definieren die Grundlage des Systems, auf dem die +installierte Software aufbaut.%></p> +<p><%:system3 Beachte bitte, dass eine fehlerhafte Konfiguration den Start +des Routers verhindern oder dich vom Zugriff auf diesen ausschließen kann.%></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/ipkg.htm b/modules/admin-core/luasrc/view/admin_system/ipkg.htm new file mode 100644 index 0000000000..9a88ee57b5 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/ipkg.htm @@ -0,0 +1,26 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:ipkg IPKG-Konfiguration%></h2> + +<br /> + +<div><strong><%:ipkg_pkglists Paketlisten%>:</strong><code>src <em>Name</em> <em>URL</em></code></div> +<div><strong><%:ipkg_targets Installationsziele%>:</strong><code>dest <em>Name</em> <em>Pfad</em></code></div> + +<br /> + +<form method="post" action="<%=controller%>/admin/system/ipkg"> + <div class="cbi-section-node" style="width: 100%"> + <div class="cbi-value"> + <div class="cbi-value-field"> + <textarea style="width: 100%" rows="10" name="data"><%=cnt%></textarea> + </div> + </div> + </div> + <div> + <input type="submit" value="<%:save Speichern%>" /> + <input type="reset" value="<%:reset Zurücksetzen%>" /> + </div> + <% if msg then %><br /><div class="error"><%:error Fehler%>: <%=msg%></div><% end %> +</form> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/packages.htm b/modules/admin-core/luasrc/view/admin_system/packages.htm new file mode 100644 index 0000000000..52da370403 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/packages.htm @@ -0,0 +1,77 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:packages Paketverwaltung%></h2> + +<br /> + +<% if install or remove or update or upgrade then %> +<div class="code"><strong><%:status Status%>:</strong><br /> +<% if update then %> + <%:packages_update Paketlisten aktualisieren%>: <% if update == 0 then %><span class="ok"><%:ok OK%></span><% else %><span class="error"><%:error Fehler%> (<%:code Code%> <%=update%>)</span><% end %><br /> +<% end %> +<% if upgrade then%> + <%:packages_upgrade Installierte Pakete aktualisieren%>: <% if upgrade == 0 then %><span class="ok"><%:ok OK%></span><% else %><span class="error"><%:error Fehler%> (<%:code Code%> <%=upgrade%>)</span><% end %><br /> +<% end %> +<% if install then for k,v in pairs(install) do %> + <%:packages_install Installation von%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok OK%></span><% else %><span class="error"><%:error Fehler%> (<%:code Code%> <%=v%>)</span><% end %><br /> +<% end end %> +<% if remove then for k,v in pairs(remove) do %> + <%:packages_remove Deinstallation von%> '<%=k%>': <% if v == 0 then %><span class="ok"><%:ok OK%></span><% else %><span class="error"><%:error Fehler%> (<%:code Code%> <%=v%>)</span><% end %><br /> +<% end end %> +</div> +<br /> +<% end %> + +<div> +<a href="<%=controller%>/admin/system/ipkg"><%:packages_ipkg Paketlisten und Installationsziele bearbeiten%></a><br /> +<a href="<%=controller%>/admin/system/packages?update=1"><%:packages_updatelist Paketlisten aktualisieren%></a><br /> +<a href="<%=controller%>/admin/system/packages?upgrade=1"><%:packages_upgrade Installierte Pakete aktualisieren%></a> +</div> + +<br /> +<br /> + +<form method="post" action="<%=controller%>/admin/system/packages"> + <div> + <span class="bold"><%:packages_installurl Paket herunterladen und installieren%>:</span><br /> + <input type="text" name="url" size="30" value="" /> + <input type="submit" name="submit" value="<%:ok OK%>" /> + </div> + + <br /> + <br /> + + <div> + <span class="bold"><%:filter Filter%>:</span> + <input type="text" name="query" size="20" value="<%=query%>" /> + <input type="submit" name="search" value="<%:packages_search Paket suchen%>" /> + <input type="submit" name="submit" value="<%:packages_do Aktionen ausführen%>" /> + </div> + + <br /> + <br /> + + <div> + <table style="font-size: 0.8em"> + <tr> + <th><%:packages_name Paketname%></th> + <th><%:version Version%></th> + <th><%:install Installieren%></th> + <th><%:delete Löschen%></th> + <th><%:descr Beschreibung%></th> + </tr> + <% for k, pkg in pairs(pkgs) do %> + <tr> + <td><%=pkg.Package%></td> + <td><%=pkg.Version%></td> + <td><% if not pkg.Status or not pkg.Status.installed then %><input type="checkbox" name="install.<%=pkg.Package%>" value="1" /><% else %><%:installed installiert%><% end %></td> + <td><% if pkg.Status and pkg.Status.installed then %><input type="checkbox" name="remove.<%=pkg.Package%>" value="1" /><% else %><%:notinstalled nicht installiert%><% end %></td> + <td><%=pkg.Description%></td> + </tr> + <% end %> + </table> + </div> + <br /> + <input type="submit" name="submit" value="<%:packages_do Aktionen ausführen%>" /> +</form> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/passwd.htm b/modules/admin-core/luasrc/view/admin_system/passwd.htm new file mode 100644 index 0000000000..87b2533687 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/passwd.htm @@ -0,0 +1,35 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:passwd Passwort ändern%></h2> +<p><%:passwd1 Ändert das Passwort des Systemverwalters (Benutzer "root")%></p> +<div><br /> +<% if stat then %> + <% if stat == 0 then %> + <code><%:password_changed Passwort erfolgreich geändert!%></code> + <% elseif stat == 10 then %> + <code class="error"><%:password_nomatch Passwörter stimmen nicht überein! %></code> + <% else %> + <code class="error"><%:unknown_error Unbekannter Fehler!%></code> + <% end %> +<% end %> +<% if not stat or stat == 10 then %> + <form method="post" action="<%=controller%>/admin/system/passwd"> + <div class="cbi-section-node"> + <div class="cbi-value"> + <div class="cbi-value-title"><%:password Passwort%></div> + <div class="cbi-value-field"><input type="password" name="pwd1" /></div> + </div> + <div class="cbi-value"> + <div class="cbi-value-title"><%:confirmation Bestätigung%></div> + <div class="cbi-value-field"><input type="password" name="pwd2" /></div> + </div> + <br /> + <div> + <input type="submit" value="<%:save Speichern%>" /> + <input type="reset" value="<%:reset Zurücksetzen%>" /> + </div> + </div> + </form> +<% end %> +</div> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/reboot.htm b/modules/admin-core/luasrc/view/admin_system/reboot.htm new file mode 100644 index 0000000000..e81be408c9 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/reboot.htm @@ -0,0 +1,11 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:reboot Neu starten%></h2> +<p><%:reboot1 Startet das Betriebssystem des Routers neu.%></p> +<% if not reboot then %> +<p><a href="<%=controller%>/admin/system/reboot?reboot=1"><%:reboot_do Neustart durchführen%></a></p> +<% else %> +<p><%:reboot_running Bitte warten: Neustart wird durchgeführt...%></p> +<script type="text/javascript">setTimeout("location='<%=controller%>/admin'", 60000)</script> +<% end %> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/sshkeys.htm b/modules/admin-core/luasrc/view/admin_system/sshkeys.htm new file mode 100644 index 0000000000..3765e1eeac --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/sshkeys.htm @@ -0,0 +1,26 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:sshkeys SSH-Schlüssel%></h2> + +<br /> + +<div><%:sshkeys_descr Hier können öffentliche SSH-Schlüssel (einer pro Zeile) + zur Authentifizierung abgelegt werden.%></div> + +<br /> + +<form method="post" action="<%=controller%>/admin/system/sshkeys"> + <div class="cbi-section-node" style="width: 100%"> + <div class="cbi-value"> + <div class="cbi-value-field"> + <textarea style="width: 100%" rows="10" name="data"><%=cnt%></textarea> + </div> + </div> + </div> + <div> + <input type="submit" value="<%:save Speichern%>" /> + <input type="reset" value="<%:reset Zurücksetzen%>" /> + </div> + <% if msg then %><br /><div class="error"><%:error Fehler%>: <%=msg%></div><% end %> +</form> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_system/upgrade.htm b/modules/admin-core/luasrc/view/admin_system/upgrade.htm new file mode 100644 index 0000000000..185e03124f --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_system/upgrade.htm @@ -0,0 +1,34 @@ +<%+header%> +<h1><%:system System%></h1> +<h2><%:upgrade Upgrade%></h2> +<p><%:upgrade1 Ersetzt die installierte Firmware (das Betriebssystem des Routers) durch ein neues. +Das Format der Firmware ist plattformabhängig.%></p> +<br /> +<% if sysupgrade and not ret then %> +<form method="post" action="<%=uploadctrl%>/admin/system/upgrade" enctype="multipart/form-data"> + <div class="cbi-section-node"> + <div class="cbi-value clear"> + <div class="cbi-value-title left"><%:fwimage Firmwareimage%></div> + <div class="cbi-value-field"><input type="file" size="30" name="image" /></div> + </div> + <br /> + <div class="cbi-value clear"> + <input type="checkbox" name="keepcfg" value="1" checked="checked" /> + <span class="bold"><%:keepcfg Konfigurationsdateien übernehmen%></span> + </div> + <br /> + <div> + <input type="submit" value="<%:fwupgrade Firmware aktualisieren%>" /> + </div> + </div> +</form> +<% elseif ret then %> + <% if ret == 0 then %> +<div class="ok"><%:flashed Flashvorgang erfolgreich. Router startet neu...%></div> + <% else %> +<div class="error"><%:flasherr Flashvorgang fehlgeschlagen!%> (<%:code Code%> <%=ret%>)</div> + <% end %> +<% else %> +<div class="error"><%:notimplemented Diese Funktion steht leider (noch) nicht zur Verfügung.%></div> +<% end %> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_uci/apply.htm b/modules/admin-core/luasrc/view/admin_uci/apply.htm new file mode 100644 index 0000000000..090967a2d9 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_uci/apply.htm @@ -0,0 +1,6 @@ +<%+header%> +<h1><%:config Konfiguration%></h1> +<p><%:uci_applied Die folgenden Änderungen wurden übernommen%>:</p> +<code><%=(changes or "-")%> +<%=output%></code> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_uci/changes.htm b/modules/admin-core/luasrc/view/admin_uci/changes.htm new file mode 100644 index 0000000000..43a48e3fcb --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_uci/changes.htm @@ -0,0 +1,11 @@ +<%+header%> +<h1><%:config Konfiguration%></h1> +<h2><%:changes Änderungen%></h2> +<code><%=luci.model.uci.changes()%></code> +<form class="inline" method="get" action="<%=controller%>/admin/uci/apply"> + <input type="submit" value="<%:apply Anwenden%>" /> +</form> +<form class="inline" method="get" action="<%=controller%>/admin/uci/revert"> + <input type="submit" value="<%:revert Verwerfen%>" /> +</form> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_uci/revert.htm b/modules/admin-core/luasrc/view/admin_uci/revert.htm new file mode 100644 index 0000000000..39aaabcd81 --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_uci/revert.htm @@ -0,0 +1,5 @@ +<%+header%> +<h1><%:config Konfiguration%></h1> +<p><%:uci_reverted Die folgenden Änderungen wurden verworfen%>:</p> +<code><%=(changes or "-")%></code> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_wifi/index.htm b/modules/admin-core/luasrc/view/admin_wifi/index.htm new file mode 100644 index 0000000000..6a6059835a --- /dev/null +++ b/modules/admin-core/luasrc/view/admin_wifi/index.htm @@ -0,0 +1,9 @@ +<%+header%> +<h1><%:wifi Drahtlos%></h1> +<p><%:wifi1 Hier finden sich Konfiugrationsmöglichkeiten für Drahtlos-Netzwerke nach dem WLAN-Standard.%></p> +<p><%:wifi2 802.11b/g/a/n-Geräte können so einfach in das bestehende physische Netzwerk integriert werden. +Die Unterstützung von virtuellen Adaptern ermöglicht auch den Einsatz als Wireless-Repeater oder von +mehreren Netzwerken gleichzeitig auf einem Gerät.%></p> +<p><%:wifi3 Es werden Managed, Client, Ad-Hoc und WDS-Modus unterstützt sowie WPA und WPA2-Verschlüsselung zur gesicherten +Kommunikation.%></p> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/error404.htm b/modules/admin-core/luasrc/view/error404.htm new file mode 100644 index 0000000000..60daee2cbd --- /dev/null +++ b/modules/admin-core/luasrc/view/error404.htm @@ -0,0 +1,5 @@ +<%+header%> +<h1>404 Not Found</h1> +<p>Sorry, the object you requested was not found.</p> +<tt>Unable to dispatch: <%=luci.http.env.PATH_INFO%></tt> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/error500.htm b/modules/admin-core/luasrc/view/error500.htm new file mode 100644 index 0000000000..8af22e8f20 --- /dev/null +++ b/modules/admin-core/luasrc/view/error500.htm @@ -0,0 +1,5 @@ +<%+header%> +<h1>500 Internal Server Error</h1> +<p>Sorry, the server encountered an unexpected error.</p> +<tt><%=message%></tt> +<%+footer%>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/footer.htm b/modules/admin-core/luasrc/view/footer.htm new file mode 100644 index 0000000000..c8506ac5c6 --- /dev/null +++ b/modules/admin-core/luasrc/view/footer.htm @@ -0,0 +1,7 @@ + </div> + <div class="clear"></div> +</div></div> + +<div class="separator magenta bold"><a href="http://luci.freifunk-halle.net"><%=require("luci").__appname__ .. " " .. luci.__version__%> - Lua Configuration Interface</a></div> +</body> +</html>
\ No newline at end of file diff --git a/modules/admin-core/luasrc/view/header.htm b/modules/admin-core/luasrc/view/header.htm new file mode 100644 index 0000000000..5f876781f6 --- /dev/null +++ b/modules/admin-core/luasrc/view/header.htm @@ -0,0 +1,137 @@ +<% +require("luci.sys") +local load1, load5, load15 = luci.sys.loadavg() + +local request = require("luci.dispatcher").request +local category = request[1] +local tree = luci.dispatcher.node() +local cattree = category and luci.dispatcher.node(category) +local node = luci.dispatcher.dispatched + +local c = tree +for i,r in ipairs(request) do + if c.nodes and c.nodes[r] then + c = c.nodes[r] + c._menu_selected = true + end +end + +require("luci.i18n").loadc("default") + +require("luci.http").prepare_content("text/html") +%><?xml version="1.0" encoding="utf-8"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> + <link rel="stylesheet" type="text/css" href="<%=media%>/cascade.css" /> + <% if node and node.css then %><link rel="stylesheet" type="text/css" href="<%=resource%>/<%=node.css%>" /><% end %> + <meta http-equiv="content-type" content="text/xhtml+xml; charset=utf-8" /> + <meta http-equiv="content-script-type" content="text/javascript" /> + <title>LuCI - Lua Configuration Interface</title> +</head> +<body> +<div id="header"> + <div class="headerlogo left"><img src="<%=media%>/logo.png" alt="<%=luci.config.brand.title%>" /></div> + <div class="whitetext smalltext right"> + <%=luci.config.brand.firmware%><br /> + <%=luci.config.brand.distro%><br /> + <%:load Last%>: <%=load1%> <%=load5%> <%=load15%><br /> + <%:hostname Hostname%>: <%=luci.sys.hostname()%> + </div> + <div> + <span class="headertitle"><%=luci.config.brand.title%></span><br /> + <span class="whitetext bold"><%=luci.config.brand.subtitle%></span> + </div> +</div> + +<div class="separator yellow bold"> +<%:path Pfad%>: <% +local c = tree +local url = controller +for k,v in pairs(request) do + if c.nodes and c.nodes[v] then + c = c.nodes[v] + url = url .. "/" .. v + %><a href="<%=url%>"><%=c.title or v%></a> <% if k ~= #request then %>» <% end + end +end +%> +</div> + +<div id="columns"><div id="columnswrapper"> + <div class="sidebar left"> +<% +local function submenu(prefix, node) + if not node._menu_selected or not node.nodes then + return false + end + local index = {} + for k, n in pairs(node.nodes) do + table.insert(index, {name=k, order=n.order or 100}) + end + + table.sort(index, function(a, b) return a.order < b.order end) +%> + <ul> + <% for j, v in pairs(index) do + local nnode = node.nodes[v.name]%> + <li> + <span<% if nnode._menu_selected then %> class="yellowtext"<%end%>><a href="<%=controller .. prefix .. v.name%>"><%=nnode.title%></a></span> + <% submenu(prefix .. v.name .. "/", nnode) %> + </li> + <% end %> + </ul> +<% +end + +if cattree and cattree.nodes then + local index = {} + for k, node in pairs(cattree.nodes) do + table.insert(index, {name=k, order=node.order or 100}) + end + + table.sort(index, function(a, b) return a.order < b.order end) + + for i, k in ipairs(index) do + node = cattree.nodes[k.name] + if node.title then %> + <div<% if node._menu_selected then %> class="yellowtext"<%end%>><a href="<%=controller%>/<%=category%>/<%=k.name%>"><%=node.title%></a> + <%submenu("/" .. category .. "/" .. k.name .. "/", node)%> + </div> +<% end + end +end +%> + </div> + <div class="sidebar right"> + <div><%:webif Weboberfläche%> + <ul><% + for k,node in pairs(tree.nodes) do + if node.title then %> + <li<% if request[1] == k then %> class="yellowtext"<%end%>><a href="<%=controller%>/<%=k%>"><%=node.title%></a></li> +<% end + end%> + </ul> + </div> + <% + if "admin" == request[1] then + require("luci.model.uci") + local ucic = luci.model.uci.changes() + if ucic then + ucic = #luci.util.split(ucic) + end + %> + <div><%:config Konfiguration%> + <ul> + <% if ucic then %> + <li><a href="<%=controller%>/admin/uci/changes"><%:changes Änderungen%>: <%=ucic%></a></li> + <li><a href="<%=controller%>/admin/uci/apply"><%:apply Anwenden%></a></li> + <li><a href="<%=controller%>/admin/uci/revert"><%:revert Verwerfen%></a></li> + <% else %> + <li><%:changes Änderungen%>: 0</li> + <% end %> + </ul> + </div> + <% end %> + </div> + <div id="content">
\ No newline at end of file |