summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources/statistics
diff options
context:
space:
mode:
authorHannu Nyman <hannu.nyman@iki.fi>2023-10-09 23:16:28 +0300
committerHannu Nyman <hannu.nyman@iki.fi>2023-10-09 23:16:36 +0300
commit08540c44629ad0fedf5feb2b535c2df182ac3973 (patch)
treef7fb1e31dd8fee0141748ca35895c86776285dce /applications/luci-app-statistics/htdocs/luci-static/resources/statistics
parentf235491381f5836701f2fb1cb2e2aed432ef127d (diff)
luci-app-statistics: memory: make hiding 'free' configurable
Make hiding the 'free' memory configurable. Set default as disabled, shown in graph which always scales to 100%. If enabled, the graph scales to actually used memory, which enables a more detailed view to memory usage. Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources/statistics')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js
index 9b0d179b0a..960d98c108 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js
@@ -5,12 +5,14 @@
'use strict';
'require baseclass';
+'require uci';
return baseclass.extend({
title: _('Memory'),
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
var p = [];
+ var hide_free = uci.get("luci_statistics", "collectd_memory", "HideFree") == "1" ? true : false;
var memory = {
title: "%H: Memory usage",
@@ -21,7 +23,7 @@ return baseclass.extend({
data: {
instances: {
memory: [
- "free",
+ ...(hide_free ? [] : ["free"]),
"buffered",
"cached",
"used"
@@ -58,7 +60,7 @@ return baseclass.extend({
data: {
instances: {
percent: [
- "free",
+ ...(hide_free ? [] : ["free"]),
"buffered",
"cached",
"used"