pull/946/merge
thibaut1304 2025-07-23 20:40:26 +02:00 committed by GitHub
commit 9b418cf89c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 122 additions and 0 deletions

View File

@ -56,6 +56,7 @@ within Homer:
- [Uptime Kuma](#uptime-kuma) - [Uptime Kuma](#uptime-kuma)
- [Vaultwarden](#vaultwarden) - [Vaultwarden](#vaultwarden)
- [Wallabag](#wallabag) - [Wallabag](#wallabag)
- [Wg-easy](#wg-easy)
- [What's Up Docker](#whats-up-docker) - [What's Up Docker](#whats-up-docker)
> [!IMPORTANT] > [!IMPORTANT]
@ -762,6 +763,20 @@ This service displays a version string instead of a subtitle. Example configurat
url: https://wallabag.example.com url: https://wallabag.example.com
``` ```
## Wg-easy
This service displays a version string instead of a subtitle.
If a new version is available, it will also be shown alongside the current one. Except on small screens.
The indicator shows if Wg-easy is online, offline. Example configuration:
```yaml
- name: "Wireguard"
type: Wg-easy
logo: assets/tools/sample.png
url: http://wg-easy.example.com
basic_auth: "admin:password"
```
## What's up Docker ## What's up Docker
What's up Docker allow to display info about the number of container running and the number for which an update is available on your Homer dashboard. What's up Docker allow to display info about the number of container running and the number for which an update is available on your Homer dashboard.

View File

@ -0,0 +1,107 @@
<template>
<Generic :item="item">
<template #content>
<p class="title is-4">{{ item.name }}</p>
<p class="subtitle is-6">
<template v-if="item.subtitle">
{{ item.subtitle }}
</template>
<template v-else-if="versionstring">
Version {{ versionstring }}
<span v-if="updateAvailable && !this.showUpdateAvailable"> </span>
<span v-if="updateAvailable && !this.showUpdateAvailable" :class="{ 'is-active': showMenu }" style="color: orange; font-weight: 500;">
Update available {{ latestVersion }}
</span>
</template>
</p>
</template>
<template #indicator>
<div v-if="status" class="status" :class="status">
{{ status }}
</div>
</template>
</Generic>
</template>
<script>
import service from "@/mixins/service.js";
export default {
name: "Wg-easy",
mixins: [service],
props: {
item: Object,
},
data: () => ({
fetchOk: null,
versionstring: null,
latestVersion: null,
updateAvailable: false,
}),
computed: {
status: function () {
return this.fetchOk ? "online" : "offline";
},
showUpdateAvailable: function () {
return this.isSmallScreenMethod();
},
},
created() {
this.fetchStatus();
},
methods: {
isSmallScreenMethod: function () {
return window.matchMedia("screen and (max-width: 1023px)").matches;
},
fetchStatus: async function () {
let headers = {};
if (this.item.basic_auth) {
const encodedCredentials = btoa(this.item.basic_auth);
headers["Authorization"] = `Basic ${encodedCredentials}`;
}
try {
const response = await this.fetch("/api/information", { headers });
this.fetchOk = true;
this.versionstring = response.currentRelease || "unknown";
this.updateAvailable = response.updateAvailable;
this.latestVersion = response.latestRelease?.version || null;
} catch (e) {
this.fetchOk = false;
console.log(e);
}
},
},
};
</script>
<style scoped lang="scss">
.status {
font-size: 0.8rem;
color: var(--text-title);
white-space: nowrap;
margin-left: 0.25rem;
&.online:before {
background-color: #94e185;
border-color: #78d965;
box-shadow: 0 0 5px 1px #94e185;
}
&.offline:before {
background-color: #c9404d;
border-color: #c42c3b;
box-shadow: 0 0 5px 1px #c9404d;
}
&:before {
content: " ";
display: inline-block;
width: 7px;
height: 7px;
margin-right: 10px;
border: 1px solid #000;
border-radius: 7px;
}
}
</style>