* luci/app/hd_idle: small usability enhancement
authorJo-Philipp Wich <jow@openwrt.org>
Thu, 2 Oct 2008 14:02:43 +0000 (14:02 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Thu, 2 Oct 2008 14:02:43 +0000 (14:02 +0000)
applications/luci-hd_idle/luasrc/model/cbi/hd_idle.lua

index 32db2605ed6ce20e9b635fa361c649656e2196c8..f7040a551bfbc1be4ad55a8e35a26f4222fbc4e0 100644 (file)
@@ -13,6 +13,8 @@ $Id$
 
 ]]--
 
+require("luci.fs")
+
 m = Map("hd-idle", translate("hd_idle"), translate("hd_idle_desc"))
 
 s = m:section(TypedSection, "hd-idle", translate("settings"))
@@ -21,7 +23,10 @@ s.anonymous = true
 
 s:option(Flag, "enabled", translate("enabled", "Enable"))
 
-s:option(Value, "disk", translate("disk")).rmempty = true
+disk = s:option(Value, "disk", translate("disk")).rmempty = true
+for _, dev in ipairs(luci.fs.glob("/dev/[sh]d[a-z]")) do
+       disk:value(luci.fs.basename(dev))
+end
 
 s:option(Value, "idle_time_interval", translate("idle_time_interval")).default = 10
 s.rmempty = true