diff options
Diffstat (limited to 'applications/luci-app-statistics')
10 files changed, 183 insertions, 25 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/mqtt.js b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/mqtt.js new file mode 100644 index 0000000000..602a453c0b --- /dev/null +++ b/applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/mqtt.js @@ -0,0 +1,88 @@ +'use strict'; +'require baseclass'; +'require form'; + +return baseclass.extend({ + title: _('Mqtt Plugin Configuration'), + + addFormOptions: function(s) { + let o, ss; + + o = s.option(form.Flag, 'enable', _('Sends or receives data via mqtt')); + + o = s.option(form.SectionValue, '__blocks', form.GridSection, 'collectd_mqtt_block'); + o.depends('enable', '1'); + + ss = o.subsection; + ss.anonymous = true; + ss.addremove = true; + + o = ss.option(form.ListValue, 'blocktype', _('Type')); + o.value('Publish', _('Publish')); + o.value('Subscribe', _('Subscribe')); + o.default = 'Publish'; + + o = ss.option(form.Value, 'name', _('Name')); + o.optional = false; + o.rmempty = false; + + o = ss.option(form.Value, 'Host', _('Host')); + o.datatype = 'host'; + o.optional = false; + o.rmempty = false; + + o = ss.option(form.Value, 'Port', _('Port')); + o.datatype = 'port'; + o.optional = true; + + o = ss.option(form.Value, 'User', _('User')); + o.optional = true; + + o = ss.option(form.Value, 'Password', _('Password')); + o.password = true; + o.optional = true; + o.modalonly = true; + + o = ss.option(form.ListValue, 'Qos', _('QoS')); + o.value('0', _('0 - At most once')); + o.value('1', _('1 - At least once')); + o.value('2', _('2 - Exactly once')); + o.modalonly = true; + o.optional = true; + + o = ss.option(form.Value, 'Prefix', _('Prefix')); + o.depends('blocktype', 'Publish'); + o.optional = true; + o.modalonly = true; + + o = ss.option(form.ListValue, 'Retain', _('Retain')); + o.depends('blocktype', 'Publish'); + o.value('true', _('True')); + o.value('false', _('False')); + o.optional = true; + o.modalonly = true; + + o = ss.option(form.ListValue, 'StoreRates', _('StoreRates')); + o.depends('blocktype', 'Publish'); + o.value('true', _('True')); + o.value('false', _('False')); + o.modalonly = true; + o.optional = true; + + o = ss.option(form.ListValue, 'CleanSession', _('CleanSession')); + o.depends('blocktype', 'Subscribe'); + o.value('true', _('True')); + o.value('false', _('False')); + o.optional = true; + o.modalonly = true; + + o = ss.option(form.Value, 'Topic', _('Topic')); + o.depends('blocktype', 'Subscribe'); + o.optional = true; + o.modalonly = true; + }, + + configSummary: function(section) { + return _('Mqtt plugin enabled'); + } +}); 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'); + } +}); diff --git a/applications/luci-app-statistics/po/bg/statistics.po b/applications/luci-app-statistics/po/bg/statistics.po index d006595bd1..2c998930a3 100644 --- a/applications/luci-app-statistics/po/bg/statistics.po +++ b/applications/luci-app-statistics/po/bg/statistics.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-05-19 19:35+0200\n" -"PO-Revision-Date: 2024-01-15 20:14+0000\n" +"PO-Revision-Date: 2024-02-28 14:29+0000\n" "Last-Translator: Boyan Alexiev <nneauu@gmail.com>\n" "Language-Team: Bulgarian <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsstatistics/bg/>\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.5-dev\n" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/apcups.json:2 @@ -618,7 +618,7 @@ msgstr "" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/syslog.js:14 msgid "Log level" -msgstr "" +msgstr "Ниво на записи" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/iptables.js:20 msgid "Match IPv4 iptables rules" diff --git a/applications/luci-app-statistics/po/es/statistics.po b/applications/luci-app-statistics/po/es/statistics.po index b846c5e434..d9549e7273 100644 --- a/applications/luci-app-statistics/po/es/statistics.po +++ b/applications/luci-app-statistics/po/es/statistics.po @@ -3,8 +3,8 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-06-10 03:41+0200\n" -"PO-Revision-Date: 2024-02-08 08:46+0000\n" -"Last-Translator: Mc Giver <mcgivergim@gmail.com>\n" +"PO-Revision-Date: 2024-02-18 06:59+0000\n" +"Last-Translator: Franco Castillo <castillofrancodamian@gmail.com>\n" "Language-Team: Spanish <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsstatistics/es/>\n" "Language: es\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.4\n" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/apcups.json:2 diff --git a/applications/luci-app-statistics/po/it/statistics.po b/applications/luci-app-statistics/po/it/statistics.po index d1b08b381e..9cddfdd847 100644 --- a/applications/luci-app-statistics/po/it/statistics.po +++ b/applications/luci-app-statistics/po/it/statistics.po @@ -3,8 +3,8 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-05-19 19:36+0200\n" -"PO-Revision-Date: 2023-10-16 16:56+0000\n" -"Last-Translator: Frankie McEyes <mceyes@protonmail.com>\n" +"PO-Revision-Date: 2024-03-06 09:48+0000\n" +"Last-Translator: Nico Carlino <ziconick@gmail.com>\n" "Language-Team: Italian <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsstatistics/it/>\n" "Language: it\n" @@ -12,7 +12,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.5-dev\n" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/apcups.json:2 @@ -325,7 +325,7 @@ msgstr "" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/curl.js:21 msgid "Enable" -msgstr "Attiva" +msgstr "Abilitare" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js:25 msgid "Enable forwarding" @@ -605,7 +605,7 @@ msgstr "" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js:44 msgid "Listen port" -msgstr "" +msgstr "Porta in ascolto" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/network.js:32 msgid "Listener interfaces" diff --git a/applications/luci-app-statistics/po/lt/statistics.po b/applications/luci-app-statistics/po/lt/statistics.po index 945c8ddd42..8ff2e1f456 100644 --- a/applications/luci-app-statistics/po/lt/statistics.po +++ b/applications/luci-app-statistics/po/lt/statistics.po @@ -1,7 +1,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2024-02-06 18:06+0000\n" +"PO-Revision-Date: 2024-03-12 11:02+0000\n" "Last-Translator: Džiugas J <dziugas1959@hotmail.com>\n" "Language-Team: Lithuanian <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsstatistics/lt/>\n" @@ -12,7 +12,7 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > " "19)) ? 0 : ((n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? " "1 : 2);\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.5-dev\n" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/apcups.json:2 @@ -533,11 +533,13 @@ msgstr "Skleidėjas/P.k – Vedėjas operuoja/vykdo „chrony“" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js:51 msgid "Hostname" -msgstr "Įrenginio pavadinimas" +msgstr "Įrenginio (t.y skleidėjo/p.k – vedėjo) pavadinimas" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/plugins/olsrd.js:15 msgid "IP or hostname where to get the txtinfo output from" -msgstr "IP arba įrenginio pavadinimas, iš kur gauti „txtinfo“ išvestį iš" +msgstr "" +"IP arba įrenginio (t.y skleidėjo/p.k – vedėjo) pavadinimas, iš kur gauti " +"„txtinfo“ išvestį iš" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/ipstatistics.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/ipstatistics.json:2 @@ -1109,22 +1111,18 @@ msgid "Rule monitoring enabled" msgstr "Taisyklių stebėjimas įjungtas" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js:142 -#, fuzzy msgid "Rx Corrupted Far" msgstr "Atsiųsti/Gauti reaktyviai „tolimai korumpuotas/-i“" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js:147 -#, fuzzy msgid "Rx Corrupted Near" msgstr "Atsiųsti/Gauti reaktyviai „artimai korumpuotas/-i“" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js:152 -#, fuzzy msgid "Rx Retransmitted Far" msgstr "Atsiųsti/Gauti reaktyviai „tolimai retransliuotas/-i“" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js:162 -#, fuzzy msgid "Rx Retransmitted Near" msgstr "Atsiųsti/Gauti reaktyviai „artimai retransliuotas/-i“" @@ -1655,10 +1653,11 @@ msgstr "Pasibaigusios užklausos laikas apklausiant „chrony“" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js:80 msgid "Try to look up fully qualified hostname" -msgstr "Pabandykite surasti/paieškoti pilnai kvalifikuotą Įrenginio pavadinimą" +msgstr "" +"Pabandykite surasti/paieškoti pilnai kvalifikuotą įrenginio (t.y skleidėjo/" +"p.k – vedėjo) pavadinimą" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/dsl.js:157 -#, fuzzy msgid "Tx Retransmitted Far" msgstr "Nusiųsti reaktyviai „tolimai retransliuotas/-i“" diff --git a/applications/luci-app-statistics/po/uk/statistics.po b/applications/luci-app-statistics/po/uk/statistics.po index 493eeb6fd9..753237b404 100644 --- a/applications/luci-app-statistics/po/uk/statistics.po +++ b/applications/luci-app-statistics/po/uk/statistics.po @@ -3,8 +3,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"PO-Revision-Date: 2024-02-01 22:49+0000\n" -"Last-Translator: Sergey Ponomarev <stokito@gmail.com>\n" +"PO-Revision-Date: 2024-02-18 20:52+0000\n" +"Last-Translator: Єгор Филенко <efilenko74@gmail.com>\n" "Language-Team: Ukrainian <https://hosted.weblate.org/projects/openwrt/" "luciapplicationsstatistics/uk/>\n" "Language: uk\n" @@ -13,7 +13,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.4\n" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/apcups.js:7 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/apcups.json:2 @@ -371,7 +371,7 @@ msgstr "Увімкнути цей плаґін" #: applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/collectd.js:113 msgid "Enabled" -msgstr "Увімкнути" +msgstr "Увімкнено" #: applications/luci-app-statistics/htdocs/luci-static/resources/statistics/rrdtool/definitions/entropy.js:10 #: applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/entropy.json:2 diff --git a/applications/luci-app-statistics/root/usr/libexec/stat-genconfig b/applications/luci-app-statistics/root/usr/libexec/stat-genconfig index d60e1a69ed..1bf622d9c1 100755 --- a/applications/luci-app-statistics/root/usr/libexec/stat-genconfig +++ b/applications/luci-app-statistics/root/usr/libexec/stat-genconfig @@ -241,6 +241,33 @@ function config_network(c) { ; } +function config_mqtt(c) { + let str = ""; + + for (let k, s in sections) { + if (s['.type'] === 'collectd_mqtt_block') { + const isPublish = s['blocktype'] === 'Publish'; + + str += isPublish ? `\t<Publish "${s.name}">\n` : `\t<Subscribe "${s.name}">\n`; + + str += `\t\tHost "${s.Host}"\n`; + str += s['Port'] ? `\t\tPort ${s.Port}\n` : ''; + str += s['User'] ? `\t\tUser "${s.User}"\n` : ''; + str += s['Password'] ? `\t\tPassword "${s.Password}"\n` : ''; + str += s['Qos'] ? `\t\tQos ${s.Qos}\n` : ''; + str += s['Prefix'] ? `\t\tPrefix ${s.Prefix}\n` : ''; + str += s['Retain'] ? `\t\tRetain ${s.Retain}\n` : ''; + str += s['StoreRates'] ? `\t\tRetain ${s.StoreRates}\n` : ''; + str += s['CleanSession'] ? `\t\tRetain ${s.CleanSession}\n` : ''; + str += s['Topic'] ? `\t\tTopic "${s.Topic}"\n` : ''; + + str += isPublish ? `\t</Publish>\n` : `\t</Subscribe>\n`; + } + } + + return str; +} + function section(plugin) { let config = sections[`collectd_${plugin}`] ?? sections.collectd; @@ -270,6 +297,7 @@ for (let filename in lsdir(plugin_dir)) { case 'iptables': plugins[name] = config_iptables; break; case 'curl': plugins[name] = config_curl; break; case 'network': plugins[name] = config_network; break; + case 'mqtt': plugins[name] = config_mqtt; break; default: plugins[name] = json(open(`${plugin_dir}/${filename}`))?.legend; } diff --git a/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/mqtt.json b/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/mqtt.json new file mode 100644 index 0000000000..ab86efb676 --- /dev/null +++ b/applications/luci-app-statistics/root/usr/share/luci/statistics/plugins/mqtt.json @@ -0,0 +1,4 @@ +{ + "title": "Mqtt", + "category": "output" +} |