aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/configuration.md2
-rw-r--r--docs/customservices.md24
-rw-r--r--public/assets/config.yml.dist2
-rw-r--r--public/assets/config.yml.dist.sample-sui2
-rw-r--r--src/components/services/Emby.vue118
-rw-r--r--src/components/services/Portainer.vue4
-rw-r--r--yarn.lock6
7 files changed, 150 insertions, 8 deletions
diff --git a/docs/configuration.md b/docs/configuration.md
index 2083be3..84a7ea7 100644
--- a/docs/configuration.md
+++ b/docs/configuration.md
@@ -5,7 +5,7 @@ Title, icons, links, colors, and services can be configured in the `config.yml`
5```yaml 5```yaml
6--- 6---
7# Homepage configuration 7# Homepage configuration
8# See https://fontawesome.com/icons for icons options 8# See https://fontawesome.com/v5/search for icons options
9 9
10# Optional: Use external configuration file. 10# Optional: Use external configuration file.
11# Using this will ignore remaining config in this file 11# Using this will ignore remaining config in this file
diff --git a/docs/customservices.md b/docs/customservices.md
index 2e65f19..d9aa43f 100644
--- a/docs/customservices.md
+++ b/docs/customservices.md
@@ -6,7 +6,16 @@ apikey included in the configuration file is exposed to anyone who can access th
6if your homer instance is secured behind some form of authentication or access restriction. 6if your homer instance is secured behind some form of authentication or access restriction.
7 7
8Available services are in `src/components/`. Here is an overview of all custom services that are available 8Available services are in `src/components/`. Here is an overview of all custom services that are available
9within Homer. 9within Homer:
10+ [PiHole](#pihole)
11+ [OpenWeatherMap](#openweathermap)
12+ [Medusa](#medusa)
13+ [Lidarr, Prowlarr, Sonarr and Radarr](#lidarr-prowlarr-sonarr-and-radarr)
14+ [PaperlessNG](#paperlessng)
15+ [Ping](#ping)
16+ [Prometheus](#prometheus)
17+ [Portainer](#portainer)
18+ [Emby](#emby)
10 19
11If you experiencing any issue, please have a look to the [troubleshooting](troubleshooting.md) page. 20If you experiencing any issue, please have a look to the [troubleshooting](troubleshooting.md) page.
12 21
@@ -145,3 +154,16 @@ See https://docs.portainer.io/v/ce-2.11/user/account-settings#access-tokens
145 # - "raspberry" 154 # - "raspberry"
146 # - "local" 155 # - "local"
147``` 156```
157
158## Emby
159
160You need to set the type to Emby, provide an api key and choose which stats to show if the subtitle is disabled.
161
162```yaml
163- name: "Emby"
164 logo: "assets/tools/sample.png"
165 url: "http://192.168.0.151/"
166 type: "Emby"
167 apikey: "MY-SUPER-SECRET-API-KEY"
168 libraryType: "music" #Choose which stats to show. Can be one of: music, series or movies.
169```
diff --git a/public/assets/config.yml.dist b/public/assets/config.yml.dist
index 63d022a..03a8682 100644
--- a/public/assets/config.yml.dist
+++ b/public/assets/config.yml.dist
@@ -1,6 +1,6 @@
1--- 1---
2# Homepage configuration 2# Homepage configuration
3# See https://fontawesome.com/icons for icons options 3# See https://fontawesome.com/v5/search for icons options
4 4
5title: "Demo dashboard" 5title: "Demo dashboard"
6subtitle: "Homer" 6subtitle: "Homer"
diff --git a/public/assets/config.yml.dist.sample-sui b/public/assets/config.yml.dist.sample-sui
index ff7f80a..4ebf4a4 100644
--- a/public/assets/config.yml.dist.sample-sui
+++ b/public/assets/config.yml.dist.sample-sui
@@ -1,6 +1,6 @@
1--- 1---
2# Homepage configuration 2# Homepage configuration
3# See https://fontawesome.com/icons for icons options 3# See https://fontawesome.com/v5/search for icons options
4 4
5title: "Hello beautiful!" 5title: "Hello beautiful!"
6subtitle: "App dashboard" 6subtitle: "App dashboard"
diff --git a/src/components/services/Emby.vue b/src/components/services/Emby.vue
new file mode 100644
index 0000000..25a2612
--- /dev/null
+++ b/src/components/services/Emby.vue
@@ -0,0 +1,118 @@
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>
10 {{ embyCount }}
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>
23import service from "@/mixins/service.js";
24import Generic from "./Generic.vue";
25
26export default {
27 name: "Emby",
28 mixins: [service],
29 props: {
30 item: Object,
31 },
32 components: {
33 Generic,
34 },
35 data: () => ({
36 status: "",
37 albumCount: 0,
38 songCount: 0,
39 movieCount: 0,
40 seriesCount: 0,
41 episodeCount: 0,
42 }),
43 computed: {
44 embyCount: function () {
45 if (this.item.libraryType === "music")
46 return `${this.songCount} songs, ${this.albumCount} albums`;
47 else if (this.item.libraryType === "movies")
48 return `${this.movieCount} movies`;
49 else if (this.item.libraryType === "series")
50 return `${this.episodeCount} eps, ${this.seriesCount} series`;
51 else return `wrong library type 💀`;
52 },
53 },
54 created() {
55 this.fetchServerStatus();
56
57 if (!this.item.subtitle && this.status !== "dead")
58 this.fetchServerMediaStats();
59 },
60 methods: {
61 fetchServerStatus: async function () {
62 this.fetch("/System/info/public")
63 .then((response) => {
64 if (response.Id) this.status = "running";
65 else throw new Error();
66 })
67 .catch((e) => {
68 console.log(e);
69 this.status = "dead";
70 });
71 },
72 fetchServerMediaStats: async function () {
73 const headers = {
74 "X-Emby-Token": this.item.apikey,
75 };
76
77 var data = await this.fetch("/items/counts", { headers }).catch((e) => {
78 console.log(e);
79 });
80
81 this.albumCount = data.AlbumCount;
82 this.songCount = data.SongCount;
83 this.movieCount = data.MovieCount;
84 this.seriesCount = data.SeriesCount;
85 this.episodeCount = data.EpisodeCount;
86 },
87 },
88};
89</script>
90
91<style scoped lang="scss">
92.status {
93 font-size: 0.8rem;
94 color: var(--text-title);
95
96 &.running:before {
97 background-color: #94e185;
98 border-color: #78d965;
99 box-shadow: 0 0 5px 1px #94e185;
100 }
101
102 &.dead:before {
103 background-color: #c9404d;
104 border-color: #c42c3b;
105 box-shadow: 0 0 5px 1px #c9404d;
106 }
107
108 &:before {
109 content: " ";
110 display: inline-block;
111 width: 7px;
112 height: 7px;
113 margin-right: 10px;
114 border: 1px solid #000;
115 border-radius: 7px;
116 }
117}
118</style>
diff --git a/src/components/services/Portainer.vue b/src/components/services/Portainer.vue
index 2e0d1e2..d101ecc 100644
--- a/src/components/services/Portainer.vue
+++ b/src/components/services/Portainer.vue
@@ -96,7 +96,9 @@ export default {
96 } 96 }
97 ); 97 );
98 98
99 containers = containers.concat(endpointContainers); 99 if (endpointContainers) {
100 containers = containers.concat(endpointContainers);
101 }
100 } 102 }
101 103
102 this.containers = containers; 104 this.containers = containers;
diff --git a/yarn.lock b/yarn.lock
index a5e1e00..8139450 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5590,9 +5590,9 @@ minimatch@^3.0.4:
5590 brace-expansion "^1.1.7" 5590 brace-expansion "^1.1.7"
5591 5591
5592minimist@^1.2.0, minimist@^1.2.5: 5592minimist@^1.2.0, minimist@^1.2.5:
5593 version "1.2.5" 5593 version "1.2.6"
5594 resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" 5594 resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44"
5595 integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== 5595 integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==
5596 5596
5597minipass@^3.1.1: 5597minipass@^3.1.1:
5598 version "3.1.3" 5598 version "3.1.3"