-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[FEATURE_REQUEST] Widget for displaying locally stored images #487
Comments
Heya @RK62, - type: embed
options:
html: '<img src="https://dashy.lan/item-icons/my-image.png" />' Hope that helps :) |
We could add a dedicated widget just for displaying images, it would be really easy to do by extending from the For example, in a new file, <template>
<div class="image-widget">
<img :src="imagePath" class="embedded-image" />
</div>
</template>
<script>
import WidgetMixin from '@/mixins/WidgetMixin';
export default {
mixins: [WidgetMixin],
computed: {
imagePath() {
if (!this.options.imagePath) this.error('You must specify an imagePath');
return this.options.imagePath;
},
},
};
</script>
<style scoped lang="scss">
.image-widget {
img.embedded-image {
max-width: 100%;
margin: 0.2rem auto;
}
}
</style> Then just import that file in You can then use the widget like normal, e.g: - type: image
options:
imagePath: https://i.ibb.co/yhbt6CY/dashy.png |
This issue has been marked as a good first issue for first-time contributors to implement! This is a great way to support the project, while also improving your skills, you'll also be credited as a contributor once your PR is merged. If you're new to web development, here are a collection of resources to help you get started. You can also find step-by-step tutorials for common tasks within Dashy, on the Dev Guides page. If you need any support at all, feel free to reach out via GitHub Discussions.
|
Thanks a lot, this works great!
in Dashy to show it.
|
Is your feature request related to a problem? If so, please describe.
I would like to include images on my dashboard.
This can be rendered Grafana graphics or just pictures from my last vacation.
Describe the solution you'd like
The widget should display an image from the local /app/public/item-icons directory. Maybe it would be better to provide a separate directory for this. It would be great to be able to select a single image or play random images from a directory.
Thanks a lot for DASHY! I use it every day and find it really cool.
Priority
Low (Nice-to-have)
Is this something you would be keen to implement
No response
The text was updated successfully, but these errors were encountered: