summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/htdocs/luci-static/resources
diff options
context:
space:
mode:
authorJoel Johnson <mrjoel@lixil.net>2020-07-30 21:42:53 -0600
committerPaul Donald <itsascambutmailmeanyway@gmail.com>2024-03-13 16:44:44 +0100
commitb5843bcd816109f548a6086f1f9188841e419fff (patch)
tree8451e4dd0b58e2164202f68eff6ddce9f7ed1de8 /applications/luci-app-statistics/htdocs/luci-static/resources
parent7d106acd53d754d2b34229e9869c538c045d932b (diff)
luci-app-statistics: add users plugin support
The users plugin is functional and useful, but requires usage of custom built packages of busybox, dropbear, openssh, or other console/shell access mechanisms. Signed-off-by: Joel Johnson <mrjoel@lixil.net>
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/users.js23
-rw-r--r--applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/users.js16
2 files changed, 39 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/users.js b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/users.js
new file mode 100644
index 0000000000..06921a3f76
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/users.js
@@ -0,0 +1,23 @@
+/* Licensed to the public under the Apache License 2.0. */
+
+'use strict';
+'require baseclass';
+
+return baseclass.extend({
+ title: _('Users'),
+
+ rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
+ return {
+ title: "%H: Users (console logins)",
+ vlabel: "count",
+ data: {
+ types: [ "users" ],
+ options: {
+ users: {
+ title: "Users %di",
+ }
+ }
+ }
+ };
+ }
+});
diff --git a/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/users.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/users.js
new file mode 100644
index 0000000000..05b5eb8849
--- /dev/null
+++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/users.js
@@ -0,0 +1,16 @@
+'use strict';
+'require baseclass';
+'require form';
+
+return baseclass.extend({
+ title: _('Users Plugin Configuration'),
+ description: _('The users plugin collects statistics about users logged in locally via shell. NOTE: Local shell (wtmp) tracking is NOT enabled in default builds. Additional setup is required to get non-zero counts.'),
+
+ addFormOptions: function(s) {
+ var o = s.option(form.Flag, 'enable', _('Enable this plugin'));
+ },
+
+ configSummary: function(section) {
+ return _('Monitoring shell users count');
+ }
+});