summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2023-08-23 14:27:20 +0200
committerGitHub <noreply@github.com>2023-08-23 14:27:20 +0200
commit727c0895a4e73f42a3fe50178f2926c61b7c5b95 (patch)
tree8acc55bc8acc5c8877128424051f02b1f22a313b
parentb17650fbd23ee9028b8a7aa55e3a9615ddf934f8 (diff)
parent8262352fe35505909e8fe3f981da039389a6ccc7 (diff)
Merge pull request #6536 from c-spiess/app-statistics-missing-sensors
luci-app-statistics: missing sensor types added
-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/plugins/sensors.js1
2 files changed, 69 insertions, 0 deletions
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/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'
];