summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2020-12-12 18:29:54 +0200
committerHannu Nyman <hannu.nyman@iki.fi>2020-12-12 18:29:54 +0200
commitf8552afb1c32aece90bba337708f650440850605 (patch)
tree482a4a0bc973197635ae85f6aa10c70d5830ec90 /applications/luci-app-statistics/htdocs/luci-static/resources
parent7b5b7fbcd63af14658ad234cd39c076a823e4629 (diff)
luci-app-statistics: add dhcpleases
Add the dhcpleases plugin: https://github.com/openwrt/packages/pull/14204 Added-Frontend-by: Hannu Nyman <hannu.nyman@iki.fi> Signed-off-by: Nick Hainke <vincent@systemli.org> [Minor changes to graph: alt_autoscale, precision, label] Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
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/dhcpleases.js25
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dhcpleases.js21
2 files changed, 46 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dhcpleases.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dhcpleases.js
new file mode 100644
index 0000000000..b54a0af27e
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dhcpleases.js
@@ -0,0 +1,25 @@
+/* Licensed to the public under the Apache License 2.0. */
+
+'use strict';
+'require baseclass';
+
+return baseclass.extend({
+ title: _('DHCP Leases'),
+
+ rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
+ return {
+ title: "%H: DHCP leases",
+ alt_autoscale_max: true,
+ vlabel: "Leases given",
+ number_format: "%3.0lf",
+ data: {
+ types: [ "count" ],
+ options: {
+ count: {
+ title: "Leases"
+ }
+ }
+ }
+ };
+ }
+});
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dhcpleases.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dhcpleases.js
new file mode 100644
index 0000000000..df185f7d8c
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/dhcpleases.js
@@ -0,0 +1,21 @@
+'use strict';
+'require baseclass';
+'require form';
+
+return baseclass.extend({
+ title: _('DHCP Leases Plugin Configuration'),
+ description: _('The dhcpleases plugin collects information about assigned DHCP leases.'),
+
+ addFormOptions: function(s) {
+ var o;
+
+ o = s.option(form.Flag, 'enable', _('Enable this plugin'));
+
+ o = s.option(form.Value, 'Path', _('DHCP leases file'));
+ o.default = '/tmp/dhcp.leases';
+ },
+
+ configSummary: function(section) {
+ return _('Monitoring DHCP leases enabled');
+ }
+});