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:
parent
dd2ccce8dc
commit
c46b9a311b
1 changed files with 17 additions and 11 deletions
|
|
@ -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));
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue