summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/controller
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2019-04-03 21:01:08 +0200
committerGitHub <noreply@github.com>2019-04-03 21:01:08 +0200
commitd679b93bad9ce0ee529b78c791de39a751a78006 (patch)
treeff77ef7b25712715e8cb5bcab0a8334c1f19d2a6 /applications/luci-app-statistics/luasrc/controller
parenta483a8d05b39a2f12a764f7d625933cae2bd92f5 (diff)
parent05f0649716ccf209ab14a569e49dd8dcefcc04c6 (diff)
Merge pull request #2618 from TDT-AG/pr/20199397-luci-app-statistics
luci-app-statistics: enhancements
Diffstat (limited to 'applications/luci-app-statistics/luasrc/controller')
-rw-r--r--applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua14
1 files changed, 9 insertions, 5 deletions
diff --git a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
index a89f9f4f87..eb7769b85f 100644
--- a/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
+++ b/applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua
@@ -115,11 +115,15 @@ function index()
-- get plugin instances
local instances = tree:plugin_instances( plugin )
- -- plugin menu entry
- entry(
- { "admin", "statistics", "graph", plugin },
- call("statistics_render"), labels[plugin], idx
- ).query = { timespan = span , host = host }
+ -- load plugin menu entry from the description
+ local plugin_name = "luci.statistics.rrdtool.definitions." .. plugin
+ local stat, def = pcall( require, plugin_name )
+ if stat and def and type(def.item) == "function" then
+ entry(
+ { "admin", "statistics", "graph", plugin },
+ call("statistics_render"), def.item(), idx
+ ).query = { timespan = span , host = host }
+ end
-- if more then one instance is found then generate submenu
if #instances > 1 then