summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-statistics/htdocs/luci-static/resources')
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js193
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/memory.js6
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js68
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js2
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js5
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js1
6 files changed, 272 insertions, 3 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js
new file mode 100644
index 0000000000..87e2d989e4
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js
@@ -0,0 +1,193 @@
+/* Licensed to the public under the Apache License 2.0. */
+
+'use strict';
+
+return L.Class.extend({
+ title: _('DSL'),
+
+ rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
+ var g = [];
+ var dtypes = graph.dataTypes(host, plugin, plugin_instance);
+
+ const d_snr = {
+ title: _("DSL Signal"),
+ vlabel: "dB",
+ data: {
+ types: ["snr"],
+ options: {
+ snr_latn_up: {
+ title: _("Line Attenuation Up (LATN)"),
+ noarea: true,
+ overlay: true
+ },
+ snr_latn_down: {
+ title: _("Line Attenuation Down (LATN)"),
+ noarea: true,
+ overlay: true
+ },
+ snr_satn_up: {
+ title: _("Signal Attenuation Up (SATN)"),
+ noarea: true,
+ overlay: true
+ },
+ snr_satn_down: {
+ title: _("Signal Attenuation Down (SATN)"),
+ noarea: true,
+ overlay: true
+ },
+ snr_snr_up: {
+ title: _("Noise Margin Up (SNR)"),
+ noarea: true,
+ overlay: true
+ },
+ snr_snr_down: {
+ title: _("Noise Margin Down (SNR)"),
+ noarea: true,
+ overlay: true
+ },
+ }
+ }
+ };
+ const d_uptime = {
+ title: _("DSL Line Uptime"),
+ vlabel: "seconds",
+ data: {
+ types: ["uptime"],
+ options: {
+ uptime: {
+ title: _("Uptime"),
+ noarea: true
+ }
+ }
+ }
+ };
+ const d_flags = {
+ title: _("DSL Flags"),
+ data: {
+ instances: {
+ bool: [
+ "bitswap_up",
+ "bitswap_down",
+ "vector_up",
+ "vector_down"
+ ]
+ },
+ options: {
+ bool_bitswap_up: {
+ title: _("Bitswap Up"),
+ noarea: true,
+ overlay: true
+ },
+ bool_bitswap_down: {
+ title: _("Bitswap Down"),
+ noarea: true,
+ overlay: true
+ },
+ bool_vector_up: {
+ title: _("Vectoring Up"),
+ noarea: true,
+ overlay: true
+ },
+ bool_vector_down: {
+ title: _("Vectoring Down"),
+ noarea: true,
+ overlay: true
+ },
+ }
+ }
+ };
+ const d_bitrate = {
+ title: _("Bitrate"),
+ vlabel: "b/s",
+ data: {
+ instances: {
+ bitrate: [
+ "attndr_up",
+ "attndr_down",
+ "data_rate_up",
+ "data_rate_down"
+ ]
+ },
+ options: {
+ bitrate_attndr_up: {
+ title: _("Max. Attainable Data Rate (ATTNDR) Up"),
+ noarea: true,
+ overlay: true
+ },
+ bitrate_attndr_down: {
+ title: _("Max. Attainable Data Rate (ATTNDR) Down"),
+ noarea: true,
+ overlay: true
+ },
+ bitrate_data_rate_up: {
+ title: _("Data Rate Up"),
+ noarea: true,
+ overlay: true
+ },
+ bitrate_data_rate_down: {
+ title: _("Data Rate Down"),
+ noarea: true,
+ overlay: true
+ }
+ }
+ }
+ };
+ const d_count = {
+ title: _("Errors"),
+ vlabel: "count",
+ data: {
+ types: ["errors"],
+ options: {
+ errors_rx_corrupted_far: {
+ title: _("Rx Corrupted Far"),
+ noarea: true,
+ overlay: true
+ },
+ errors_rx_corrupted_near: {
+ title: _("Rx Corrupted Near"),
+ noarea: true,
+ overlay: true
+ },
+ errors_rx_retransmitted_far: {
+ title: _("Rx Retransmitted Far"),
+ noarea: true,
+ overlay: true
+ },
+ errors_tx_retransmitted_far: {
+ title: _("Tx Retransmitted Far"),
+ noarea: true,
+ overlay: true
+ },
+ errors_rx_retransmitted_near: {
+ title: _("Rx Retransmitted Near"),
+ noarea: true,
+ overlay: true
+ },
+ errors_tx_retransmitted_near: {
+ title: _("Tx Retransmitted Near"),
+ noarea: true,
+ overlay: true
+ },
+ }
+ }
+ };
+
+ if (dtypes.includes("snr")) {
+ g.push(d_snr);
+ }
+ if (dtypes.includes("uptime")) {
+ g.push(d_uptime);
+ }
+ if (dtypes.includes("bool")) {
+ g.push(d_flags);
+ }
+ if (dtypes.includes("bitrate")) {
+ g.push(d_bitrate);
+ }
+ if (dtypes.includes("count")) {
+ g.push(d_count);
+ }
+
+ return g;
+ }
+});
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"
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js
index 3da1bcfd82..f612e39f6b 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/sensors.js
@@ -44,6 +44,74 @@ return baseclass.extend({
}
});
}
+ if (types.indexOf('voltage') > -1) {
+ rv.push({
+ per_instance: true,
+ title: "%H: %pi - %di",
+ vlabel: "V",
+ number_format: "%4.1lf V",
+ data: {
+ types: [ "voltage" ],
+ options: {
+ voltage__value: {
+ color: "0000ff",
+ title: "Voltage"
+ }
+ }
+ }
+ });
+ }
+ if (types.indexOf('current') > -1) {
+ rv.push({
+ per_instance: true,
+ title: "%H: %pi - %di",
+ vlabel: "A",
+ number_format: "%4.1lf A",
+ data: {
+ types: [ "current" ],
+ options: {
+ current__value: {
+ color: "00ff00",
+ title: "Current"
+ }
+ }
+ }
+ });
+ }
+ if (types.indexOf('power') > -1) {
+ rv.push({
+ per_instance: true,
+ title: "%H: %pi - %di",
+ vlabel: "W",
+ number_format: "%4.1lf W",
+ data: {
+ types: [ "power" ],
+ options: {
+ power__value: {
+ color: "ff0000",
+ title: "Power"
+ }
+ }
+ }
+ });
+ }
+ if (types.indexOf('fanspeed') > -1) {
+ rv.push({
+ per_instance: true,
+ title: "%H: %pi - %di",
+ vlabel: "rpm",
+ number_format: "%4lf rpm",
+ data: {
+ types: [ "fanspeed" ],
+ options: {
+ fanspeed__value: {
+ color: "0000ff",
+ title: "Fan speed"
+ }
+ }
+ }
+ });
+ }
return rv;
}
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js
index a3189143eb..db24d18592 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js
@@ -182,7 +182,7 @@ return view.extend({
E('button', {
'class': 'cbi-button',
'click': function(ev) { location.href = 'collectd' }
- }, [ _('Setup collectd') ])
+ }, [ _('Set up collectd') ])
])
]);
},
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js
index a4a8eb2761..864857faa3 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/memory.js
@@ -11,6 +11,11 @@ return baseclass.extend({
o = s.option(form.Flag, 'enable', _('Enable this plugin'));
+ o = s.option(form.Flag, 'HideFree', _('Hide free memory'),
+ _('Hiding the free memory item makes the graph to scale to actual memory usage, not to 100%.'));
+ o.default = '0';
+ o.rmempty = false;
+
o = s.option(form.Flag, 'ValuesAbsolute', _('Absolute values'), _('When set to true, we request absolute values'));
o.default = '1';
o.depends('enable', '1');
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js
index a1a2472654..a55be1f4f4 100644
--- a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/sensors.js
@@ -9,6 +9,7 @@ var sensorTypes = [
/^(?:cpu_temp|remote_temp|temp)[0-9]*$/, 'temperature',
/^(?:fan)[0-9]*$/, 'fanspeed',
/^(?:humidity)[0-9]*$/, 'humidity',
+ /^(?:curr)[0-9]*$/, 'current',
/^(?:power)[0-9]*$/, 'power'
];