Revert "Change onRender function to always update the dashboard stats"

This reverts commit d26e8c1d0c.

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 d26e8c1d0c
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
This commit is contained in:
John Janzen 2024-12-19 16:10:46 +01:00
parent 805968aac6
commit f537619ffe

View File

@ -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);
});
}
},
/**