luci-app-statistics: support graph menu entries without corresponding labels
authorJo-Philipp Wich <jo@mein.io>
Sat, 10 Jun 2017 18:26:10 +0000 (20:26 +0200)
committerJo-Philipp Wich <jo@mein.io>
Sat, 10 Jun 2017 18:33:32 +0000 (20:33 +0200)
Properly render menu items for plugin instances that do not have a
corresponding label defined.

This allows for registering new graph pages solely by dropping files
into /usr/lib/lua/luci/statistics/rrdtool/definitions/

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
applications/luci-app-statistics/luasrc/controller/luci_statistics/luci_statistics.lua

index 1bc0714de809c2f3b24122b0f2f2ffa80dba3752..443f20b0f4bbaf6de1a7d765a2823fe3d8b5eb66 100644 (file)
@@ -88,7 +88,7 @@ function index()
                        _entry(
                                { "admin", "statistics", "collectd", section, plugin },
                                cbi("luci_statistics/" .. plugin ),
-                               labels[plugin], j * 10
+                               labels[plugin] or plugin, j * 10
                        )
                end