1
0
Fork 0
mirror of https://github.com/bastienwirtz/homer.git synced 2026-07-17 16:38:59 +00:00

feat: autoupdate support for adGuardHome

This commit is contained in:
Bastien Wirtz 2026-01-18 14:39:09 +01:00
parent dd2ccce8dc
commit c46b9a311b

View file

@ -51,21 +51,27 @@ export default {
},
},
created: function () {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
if (!this.item.subtitle) {
this.fetchStats();
}
},
methods: {
fetchStatus: async function () {
this.status = await this.fetch("/control/status").catch((e) =>
console.log(e),
);
},
fetchStats: async function () {
this.stats = await this.fetch("/control/stats").catch((e) =>
console.log(e),
);
this.fetch("/control/status")
.then((status) => {
this.status = status;
})
.catch((e) => console.log(e));
if (!this.item.subtitle) {
this.fetch("/control/stats")
.then((stats) => {
this.stats = stats;
})
.catch((e) => console.log(e));
}
},
},
};