VolkovLabs / business-media

The Business Media panel is a Grafana plugin that renders PNG, JPG, GIF, MP4, WEBM, MP3, OGG, and PDF files encoded in the base64 format and URL.
https://docs.volkovlabs.io
Apache License 2.0
24 stars 3 forks source link

How to display an image or a video #59

Closed Eliot-24 closed 1 year ago

Eliot-24 commented 1 year ago

Hello, I am simply looking to display a JPG image with a link (like: http://192.168.2.100/grafana/image.JPG). I think it's possible but I don't understand how it works and I can't. It's probably not like that but I tried with the Static source with in the img box of the table this: data:192.168.2.100/grafana/image.JPG;base64,XXX or http://192.168.2.100/grafana/image.JPG;base64,XXX Capture d’écran 2022-12-24 135030 I also have an error message in the static plugin. Capture d’écran 2022-12-24 135228

mikhail-vl commented 1 year ago

Hello @Eliot-24, the Base64 panel gets media files from a data source. It does not access files directly using a URL or path.

If you would like to store an image using the Static Data Source, it should be encoded using base64 and then pasted in the field's value as data:image/jpg;base64,YOUR-BASE64-ENCODED-IMAGE.

We explained how to do it in the video: https://youtu.be/QOV8ECOUjWs?t=250. I would recommend watching the whole video to learn more about the Static Data Source.

Regarding the Alerting not supported error, it's expected as it's not a backend plugin and does not support alerting. Let me know if there is anything else.

Eliot-24 commented 1 year ago

Hello, thank you for your answer. However, I watched the video and I still don't understand a few things.

Where should the base64 encode file of an image/video that I want to display be located? Where do you indicate the path of the file so that grafana displays the correct image? (I use grafana in a docker on a synology nas)

Are there detailed instructions somewhere?

mikhail-vl commented 1 year ago

@Eliot-24, We updated documentation based on the recent questions, it outlines how to use data sources and various supported formats: https://volkovlabs.io/plugins/volkovlabs-image-panel/

As explained in the documentation, panels are using data sources to get the data and should not interact with external resources directly. In the documentation, we provided examples of how to use the Static and PostgresSQL data sources.

Let us know if there is anything else.