summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-mod-admin-mini/luasrc
diff options
context:
space:
mode:
Diffstat (limited to 'modules/luci-mod-admin-mini/luasrc')
-rw-r--r--modules/luci-mod-admin-mini/luasrc/controller/mini/index.lua6
-rw-r--r--modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua24
-rw-r--r--modules/luci-mod-admin-mini/luasrc/model/cbi/mini/dhcp.lua8
-rw-r--r--modules/luci-mod-admin-mini/luasrc/model/cbi/mini/passwd.lua4
-rw-r--r--modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua2
5 files changed, 22 insertions, 22 deletions
diff --git a/modules/luci-mod-admin-mini/luasrc/controller/mini/index.lua b/modules/luci-mod-admin-mini/luasrc/controller/mini/index.lua
index dd25f2c52b..6228ad7c8d 100644
--- a/modules/luci-mod-admin-mini/luasrc/controller/mini/index.lua
+++ b/modules/luci-mod-admin-mini/luasrc/controller/mini/index.lua
@@ -10,14 +10,14 @@ function index()
root.target = alias("mini")
root.index = true
end
-
+
entry({"about"}, template("about"))
-
+
local page = entry({"mini"}, alias("mini", "index"), _("Essentials"), 10)
page.sysauth = "root"
page.sysauth_authenticator = "htmlauth"
page.index = true
-
+
entry({"mini", "index"}, alias("mini", "index", "index"), _("Overview"), 10).index = true
entry({"mini", "index", "index"}, form("mini/index"), _("General"), 1).ignoreindex = true
entry({"mini", "index", "luci"}, cbi("mini/luci", {autoapply=true}), _("Settings"), 10)
diff --git a/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua b/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
index 74a5ae4d36..b23193a170 100644
--- a/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
+++ b/modules/luci-mod-admin-mini/luasrc/controller/mini/system.lua
@@ -17,8 +17,8 @@ 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
+
+ local restore_fpi
luci.http.setfilehandler(
function(meta, chunk, eof)
if not restore_fpi then
@@ -32,11 +32,11 @@ function action_backup()
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()
@@ -66,7 +66,7 @@ function action_upgrade()
require("luci.model.uci")
local tmpfile = "/tmp/firmware.img"
-
+
local function image_supported()
-- XXX: yay...
return ( 0 == os.execute(
@@ -76,11 +76,11 @@ function action_upgrade()
% tmpfile
) )
end
-
+
local function image_checksum()
return (luci.sys.exec("md5sum %q" % tmpfile):match("^([^%s]+)"))
end
-
+
local function storage_size()
local size = 0
if nixio.fs.access("/proc/mtd") then
@@ -128,9 +128,9 @@ function action_upgrade()
local has_support = image_supported()
local has_platform = nixio.fs.access("/lib/upgrade/platform.sh")
local has_upload = luci.http.formvalue("image")
-
+
-- This does the actual flashing which is invoked inside an iframe
- -- so don't produce meaningful errors here because the the
+ -- so don't produce meaningful errors here because the the
-- previous pages should arrange the stuff as required.
if step == 4 then
if has_platform and has_image and has_support then
@@ -163,7 +163,7 @@ function action_upgrade()
if has_image then
nixio.fs.unlink(tmpfile)
end
-
+
luci.template.render("mini/upgrade", {
step=1,
bad_image=(has_image and not has_support or false),
@@ -180,14 +180,14 @@ function action_upgrade()
flashsize=storage_size(),
keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1")
} )
-
+
-- Step 3: load iframe which calls the actual flash procedure
elseif step == 3 then
luci.template.render("mini/upgrade", {
step=3,
keepconfig=(keep_avail and luci.http.formvalue("keepcfg") == "1")
} )
- end
+ end
end
function _keep_pattern()
diff --git a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/dhcp.lua b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/dhcp.lua
index 8841d1ff82..0743ece978 100644
--- a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/dhcp.lua
+++ b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/dhcp.lua
@@ -30,15 +30,15 @@ limit:depends("ignore", "0")
function limit.cfgvalue(self, section)
local value = Value.cfgvalue(self, section)
-
+
if value then
return tonumber(value) + 1
- end
+ end
end
function limit.write(self, section, value)
value = tonumber(value) - 1
- return Value.write(self, section, value)
+ return Value.write(self, section, value)
end
limit.rmempty = true
@@ -53,7 +53,7 @@ uci:foreach("dhcp", "dnsmasq",
function(section)
leasefn = section.leasefile
end
-)
+)
local leasefp = leasefn and fs.access(leasefn) and io.lines(leasefn)
if leasefp then
leases = {}
diff --git a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/passwd.lua b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/passwd.lua
index 8cdb4be9fa..b7b40e25d0 100644
--- a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/passwd.lua
+++ b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/passwd.lua
@@ -19,13 +19,13 @@ end
function f.handle(self, state, data)
if state == FORM_VALID then
local stat = luci.sys.user.setpasswd("root", data.pw1) == 0
-
+
if stat then
f.message = translate("Password successfully changed")
else
f.errmessage = translate("Unknown Error")
end
-
+
data.pw1 = nil
data.pw2 = nil
end
diff --git a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua
index 799211fef4..a588164375 100644
--- a/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua
+++ b/modules/luci-mod-admin-mini/luasrc/model/cbi/mini/wifi.lua
@@ -242,7 +242,7 @@ if hwtype == "mac80211" then
encr.description = translate(
"WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..
"and ad-hoc mode) to be installed."
- )
+ )
else
encr.description = translate(
"WPA-Encryption requires wpa_supplicant (for client mode) or hostapd (for AP " ..