luci-app-statistics: render all graphs on refresh if no summary
authorJames Haggerty <james.haggerty@morsemicro.com>
Thu, 24 Oct 2024 01:17:21 +0000 (12:17 +1100)
committerPaul Donald <newtwen+github@gmail.com>
Thu, 24 Oct 2024 13:05:25 +0000 (15:05 +0200)
Previously, if there would usually be a summary page for the data
but this was not happening because there was only a single instance
(e.g. a single wifi interface), the refresh would mistakenly
request the summary rather than the existing data.

i.e. graphs would mysteriously disappear on refresh.

Signed-off-by: James Haggerty <james.haggerty@morsemicro.com>
applications/luci-app-statistics/htdocs/luci-static/resources/view/statistics/graphs.js

index 4ac81ff82653581860616192f3cba78c8ef6177e..479dcbcbbcbb3ed76bc567ecff960dda51a77397 100644 (file)
@@ -74,7 +74,7 @@ return view.extend({
                                        'data-tab-title': multiple ? title : null,
                                        'data-plugin': plugin,
                                        'data-plugin-instance': plugin_instance,
-                                       'data-is-index': i ? null : true,
+                                       'data-is-index': i || render_instances.length == 1 ? null : true,
                                        'cbi-tab-active': function(ev) { activeInstance = ev.target.getAttribute('data-plugin-instance') }
                                }, blobs.map(function(blob) {
                                        return E('img', {