Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SecondaryLink Service #798

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions docs/customservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,21 @@ If you experiencing any issue, please have a look to the [troubleshooting](troub
type: "<type>"
```

## SecondaryLink

The SecondaryLink service allows generic cards to have a second link added to them in the format of an icon.

The following configuration is available for the SecondaryLink service:

```yaml
- type: "SecondaryLink"
SecondaryLinkUrl: "https://my-second-link" # url for the second link
SecondaryLinkTarget: "_blank" # optional html tag target attribute.
SecondaryLinkHover: "More Info" # optional text to show when the second link is hovered over.
SecondaryLinkIcon: "fas fa-circle-info" # icon to use as the visual indicator of the link
```
Like the rest of Homer, FontAwesome icons can be used for the SecondaryLinkIcon.

## PiHole

Using the PiHole service you can display info about your local PiHole instance right on your Homer dashboard.
Expand Down
32 changes: 32 additions & 0 deletions src/components/services/SecondaryLink.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<template>
<Generic :item="item">
<template #indicator>
<div class="status">
<a :href="item.SecondaryLinkUrl" :target="item.SecondaryLinkTarget" :title="item.SecondaryLinkHover" rel="noreferrer">
<i
class="fa-xl" :class="item.SecondaryLinkIcon"
></i>
</a>
</div>
</template>
</Generic>
</template>

<script>
import service from "@/mixins/service.js";
import Generic from "./Generic.vue";

export default {
name: "SecondaryLink",
mixins: [service],
props: {
item: Object,
},
components: {
Generic,
},
data: () => ({
animate: false,
}),
};
</script>