Merge pull request #4206 from badkeyy/bugfix/update-dashboard-stats-on-change

Update the dashboard stats every time the dashboard is shown
This commit is contained in:
jc21 2024-12-04 13:08:21 +10:00 committed by GitHub
commit fcf4117f8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -50,8 +50,7 @@ module.exports = Mn.View.extend({
onRender: function () { onRender: function () {
let view = this; let view = this;
if (typeof view.stats.hosts === 'undefined') { Api.Reports.getHostStats()
Api.Reports.getHostStats()
.then(response => { .then(response => {
if (!view.isDestroyed()) { if (!view.isDestroyed()) {
view.stats.hosts = response; view.stats.hosts = response;
@ -61,7 +60,6 @@ module.exports = Mn.View.extend({
.catch(err => { .catch(err => {
console.log(err); console.log(err);
}); });
}
}, },
/** /**