diff --git a/openwrt/files/etc/config/system b/openwrt/files/etc/config/system index 5c36d60..bbc17e1 100644 --- a/openwrt/files/etc/config/system +++ b/openwrt/files/etc/config/system @@ -1,4 +1,5 @@ config system + option timezone UTC option hostname flukso option device 0123456789abcdef0123456789abcdef option key 00112233445566778899aabbccddeeff diff --git a/openwrt/packages/luci/host/etc/config/luci b/openwrt/packages/luci/host/etc/config/luci index c890105..843a7fe 100644 --- a/openwrt/packages/luci/host/etc/config/luci +++ b/openwrt/packages/luci/host/etc/config/luci @@ -1,8 +1,8 @@ config 'core' 'main' option 'lang' 'auto' + option 'mediaurlbase' '/luci-static/openwrt.org' option 'resourcebase' '/luci-static/resources' - option 'mediaurlbase' '/luci-static/oxygen' config 'extern' 'flash_keep' option 'uci' '/etc/config/' diff --git a/openwrt/packages/luci/host/usr/bin/boa b/openwrt/packages/luci/host/usr/bin/boa index 271e5a1..55594df 100755 Binary files a/openwrt/packages/luci/host/usr/bin/boa and b/openwrt/packages/luci/host/usr/bin/boa differ diff --git a/openwrt/packages/luci/host/usr/bin/boa_indexer b/openwrt/packages/luci/host/usr/bin/boa_indexer index 1114e26..c857026 100755 Binary files a/openwrt/packages/luci/host/usr/bin/boa_indexer and b/openwrt/packages/luci/host/usr/bin/boa_indexer differ diff --git a/openwrt/packages/luci/host/usr/bin/lucittpd b/openwrt/packages/luci/host/usr/bin/lucittpd index 1962d36..34988d3 100755 Binary files a/openwrt/packages/luci/host/usr/bin/lucittpd and b/openwrt/packages/luci/host/usr/bin/lucittpd differ diff --git a/openwrt/packages/luci/host/usr/bin/uci b/openwrt/packages/luci/host/usr/bin/uci index 5679947..7002711 100755 Binary files a/openwrt/packages/luci/host/usr/bin/uci and b/openwrt/packages/luci/host/usr/bin/uci differ diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/controller/mini/system.lua b/openwrt/packages/luci/host/usr/lib/lua/luci/controller/mini/system.lua index 17b6309..3723a4b 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/controller/mini/system.lua +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/controller/mini/system.lua @@ -19,112 +19,6 @@ function index() luci.i18n.loadc("admin-core") local i18n = luci.i18n.translate ---[[ entry({"system"}, alias("mini", "system", "index"), i18n("system"), 40).index = true - entry({"system", "index"}, cbi("mini/system", {autoapply=true}), i18n("general"), 1) - entry({"system", "passwd"}, form("mini/passwd"), i18n("a_s_changepw"), 10) - entry({"system", "backup"}, call("action_backup"), i18n("a_s_backup"), 80) - entry({"system", "upgrade"}, call("action_upgrade"), i18n("a_s_flash"), 90) - entry({"system", "reboot"}, call("action_reboot"), i18n("reboot"), 100) -]]-- + entry({"system"}, cbi("mini/system", {autoapply=true}), i18n("system"), 1) end - -function action_backup() - local reset_avail = os.execute([[grep '"rootfs_data"' /proc/mtd >/dev/null 2>&1]]) == 0 - local restore_cmd = "gunzip | tar -xC/ >/dev/null 2>&1" - local backup_cmd = "tar -c %s | gzip 2>/dev/null" - - local restore_fpi - luci.http.setfilehandler( - function(meta, chunk, eof) - if not restore_fpi then - restore_fpi = io.popen(restore_cmd, "w") - end - if chunk then - restore_fpi:write(chunk) - end - if eof then - restore_fpi:close() - end - end - ) - - local upload = luci.http.formvalue("archive") - local backup = luci.http.formvalue("backup") - local reset = reset_avail and luci.http.formvalue("reset") - - if upload and #upload > 0 then - luci.template.render("mini/applyreboot") - luci.sys.reboot() - elseif backup then - luci.util.perror(backup_cmd:format(_keep_pattern())) - local backup_fpi = io.popen(backup_cmd:format(_keep_pattern()), "r") - luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"' % { - luci.sys.hostname(), os.date("%Y-%m-%d")}) - luci.http.prepare_content("application/x-targz") - luci.ltn12.pump.all(luci.ltn12.source.file(backup_fpi), luci.http.write) - elseif reset then - luci.template.render("mini/applyreboot") - luci.util.exec("mtd -r erase rootfs_data") - else - luci.template.render("mini/backup", {reset_avail = reset_avail}) - end -end - -function action_reboot() - local reboot = luci.http.formvalue("reboot") - luci.template.render("mini/reboot", {reboot=reboot}) - if reboot then - luci.sys.reboot() - end -end - -function action_upgrade() - require("luci.model.uci") - - local ret = nil - local plat = luci.fs.mtime("/lib/upgrade/platform.sh") - local tmpfile = "/tmp/firmware.img" - local keep_avail = true - - local file - luci.http.setfilehandler( - function(meta, chunk, eof) - if not file then - file = io.open(tmpfile, "w") - end - if chunk then - file:write(chunk) - end - if eof then - file:close() - end - end - ) - - local fname = luci.http.formvalue("image") - local keepcfg = keep_avail and luci.http.formvalue("keepcfg") - - if plat and fname then - ret = function() - return luci.sys.flash(tmpfile, keepcfg and _keep_pattern()) - end - end - - luci.http.prepare_content("text/html") - luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) -end - -function _keep_pattern() - local kpattern = "" - local files = luci.model.uci.cursor():get_all("luci", "flash_keep") - if files then - kpattern = "" - for k, v in pairs(files) do - if k:sub(1,1) ~= "." and luci.fs.glob(v) then - kpattern = kpattern .. " " .. v - end - end - end - return kpattern -end diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/i18n/admin-core.en.lua b/openwrt/packages/luci/host/usr/lib/lua/luci/i18n/admin-core.en.lua index cb2aa4e..7decbfe 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/i18n/admin-core.en.lua +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/i18n/admin-core.en.lua @@ -21,8 +21,8 @@ a_i_keepflash = 'Files to be kept when flashing a new firmware' a_i_keepflash1 = 'When flashing a new firmware with LuCI these files will be added to the new firmware installation.' a_st_i_status1 = 'Here you can find information about the current system status like CPU clock frequency, memory usage or network interface data.' a_st_i_status2 = 'Also kernel or service logfiles can be viewed here to get an overview over their current state.' -iwscan = 'WLAN-Scan' -iwscan1 = 'Wifi networks in your local environment' +iwscan = 'Wifi-Scan' +iwscan1 = 'Wifi networks detected by this Fluksometer' iwscan_encr = 'Encr.' iwscan_link = 'Link' iwscan_signal = 'Signal' @@ -247,9 +247,10 @@ system_system_logsize = 'System log buffer size' system_system_logip = 'External system log server' system_system_conloglevel = 'Log output level' system_system_conloglevel_desc = 'Level of log messages on the console' +m_i_chipset = 'Chipset' m_i_processor = 'Processor' m_i_memory = 'Memory' -m_i_systemtime = 'Local Time' +m_i_systemtime = 'System Time [UTC]' m_i_uptime = 'Uptime' m_n_d_firstaddress = 'First leased address' m_n_d_numleases = 'Number of leased addresses' diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/network.lua b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/network.lua index 3cbc86c..884d3d2 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/network.lua +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/network.lua @@ -32,57 +32,6 @@ for k, v in pairs(network) do end m = Map("network", translate("network")) -s = m:section(Table, ifaces, translate("status")) -s.parse = function() end - -s:option(DummyValue, ".name", translate("network")) - -hwaddr = s:option(DummyValue, "_hwaddr", - translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc")) -function hwaddr.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") or "" - return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") - or luci.util.exec("ifconfig " .. ix):match(" ([A-F0-9:]+)%s*\n") - or "n/a" -end - - -s:option(DummyValue, "ipaddr", translate("ipaddress")) - -s:option(DummyValue, "netmask", translate("netmask")) - - -txrx = s:option(DummyValue, "_txrx", - translate("network_interface_txrx"), translate("network_interface_txrx_desc")) - -function txrx.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") - - local rx = netstat and netstat[ix] and netstat[ix][1] - rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-" - - local tx = netstat and netstat[ix] and netstat[ix][9] - tx = tx and luci.tools.webadmin.byte_format(tonumber(tx)) or "-" - - return string.format("%s / %s", tx, rx) -end - -errors = s:option(DummyValue, "_err", - translate("network_interface_err"), translate("network_interface_err_desc")) - -function errors.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") - - local rx = netstat and netstat[ix] and netstat[ix][3] - local tx = netstat and netstat[ix] and netstat[ix][11] - - rx = rx and tostring(rx) or "-" - tx = tx and tostring(tx) or "-" - - return string.format("%s / %s", tx, rx) -end - - s = m:section(NamedSection, "lan", "interface", translate("m_n_local")) s.addremove = false @@ -105,7 +54,7 @@ p = s:option(ListValue, "proto", translate("protocol")) p.override_values = true p:value("none", "disabled") p:value("static", translate("manual", "manual")) -p:value("dhcp", translate("automatic", "automatic")) +p:value("dhcp", translate("automatic", "DHCP")) if has_pppoe then p:value("pppoe", "PPPoE") end if has_pptp then p:value("pptp", "PPTP") end diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/system.lua b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/system.lua index 6ab7d0d..acac6d8 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/system.lua +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/system.lua @@ -17,9 +17,9 @@ require("luci.sys.zoneinfo") require("luci.tools.webadmin") -m = Map("system", translate("system"), translate("a_s_desc")) +m = Map("system", translate("system"), "") -s = m:section(TypedSection, "system", "") +s = m:section(TypedSection, "system", translate("general")) s.anonymous = true @@ -27,7 +27,7 @@ s.anonymous = true local system, model, memtotal, memcached, membuffers, memfree = luci.sys.sysinfo() local uptime = luci.sys.uptime() -s:option(DummyValue, "_system", translate("system")).value = system +s:option(DummyValue, "_chipset", translate("m_i_chipset")).value = system s:option(DummyValue, "_cpu", translate("m_i_processor")).value = model local load1, load5, load15 = luci.sys.loadavg() @@ -49,7 +49,169 @@ s:option(DummyValue, "_systime", translate("m_i_systemtime")).value = s:option(DummyValue, "_uptime", translate("m_i_uptime")).value = luci.tools.webadmin.date_format(tonumber(uptime)) - -s:option(DummyValue, "hostname", translate("hostname")) + +-- Wifi Data init -- +local uci = luci.model.uci.cursor() +if not uci:get("network", "wan") then + uci:section("network", "interface", "wan", {proto="none", ifname=" "}) + uci:save("network") + uci:commit("network") +end + +local wlcursor = luci.model.uci.cursor_state() +local wireless = wlcursor:get_all("wireless") +local wifidata = luci.sys.wifi.getiwconfig() +local wifidevs = {} +local ifaces = {} + +for k, v in pairs(wireless) do + if v[".type"] == "wifi-iface" then + table.insert(ifaces, v) + end +end + +wlcursor:foreach("wireless", "wifi-device", + function(section) + table.insert(wifidevs, section[".name"]) + end) + + +-- Wifi Status Table -- +s = m:section(Table, ifaces, translate("wifi")) + +link = s:option(DummyValue, "_link", translate("link")) +function link.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return wifidata[ifname] and wifidata[ifname]["Link Quality"] or "-" +end + +essid = s:option(DummyValue, "ssid", "ESSID") + +bssid = s:option(DummyValue, "_bsiid", "BSSID") +function bssid.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return (wifidata[ifname] and (wifidata[ifname].Cell + or wifidata[ifname]["Access Point"])) or "-" +end + +protocol = s:option(DummyValue, "_mode", translate("protocol")) +function protocol.cfgvalue(self, section) + local mode = wireless[self.map:get(section, "device")].mode + return mode and "802." .. mode +end + +mode = s:option(DummyValue, "mode", translate("mode")) +encryption = s:option(DummyValue, "encryption", translate("iwscan_encr")) + +power = s:option(DummyValue, "_power", translate("power")) +function power.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return wifidata[ifname] and wifidata[ifname]["Tx-Power"] or "-" +end + +scan = s:option(Button, "_scan", translate("scan")) +scan.inputstyle = "find" + +function scan.cfgvalue(self, section) + return self.map:get(section, "ifname") or false +end + +-- Wifi-Scan-Table -- +t2 = m:section(Table, {}, translate("iwscan"), translate("iwscan1")) + +function scan.write(self, section) + m.autoapply = false + t2.render = t2._render + local ifname = self.map:get(section, "ifname") + luci.util.update(t2.data, luci.sys.wifi.iwscan(ifname)) +end + +t2._render = t2.render +t2.render = function() end + +t2:option(DummyValue, "Quality", translate("iwscan_link")) +essid = t2:option(DummyValue, "ESSID", "ESSID") +function essid.cfgvalue(self, section) + return self.map:get(section, "ESSID") +end + +t2:option(DummyValue, "Address", "BSSID") +t2:option(DummyValue, "Mode", translate("mode")) +chan = t2:option(DummyValue, "channel", translate("channel")) +function chan.cfgvalue(self, section) + return self.map:get(section, "Channel") + or self.map:get(section, "Frequency") + or "-" +end + +t2:option(DummyValue, "Encryption key", translate("iwscan_encr")) + +t2:option(DummyValue, "Signal level", translate("iwscan_signal")) + +t2:option(DummyValue, "Noise level", translate("iwscan_noise")) + +-- Interface Data Init-- +local network = luci.model.uci.cursor_state():get_all("network") + +local netstat = luci.sys.net.deviceinfo() +local ifaces = {} + +for k, v in pairs(network) do + if v[".type"] == "interface" and k ~= "loopback" then + table.insert(ifaces, v) + end +end + +-- Interfaces Status Table-- +s = m:section(Table, ifaces, translate("interfaces")) +s.parse = function() end + +s:option(DummyValue, ".name", translate("interface")) + +hwaddr = s:option(DummyValue, "_hwaddr", + translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc")) +function hwaddr.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") or "" + return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") + or luci.util.exec("ifconfig " .. ix):match(" ([A-F0-9:]+)%s*\n") + or "n/a" +end + + +s:option(DummyValue, "ipaddr", translate("ipaddress")) + +s:option(DummyValue, "netmask", translate("netmask")) + + +txrx = s:option(DummyValue, "_txrx", + translate("network_interface_txrx"), translate("network_interface_txrx_desc")) + +function txrx.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") + + local rx = netstat and netstat[ix] and netstat[ix][1] + rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-" + + local tx = netstat and netstat[ix] and netstat[ix][9] + tx = tx and luci.tools.webadmin.byte_format(tonumber(tx)) or "-" + + return string.format("%s / %s", tx, rx) +end + +errors = s:option(DummyValue, "_err", + translate("network_interface_err"), translate("network_interface_err_desc")) + +function errors.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") + + local rx = netstat and netstat[ix] and netstat[ix][3] + local tx = netstat and netstat[ix] and netstat[ix][11] + + rx = rx and tostring(rx) or "-" + tx = tx and tostring(tx) or "-" + + return string.format("%s / %s", tx, rx) +end + return m diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/wifi.lua b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/wifi.lua index a182fcb..a696f8f 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/wifi.lua +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/model/cbi/mini/wifi.lua @@ -45,95 +45,15 @@ wlcursor:foreach("wireless", "wifi-device", m = Map("wireless", translate("wifi"), translate("a_w_devices1")) m:chain("network") - --- Status Table -- -s = m:section(Table, ifaces, translate("networks")) - -link = s:option(DummyValue, "_link", translate("link")) -function link.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return wifidata[ifname] and wifidata[ifname]["Link Quality"] or "-" -end - -essid = s:option(DummyValue, "ssid", "ESSID") - -bssid = s:option(DummyValue, "_bsiid", "BSSID") -function bssid.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return (wifidata[ifname] and (wifidata[ifname].Cell - or wifidata[ifname]["Access Point"])) or "-" -end - -channel = s:option(DummyValue, "channel", translate("channel")) -function channel.cfgvalue(self, section) - return wireless[self.map:get(section, "device")].channel -end - -protocol = s:option(DummyValue, "_mode", translate("protocol")) -function protocol.cfgvalue(self, section) - local mode = wireless[self.map:get(section, "device")].mode - return mode and "802." .. mode -end - -mode = s:option(DummyValue, "mode", translate("mode")) -encryption = s:option(DummyValue, "encryption", translate("iwscan_encr")) - -power = s:option(DummyValue, "_power", translate("power")) -function power.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return wifidata[ifname] and wifidata[ifname]["Tx-Power"] or "-" -end - -scan = s:option(Button, "_scan", translate("scan")) -scan.inputstyle = "find" - -function scan.cfgvalue(self, section) - return self.map:get(section, "ifname") or false -end - --- WLAN-Scan-Table -- - -t2 = m:section(Table, {}, translate("iwscan"), translate("iwscan1")) - -function scan.write(self, section) - m.autoapply = false - t2.render = t2._render - local ifname = self.map:get(section, "ifname") - luci.util.update(t2.data, luci.sys.wifi.iwscan(ifname)) -end - -t2._render = t2.render -t2.render = function() end - -t2:option(DummyValue, "Quality", translate("iwscan_link")) -essid = t2:option(DummyValue, "ESSID", "ESSID") -function essid.cfgvalue(self, section) - return self.map:get(section, "ESSID") -end - -t2:option(DummyValue, "Address", "BSSID") -t2:option(DummyValue, "Mode", translate("mode")) -chan = t2:option(DummyValue, "channel", translate("channel")) -function chan.cfgvalue(self, section) - return self.map:get(section, "Channel") - or self.map:get(section, "Frequency") - or "-" -end - -t2:option(DummyValue, "Encryption key", translate("iwscan_encr")) - -t2:option(DummyValue, "Signal level", translate("iwscan_signal")) - -t2:option(DummyValue, "Noise level", translate("iwscan_noise")) - - - if #wifidevs < 1 then return m end -- Config Section -- +local hwtype = m:get(wifidevs[1], "type") + +--[[ s = m:section(NamedSection, wifidevs[1], "wifi-device", translate("devices")) s.addremove = false @@ -155,7 +75,7 @@ ch = s:option(Value, "channel", translate("a_w_channel")) for i=1, 14 do ch:value(i, i .. " (2.4 GHz)") end - +]]-- s = m:section(TypedSection, "wifi-iface", translate("m_n_local")) s.anonymous = true @@ -238,7 +158,7 @@ function key:validate(value, section) return nil end elseif encr:formvalue(section) == 'psk' or encr:formvalue(section) == 'psk2' then - return #value == 64 and value:hexcheck() + return #value > 7 and #value < 64 and value else return value end diff --git a/openwrt/packages/luci/host/usr/lib/lua/luci/view/themes/oxygen/footer.htm b/openwrt/packages/luci/host/usr/lib/lua/luci/view/themes/oxygen/footer.htm index 1666ee0..293a49c 100644 --- a/openwrt/packages/luci/host/usr/lib/lua/luci/view/themes/oxygen/footer.htm +++ b/openwrt/packages/luci/host/usr/lib/lua/luci/view/themes/oxygen/footer.htm @@ -15,7 +15,7 @@ $Id$
-

Powered by <%= luci.__appname__ .. " (v" .. luci.__version__ .. ")" %>

+

Powered by LuCI

diff --git a/openwrt/packages/luci/host/www/luci-static/oxygen/dashboard.css b/openwrt/packages/luci/host/www/luci-static/oxygen/dashboard.css index 1ac147f..b8b3097 100644 --- a/openwrt/packages/luci/host/www/luci-static/oxygen/dashboard.css +++ b/openwrt/packages/luci/host/www/luci-static/oxygen/dashboard.css @@ -20,89 +20,12 @@ div.dashicon a { font-weight: bold; } -div.di_index a { - background-image: url(icons/network.png); +div.di_network a { + background-image: url(icons/network.png); } div.di_wifi a { background-image: url(icons/wifi.png); } - -div.di_network a { - background-image: url(icons/network.png); -} - -div.di_luci a { - background-image: url(icons/desktop.png); -} - -/**div.di_index a { - background-image: url(icons/overview.png); -}**/ - -div.di_logout a { - background-image: url(icons/logout.png); -} - -/**div.di_freifunk a { - background-image: url(icons/freifunk.png); -}**/ - -div.di_status a { - background-image: url(icons/status.png); -} - -div.di_system a { - background-image: url(icons/system.png); -} - -div.di_syslog a { - background-image: url(icons/shell.png); -} - -div.di_ntpc a { - background-image: url(icons/datetime.png); -} - -div.di_leds a { - background-image: url(icons/lightbulb.png); -} - -div.di_reboot a { - background-image: url(icons/restart.png); -} - -div.di_passwd a { - background-image: url(icons/login.png); -} - -div.di_statistics a { - background-image: url(icons/stats.png); -} - -div.di_packages a { - background-image: url(icons/package.png); -} - -div.di_sshkeys a { - background-image: url(icons/key.png); -} - -div.di_upgrade a { - background-image: url(icons/flash.png); -} - -div.di_services a { - background-image: url(icons/worker.png); -} - -div.di_backup a { - background-image: url(icons/switch.png); -} - -div.di_fstab a { - background-image: url(icons/harddisk.png); -} - } diff --git a/openwrt/packages/luci/host/www/luci-static/oxygen/flukso.png b/openwrt/packages/luci/host/www/luci-static/oxygen/flukso.png index d3710f3..1e419fe 100755 Binary files a/openwrt/packages/luci/host/www/luci-static/oxygen/flukso.png and b/openwrt/packages/luci/host/www/luci-static/oxygen/flukso.png differ diff --git a/openwrt/packages/luci/host/www/luci/splash/index.html b/openwrt/packages/luci/host/www/luci/splash/index.html index 486409a..5257312 100644 --- a/openwrt/packages/luci/host/www/luci/splash/index.html +++ b/openwrt/packages/luci/host/www/luci/splash/index.html @@ -4,7 +4,7 @@ - -LuCI - Lua Configuration Interface + +Flukso Configuration Interface diff --git a/openwrt/packages/luci/i18n/english/luasrc/i18n/admin-core.en.lua b/openwrt/packages/luci/i18n/english/luasrc/i18n/admin-core.en.lua index cb2aa4e..4374db2 100644 --- a/openwrt/packages/luci/i18n/english/luasrc/i18n/admin-core.en.lua +++ b/openwrt/packages/luci/i18n/english/luasrc/i18n/admin-core.en.lua @@ -21,8 +21,8 @@ a_i_keepflash = 'Files to be kept when flashing a new firmware' a_i_keepflash1 = 'When flashing a new firmware with LuCI these files will be added to the new firmware installation.' a_st_i_status1 = 'Here you can find information about the current system status like CPU clock frequency, memory usage or network interface data.' a_st_i_status2 = 'Also kernel or service logfiles can be viewed here to get an overview over their current state.' -iwscan = 'WLAN-Scan' -iwscan1 = 'Wifi networks in your local environment' +iwscan = 'Wifi-Scan' +iwscan1 = 'Wifi networks detected by this Fluksometer' iwscan_encr = 'Encr.' iwscan_link = 'Link' iwscan_signal = 'Signal' @@ -103,7 +103,7 @@ a_w_channel = 'Channel' a_w_wifi1 = 'On this pages you can find configuration options for WLAN based wireless networks.' a_w_wifi2 = 'You can easily integrate your 802.11a/b/g/n-devices into your physical network and use the virtual adapter support to build wireless repeaters or offer several networks with one device.' a_w_wifi3 = 'There is support for Managed, Client, Ad-Hoc and WDS operating modes as well as WPA and WPA2 encryption for secure communnication.' -a_w_devices1 = 'Here you can configure installed wifi devices.' +a_w_devices1 = 'Please enter the name, encryption type and key/passphrase of your wifi network.' a_w_txantenna = 'Transmit Antenna' a_w_rxantenna = 'Receive Antenna' a_w_distance1 = 'Distance to furthest station (in meter)' @@ -234,10 +234,11 @@ a_n_routes_kernel6 = 'Active IPv6/dev/null 2>&1]]) == 0 - local restore_cmd = "gunzip | tar -xC/ >/dev/null 2>&1" - local backup_cmd = "tar -c %s | gzip 2>/dev/null" - - local restore_fpi - luci.http.setfilehandler( - function(meta, chunk, eof) - if not restore_fpi then - restore_fpi = io.popen(restore_cmd, "w") - end - if chunk then - restore_fpi:write(chunk) - end - if eof then - restore_fpi:close() - end - end - ) - - local upload = luci.http.formvalue("archive") - local backup = luci.http.formvalue("backup") - local reset = reset_avail and luci.http.formvalue("reset") - - if upload and #upload > 0 then - luci.template.render("mini/applyreboot") - luci.sys.reboot() - elseif backup then - luci.util.perror(backup_cmd:format(_keep_pattern())) - local backup_fpi = io.popen(backup_cmd:format(_keep_pattern()), "r") - luci.http.header('Content-Disposition', 'attachment; filename="backup-%s-%s.tar.gz"' % { - luci.sys.hostname(), os.date("%Y-%m-%d")}) - luci.http.prepare_content("application/x-targz") - luci.ltn12.pump.all(luci.ltn12.source.file(backup_fpi), luci.http.write) - elseif reset then - luci.template.render("mini/applyreboot") - luci.util.exec("mtd -r erase rootfs_data") - else - luci.template.render("mini/backup", {reset_avail = reset_avail}) - end -end - -function action_reboot() - local reboot = luci.http.formvalue("reboot") - luci.template.render("mini/reboot", {reboot=reboot}) - if reboot then - luci.sys.reboot() - end -end - -function action_upgrade() - require("luci.model.uci") - - local ret = nil - local plat = luci.fs.mtime("/lib/upgrade/platform.sh") - local tmpfile = "/tmp/firmware.img" - local keep_avail = true - - local file - luci.http.setfilehandler( - function(meta, chunk, eof) - if not file then - file = io.open(tmpfile, "w") - end - if chunk then - file:write(chunk) - end - if eof then - file:close() - end - end - ) - - local fname = luci.http.formvalue("image") - local keepcfg = keep_avail and luci.http.formvalue("keepcfg") - - if plat and fname then - ret = function() - return luci.sys.flash(tmpfile, keepcfg and _keep_pattern()) - end - end - - luci.http.prepare_content("text/html") - luci.template.render("mini/upgrade", {sysupgrade=plat, ret=ret, keep_avail=keep_avail}) -end - -function _keep_pattern() - local kpattern = "" - local files = luci.model.uci.cursor():get_all("luci", "flash_keep") - if files then - kpattern = "" - for k, v in pairs(files) do - if k:sub(1,1) ~= "." and luci.fs.glob(v) then - kpattern = kpattern .. " " .. v - end - end - end - return kpattern -end diff --git a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/network.lua b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/network.lua index 3cbc86c..3c7aeca 100644 --- a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/network.lua +++ b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/network.lua @@ -31,58 +31,7 @@ for k, v in pairs(network) do end end -m = Map("network", translate("network")) -s = m:section(Table, ifaces, translate("status")) -s.parse = function() end - -s:option(DummyValue, ".name", translate("network")) - -hwaddr = s:option(DummyValue, "_hwaddr", - translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc")) -function hwaddr.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") or "" - return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") - or luci.util.exec("ifconfig " .. ix):match(" ([A-F0-9:]+)%s*\n") - or "n/a" -end - - -s:option(DummyValue, "ipaddr", translate("ipaddress")) - -s:option(DummyValue, "netmask", translate("netmask")) - - -txrx = s:option(DummyValue, "_txrx", - translate("network_interface_txrx"), translate("network_interface_txrx_desc")) - -function txrx.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") - - local rx = netstat and netstat[ix] and netstat[ix][1] - rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-" - - local tx = netstat and netstat[ix] and netstat[ix][9] - tx = tx and luci.tools.webadmin.byte_format(tonumber(tx)) or "-" - - return string.format("%s / %s", tx, rx) -end - -errors = s:option(DummyValue, "_err", - translate("network_interface_err"), translate("network_interface_err_desc")) - -function errors.cfgvalue(self, section) - local ix = self.map:get(section, "ifname") - - local rx = netstat and netstat[ix] and netstat[ix][3] - local tx = netstat and netstat[ix] and netstat[ix][11] - - rx = rx and tostring(rx) or "-" - tx = tx and tostring(tx) or "-" - - return string.format("%s / %s", tx, rx) -end - - +m = Map("network", translate("network"), translate("m_n_network")) s = m:section(NamedSection, "lan", "interface", translate("m_n_local")) s.addremove = false @@ -105,7 +54,7 @@ p = s:option(ListValue, "proto", translate("protocol")) p.override_values = true p:value("none", "disabled") p:value("static", translate("manual", "manual")) -p:value("dhcp", translate("automatic", "automatic")) +p:value("dhcp", translate("automatic", "DHCP")) if has_pppoe then p:value("pppoe", "PPPoE") end if has_pptp then p:value("pptp", "PPTP") end diff --git a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/system.lua b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/system.lua index 6ab7d0d..e8b8995 100644 --- a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/system.lua +++ b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/system.lua @@ -17,17 +17,16 @@ require("luci.sys.zoneinfo") require("luci.tools.webadmin") -m = Map("system", translate("system"), translate("a_s_desc")) +m = Map("system", translate("system"), "") +m.pageaction = false -s = m:section(TypedSection, "system", "") +s = m:section(TypedSection, "system", translate("general")) s.anonymous = true - - local system, model, memtotal, memcached, membuffers, memfree = luci.sys.sysinfo() local uptime = luci.sys.uptime() -s:option(DummyValue, "_system", translate("system")).value = system +s:option(DummyValue, "_chipset", translate("m_i_chipset")).value = system s:option(DummyValue, "_cpu", translate("m_i_processor")).value = model local load1, load5, load15 = luci.sys.loadavg() @@ -49,7 +48,169 @@ s:option(DummyValue, "_systime", translate("m_i_systemtime")).value = s:option(DummyValue, "_uptime", translate("m_i_uptime")).value = luci.tools.webadmin.date_format(tonumber(uptime)) - -s:option(DummyValue, "hostname", translate("hostname")) + +-- Wifi Data init -- +local uci = luci.model.uci.cursor() +if not uci:get("network", "wan") then + uci:section("network", "interface", "wan", {proto="none", ifname=" "}) + uci:save("network") + uci:commit("network") +end + +local wlcursor = luci.model.uci.cursor_state() +local wireless = wlcursor:get_all("wireless") +local wifidata = luci.sys.wifi.getiwconfig() +local wifidevs = {} +local ifaces = {} + +for k, v in pairs(wireless) do + if v[".type"] == "wifi-iface" then + table.insert(ifaces, v) + end +end + +wlcursor:foreach("wireless", "wifi-device", + function(section) + table.insert(wifidevs, section[".name"]) + end) + + +-- Wifi Status Table -- +s = m:section(Table, ifaces, translate("wifi")) + +link = s:option(DummyValue, "_link", translate("link")) +function link.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return wifidata[ifname] and wifidata[ifname]["Link Quality"] or "-" +end + +essid = s:option(DummyValue, "ssid", "ESSID") + +bssid = s:option(DummyValue, "_bsiid", "BSSID") +function bssid.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return (wifidata[ifname] and (wifidata[ifname].Cell + or wifidata[ifname]["Access Point"])) or "-" +end + +protocol = s:option(DummyValue, "_mode", translate("protocol")) +function protocol.cfgvalue(self, section) + local mode = wireless[self.map:get(section, "device")].mode + return mode and "802." .. mode +end + +mode = s:option(DummyValue, "mode", translate("mode")) +encryption = s:option(DummyValue, "encryption", translate("iwscan_encr")) + +power = s:option(DummyValue, "_power", translate("power")) +function power.cfgvalue(self, section) + local ifname = self.map:get(section, "ifname") + return wifidata[ifname] and wifidata[ifname]["Tx-Power"] or "-" +end + +scan = s:option(Button, "_scan", translate("scan")) +scan.inputstyle = "find" + +function scan.cfgvalue(self, section) + return self.map:get(section, "ifname") or false +end + +-- Wifi-Scan-Table -- +t2 = m:section(Table, {}, translate("iwscan"), translate("iwscan1")) + +function scan.write(self, section) + m.autoapply = false + t2.render = t2._render + local ifname = self.map:get(section, "ifname") + luci.util.update(t2.data, luci.sys.wifi.iwscan(ifname)) +end + +t2._render = t2.render +t2.render = function() end + +t2:option(DummyValue, "Quality", translate("iwscan_link")) +essid = t2:option(DummyValue, "ESSID", "ESSID") +function essid.cfgvalue(self, section) + return self.map:get(section, "ESSID") +end + +t2:option(DummyValue, "Address", "BSSID") +t2:option(DummyValue, "Mode", translate("mode")) +chan = t2:option(DummyValue, "channel", translate("channel")) +function chan.cfgvalue(self, section) + return self.map:get(section, "Channel") + or self.map:get(section, "Frequency") + or "-" +end + +t2:option(DummyValue, "Encryption key", translate("iwscan_encr")) + +t2:option(DummyValue, "Signal level", translate("iwscan_signal")) + +t2:option(DummyValue, "Noise level", translate("iwscan_noise")) + +-- Interface Data Init-- +local network = luci.model.uci.cursor_state():get_all("network") + +local netstat = luci.sys.net.deviceinfo() +local ifaces = {} + +for k, v in pairs(network) do + if v[".type"] == "interface" and k ~= "loopback" then + table.insert(ifaces, v) + end +end + +-- Interfaces Status Table-- +s = m:section(Table, ifaces, translate("interfaces")) +s.parse = function() end + +s:option(DummyValue, ".name", translate("interface")) + +hwaddr = s:option(DummyValue, "_hwaddr", + translate("network_interface_hwaddr"), translate("network_interface_hwaddr_desc")) +function hwaddr.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") or "" + return luci.fs.readfile("/sys/class/net/" .. ix .. "/address") + or luci.util.exec("ifconfig " .. ix):match(" ([A-F0-9:]+)%s*\n") + or "n/a" +end + + +s:option(DummyValue, "ipaddr", translate("ipaddress")) + +s:option(DummyValue, "netmask", translate("netmask")) + + +txrx = s:option(DummyValue, "_txrx", + translate("network_interface_txrx"), translate("network_interface_txrx_desc")) + +function txrx.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") + + local rx = netstat and netstat[ix] and netstat[ix][1] + rx = rx and luci.tools.webadmin.byte_format(tonumber(rx)) or "-" + + local tx = netstat and netstat[ix] and netstat[ix][9] + tx = tx and luci.tools.webadmin.byte_format(tonumber(tx)) or "-" + + return string.format("%s / %s", tx, rx) +end + +errors = s:option(DummyValue, "_err", + translate("network_interface_err"), translate("network_interface_err_desc")) + +function errors.cfgvalue(self, section) + local ix = self.map:get(section, "ifname") + + local rx = netstat and netstat[ix] and netstat[ix][3] + local tx = netstat and netstat[ix] and netstat[ix][11] + + rx = rx and tostring(rx) or "-" + tx = tx and tostring(tx) or "-" + + return string.format("%s / %s", tx, rx) +end + return m diff --git a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua index 061629d..852e722 100644 --- a/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua +++ b/openwrt/packages/luci/modules/admin-mini/luasrc/model/cbi/mini/wifi.lua @@ -45,84 +45,6 @@ wlcursor:foreach("wireless", "wifi-device", m = Map("wireless", translate("wifi"), translate("a_w_devices1")) m:chain("network") - --- Status Table -- -s = m:section(Table, ifaces, translate("networks")) - -link = s:option(DummyValue, "_link", translate("link")) -function link.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return wifidata[ifname] and wifidata[ifname]["Link Quality"] or "-" -end - -essid = s:option(DummyValue, "ssid", "ESSID") - -bssid = s:option(DummyValue, "_bsiid", "BSSID") -function bssid.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return (wifidata[ifname] and (wifidata[ifname].Cell - or wifidata[ifname]["Access Point"])) or "-" -end - -protocol = s:option(DummyValue, "_mode", translate("protocol")) -function protocol.cfgvalue(self, section) - local mode = wireless[self.map:get(section, "device")].mode - return mode and "802." .. mode -end - -mode = s:option(DummyValue, "mode", translate("mode")) -encryption = s:option(DummyValue, "encryption", translate("iwscan_encr")) - -power = s:option(DummyValue, "_power", translate("power")) -function power.cfgvalue(self, section) - local ifname = self.map:get(section, "ifname") - return wifidata[ifname] and wifidata[ifname]["Tx-Power"] or "-" -end - -scan = s:option(Button, "_scan", translate("scan")) -scan.inputstyle = "find" - -function scan.cfgvalue(self, section) - return self.map:get(section, "ifname") or false -end - --- WLAN-Scan-Table -- - -t2 = m:section(Table, {}, translate("iwscan"), translate("iwscan1")) - -function scan.write(self, section) - m.autoapply = false - t2.render = t2._render - local ifname = self.map:get(section, "ifname") - luci.util.update(t2.data, luci.sys.wifi.iwscan(ifname)) -end - -t2._render = t2.render -t2.render = function() end - -t2:option(DummyValue, "Quality", translate("iwscan_link")) -essid = t2:option(DummyValue, "ESSID", "ESSID") -function essid.cfgvalue(self, section) - return self.map:get(section, "ESSID") -end - -t2:option(DummyValue, "Address", "BSSID") -t2:option(DummyValue, "Mode", translate("mode")) -chan = t2:option(DummyValue, "channel", translate("channel")) -function chan.cfgvalue(self, section) - return self.map:get(section, "Channel") - or self.map:get(section, "Frequency") - or "-" -end - -t2:option(DummyValue, "Encryption key", translate("iwscan_encr")) - -t2:option(DummyValue, "Signal level", translate("iwscan_signal")) - -t2:option(DummyValue, "Noise level", translate("iwscan_noise")) - - - if #wifidevs < 1 then return m end @@ -131,31 +53,8 @@ end local hwtype = m:get(wifidevs[1], "type") ---[[ -s = m:section(NamedSection, wifidevs[1], "wifi-device", translate("devices")) -s.addremove = false -local hwtype = m:get(wifidevs[1], "type") - -if hwtype == "atheros" then - mode = s:option(ListValue, "hwmode", translate("mode")) - mode.override_values = true - mode:value("", "auto") - mode:value("11b", "802.11b") - mode:value("11g", "802.11g") - mode:value("11a", "802.11a") - mode:value("11bg", "802.11b+g") - mode.rmempty = true -end - - -ch = s:option(Value, "channel", translate("a_w_channel")) -for i=1, 14 do - ch:value(i, i .. " (2.4 GHz)") -end -]]-- - -s = m:section(TypedSection, "wifi-iface", translate("m_n_local")) +s = m:section(TypedSection, "wifi-iface", "") s.anonymous = true s.addremove = false diff --git a/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/dashboard.css b/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/dashboard.css index b8b3097..184afe7 100644 --- a/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/dashboard.css +++ b/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/dashboard.css @@ -20,12 +20,16 @@ div.dashicon a { font-weight: bold; } +div.di_system a { + background-image: url(icons/system.png); +} + div.di_network a { background-image: url(icons/network.png); } div.di_wifi a { - background-image: url(icons/wifi.png); + background-image: url(icons/wifi.png); } } diff --git a/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/icons/system.png b/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/icons/system.png new file mode 100644 index 0000000..db92faa Binary files /dev/null and b/openwrt/packages/luci/themes/oxygen/htdocs/luci-static/oxygen/icons/system.png differ