luci-app-statistics: add missing ACL rules
[project/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / df.lua
1 -- Copyright 2008 Freifunk Leipzig / Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 module("luci.statistics.rrdtool.definitions.df", package.seeall)
5
6 function item()
7 return luci.i18n.translate("Disk Space Usage")
8 end
9
10 function rrdargs( graph, plugin, plugin_instance, dtype )
11
12 local df_complex = {
13 title = "%H: Disk space usage on %pi",
14 vlabel = "Bytes",
15 number_format = "%5.1lf%sB",
16
17 data = {
18 instances = {
19 df_complex = { "free", "used", "reserved" }
20 },
21
22 options = {
23 df_complex_free = {
24 color = "00ff00",
25 overlay = false,
26 title = "free"
27 },
28
29 df_complex_used = {
30 color = "ff0000",
31 overlay = false,
32 title = "used"
33 },
34
35 df_complex_reserved = {
36 color = "0000ff",
37 overlay = false,
38 title = "reserved"
39 }
40 }
41 }
42 }
43
44 local percent_bytes = {
45 title = "%H: Disk space usage on %pi",
46 vlabel = "Percent",
47 number_format = "%5.2lf %%",
48
49 data = {
50 instances = {
51 percent_bytes = { "free", "used", "reserved" }
52 },
53
54 options = {
55 percent_bytes_free = {
56 color = "00ff00",
57 overlay = false,
58 title = "free"
59 },
60
61 percent_bytes_used = {
62 color = "ff0000",
63 overlay = false,
64 title = "used"
65 },
66
67 percent_bytes_reserved = {
68 color = "0000ff",
69 overlay = false,
70 title = "reserved"
71 }
72 }
73 }
74 }
75
76 local types = graph.tree:data_types( plugin, plugin_instance )
77
78 local p = {}
79 for _, t in ipairs(types) do
80 if t == "percent_bytes" then
81 p[#p+1] = percent_bytes
82 end
83
84 if t == "df_complex" then
85 p[#p+1] = df_complex
86 end
87 end
88
89 return p
90 end