Automatic Update Picture in Text panel

Dear all,

i try to add a refreshing picture link to the text panel.

For example like this:

<img src="https://www.augsburg.de/fileadmin/user_upload/header/webcam/webcamerker/B_Rathaus_und_Perlachturm_00.jpg" id="imageToUpdate" />
<script language="javascript">
function updateImage() {
   image = document.getElementById("imageToUpdate");
   image.src = "https://www.augsburg.de/fileadmin/user_upload/header/webcam/webcamerker/B_Rathaus_und_Perlachturm_00.jpg" + "?r=" + Math.random();
   setTimeout(updateImage, 2000);
   console.log("Refreshing");
}
updateImage();
</script>

Unfortunately it does not work. I see the picture and the code below of the picture.

Thank you very much in advance.

you could try the dynamic text panel:

try enabling sanitize_html in your grafana ini

1 Like

Thank you all for your answers.

I changed it to:

;disable_sanitize_html = true

And restart Grafana

But unfortunately i have the same problem. I see the pic and below of the pic i see the “<script…” part :frowning:

take out the semi colon otherwise its still commented out:

disable_sanitize_html = true

1 Like

Thank you for your help. I did it now like this and restartet Grafana service

disable_sanitize_html = true

Unfortunately still does not work :frowning:

EDIT:
Restart of the server and all works fine. Thank you very much :slight_smile:

1 Like

Just one question.
When i want to add a panel with another Picture Link from a cam only one panel will be updates with the new pics. The other shows always the old picture. What i have to change if i want to have multiple panels working with this?
Thank you very much. :slight_smile:

Hey all. Unfotunately i did not found out how multiple panels working with this. Maybe someone have an idea? Thank you very much.