Răsfoiți Sursa

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
John Janzen 1 an în urmă
părinte
comite
f537619ffe
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      frontend/js/app/dashboard/main.js

+ 3 - 1
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);
                 });
+        }
     },
 
     /**