luci-app-olsr: handle empty result for non-status tables
[oweals/luci.git] / applications / luci-app-statistics / luasrc / statistics / rrdtool / definitions / memory.lua
1 --[[
2
3 (c) 2011 Manuel Munz <freifunk at somakoma dot de>
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9         http://www.apache.org/licenses/LICENSE-2.0
10 ]]--
11
12 module("luci.statistics.rrdtool.definitions.memory",package.seeall)
13
14 function item()
15         return luci.i18n.translate("Memory")
16 end
17
18 function rrdargs( graph, plugin, plugin_instance, dtype )
19
20         return {
21                 title = "%H: Memory usage",
22                 vlabel = "MB",
23                 number_format = "%5.1lf%s",
24                 y_min = "0",
25                 alt_autoscale_max = true,
26                 data = {
27                         instances = { 
28                                 memory = { "free", "buffered", "cached", "used" }
29                         },
30
31                         options = {
32                                 memory_buffered = { color = "0000ff", title = "Buffered" },
33                                 memory_cached   = { color = "ff00ff", title = "Cached" },
34                                 memory_used     = { color = "ff0000", title = "Used" },
35                                 memory_free     = { color = "00ff00", title = "Free" }
36                         }
37                 }
38         }
39 end