From f537619ffef839de35914b5aaff10cb4e82c14e1 Mon Sep 17 00:00:00 2001 From: John Janzen Date: Thu, 19 Dec 2024 16:10:46 +0100 Subject: [PATCH] Revert "Change onRender function to always update the dashboard stats" This reverts commit d26e8c1d0c44a5fbeb1264f8fe713bdac0f5e703. This reopens #4204 (which i can't reproduce sadly) The reverted commit is responsible for an infinite loop of requests to /hosts, which makes buttons unresponsive on the main page another way to invalidate the cache needs to be found this infinite requests loop happens on d26e8c1d0c44a5fbeb1264f8fe713bdac0f5e703 and on the docker image `nginxproxymanager/nginx-proxy-manager-dev:pr-4206` the docker image is attaced to the pr #4206 which merges the commit --- frontend/js/app/dashboard/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/js/app/dashboard/main.js b/frontend/js/app/dashboard/main.js index 4765d06..c2e82f8 100644 --- a/frontend/js/app/dashboard/main.js +++ b/frontend/js/app/dashboard/main.js @@ -50,7 +50,8 @@ module.exports = Mn.View.extend({ onRender: function () { let view = this; - Api.Reports.getHostStats() + if (typeof view.stats.hosts === 'undefined') { + Api.Reports.getHostStats() .then(response => { if (!view.isDestroyed()) { view.stats.hosts = response; @@ -60,6 +61,7 @@ module.exports = Mn.View.extend({ .catch(err => { console.log(err); }); + } }, /**