From: Steven Barth Date: Tue, 15 Jul 2008 08:47:36 +0000 (+0000) Subject: Split up admin-core into admin-core and admin-full, preparing admin-mini X-Git-Tag: 0.8.0~663 X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=97ff4a156ff1aa6a4d2ab65ab13d12b4eb2651e2 Split up admin-core into admin-core and admin-full, preparing admin-mini --- diff --git a/contrib/package/luci/Makefile b/contrib/package/luci/Makefile index 2c30695e7..e369acfc4 100644 --- a/contrib/package/luci/Makefile +++ b/contrib/package/luci/Makefile @@ -286,7 +286,7 @@ endef define Package/luci-mod-admin-core $(call Package/luci/webtemplate) DEPENDS+=+luci-web +luci-cbi +luci-theme-openwrt +luci-i18n-english - TITLE:=Administration module + TITLE:=Administration core module endef define Package/luci-mod-admin-core/install @@ -294,9 +294,31 @@ define Package/luci-mod-admin-core/install endef +define Package/luci-mod-admin-mini + $(call Package/luci/webtemplate) + DEPENDS+=+luci-mod-admin-core + TITLE:=Simplified Administration module +endef + +define Package/luci-mod-admin-mini/install + $(call Package/luci/install/template,$(1),modules/admin-mini) +endef + + +define Package/luci-mod-admin-full + $(call Package/luci/webtemplate) + DEPENDS+=+luci-mod-admin-core + TITLE:=Full featured Administration module +endef + +define Package/luci-mod-admin-full/install + $(call Package/luci/install/template,$(1),modules/admin-full) +endef + + define Package/luci-mod-freifunk $(call Package/luci/fftemplate) - DEPENDS:=+luci-mod-admin-core + DEPENDS:=+luci-mod-admin-full TITLE:=LuCI Freifunk module endef @@ -325,7 +347,7 @@ endef define Package/luci-app-firewall $(call Package/luci/webtemplate) - DEPENDS+=+luci-mod-admin-core + DEPENDS+=+luci-mod-admin-full TITLE:=Firewall and Portforwarding application endef @@ -340,7 +362,7 @@ endef define Package/luci-app-olsr $(call Package/luci/webtemplate) - DEPENDS+=+luci-mod-admin-core +olsrd-mod-txtinfo + DEPENDS+=+luci-mod-admin-full +olsrd-mod-txtinfo TITLE:=OLSR configuration and status module endef @@ -351,7 +373,7 @@ endef define Package/luci-app-qos $(call Package/luci/webtemplate) - DEPENDS+=+luci-mod-admin-core +qos-scripts + DEPENDS+=+luci-mod-admin-full +qos-scripts TITLE:=Quality of Service configuration module endef @@ -377,7 +399,7 @@ endef define Package/luci-app-statistics $(call Package/luci/webtemplate) - DEPENDS+=+luci-mod-admin-core +collectd +collectd-mod-rrdtool1 +rrdtool1 + DEPENDS+=+luci-mod-admin-full +collectd +collectd-mod-rrdtool1 +rrdtool1 TITLE:=LuCI Statistics Application endef @@ -516,6 +538,12 @@ endif ifneq ($(CONFIG_PACKAGE_luci-mod-admin-core),) PKG_SELECTED_MODULES+=modules/admin-core endif +ifneq ($(CONFIG_PACKAGE_luci-mod-admin-mini),) + PKG_SELECTED_MODULES+=modules/admin-mini +endif +ifneq ($(CONFIG_PACKAGE_luci-mod-admin-full),) + PKG_SELECTED_MODULES+=modules/admin-full +endif ifneq ($(CONFIG_PACKAGE_luci-mod-freifunk),) PKG_SELECTED_MODULES+=modules/freifunk endif @@ -592,6 +620,8 @@ $(eval $(call BuildPackage,luci-ff-berlin)) $(eval $(call BuildPackage,luci-ff-augsburg)) $(eval $(call BuildPackage,luci-mod-admin-core)) +#$(eval $(call BuildPackage,luci-mod-admin-mini)) +$(eval $(call BuildPackage,luci-mod-admin-full)) $(eval $(call BuildPackage,luci-mod-freifunk)) $(eval $(call BuildPackage,luci-app-ffwizard-leipzig)) diff --git a/modules/admin-core/luasrc/controller/admin/index.lua b/modules/admin-core/luasrc/controller/admin/index.lua deleted file mode 100644 index eb58e0042..000000000 --- a/modules/admin-core/luasrc/controller/admin/index.lua +++ /dev/null @@ -1,49 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.index", package.seeall) - -function index() - luci.i18n.loadc("admin-core") - local i18n = luci.i18n.translate - - local root = node() - if not root.target then - root.target = alias("admin") - end - - entry({"about"}, template("about")).i18n = "admin-core" - - local page = node("admin") - page.target = alias("admin", "index") - page.title = i18n("administration", "Administration") - page.order = 10 - page.i18n = "admin-core" - page.sysauth = "root" - - local page = node("admin", "index") - page.target = template("admin_index/index") - page.title = i18n("overview", "Übersicht") - page.order = 10 - - local page = node("admin", "index", "luci") - page.target = cbi("admin_index/luci") - page.title = i18n("a_i_ui", "Oberfläche") - - entry({"admin", "logout"}, call("action_logout"), i18n("logout")) -end - -function action_logout() - luci.http.header("Set-Cookie", "sysauth=; path=/") - luci.http.redirect(luci.dispatcher.build_url()) -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 deleted file mode 100644 index 871263334..000000000 --- a/modules/admin-core/luasrc/controller/admin/network.lua +++ /dev/null @@ -1,49 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.network", package.seeall) - -function index() - require("luci.i18n") - local i18n = luci.i18n.translate - - local page = node("admin", "network") - page.target = template("admin_network/index") - page.title = i18n("network", "Netzwerk") - page.order = 50 - - local page = node("admin", "network", "vlan") - page.target = cbi("admin_network/vlan") - page.title = i18n("a_n_switch", "Switch") - page.order = 10 - - local page = node("admin", "network", "ifaces") - page.target = cbi("admin_network/ifaces") - page.title = i18n("interfaces", "Schnittstellen") - page.order = 20 - - local page = node("admin", "network", "dhcp") - page.target = cbi("admin_network/dhcp") - page.title = "DHCP" - 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 = i18n("a_n_routes", "Routen") - page.order = 50 -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 deleted file mode 100644 index 59defbbbd..000000000 --- a/modules/admin-core/luasrc/controller/admin/services.lua +++ /dev/null @@ -1,39 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.services", package.seeall) - -function index() - luci.i18n.loadc("admin-core") - local i18n = luci.i18n.translate - - local page = node("admin", "services") - page.target = template("admin_services/index") - page.title = i18n("services", "Dienste") - page.order = 40 - - local page = node("admin", "services", "httpd") - page.target = cbi("admin_services/httpd") - page.title = "Busybox HTTPd" - page.order = 10 - - local page = node("admin", "services", "dropbear") - page.target = cbi("admin_services/dropbear") - page.title = "Dropbear SSHd" - page.order = 20 - - local page = node("admin", "services", "dnsmasq") - page.target = cbi("admin_services/dnsmasq") - page.title = "Dnsmasq" - page.order = 30 -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 deleted file mode 100644 index 3a0f04074..000000000 --- a/modules/admin-core/luasrc/controller/admin/status.lua +++ /dev/null @@ -1,29 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.status", package.seeall) - -function index() - luci.i18n.loadc("admin-core") - local i18n = luci.i18n.translate - - entry({"admin", "status"}, template("admin_status/index"), i18n("status", "Status"), 20) - entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll")) - entry({"admin", "status", "routes"}, template("admin_status/routes"), "Routingtabelle", 10) - entry({"admin", "status", "iwscan"}, template("admin_status/iwscan"), "WLAN-Scan", 20) -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 deleted file mode 100644 index 862a741cd..000000000 --- a/modules/admin-core/luasrc/controller/admin/system.lua +++ /dev/null @@ -1,221 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.system", package.seeall) - -function index() - luci.i18n.loadc("admin-core") - local i18n = luci.i18n.translate - - entry({"admin", "system"}, template("admin_system/index"), i18n("system", "System"), 30) - entry({"admin", "system", "packages"}, call("action_packages"), i18n("a_s_packages", "Paketverwaltung"), 10) - entry({"admin", "system", "packages", "ipkg"}, call("action_ipkg"), i18n("a_s_p_ipkg", "IPKG-Konfiguration")) - entry({"admin", "system", "passwd"}, call("action_passwd"), i18n("a_s_changepw", "Passwort ändern"), 20) - entry({"admin", "system", "sshkeys"}, call("action_sshkeys"), i18n("a_s_sshkeys", "SSH-Schlüssel"), 30) - entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system", "System"), 40) - entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab", "Einhängepunkte"), 50) - entry({"admin", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash", "Firmwareupgrade"), 60) - entry({"admin", "system", "reboot"}, call("action_reboot"), i18n("reboot", "Neu starten"), 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 = require("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() - require("luci.model.uci") - 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.get_all("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 deleted file mode 100644 index 215a13a34..000000000 --- a/modules/admin-core/luasrc/controller/admin/uci.lua +++ /dev/null @@ -1,99 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.uci", package.seeall) - -function index() - local i18n = luci.i18n.translate - - entry({"admin", "uci"}, nil, i18n("config")) - entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes")) - entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert")) - entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply")) -end - -function convert_changes(changes) - local ret = {} - for r, tbl in pairs(changes) do - for s, os in pairs(tbl) do - for o, v in pairs(os) do - local val, str - if (v == "") then - str = "-" - val = "" - else - str = "" - val = "="..v - end - str = r.."."..s - if o ~= ".type" then - str = str.."."..o - end - table.insert(ret, str..val) - end - end - end - return table.concat(ret, "\n") -end - -function action_changes() - local changes = convert_changes(luci.model.uci.changes()) - luci.template.render("admin_uci/changes", {changes=changes}) -end - -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 r, tbl in pairs(changes) do - if r then - luci.model.uci.load(r) - luci.model.uci.commit(r) - luci.model.uci.unload(r) - if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then - run[luci.config.uci_oncommit[r]] = true - end - end - 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=convert_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 r, tbl in pairs(changes) do - luci.model.uci.load(r) - luci.model.uci.revert(r) - luci.model.uci.unload(r) - end - end - - luci.template.render("admin_uci/revert", {changes=convert_changes(changes)}) -end diff --git a/modules/admin-core/luasrc/controller/admin/wifi.lua b/modules/admin-core/luasrc/controller/admin/wifi.lua deleted file mode 100644 index 4bef0b7a5..000000000 --- a/modules/admin-core/luasrc/controller/admin/wifi.lua +++ /dev/null @@ -1,34 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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$ -]]-- -module("luci.controller.admin.wifi", package.seeall) - -function index() - luci.i18n.loadc("admin-core") - local i18n = luci.i18n.translate - - local page = node("admin", "wifi") - page.target = template("admin_wifi/index") - page.title = i18n("wifi", "Drahtlos") - page.order = 60 - - local page = node("admin", "wifi", "devices") - page.target = cbi("admin_wifi/devices") - page.title = i18n("devices", "Geräte") - page.order = 10 - - local page = node("admin", "wifi", "networks") - page.target = cbi("admin_wifi/networks") - page.title = i18n("networks", "Netze") - page.order = 20 -end \ 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 deleted file mode 100644 index 3fdccbf80..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_index/luci.lua +++ /dev/null @@ -1,44 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_network/dhcp.lua b/modules/admin-core/luasrc/model/cbi/admin_network/dhcp.lua deleted file mode 100644 index b22f7354a..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_network/dhcp.lua +++ /dev/null @@ -1,53 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_network/ifaces.lua b/modules/admin-core/luasrc/model/cbi/admin_network/ifaces.lua deleted file mode 100644 index 2851f3ad5..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_network/ifaces.lua +++ /dev/null @@ -1,52 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_network/ptp.lua b/modules/admin-core/luasrc/model/cbi/admin_network/ptp.lua deleted file mode 100644 index 565edb7fd..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_network/ptp.lua +++ /dev/null @@ -1,43 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_network/routes.lua b/modules/admin-core/luasrc/model/cbi/admin_network/routes.lua deleted file mode 100644 index 15f994c16..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_network/routes.lua +++ /dev/null @@ -1,35 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_network/vlan.lua b/modules/admin-core/luasrc/model/cbi/admin_network/vlan.lua deleted file mode 100644 index 8cae7f94b..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_network/vlan.lua +++ /dev/null @@ -1,22 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_services/dnsmasq.lua b/modules/admin-core/luasrc/model/cbi/admin_services/dnsmasq.lua deleted file mode 100644 index e85306471..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_services/dnsmasq.lua +++ /dev/null @@ -1,42 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_services/dropbear.lua b/modules/admin-core/luasrc/model/cbi/admin_services/dropbear.lua deleted file mode 100644 index a8ce2694a..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_services/dropbear.lua +++ /dev/null @@ -1,26 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_services/httpd.lua b/modules/admin-core/luasrc/model/cbi/admin_services/httpd.lua deleted file mode 100644 index 44beb9c9e..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_services/httpd.lua +++ /dev/null @@ -1,30 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_system/fstab.lua b/modules/admin-core/luasrc/model/cbi/admin_system/fstab.lua deleted file mode 100644 index be2562ca0..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_system/fstab.lua +++ /dev/null @@ -1,34 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_system/system.lua b/modules/admin-core/luasrc/model/cbi/admin_system/system.lua deleted file mode 100644 index dd59d8c01..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_system/system.lua +++ /dev/null @@ -1,22 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_wifi/devices.lua b/modules/admin-core/luasrc/model/cbi/admin_wifi/devices.lua deleted file mode 100644 index b4e0e2915..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_wifi/devices.lua +++ /dev/null @@ -1,64 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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-core/luasrc/model/cbi/admin_wifi/networks.lua b/modules/admin-core/luasrc/model/cbi/admin_wifi/networks.lua deleted file mode 100644 index f0379b370..000000000 --- a/modules/admin-core/luasrc/model/cbi/admin_wifi/networks.lua +++ /dev/null @@ -1,83 +0,0 @@ ---[[ -LuCI - Lua Configuration Interface - -Copyright 2008 Steven Barth - -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 diff --git a/modules/admin-core/luasrc/view/admin_index/index.htm b/modules/admin-core/luasrc/view/admin_index/index.htm deleted file mode 100644 index 4ea58c2b8..000000000 --- a/modules/admin-core/luasrc/view/admin_index/index.htm +++ /dev/null @@ -1,24 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:a_i_i_hello%>

-

<%:a_i_i_admin1%>

-

<%:a_i_i_admin2%>
-<%:a_i_i_admin3%>

-

<%:a_i_i_admin4%>

-

<%:a_i_i_admin5%>

-

<%:a_i_i_admin6%>

-

<%:a_i_i_team%>

-<%+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 deleted file mode 100644 index dec286436..000000000 --- a/modules/admin-core/luasrc/view/admin_network/index.htm +++ /dev/null @@ -1,22 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:network%>

-

<%:a_network1%>

-

<%:a_network2%>

-

<%:a_network3%>

-

<%:a_network4%>

-

<%:a_network5%>

-<%+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 deleted file mode 100644 index c0bd8b361..000000000 --- a/modules/admin-core/luasrc/view/admin_services/index.htm +++ /dev/null @@ -1,19 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:services%>

-

<%:a_srv_services1%>

-

<%:a_srv_services2%>

-<%+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 deleted file mode 100644 index e1f4b0e53..000000000 --- a/modules/admin-core/luasrc/view/admin_status/index.htm +++ /dev/null @@ -1,19 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:status%>

-

<%:a_st_i_status1%>

-

<%:a_st_i_status2%>

-<%+footer%> \ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_status/iwscan.htm b/modules/admin-core/luasrc/view/admin_status/iwscan.htm deleted file mode 100644 index cbba791e6..000000000 --- a/modules/admin-core/luasrc/view/admin_status/iwscan.htm +++ /dev/null @@ -1,52 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:iwscan%>

-

<%:iwscan1%>

- -
- - - - - - - - - - - - -<%for iface, cells in pairs(luci.sys.wifi.iwscan()) do - for i, cell in ipairs(cells) do -%> - - - - - - - - - - - -<% - end -end -%> -
<%:interface%>ESSIDBSSID<%:mode%><%:channel%><%:iwscan_encr%><%:iwscan_link%><%:iwscan_signal%><%:iwscan_noise%>
<%=iface%><%=cell.ESSID%><%=cell.Address%><%=cell.Mode%><%=(cell.Channel or cell.Frequency or "")%><%=cell["Encryption key"]%><%=cell.Quality%><%=cell["Signal level"]%><%=cell["Noise level"]%>
-
-<%+footer%> \ No newline at end of file diff --git a/modules/admin-core/luasrc/view/admin_status/routes.htm b/modules/admin-core/luasrc/view/admin_status/routes.htm deleted file mode 100644 index c4ebf347a..000000000 --- a/modules/admin-core/luasrc/view/admin_status/routes.htm +++ /dev/null @@ -1,42 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:routes%>

- -
- - - - - - - - -<% -local routes = luci.sys.net.routes() - -for i, r in pairs(routes) do -%> - - - - - - - -<% end %> -
<%:target%><%:routes_netmask%><%:routes_gateway%><%:routes_metric%><%:interface%>
<%=luci.sys.net.hexip4(r.Destination)%><%=luci.sys.net.hexip4(r.Mask)%><%=luci.sys.net.hexip4(r.Gateway)%><%=r.Metric%><%=r.Iface%>
-
-<%+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 deleted file mode 100644 index f3d1f0a96..000000000 --- a/modules/admin-core/luasrc/view/admin_status/syslog.htm +++ /dev/null @@ -1,19 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:status%>

-

<%:syslog%>

-<%=syslog%> -<%+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 deleted file mode 100644 index bac1729d0..000000000 --- a/modules/admin-core/luasrc/view/admin_system/editor.htm +++ /dev/null @@ -1,28 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:texteditor%>

-
-
<%:file%>: -<% if msg then %><%:error%>: <%=msg%><% end %>
-
-
-
-
- - -
-
-<%+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 deleted file mode 100644 index 3138903c4..000000000 --- a/modules/admin-core/luasrc/view/admin_system/index.htm +++ /dev/null @@ -1,20 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_i_system1%>

-

<%:a_s_i_system2%>

-

<%:a_s_i_system3%>

-<%+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 deleted file mode 100644 index 0cd87d990..000000000 --- a/modules/admin-core/luasrc/view/admin_system/ipkg.htm +++ /dev/null @@ -1,40 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_p_ipkg%>

- -
- -
<%:a_s_p_ipkg_pkglists%>:src Name URL
-
<%:a_s_p_ipkg_targets%>:dest Name Pfad
- -
- -
-
-
-
- -
-
-
-
- - -
- <% if msg then %>
<%:error%>: <%=msg%>
<% end %> -
-<%+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 deleted file mode 100644 index 0f8f2c16e..000000000 --- a/modules/admin-core/luasrc/view/admin_system/packages.htm +++ /dev/null @@ -1,91 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_packages%>

- -
- -<% if install or remove or update or upgrade then %> -
<%:status%>:
-<% if update then %> - <%:a_s_packages_update%>: <% if update == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=update%>)<% end %>
-<% end %> -<% if upgrade then%> - <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=upgrade%>)<% end %>
-<% end %> -<% if install then for k,v in pairs(install) do %> - <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
-<% end end %> -<% if remove then for k,v in pairs(remove) do %> - <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
-<% end end %> -
-
-<% end %> - - - -
-
- -
-
- <%:a_s_packages_installurl%>:
- - -
- -
-
- -
- <%:filter%>: - - - -
- -
-
- -
- - - - - - - - - <% for k, pkg in pairs(pkgs) do %> - - - - - - - - <% end %> -
<%:a_s_packages_name%><%:version%><%:install%><%:delete%><%:descr%>
<%=pkg.Package%><%=pkg.Version%><% if not pkg.Status or not pkg.Status.installed then %><% else %><%:installed%><% end %><% if pkg.Status and pkg.Status.installed then %><% else %><%:notinstalled%><% end %><%=pkg.Description%>
-
-
- -
-<%+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 deleted file mode 100644 index 176abaea2..000000000 --- a/modules/admin-core/luasrc/view/admin_system/passwd.htm +++ /dev/null @@ -1,49 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_changepw%>

-

<%:a_s_changepw1%>

-

-<% if stat then %> - <% if stat == 0 then %> - <%:a_s_changepw_changed%>! - <% elseif stat == 10 then %> - <%:a_s_changepw_nomatch%>! - <% else %> - <%:unknownerror%>! - <% end %> -<% end %> -<% if not stat or stat == 10 then %> -
-
-
-
<%:password%>
-
-
-
-
<%:confirmation%>
-
-
-
-
- - -
-
-
-<% end %> -
-<%+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 deleted file mode 100644 index 3ddfa5880..000000000 --- a/modules/admin-core/luasrc/view/admin_system/reboot.htm +++ /dev/null @@ -1,25 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:reboot%>

-

<%:a_s_reboot1%>

-<% if not reboot then %> -

<%:a_s_reboot_do%>

-<% else %> -

<%:a_s_reboot_running%>

- -<% 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 deleted file mode 100644 index 9a08af9e3..000000000 --- a/modules/admin-core/luasrc/view/admin_system/sshkeys.htm +++ /dev/null @@ -1,39 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_sshkeys%>

- -
- -
<%:a_s_sshkeys1%>
- -
- -
-
-
-
- -
-
-
-
- - -
- <% if msg then %>
<%:error%>: <%=msg%>
<% end %> -
-<%+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 deleted file mode 100644 index 16ba50cd9..000000000 --- a/modules/admin-core/luasrc/view/admin_system/upgrade.htm +++ /dev/null @@ -1,47 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:system%>

-

<%:a_s_flash%>

-

<%:a_s_flash_upgrade1%>

-
-<% if sysupgrade and not ret then %> -
" enctype="multipart/form-data"> -
-
-
<%:a_s_flash_fwimage%>
-
-
-
-
- - <%:a_s_flash_keepcfg%> -
-
-
- -
-
-
-<% elseif ret then %> - <% if ret == 0 then %> -
<%:a_s_flash_flashed%>
- <% else %> -
<%:a_s_flash_flasherr%>! (<%:code%> <%=ret%>)
- <% end %> -<% else %> -
<%:a_s_flash_notimplemented%>
-<% 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 deleted file mode 100644 index e28094728..000000000 --- a/modules/admin-core/luasrc/view/admin_uci/apply.htm +++ /dev/null @@ -1,20 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:config%>

-

<%:uci_applied%>:

-<%=(changes or "-")%> -<%=output%> -<%+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 deleted file mode 100644 index f2a88602a..000000000 --- a/modules/admin-core/luasrc/view/admin_uci/changes.htm +++ /dev/null @@ -1,25 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:config%>

-

<%:changes%>

-<%=changes%> -
- -
-
- -
-<%+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 deleted file mode 100644 index 7f98a0435..000000000 --- a/modules/admin-core/luasrc/view/admin_uci/revert.htm +++ /dev/null @@ -1,19 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:config%>

-

<%:uci_reverted%>:

-<%=(changes or "-")%> -<%+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 deleted file mode 100644 index 58281d14f..000000000 --- a/modules/admin-core/luasrc/view/admin_wifi/index.htm +++ /dev/null @@ -1,20 +0,0 @@ -<%# -LuCI - Lua Configuration Interface -Copyright 2008 Steven Barth -Copyright 2008 Jo-Philipp Wich - -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$ - --%> -<%+header%> -

<%:wifi%>

-

<%:a_w_wifi1%>

-

<%:a_w_wifi2%>

-

<%:a_w_wifi3%>

-<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/Makefile b/modules/admin-full/Makefile new file mode 100644 index 000000000..81a96f6a8 --- /dev/null +++ b/modules/admin-full/Makefile @@ -0,0 +1,2 @@ +include ../../build/config.mk +include ../../build/module.mk \ No newline at end of file diff --git a/modules/admin-full/luasrc/controller/admin/index.lua b/modules/admin-full/luasrc/controller/admin/index.lua new file mode 100644 index 000000000..eb58e0042 --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/index.lua @@ -0,0 +1,49 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.index", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + local root = node() + if not root.target then + root.target = alias("admin") + end + + entry({"about"}, template("about")).i18n = "admin-core" + + local page = node("admin") + page.target = alias("admin", "index") + page.title = i18n("administration", "Administration") + page.order = 10 + page.i18n = "admin-core" + page.sysauth = "root" + + local page = node("admin", "index") + page.target = template("admin_index/index") + page.title = i18n("overview", "Übersicht") + page.order = 10 + + local page = node("admin", "index", "luci") + page.target = cbi("admin_index/luci") + page.title = i18n("a_i_ui", "Oberfläche") + + entry({"admin", "logout"}, call("action_logout"), i18n("logout")) +end + +function action_logout() + luci.http.header("Set-Cookie", "sysauth=; path=/") + luci.http.redirect(luci.dispatcher.build_url()) +end \ No newline at end of file diff --git a/modules/admin-full/luasrc/controller/admin/network.lua b/modules/admin-full/luasrc/controller/admin/network.lua new file mode 100644 index 000000000..871263334 --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/network.lua @@ -0,0 +1,49 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.network", package.seeall) + +function index() + require("luci.i18n") + local i18n = luci.i18n.translate + + local page = node("admin", "network") + page.target = template("admin_network/index") + page.title = i18n("network", "Netzwerk") + page.order = 50 + + local page = node("admin", "network", "vlan") + page.target = cbi("admin_network/vlan") + page.title = i18n("a_n_switch", "Switch") + page.order = 10 + + local page = node("admin", "network", "ifaces") + page.target = cbi("admin_network/ifaces") + page.title = i18n("interfaces", "Schnittstellen") + page.order = 20 + + local page = node("admin", "network", "dhcp") + page.target = cbi("admin_network/dhcp") + page.title = "DHCP" + 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 = i18n("a_n_routes", "Routen") + page.order = 50 +end \ No newline at end of file diff --git a/modules/admin-full/luasrc/controller/admin/services.lua b/modules/admin-full/luasrc/controller/admin/services.lua new file mode 100644 index 000000000..59defbbbd --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/services.lua @@ -0,0 +1,39 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.services", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + local page = node("admin", "services") + page.target = template("admin_services/index") + page.title = i18n("services", "Dienste") + page.order = 40 + + local page = node("admin", "services", "httpd") + page.target = cbi("admin_services/httpd") + page.title = "Busybox HTTPd" + page.order = 10 + + local page = node("admin", "services", "dropbear") + page.target = cbi("admin_services/dropbear") + page.title = "Dropbear SSHd" + page.order = 20 + + local page = node("admin", "services", "dnsmasq") + page.target = cbi("admin_services/dnsmasq") + page.title = "Dnsmasq" + page.order = 30 +end \ No newline at end of file diff --git a/modules/admin-full/luasrc/controller/admin/status.lua b/modules/admin-full/luasrc/controller/admin/status.lua new file mode 100644 index 000000000..3a0f04074 --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/status.lua @@ -0,0 +1,29 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.status", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + entry({"admin", "status"}, template("admin_status/index"), i18n("status", "Status"), 20) + entry({"admin", "status", "syslog"}, call("action_syslog"), i18n("syslog", "Systemprotokoll")) + entry({"admin", "status", "routes"}, template("admin_status/routes"), "Routingtabelle", 10) + entry({"admin", "status", "iwscan"}, template("admin_status/iwscan"), "WLAN-Scan", 20) +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-full/luasrc/controller/admin/system.lua b/modules/admin-full/luasrc/controller/admin/system.lua new file mode 100644 index 000000000..862a741cd --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/system.lua @@ -0,0 +1,221 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.system", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + entry({"admin", "system"}, template("admin_system/index"), i18n("system", "System"), 30) + entry({"admin", "system", "packages"}, call("action_packages"), i18n("a_s_packages", "Paketverwaltung"), 10) + entry({"admin", "system", "packages", "ipkg"}, call("action_ipkg"), i18n("a_s_p_ipkg", "IPKG-Konfiguration")) + entry({"admin", "system", "passwd"}, call("action_passwd"), i18n("a_s_changepw", "Passwort ändern"), 20) + entry({"admin", "system", "sshkeys"}, call("action_sshkeys"), i18n("a_s_sshkeys", "SSH-Schlüssel"), 30) + entry({"admin", "system", "system"}, cbi("admin_system/system"), i18n("system", "System"), 40) + entry({"admin", "system", "fstab"}, cbi("admin_system/fstab"), i18n("a_s_fstab", "Einhängepunkte"), 50) + entry({"admin", "system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash", "Firmwareupgrade"), 60) + entry({"admin", "system", "reboot"}, call("action_reboot"), i18n("reboot", "Neu starten"), 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 = require("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() + require("luci.model.uci") + 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.get_all("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-full/luasrc/controller/admin/uci.lua b/modules/admin-full/luasrc/controller/admin/uci.lua new file mode 100644 index 000000000..215a13a34 --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/uci.lua @@ -0,0 +1,99 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.uci", package.seeall) + +function index() + local i18n = luci.i18n.translate + + entry({"admin", "uci"}, nil, i18n("config")) + entry({"admin", "uci", "changes"}, call("action_changes"), i18n("changes")) + entry({"admin", "uci", "revert"}, call("action_revert"), i18n("revert")) + entry({"admin", "uci", "apply"}, call("action_apply"), i18n("apply")) +end + +function convert_changes(changes) + local ret = {} + for r, tbl in pairs(changes) do + for s, os in pairs(tbl) do + for o, v in pairs(os) do + local val, str + if (v == "") then + str = "-" + val = "" + else + str = "" + val = "="..v + end + str = r.."."..s + if o ~= ".type" then + str = str.."."..o + end + table.insert(ret, str..val) + end + end + end + return table.concat(ret, "\n") +end + +function action_changes() + local changes = convert_changes(luci.model.uci.changes()) + luci.template.render("admin_uci/changes", {changes=changes}) +end + +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 r, tbl in pairs(changes) do + if r then + luci.model.uci.load(r) + luci.model.uci.commit(r) + luci.model.uci.unload(r) + if luci.config.uci_oncommit and luci.config.uci_oncommit[r] then + run[luci.config.uci_oncommit[r]] = true + end + end + 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=convert_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 r, tbl in pairs(changes) do + luci.model.uci.load(r) + luci.model.uci.revert(r) + luci.model.uci.unload(r) + end + end + + luci.template.render("admin_uci/revert", {changes=convert_changes(changes)}) +end diff --git a/modules/admin-full/luasrc/controller/admin/wifi.lua b/modules/admin-full/luasrc/controller/admin/wifi.lua new file mode 100644 index 000000000..4bef0b7a5 --- /dev/null +++ b/modules/admin-full/luasrc/controller/admin/wifi.lua @@ -0,0 +1,34 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.wifi", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + local page = node("admin", "wifi") + page.target = template("admin_wifi/index") + page.title = i18n("wifi", "Drahtlos") + page.order = 60 + + local page = node("admin", "wifi", "devices") + page.target = cbi("admin_wifi/devices") + page.title = i18n("devices", "Geräte") + page.order = 10 + + local page = node("admin", "wifi", "networks") + page.target = cbi("admin_wifi/networks") + page.title = i18n("networks", "Netze") + page.order = 20 +end \ No newline at end of file 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 000000000..3fdccbf80 --- /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 + +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 000000000..b22f7354a --- /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 + +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 000000000..2851f3ad5 --- /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 + +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 000000000..565edb7fd --- /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 + +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 000000000..15f994c16 --- /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 + +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 000000000..8cae7f94b --- /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 + +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 000000000..e85306471 --- /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 + +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 000000000..a8ce2694a --- /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 + +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 000000000..44beb9c9e --- /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 + +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 000000000..be2562ca0 --- /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 + +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 000000000..dd59d8c01 --- /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 + +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 000000000..b4e0e2915 --- /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 + +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 000000000..f0379b370 --- /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 + +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 diff --git a/modules/admin-full/luasrc/view/admin_index/index.htm b/modules/admin-full/luasrc/view/admin_index/index.htm new file mode 100644 index 000000000..4ea58c2b8 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_index/index.htm @@ -0,0 +1,24 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:a_i_i_hello%>

+

<%:a_i_i_admin1%>

+

<%:a_i_i_admin2%>
+<%:a_i_i_admin3%>

+

<%:a_i_i_admin4%>

+

<%:a_i_i_admin5%>

+

<%:a_i_i_admin6%>

+

<%:a_i_i_team%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_network/index.htm b/modules/admin-full/luasrc/view/admin_network/index.htm new file mode 100644 index 000000000..dec286436 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_network/index.htm @@ -0,0 +1,22 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:network%>

+

<%:a_network1%>

+

<%:a_network2%>

+

<%:a_network3%>

+

<%:a_network4%>

+

<%:a_network5%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_services/index.htm b/modules/admin-full/luasrc/view/admin_services/index.htm new file mode 100644 index 000000000..c0bd8b361 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_services/index.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:services%>

+

<%:a_srv_services1%>

+

<%:a_srv_services2%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_status/index.htm b/modules/admin-full/luasrc/view/admin_status/index.htm new file mode 100644 index 000000000..e1f4b0e53 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_status/index.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:status%>

+

<%:a_st_i_status1%>

+

<%:a_st_i_status2%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_status/iwscan.htm b/modules/admin-full/luasrc/view/admin_status/iwscan.htm new file mode 100644 index 000000000..cbba791e6 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_status/iwscan.htm @@ -0,0 +1,52 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:iwscan%>

+

<%:iwscan1%>

+ +
+ + + + + + + + + + + + +<%for iface, cells in pairs(luci.sys.wifi.iwscan()) do + for i, cell in ipairs(cells) do +%> + + + + + + + + + + + +<% + end +end +%> +
<%:interface%>ESSIDBSSID<%:mode%><%:channel%><%:iwscan_encr%><%:iwscan_link%><%:iwscan_signal%><%:iwscan_noise%>
<%=iface%><%=cell.ESSID%><%=cell.Address%><%=cell.Mode%><%=(cell.Channel or cell.Frequency or "")%><%=cell["Encryption key"]%><%=cell.Quality%><%=cell["Signal level"]%><%=cell["Noise level"]%>
+
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_status/routes.htm b/modules/admin-full/luasrc/view/admin_status/routes.htm new file mode 100644 index 000000000..c4ebf347a --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_status/routes.htm @@ -0,0 +1,42 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:routes%>

+ +
+ + + + + + + + +<% +local routes = luci.sys.net.routes() + +for i, r in pairs(routes) do +%> + + + + + + + +<% end %> +
<%:target%><%:routes_netmask%><%:routes_gateway%><%:routes_metric%><%:interface%>
<%=luci.sys.net.hexip4(r.Destination)%><%=luci.sys.net.hexip4(r.Mask)%><%=luci.sys.net.hexip4(r.Gateway)%><%=r.Metric%><%=r.Iface%>
+
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_status/syslog.htm b/modules/admin-full/luasrc/view/admin_status/syslog.htm new file mode 100644 index 000000000..f3d1f0a96 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_status/syslog.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:status%>

+

<%:syslog%>

+<%=syslog%> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/editor.htm b/modules/admin-full/luasrc/view/admin_system/editor.htm new file mode 100644 index 000000000..bac1729d0 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/editor.htm @@ -0,0 +1,28 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:texteditor%>

+
+
<%:file%>: +<% if msg then %><%:error%>: <%=msg%><% end %>
+
+
+
+
+ + +
+
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/index.htm b/modules/admin-full/luasrc/view/admin_system/index.htm new file mode 100644 index 000000000..3138903c4 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/index.htm @@ -0,0 +1,20 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_i_system1%>

+

<%:a_s_i_system2%>

+

<%:a_s_i_system3%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/ipkg.htm b/modules/admin-full/luasrc/view/admin_system/ipkg.htm new file mode 100644 index 000000000..0cd87d990 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/ipkg.htm @@ -0,0 +1,40 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_p_ipkg%>

+ +
+ +
<%:a_s_p_ipkg_pkglists%>:src Name URL
+
<%:a_s_p_ipkg_targets%>:dest Name Pfad
+ +
+ +
+
+
+
+ +
+
+
+
+ + +
+ <% if msg then %>
<%:error%>: <%=msg%>
<% end %> +
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/packages.htm b/modules/admin-full/luasrc/view/admin_system/packages.htm new file mode 100644 index 000000000..0f8f2c16e --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/packages.htm @@ -0,0 +1,91 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_packages%>

+ +
+ +<% if install or remove or update or upgrade then %> +
<%:status%>:
+<% if update then %> + <%:a_s_packages_update%>: <% if update == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=update%>)<% end %>
+<% end %> +<% if upgrade then%> + <%:a_s_packages_upgrade%>: <% if upgrade == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=upgrade%>)<% end %>
+<% end %> +<% if install then for k,v in pairs(install) do %> + <%:a_s_packages_install%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
+<% end end %> +<% if remove then for k,v in pairs(remove) do %> + <%:a_s_packages_remove%> '<%=k%>': <% if v == 0 then %><%:ok%><% else %><%:error%> (<%:code%> <%=v%>)<% end %>
+<% end end %> +
+
+<% end %> + + + +
+
+ +
+
+ <%:a_s_packages_installurl%>:
+ + +
+ +
+
+ +
+ <%:filter%>: + + + +
+ +
+
+ +
+ + + + + + + + + <% for k, pkg in pairs(pkgs) do %> + + + + + + + + <% end %> +
<%:a_s_packages_name%><%:version%><%:install%><%:delete%><%:descr%>
<%=pkg.Package%><%=pkg.Version%><% if not pkg.Status or not pkg.Status.installed then %><% else %><%:installed%><% end %><% if pkg.Status and pkg.Status.installed then %><% else %><%:notinstalled%><% end %><%=pkg.Description%>
+
+
+ +
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/passwd.htm b/modules/admin-full/luasrc/view/admin_system/passwd.htm new file mode 100644 index 000000000..176abaea2 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/passwd.htm @@ -0,0 +1,49 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_changepw%>

+

<%:a_s_changepw1%>

+

+<% if stat then %> + <% if stat == 0 then %> + <%:a_s_changepw_changed%>! + <% elseif stat == 10 then %> + <%:a_s_changepw_nomatch%>! + <% else %> + <%:unknownerror%>! + <% end %> +<% end %> +<% if not stat or stat == 10 then %> +
+
+
+
<%:password%>
+
+
+
+
<%:confirmation%>
+
+
+
+
+ + +
+
+
+<% end %> +
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/reboot.htm b/modules/admin-full/luasrc/view/admin_system/reboot.htm new file mode 100644 index 000000000..3ddfa5880 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/reboot.htm @@ -0,0 +1,25 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:reboot%>

+

<%:a_s_reboot1%>

+<% if not reboot then %> +

<%:a_s_reboot_do%>

+<% else %> +

<%:a_s_reboot_running%>

+ +<% end %> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/sshkeys.htm b/modules/admin-full/luasrc/view/admin_system/sshkeys.htm new file mode 100644 index 000000000..9a08af9e3 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/sshkeys.htm @@ -0,0 +1,39 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_sshkeys%>

+ +
+ +
<%:a_s_sshkeys1%>
+ +
+ +
+
+
+
+ +
+
+
+
+ + +
+ <% if msg then %>
<%:error%>: <%=msg%>
<% end %> +
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_system/upgrade.htm b/modules/admin-full/luasrc/view/admin_system/upgrade.htm new file mode 100644 index 000000000..16ba50cd9 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_system/upgrade.htm @@ -0,0 +1,47 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:system%>

+

<%:a_s_flash%>

+

<%:a_s_flash_upgrade1%>

+
+<% if sysupgrade and not ret then %> +
" enctype="multipart/form-data"> +
+
+
<%:a_s_flash_fwimage%>
+
+
+
+
+ + <%:a_s_flash_keepcfg%> +
+
+
+ +
+
+
+<% elseif ret then %> + <% if ret == 0 then %> +
<%:a_s_flash_flashed%>
+ <% else %> +
<%:a_s_flash_flasherr%>! (<%:code%> <%=ret%>)
+ <% end %> +<% else %> +
<%:a_s_flash_notimplemented%>
+<% end %> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_uci/apply.htm b/modules/admin-full/luasrc/view/admin_uci/apply.htm new file mode 100644 index 000000000..e28094728 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_uci/apply.htm @@ -0,0 +1,20 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:config%>

+

<%:uci_applied%>:

+<%=(changes or "-")%> +<%=output%> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_uci/changes.htm b/modules/admin-full/luasrc/view/admin_uci/changes.htm new file mode 100644 index 000000000..f2a88602a --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_uci/changes.htm @@ -0,0 +1,25 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:config%>

+

<%:changes%>

+<%=changes%> +
+ +
+
+ +
+<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_uci/revert.htm b/modules/admin-full/luasrc/view/admin_uci/revert.htm new file mode 100644 index 000000000..7f98a0435 --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_uci/revert.htm @@ -0,0 +1,19 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:config%>

+

<%:uci_reverted%>:

+<%=(changes or "-")%> +<%+footer%> \ No newline at end of file diff --git a/modules/admin-full/luasrc/view/admin_wifi/index.htm b/modules/admin-full/luasrc/view/admin_wifi/index.htm new file mode 100644 index 000000000..58281d14f --- /dev/null +++ b/modules/admin-full/luasrc/view/admin_wifi/index.htm @@ -0,0 +1,20 @@ +<%# +LuCI - Lua Configuration Interface +Copyright 2008 Steven Barth +Copyright 2008 Jo-Philipp Wich + +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$ + +-%> +<%+header%> +

<%:wifi%>

+

<%:a_w_wifi1%>

+

<%:a_w_wifi2%>

+

<%:a_w_wifi3%>

+<%+footer%> \ No newline at end of file diff --git a/modules/admin-mini/Makefile b/modules/admin-mini/Makefile new file mode 100644 index 000000000..81a96f6a8 --- /dev/null +++ b/modules/admin-mini/Makefile @@ -0,0 +1,2 @@ +include ../../build/config.mk +include ../../build/module.mk \ No newline at end of file diff --git a/modules/admin-mini/luasrc/controller/index.lua b/modules/admin-mini/luasrc/controller/index.lua new file mode 100644 index 000000000..eb58e0042 --- /dev/null +++ b/modules/admin-mini/luasrc/controller/index.lua @@ -0,0 +1,49 @@ +--[[ +LuCI - Lua Configuration Interface + +Copyright 2008 Steven Barth + +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$ +]]-- +module("luci.controller.admin.index", package.seeall) + +function index() + luci.i18n.loadc("admin-core") + local i18n = luci.i18n.translate + + local root = node() + if not root.target then + root.target = alias("admin") + end + + entry({"about"}, template("about")).i18n = "admin-core" + + local page = node("admin") + page.target = alias("admin", "index") + page.title = i18n("administration", "Administration") + page.order = 10 + page.i18n = "admin-core" + page.sysauth = "root" + + local page = node("admin", "index") + page.target = template("admin_index/index") + page.title = i18n("overview", "Übersicht") + page.order = 10 + + local page = node("admin", "index", "luci") + page.target = cbi("admin_index/luci") + page.title = i18n("a_i_ui", "Oberfläche") + + entry({"admin", "logout"}, call("action_logout"), i18n("logout")) +end + +function action_logout() + luci.http.header("Set-Cookie", "sysauth=; path=/") + luci.http.redirect(luci.dispatcher.build_url()) +end \ No newline at end of file