luci-app-statistics: processes plugin: add labels, correct data
[project/luci.git] / applications / luci-app-hd-idle / luasrc / model / cbi / hd_idle.lua
1 -- Copyright 2008 Yanira <forum-2008@email.de>
2 -- Licensed to the public under the Apache License 2.0.
3
4 require("nixio.fs")
5
6 m = Map("hd-idle", "hd-idle",
7         translate("hd-idle is a utility program for spinning-down external " ..
8                 "disks after a period of idle time."))
9
10 s = m:section(TypedSection, "hd-idle", translate("Settings"))
11 s.anonymous = true
12
13 s:option(Flag, "enabled", translate("Enable"))
14
15 disk = s:option(Value, "disk", translate("Disk"))
16 disk.rmempty = true
17 for dev in nixio.fs.glob("/dev/[sh]d[a-z]") do
18         disk:value(nixio.fs.basename(dev))
19 end
20
21 s:option(Value, "idle_time_interval", translate("Idle-time")).default = 10
22 s.rmempty = true
23 unit = s:option(ListValue, "idle_time_unit", translate("Idle-time unit"))
24 unit.default = "minutes"
25 unit:value("minutes", translate("min"))
26 unit:value("hours", translate("h"))
27 unit.rmempty = true
28
29 return m