From f341dfe91a766003a9333725e88823e2866fb3c8 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 7 Apr 2008 21:01:39 +0000 Subject: * Added configuration pages for Dropbear, HTTPd, Mount Points * Reorganized menu structure * Prepare firmware upgrade mechanism --- src/ffluci/controller/admin/mesh.lua | 1 - src/ffluci/controller/admin/services.lua | 1 + src/ffluci/controller/admin/system.lua | 4 ++ src/ffluci/menu.lua | 2 +- src/ffluci/model/cbi/admin_index/luci.lua | 3 + src/ffluci/model/cbi/admin_mesh/olsrd.lua | 82 ------------------------ src/ffluci/model/cbi/admin_services/dropbear.lua | 14 ++++ src/ffluci/model/cbi/admin_services/httpd.lua | 18 ++++++ src/ffluci/model/cbi/admin_services/olsrd.lua | 82 ++++++++++++++++++++++++ src/ffluci/model/cbi/admin_system/fstab.lua | 21 ++++++ src/ffluci/model/menu/00main.lua | 18 +++--- src/ffluci/view/admin_services/index.htm | 2 + src/ffluci/view/admin_system/packages.htm | 1 + src/ffluci/view/admin_system/upgrade.htm | 26 ++++++++ 14 files changed, 183 insertions(+), 92 deletions(-) delete mode 100644 src/ffluci/controller/admin/mesh.lua create mode 100644 src/ffluci/controller/admin/services.lua delete mode 100644 src/ffluci/model/cbi/admin_mesh/olsrd.lua create mode 100644 src/ffluci/model/cbi/admin_services/dropbear.lua create mode 100644 src/ffluci/model/cbi/admin_services/httpd.lua create mode 100644 src/ffluci/model/cbi/admin_services/olsrd.lua create mode 100644 src/ffluci/model/cbi/admin_system/fstab.lua create mode 100644 src/ffluci/view/admin_services/index.htm create mode 100644 src/ffluci/view/admin_system/upgrade.htm (limited to 'src') diff --git a/src/ffluci/controller/admin/mesh.lua b/src/ffluci/controller/admin/mesh.lua deleted file mode 100644 index 3dbe98cbb6..0000000000 --- a/src/ffluci/controller/admin/mesh.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.mesh", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/services.lua b/src/ffluci/controller/admin/services.lua new file mode 100644 index 0000000000..42181212bd --- /dev/null +++ b/src/ffluci/controller/admin/services.lua @@ -0,0 +1 @@ +module("ffluci.controller.admin.services", package.seeall) \ No newline at end of file diff --git a/src/ffluci/controller/admin/system.lua b/src/ffluci/controller/admin/system.lua index fc31ea22b5..102ce99b8d 100644 --- a/src/ffluci/controller/admin/system.lua +++ b/src/ffluci/controller/admin/system.lua @@ -173,4 +173,8 @@ function action_sshkeys() end ffluci.template.render("admin_system/sshkeys", {cnt=cnt, msg=err}) +end + +function action_upgrade() + -- To be implemented end \ No newline at end of file diff --git a/src/ffluci/menu.lua b/src/ffluci/menu.lua index 5a5f421e9d..0a1aad5d1f 100644 --- a/src/ffluci/menu.lua +++ b/src/ffluci/menu.lua @@ -47,7 +47,7 @@ local menuc = {} -- Adds a menu category to the current menu and selects it function add(cat, controller, title, order) - order = order or 50 + order = order or 100 if not menu[cat] then menu[cat] = {} end diff --git a/src/ffluci/model/cbi/admin_index/luci.lua b/src/ffluci/model/cbi/admin_index/luci.lua index ec6c2228b9..eed626c5b7 100644 --- a/src/ffluci/model/cbi/admin_index/luci.lua +++ b/src/ffluci/model/cbi/admin_index/luci.lua @@ -5,6 +5,9 @@ c = m:section(NamedSection, "main", "core", "Allgemein") c:option(Value, "lang", "Sprache") c:option(Value, "mediaurlbase", "Mediaverzeichnis") +f = m:section(NamedSection, "flash", "extern", "Firmwareupgrade") +f:option(Value, "keep", "Übernehme Dateien").size = 64 + p = m:section(NamedSection, "category_privileges", "core", "Kategorieprivilegien") p.dynamic = true diff --git a/src/ffluci/model/cbi/admin_mesh/olsrd.lua b/src/ffluci/model/cbi/admin_mesh/olsrd.lua deleted file mode 100644 index 430b786874..0000000000 --- a/src/ffluci/model/cbi/admin_mesh/olsrd.lua +++ /dev/null @@ -1,82 +0,0 @@ --- ToDo: Autodetect things, Translate, Add descriptions -require("ffluci.fs") - -m = Map("olsr", "OLSR") - -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").isnumber = 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", "MPR-Erfassung").isinteger = true - -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").isinteger = true - -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 - -i:option(Value, "Interface", "Netzwerkschnittstellen") - -i:option(Value, "HelloInterval", "Hello-Intervall").isnumber = true - -i:option(Value, "HelloValidityTime", "Hello-Gültigkeit").isnumber = true - -i:option(Value, "TcInterval", "TC-Intervall").isnumber = true - -i:option(Value, "TcValidityTime", "TC-Gültigkeit").isnumber = true - -i:option(Value, "MidInterval", "MID-Intervall").isnumber = true - -i:option(Value, "MidValidityTime", "MID-Gültigkeit").isnumber = true - -i:option(Value, "HnaInterval", "HNA-Intervall").isnumber = true - -i:option(Value, "HnaValidityTime", "HNA-Gültigkeit").isnumber = 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(ffluci.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/src/ffluci/model/cbi/admin_services/dropbear.lua b/src/ffluci/model/cbi/admin_services/dropbear.lua new file mode 100644 index 0000000000..b8fcb9e6b2 --- /dev/null +++ b/src/ffluci/model/cbi/admin_services/dropbear.lua @@ -0,0 +1,14 @@ +-- ToDo: Translate, Add descriptions +m = Map("dropbear", "SSH-Server") + +s = m:section(TypedSection, "dropbear") +s.anonymous = true + +port = s:option(Value, "Port", "Port") +port.isinteger = true + +pwauth = s:option(Flag, "PasswordAuth", "Passwortanmeldung") +pwauth.enabled = 'on' +pwauth.disabled = 'off' + +return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/httpd.lua b/src/ffluci/model/cbi/admin_services/httpd.lua new file mode 100644 index 0000000000..f89dbb7aeb --- /dev/null +++ b/src/ffluci/model/cbi/admin_services/httpd.lua @@ -0,0 +1,18 @@ +-- ToDo: Translate, Add descriptions +m = Map("httpd", "HTTP-Server") + +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") +realm.rmempty = true + +return m \ No newline at end of file diff --git a/src/ffluci/model/cbi/admin_services/olsrd.lua b/src/ffluci/model/cbi/admin_services/olsrd.lua new file mode 100644 index 0000000000..430b786874 --- /dev/null +++ b/src/ffluci/model/cbi/admin_services/olsrd.lua @@ -0,0 +1,82 @@ +-- ToDo: Autodetect things, Translate, Add descriptions +require("ffluci.fs") + +m = Map("olsr", "OLSR") + +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").isnumber = 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", "MPR-Erfassung").isinteger = true + +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").isinteger = true + +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 + +i:option(Value, "Interface", "Netzwerkschnittstellen") + +i:option(Value, "HelloInterval", "Hello-Intervall").isnumber = true + +i:option(Value, "HelloValidityTime", "Hello-Gültigkeit").isnumber = true + +i:option(Value, "TcInterval", "TC-Intervall").isnumber = true + +i:option(Value, "TcValidityTime", "TC-Gültigkeit").isnumber = true + +i:option(Value, "MidInterval", "MID-Intervall").isnumber = true + +i:option(Value, "MidValidityTime", "MID-Gültigkeit").isnumber = true + +i:option(Value, "HnaInterval", "HNA-Intervall").isnumber = true + +i:option(Value, "HnaValidityTime", "HNA-Gültigkeit").isnumber = 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(ffluci.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/src/ffluci/model/cbi/admin_system/fstab.lua b/src/ffluci/model/cbi/admin_system/fstab.lua new file mode 100644 index 0000000000..cf9a483d78 --- /dev/null +++ b/src/ffluci/model/cbi/admin_system/fstab.lua @@ -0,0 +1,21 @@ +m = Map("fstab", "Einhängepunkte") + +mount = m:section(TypedSection, "mount", "Einhängepunkte") +mount.anonymous = true +mount.addremove = true + +mount:option(Flag, "enabled", "aktivieren") +mount:option(Value, "device", "Gerät") +mount:option(Value, "target", "Einhängepunkt") +mount:option(Value, "fstype", "Dateisystem") +mount:option(Value, "options", "Optionen") + + +swap = m:section(TypedSection, "swap", "SWAP") +swap.anonymous = true +swap.addremove = true + +swap:option(Flag, "enabled", "aktivieren") +swap:option(Value, "device", "Gerät") + +return m diff --git a/src/ffluci/model/menu/00main.lua b/src/ffluci/model/menu/00main.lua index e0bd403c19..d1c535f769 100644 --- a/src/ffluci/model/menu/00main.lua +++ b/src/ffluci/model/menu/00main.lua @@ -4,17 +4,22 @@ act("contact", "Kontakt") add("admin", "index", "Übersicht", 10) -act("luci", "FFLuCI") act("contact", "Kontakt") +act("luci", "FFLuCI") add("admin", "system", "System", 20) act("packages", "Paketverwaltung") act("passwd", "Passwort ändern") act("sshkeys", "SSH-Schlüssel") -act("ipkg", "IPKG-Konfiguration") +act("fstab", "Einhängepunkte") act("reboot", "Neu starten") -add("admin", "network", "Netzwerk", 30) +add("admin", "services", "Dienste", 30) +act("olsrd", "OLSR") +act("httpd", "HTTP-Server") +act("dropbear", "SSH-Server") + +add("admin", "network", "Netzwerk", 40) act("vlan", "Switch") act("ifaces", "Schnittstellen") act("ptp", "PPPoE / PPTP") @@ -22,9 +27,6 @@ act("routes", "Statische Routen") act("portfw", "Portweiterleitung") act("firewall", "Firewall") -add("admin", "wifi", "Drahtlos", 40) +add("admin", "wifi", "Drahtlos", 50) act("devices", "Geräte") -act("networks", "Netze") - -add("admin", "mesh", "Mesh", 50) -act("olsrd", "OLSR") \ No newline at end of file +act("networks", "Netze") \ No newline at end of file diff --git a/src/ffluci/view/admin_services/index.htm b/src/ffluci/view/admin_services/index.htm new file mode 100644 index 0000000000..75aa026582 --- /dev/null +++ b/src/ffluci/view/admin_services/index.htm @@ -0,0 +1,2 @@ +<%+header%> +<%+footer%> \ No newline at end of file diff --git a/src/ffluci/view/admin_system/packages.htm b/src/ffluci/view/admin_system/packages.htm index ef27f369ab..d9cdb4dd0e 100644 --- a/src/ffluci/view/admin_system/packages.htm +++ b/src/ffluci/view/admin_system/packages.htm @@ -23,6 +23,7 @@ <% end %>
+<%:packages_ipkg Paketlisten und Installationsziele bearbeiten%>
<%:packages_updatelist Paketlisten aktualisieren%>
<%:packages_upgrade Installierte Pakete aktualisieren%>
diff --git a/src/ffluci/view/admin_system/upgrade.htm b/src/ffluci/view/admin_system/upgrade.htm new file mode 100644 index 0000000000..e7a8f2f686 --- /dev/null +++ b/src/ffluci/view/admin_system/upgrade.htm @@ -0,0 +1,26 @@ +<%+header%> +

<%:system System%>

+

<%:upgrade Upgrade%>

+
+<% if sysupgrade then %> +
+
+
+
<%:fwimage Firmwareimage%>
+
+
+
+
+ + <%:keepcfg Konfigurationsdateien übernehmen%> +
+
+
+ +
+
+
+<% else %> +
<%:notimplemented Diese Funktion ist leider (noch) nicht eingebaut.%>
+<% end %> +<%+footer%> \ No newline at end of file -- cgit v1.2.3