mirror of
https://github.com/bastienwirtz/homer.git
synced 2026-05-06 19:06:09 +02:00
migrate all service to glabal updater
This commit is contained in:
@@ -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: {
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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}`);
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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: {
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user