Merge remote-tracking branch 'upstream/main' into mealie-service

This commit is contained in:
Andreas Waschinski 2021-07-28 16:13:50 +02:00
commit b2062fb60a
9 changed files with 2072 additions and 2055 deletions

View File

@ -43,8 +43,8 @@
- [Features](#features) - [Features](#features)
- [Getting started](#getting-started) - [Getting started](#getting-started)
- [Configuration](docs/configuration.md) - [Configuration](docs/configuration.md)
- [Custom services](docs/customservices.md)
- [Tips & tricks](docs/tips-and-tricks.md) - [Tips & tricks](docs/tips-and-tricks.md)
- [Roadmap](#roadmap)
- [Development](docs/development.md) - [Development](docs/development.md)
@ -134,9 +134,3 @@ npm run build
``` ```
Then your dashboard is ready to use in the `/dist` directory. Then your dashboard is ready to use in the `/dist` directory.
## Roadmap
- [ ] Add new themes.
- [ ] Add support for custom service card (add custom feature to some service / app link)

View File

@ -1,6 +1,8 @@
# Custom Services # Custom Services
Here is an overview of all custom services that are available within Homer. Some service can use a specific a component that provides some extra features by adding a `type` key to the service yaml
configuration. Available services are in `src/components/`. Here is an overview of all custom services that are available
within Homer.
## PiHole ## PiHole
@ -39,3 +41,13 @@ apikey: "01234deb70424befb1f4ef6a23456789"
``` ```
The url must be the root url of Radarr/Sonarr application. The url must be the root url of Radarr/Sonarr application.
The Radarr/Sonarr API key can be found in Settings > General. It is needed to access the API. The Radarr/Sonarr API key can be found in Settings > General. It is needed to access the API.
## PaperlessNG
For Paperless you need an API-Key which you have to store at the item in the field `apikey`.
## Ping
For Paperless you need an API-Key which you have to store at the item in the field `apikey`.

View File

@ -1,6 +1,6 @@
{ {
"name": "homer", "name": "homer",
"version": "21.03.2", "version": "21.07.1",
"license": "Apache-2.0", "license": "Apache-2.0",
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
@ -9,12 +9,12 @@
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-free": "^5.15.3", "@fortawesome/fontawesome-free": "^5.15.3",
"bulma": "^0.9.2", "bulma": "^0.9.3",
"core-js": "^3.10.1", "core-js": "^3.15.2",
"js-yaml": "^4.0.0", "js-yaml": "^4.1.0",
"lodash.merge": "^4.6.2", "lodash.merge": "^4.6.2",
"register-service-worker": "^1.7.2", "register-service-worker": "^1.7.2",
"vue": "^2.6.12" "vue": "^2.6.14"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "~4.5.0", "@vue/cli-plugin-babel": "~4.5.0",

View File

@ -37,8 +37,8 @@ export default {
method: "HEAD", method: "HEAD",
cache: "no-store", cache: "no-store",
}) })
.then(function () { .then(function (response) {
that.offline = false; that.offline = !response.ok;
}) })
.catch(function () { .catch(function () {
that.offline = true; that.offline = true;

View File

@ -51,9 +51,9 @@ export default {
}, },
methods: { methods: {
fetchStatus: async function () { fetchStatus: async function () {
this.status = await fetch( this.status = await fetch(`${this.item.url}/control/status`).then(
`${this.item.url}/control/status` (response) => response.json()
).then((response) => response.json()); );
}, },
}, },
}; };

View File

@ -52,20 +52,22 @@ export default {
if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing if (this.item.subtitle != null) return; // omitting unnecessary ajax call as the subtitle is showing
var apikey = this.item.apikey; var apikey = this.item.apikey;
if (!apikey) { if (!apikey) {
console.error("apikey is not present in config.yml for the paperless entry!"); console.error(
"apikey is not present in config.yml for the paperless entry!"
);
return; return;
} }
const url = `${this.item.url}/api/documents/`; const url = `${this.item.url}/api/documents/`;
this.api = await fetch(url, { this.api = await fetch(url, {
headers: { headers: {
"Authorization": "Token " + this.item.apikey Authorization: "Token " + this.item.apikey,
} },
}) })
.then(function(response) { .then(function (response) {
if (!response.ok) { if (!response.ok) {
throw new Error("Not 2xx response") throw new Error("Not 2xx response");
} else { } else {
return response.json() return response.json();
} }
}) })
.catch((e) => console.log(e)); .catch((e) => console.log(e));

View File

@ -83,13 +83,13 @@ export default {
&.enabled:before { &.enabled:before {
background-color: #94e185; background-color: #94e185;
border-color: #78d965; border-color: #78d965;
box-shadow: 0 0 4px 1px #94e185; box-shadow: 0 0 5px 1px #94e185;
} }
&.disabled:before { &.disabled:before {
background-color: #c9404d; background-color: #c9404d;
border-color: #c42c3b; border-color: #c42c3b;
box-shadow: 0 0 4px 1px #c9404d; box-shadow: 0 0 5px 1px #c9404d;
} }
&:before { &:before {

View File

@ -22,8 +22,8 @@
</template> </template>
</p> </p>
</div> </div>
<div v-if="api" class="status" :class="api.status"> <div v-if="status" class="status" :class="status">
{{ api.status }} {{ status }}
</div> </div>
</div> </div>
<div class="tag" :class="item.tagstyle" v-if="item.tag"> <div class="tag" :class="item.tagstyle" v-if="item.tag">
@ -42,9 +42,7 @@ export default {
item: Object, item: Object,
}, },
data: () => ({ data: () => ({
api: { status: null,
status: "",
},
}), }),
created() { created() {
this.fetchStatus(); this.fetchStatus();
@ -52,9 +50,16 @@ export default {
methods: { methods: {
fetchStatus: async function () { fetchStatus: async function () {
const url = `${this.item.url}`; const url = `${this.item.url}`;
this.api.status = await fetch(url) fetch(url, { method: "HEAD", cache: "no-cache" })
.then((response) => "enabled") .then((response) => {
.catch((e) => "disabled"); if (!response.ok) {
throw Error(response.statusText);
}
this.status = "online";
})
.catch(() => {
this.status = "offline";
});
}, },
}, },
}; };
@ -68,16 +73,16 @@ export default {
font-size: 0.8rem; font-size: 0.8rem;
color: var(--text-title); color: var(--text-title);
&.enabled:before { &.online:before {
background-color: #94e185; background-color: #94e185;
border-color: #78d965; border-color: #78d965;
box-shadow: 0 0 4px 1px #94e185; box-shadow: 0 0 5px 1px #94e185;
} }
&.disabled:before { &.offline:before {
background-color: #c9404d; background-color: #c9404d;
border-color: #c42c3b; border-color: #c42c3b;
box-shadow: 0 0 4px 1px #c9404d; box-shadow: 0 0 5px 1px #c9404d;
} }
&:before { &:before {

4034
yarn.lock

File diff suppressed because it is too large Load Diff