blob: 11de22b4704c13417c7532385acec8153a71d91a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="3600">
<style>
html, body, iframe { margin: 0; padding: 0; border: none; width: 100%; height: 100%; }
</style>
</head>
<body>
<script>
var urls = [];
var CycleSeconds = 30;
var request = new XMLHttpRequest();
request.open('GET', '/data/manifest.json', true);
request.send(null);
request.onreadystatechange = function () {
if (request.readyState != XMLHttpRequest.DONE)
return;
if (request.status !== 200) {
alert('Failed with status: ' + request.status);
return;
}
var manifest = JSON.parse(request.responseText);
var dashboards = [];
for (var dashboardName in manifest.dashboards)
dashboards.push(dashboardName);
for (var dashboardName of dashboards)
urls.push('/v3/#/dashboard/' + dashboardName);
loadURLAt(0);
}
var oldIframe = null;
function loadURLAt(i) {
var newIframe = document.createElement('iframe');
document.body.appendChild(newIframe);
newIframe.src = urls[i];
newIframe.onload = showNewFrame.bind(window, i, newIframe);
}
function showNewFrame(i, iframe) {
if (oldIframe)
document.body.removeChild(oldIframe);
oldIframe = iframe;
i = (i + 1) % urls.length;
setTimeout(loadURLAt.bind(window, i), CycleSeconds * 1000);
}
</script>
</body>
</html>