From cd1e8cc6b94ef9aed2199d69f54c94d0c0919605 Mon Sep 17 00:00:00 2001 From: Florian Eckert Date: Thu, 7 Mar 2019 14:50:17 +0100 Subject: [PATCH] luci-app-statistics: add new item callback for menu entry Add the item callback function to the rrdtool definitions. Signed-off-by: Florian Eckert --- .../luasrc/statistics/rrdtool/definitions/apcups.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/conntrack.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/contextswitch.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/cpu.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/cpufreq.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/curl.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/df.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/disk.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/dns.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/entropy.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/interface.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/iptables.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/irq.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/iwinfo.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/load.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/memory.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/netlink.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/nut.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/olsrd.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/openvpn.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/ping.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/processes.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/sensors.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/splash_leases.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/tcpconns.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/thermal.lua | 4 ++++ .../luasrc/statistics/rrdtool/definitions/uptime.lua | 4 ++++ 27 files changed, 108 insertions(+) diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua index 37055f586..637b5f959 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/apcups.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.apcups",package.seeall) +function item() + return luci.i18n.translate("APC UPS") +end + function rrdargs( graph, plugin, plugin_instance ) local lu = require("luci.util") diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua index 5212b736e..d99dab0f0 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/conntrack.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.conntrack",package.seeall) +function item() + return luci.i18n.translate("Conntrack") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/contextswitch.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/contextswitch.lua index 6826e12ad..f9473e440 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/contextswitch.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/contextswitch.lua @@ -2,6 +2,10 @@ module("luci.statistics.rrdtool.definitions.contextswitch",package.seeall) +function item() + return luci.i18n.translate("Context Switches") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua index ae0c0ce77..226c84ee9 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpu.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.cpu",package.seeall) +function item() + return luci.i18n.translate("Processor") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpufreq.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpufreq.lua index 25a72d228..08aab04b8 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpufreq.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/cpufreq.lua @@ -2,6 +2,10 @@ module("luci.statistics.rrdtool.definitions.cpufreq",package.seeall) +function item() + return luci.i18n.translate("CPU Frequency") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua index 2bbdfb08f..4fde243ca 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/curl.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.curl", package.seeall) +function item() + return luci.i18n.translate("cUrl") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/df.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/df.lua index 7a69e85ee..fb732991b 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/df.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/df.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.df", package.seeall) +function item() + return luci.i18n.translate("Disk Space Usage") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) local df_complex = { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua index b6f7d6d5f..29597ff98 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/disk.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.disk", package.seeall) +function item() + return luci.i18n.translate("Disk Usage") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/dns.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/dns.lua index cf96d8fbe..0ff4c7685 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/dns.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/dns.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.dns", package.seeall) +function item() + return luci.i18n.translate("DNS") +end + function rrdargs( graph, plugin, plugin_instance ) local traffic = { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua index 3d30a70af..01eb33f9b 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/entropy.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.entropy", package.seeall) +function item() + return luci.i18n.translate("Entropy") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua index 6ca65e539..a4d4eefd5 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/interface.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.interface", package.seeall) +function item() + return luci.i18n.translate("Interfaces") +end + function rrdargs( graph, plugin, plugin_instance ) -- diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iptables.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iptables.lua index 9790e0e3d..7218bfd44 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iptables.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iptables.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.iptables", package.seeall) +function item() + return luci.i18n.translate("Firewall") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/irq.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/irq.lua index f61d0da64..56b4547b9 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/irq.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/irq.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.irq", package.seeall) +function item() + return luci.i18n.translate("Interrupts") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua index 194afd6fc..53f4c7a40 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/iwinfo.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.iwinfo", package.seeall) +function item() + return luci.i18n.translate("Wireless") +end + function rrdargs( graph, plugin, plugin_instance ) -- diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/load.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/load.lua index ce762dab4..b06c8c414 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/load.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/load.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.load", package.seeall) +function item() + return luci.i18n.translate("System Load") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua index 53d559c59..b05d31dc0 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/memory.lua @@ -11,6 +11,10 @@ You may obtain a copy of the License at module("luci.statistics.rrdtool.definitions.memory",package.seeall) +function item() + return luci.i18n.translate("Memory") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua index f48504853..bdd3f2eb4 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/netlink.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.netlink", package.seeall) +function item() + return luci.i18n.translate("Netlink") +end + function rrdargs( graph, plugin, plugin_instance ) -- diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua index dd9319690..84ca4951f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/nut.lua @@ -2,6 +2,10 @@ module("luci.statistics.rrdtool.definitions.nut",package.seeall) +function item() + return luci.i18n.translate("UPS") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) local voltages = { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua index 481557bb7..52bfbdf4f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/olsrd.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.olsrd", package.seeall) +function item() + return luci.i18n.translate("OLSRd") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) local g = { } diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua index 876e871d1..d16dbac90 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/openvpn.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.openvpn", package.seeall) +function item() + return luci.i18n.translate("OpenVPN") +end + function rrdargs( graph, plugin, plugin_instance ) local inst = plugin_instance:gsub("^openvpn%.(.+)%.status$", "%1") diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua index 5b575bfff..c3645e408 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/ping.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.ping", package.seeall) +function item() + return luci.i18n.translate("Ping") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua index 010ac1cd2..4303824f3 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/processes.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.processes", package.seeall) +function item() + return luci.i18n.translate("Processes") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) if plugin_instance == "" then diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua index b3119234a..6e09a7b9f 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/sensors.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.sensors", package.seeall) +function item() + return luci.i18n.translate("Sensors") +end + function rrdargs( graph, plugin, plugin_instance ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua index 1a192ae6a..5af998cfb 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/splash_leases.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.splash_leases", package.seeall) +function item() + return luci.i18n.translate("Splash Leases") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua index 7e7ed238f..2d762f7a4 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/tcpconns.lua @@ -3,6 +3,10 @@ module("luci.statistics.rrdtool.definitions.tcpconns", package.seeall) +function item() + return luci.i18n.translate("TCP Connections") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/thermal.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/thermal.lua index 532246465..4a555a605 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/thermal.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/thermal.lua @@ -2,6 +2,10 @@ module("luci.statistics.rrdtool.definitions.thermal",package.seeall) +function item() + return luci.i18n.translate("Thermal") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { diff --git a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua index a50e78491..8d7d42bc6 100644 --- a/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua +++ b/applications/luci-app-statistics/luasrc/statistics/rrdtool/definitions/uptime.lua @@ -11,6 +11,10 @@ You may obtain a copy of the License at module("luci.statistics.rrdtool.definitions.uptime", package.seeall) +function item() + return luci.i18n.translate("Uptime") +end + function rrdargs( graph, plugin, plugin_instance, dtype ) return { -- 2.25.1