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 docuseal #851

Merged
merged 2 commits into from
Jan 5, 2025
Merged
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
12 changes: 12 additions & 0 deletions docs/customservices.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ within Homer:
- [Common options](#common-options)
- [AdGuard Home](#adguard-home)
- [CopyToClipboard](#copy-to-clipboard)
- [Docuseal](#docuseal)
- [Emby / Jellyfin](#emby--jellyfin)
- [FreshRSS](#freshrss)
- [Gitea / Forgejo](#gitea--forgejo)
Expand Down Expand Up @@ -100,6 +101,17 @@ Configuration example:
clipboard: "this text will be copied to your clipboard"
```

## Docuseal

This service displays a version string instead of a subtitle. Example configuration:

```yaml
- name: Docuseal
type: Docuseal
logo: assets/tools/sample.png
url: http://docuseal.example.com
```

## Emby / Jellyfin

You need to set the type to Emby, provide an api key and choose which stats to show if the subtitle is disabled.
Expand Down
1 change: 1 addition & 0 deletions dummy-data/docuseal/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.8.3a
87 changes: 87 additions & 0 deletions src/components/services/Docuseal.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<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 }}
</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";
import Generic from "./Generic.vue";

export default {
name: "Docuseal",
components: {
Generic,
},
mixins: [service],
props: {
item: Object,
},
data: () => ({
status: null,
versionstring: null,
}),
created() {
this.fetchStatus();
},
methods: {
fetchStatus: async function () {
this.fetch("/version", null, false)
.then((response) => {
this.status = "online";
this.versionstring = response;
})
.catch((e) => {
this.status = "offline";
meonkeys marked this conversation as resolved.
Show resolved Hide resolved
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>
2 changes: 1 addition & 1 deletion src/mixins/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default {
throw new Error(`Ping: target not available (${response.status} error)`);
}

return json ? response.json() : response;
return json ? response.json() : response.text();
meonkeys marked this conversation as resolved.
Show resolved Hide resolved
});
},
},
Expand Down
Loading