migrate all service to glabal updater

This commit is contained in:
Bastien Wirtz
2026-01-25 17:05:53 +01:00
parent 531b1e3f64
commit 9c90387ba1
17 changed files with 79 additions and 13 deletions

View File

@@ -40,10 +40,10 @@ export default {
statusMessage: false,
}),
created() {
const updateInterval = parseInt(this.item.updateInterval, 10) || 0;
if (updateInterval > 0) {
setInterval(() => this.fetchStatus(), updateInterval);
}
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -44,10 +44,17 @@ export default {
},
},
created() {
this.fetchStatus();
this.fetchMessages();
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchAll;
// Initial data fetch
this.fetchAll();
},
methods: {
fetchAll: async function () {
this.fetchStatus();
this.fetchMessages();
},
fetchStatus: async function () {
await this.fetch(`/health`)
.catch((e) => console.log(e))

View File

@@ -55,6 +55,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -44,6 +44,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -26,6 +26,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchBookmarks;
// Initial data fetch
this.fetchBookmarks();
},
methods: {

View File

@@ -47,6 +47,10 @@ export default {
};
},
created: function () {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchConfig;
// Initial data fetch
this.fetchConfig();
},
methods: {

View File

@@ -63,10 +63,10 @@ export default {
},
},
created() {
const checkInterval = parseInt(this.item.checkInterval, 10) || 0;
if (checkInterval > 0) {
setInterval(() => this.fetchConfig(), checkInterval);
}
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -39,6 +39,10 @@ export default {
};
},
created: function () {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchConfig;
// Initial data fetch
this.fetchConfig();
},
methods: {

View File

@@ -82,10 +82,18 @@ export default {
},
created() {
this.display = this.item.display == "bar" ? this.item.display : "text";
this.fetchPrinterStatus();
this.fetchStatus();
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchAll;
// Initial data fetch
this.fetchAll();
},
methods: {
fetchAll: async function () {
this.fetchPrinterStatus();
this.fetchStatus();
},
fetchStatus: async function () {
try {
const response = await this.fetch(`api/job?apikey=${this.item.apikey}`);

View File

@@ -63,6 +63,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -82,6 +82,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
this.fetchVersion();
},

View File

@@ -59,6 +59,10 @@ export default {
},
},
created() {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -101,6 +101,11 @@ export default {
}),
created() {
if (this.item.hide) this.hide = this.item.hide;
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -46,6 +46,10 @@ export default {
};
},
created: function () {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchConfig;
// Initial data fetch
this.fetchConfig();
},
methods: {

View File

@@ -18,7 +18,8 @@
</p>
</template>
<template #indicator>
<span v-if="!error" class="count">{{ count || 0 }}
<span v-if="!error" class="count"
>{{ count || 0 }}
<template v-if="(count || 0) === 1">torrent</template>
<template v-else>torrents</template>
</span>

View File

@@ -110,6 +110,11 @@ export default {
created() {
/* eslint-disable */
this.item.url = `${this.item.url}/status/${this.dashboard}`;
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchStatus;
// Initial data fetch
this.fetchStatus();
},
methods: {

View File

@@ -37,6 +37,10 @@ export default {
};
},
created: function () {
// Set up auto-update method for the scheduler
this.autoUpdateMethod = this.fetchConfig;
// Initial data fetch
this.fetchConfig();
},
methods: {