Skip to content

Commit e5bd328

Browse files
thibaut1304bastienwirtz
authored andcommitted
add service vaultwarden, view status and version
1 parent 2a29000 commit e5bd328

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

docs/customservices.md

+12
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ within Homer:
5050
- [Tdarr](#tdarr)
5151
- [Traefik](#traefik)
5252
- [Uptime Kuma](#uptime-kuma)
53+
- [Vaultwarden](#vaultwarden)
5354
- [Wallabag](#wallabag)
5455
- [What's Up Docker](#whats-up-docker)
5556

@@ -670,6 +671,17 @@ The following configuration is available for the UptimeKuma service. Needs v1.13
670671
slug: "myCustomDashboard" # Defaults to "default" if not provided.
671672
type: "UptimeKuma"
672673
```
674+
## Vaultwarden
675+
676+
This service displays a version string instead of a subtitle. The indicator
677+
shows if Vaultwarden is online, offline
678+
679+
```yaml
680+
- name: "Vaultwarden - Server"
681+
type: "Vaultwarden"
682+
logo: "assets/tools/sample.png"
683+
url: "http://vaultwarden.example.com"
684+
```
673685

674686
## Wallabag
675687

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<template>
2+
<Generic :item="item">
3+
<template #content>
4+
<p class="title is-4">{{ item.name }}</p>
5+
<p class="subtitle is-6">
6+
<template v-if="item.subtitle">
7+
{{ item.subtitle }}
8+
</template>
9+
<template v-else-if="versionstring">
10+
Version {{ versionstring }}
11+
</template>
12+
</p>
13+
</template>
14+
<template #indicator>
15+
<div v-if="status" class="status" :class="status">
16+
{{ status }}
17+
</div>
18+
</template>
19+
</Generic>
20+
</template>
21+
22+
<script>
23+
import service from "@/mixins/service.js";
24+
import Generic from "./Generic.vue";
25+
26+
export default {
27+
name: "Vaultwarden",
28+
components: {
29+
Generic,
30+
},
31+
mixins: [service],
32+
props: {
33+
item: Object,
34+
},
35+
data: () => ({
36+
fetchOk: null,
37+
versionstring: null,
38+
}),
39+
computed: {
40+
status: function () {
41+
return this.fetchOk ? "online" : "offline";
42+
},
43+
},
44+
created() {
45+
this.fetchStatus();
46+
},
47+
methods: {
48+
fetchStatus: async function () {
49+
this.fetch("api/version")
50+
.then((response) => {
51+
this.fetchOk = true;
52+
this.versionstring = response;
53+
})
54+
.catch((e) => {
55+
this.fetchOk = false;
56+
console.log(e);
57+
});
58+
},
59+
},
60+
};
61+
</script>
62+
63+
<style scoped lang="scss">
64+
.status {
65+
font-size: 0.8rem;
66+
color: var(--text-title);
67+
white-space: nowrap;
68+
margin-left: 0.25rem;
69+
70+
&.online:before {
71+
background-color: #94e185;
72+
border-color: #78d965;
73+
box-shadow: 0 0 5px 1px #94e185;
74+
}
75+
76+
&.offline:before {
77+
background-color: #c9404d;
78+
border-color: #c42c3b;
79+
box-shadow: 0 0 5px 1px #c9404d;
80+
}
81+
82+
&:before {
83+
content: " ";
84+
display: inline-block;
85+
width: 7px;
86+
height: 7px;
87+
margin-right: 10px;
88+
border: 1px solid #000;
89+
border-radius: 7px;
90+
}
91+
}
92+
</style>

0 commit comments

Comments
 (0)