obscreen/views/fleet/studio/fleet-studio.jinja.html
2024-06-21 13:56:19 +02:00

45 lines
1.6 KiB
HTML

<!DOCTYPE html>
<head>
<title>Obscreen - Fleet Studio</title>
<link rel="stylesheet" href="{{ STATIC_PREFIX }}css/compiled/fleet-studio.css" />
</head>
<body>
<ul class="pagetab">
{% for node_studio in node_studios %}
<li class="{% if loop.first %}active{% endif %}">
<a href="javascript:void(0);" class="studio-switch" data-id="{{ node_studio.id }}" onclick="tab('{{ node_studio.id }}')">
{{ node_studio.name }}
</a>
</li>
{% endfor %}
</ul>
<main>
{% for node_studio in node_studios %}
<div class="studio-frame {% if not loop.first %}hidden{% endif %}" data-id="{{ node_studio.id }}">
<iframe src="http://{{ node_studio.host }}:{{ node_studio.port }}/slideshow?fleet_mode=1" frameborder="0" allowtransparency=""></iframe>
</div>
{% endfor %}
</main>
<script type="text/javascript">
const tab = function(id) {
const $switches = document.getElementsByClassName('studio-switch');
const $frames = document.getElementsByClassName('studio-frame');
for (let i = 0; i < $switches.length; i++) {
const $switch = $switches[i];
$switch.parentElement.className = $switch.dataset.id === id ? 'active' : '';
}
for (let j = 0; j < $frames.length; j++) {
const $frame = $frames[j];
$frame.className = $frame.dataset.id === id ? 'studio-frame' : 'studio-frame hidden';
}
document.location.hash = id;
};
var hash = document.location.hash.replace('#', '');
if (hash) {
tab(hash);
}
</script>
</body>
</html>