Suggestion to add reastart ability for Failed to Load widget

Started by +DS_DV+, July 28, 2024, 12:40:09 PM

Previous topic - Next topic
Hi OPNSense Devs,
first let me say i really like the new Dashboard <3

Sadly tho i fail to load every widget :/
Some of them always show the red exclamation mark and the message "Failed to load widget".
Since i run a pretty "low spec" Zotac ZBOX Ci323 and a few CI327 with intel n3000 series CPUS i suspect its due to them timing out while initialization?

The workaround is after the Dashboard is loaded to remove the failed widget and re-add it.

Therefor i would really love not only the "remove X" for each widget in the top right corner but also suggest a "reload arrow" in the top left corner of each widget so we can attempt to 'restart' single widgets which failed to load widgets (:

with kind regards

I don't think manually reloading randomly failing widgets is a solution for anything. This needs a serious rework to get back to previously working state, not claiming "oh your firewall box/client you are viewing from is too slow to handle dashboard widgets". Yeah, it can handle IPS and lots of other services at 250 Mbps - but all of a sudden cannot handle widgets with default install nothing added and running - just a box used for testing the dashboard. C'mon...  :-X

You can try this, definitely helped here (thanks to meyergru).

--- /usr/local/opnsense/www/js/widgets/BaseWidget.js    2024-07-26 08:22:07.000000000 +0200
+++ /usr/local/opnsense/www/js/widgets/BaseWidget.js    2024-07-28 17:34:42.671882000 +0200
@@ -37,7 +37,7 @@
         this.cachedData = {};

         /* Connection timeout params */
-        this.timeoutPeriod = 1000;
+        this.timeoutPeriod = 10000;
         this.retryLimit = 3;
         this.eventSourceRetryCount = 0; // retrycount for $.ajax is managed in its own scope



BTW, some sort of retry seems to be already there - limited to 3 attempts and apparently doing nothing particularly useful for people who happen to hit this issue with widgets timeout.

I wonder what unit this is. With milliseconds 1000 would still be a whole second. But microseconds? Hardly, that would result in a 1 ms timeout. So what is it?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)


One tick is 100 nanoseconds, a tenth of a microsecond. So 1.000.000 is 100 milliseconds - which is a value in the right order of magnitude and might still be too short for slower devices.

TIL. Things you never thought you might be asking.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Well, they apparently cannot decide neither on the desired timeout, nor on units. As it is nowthis.timeoutPeriod = 1000; in the discussed file is 1 second.

https://github.com/opnsense/core/commit/2296c2f5ea4358e3b93ef7c95e39861ae872df7b

For me, every single widget fails to load. If I'm lucky, one or two show up after several refreshes. Then it goes back to none at all.

Nevermind, I didn't realize a further update was available after upgrading. 24.7_9 seems to fix it (mostly, anyway). Apologies for bringing this back to the top.