projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
convert luci.fs users to nixio.fs api
[project/luci.git]
/
applications
/
luci-hd_idle
/
luasrc
/
model
/
cbi
/
hd_idle.lua
diff --git
a/applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
b/applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
index
32db260
..
60817db
100644
(file)
--- a/
applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
+++ b/
applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua
@@
-13,15
+13,20
@@
$Id$
]]--
]]--
+require("nixio.fs")
+
m = Map("hd-idle", translate("hd_idle"), translate("hd_idle_desc"))
s = m:section(TypedSection, "hd-idle", translate("settings"))
m = Map("hd-idle", translate("hd_idle"), translate("hd_idle_desc"))
s = m:section(TypedSection, "hd-idle", translate("settings"))
-s.addremove = true
s.anonymous = true
s.anonymous = true
-s:option(Flag, "enabled", translate("enable
d
", "Enable"))
+s:option(Flag, "enabled", translate("enable", "Enable"))
-s:option(Value, "disk", translate("disk")).rmempty = true
+disk = s:option(Value, "disk", translate("disk"))
+disk.rmempty = true
+for _, dev in nixio.fs.glob("/dev/[sh]d[a-z]") do
+ disk:value(nixio.fs.basename(dev))
+end
s:option(Value, "idle_time_interval", translate("idle_time_interval")).default = 10
s.rmempty = true
s:option(Value, "idle_time_interval", translate("idle_time_interval")).default = 10
s.rmempty = true