Skip to content

Instantly share code, notes, and snippets.

@JanKoppe
Created May 5, 2017 19:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanKoppe/e3366de19fdbc39b51c8c6ef5317c3c4 to your computer and use it in GitHub Desktop.
Save JanKoppe/e3366de19fdbc39b51c8c6ef5317c3c4 to your computer and use it in GitHub Desktop.
Grafana Cat Panel

Grafana Cat Panel

Recent studies have shown that a steady flow of cute kitten pictures can increase work productivity by up to 100% and boost general morale. Therefore every dashboard should provide a cat panel.

Paste this code in a "Text" Panel with html mode and enjoy.

<div id="cat-anchor"></div>
<script>
var catAnchor = document.getElementById("cat-anchor");
/* this is ugly, but gets a reference to the .panel-container parent element */
var panelContainer = catAnchor.parentNode.parentNode.parentNode.parentNode;
panelContainer.style.backgroundRepeat = "no-repeat";
panelContainer.style.backgroundPosition = "center center";
panelContainer.style.backgroundSize = "cover";
function neuekatze() {
panelContainer.style.backgroundImage = "url('https://thecatapi.com/api/images/get?format=src&type=jpg&size=small&rand=" + new Date().getTime() + "')";
}
neuekatze();
setInterval(neuekatze, 5000);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment