
{% extends "layout.html" %}
{% block content %}
<script type="text/javascript">
    $(function() {
    });
</script>
{% if data['test_instance_list']|count %}
    {% for test_instance in data['test_instance_list'] %}
        <button name="stopWebsocket" class="btn btn-default" onclick="Sijax.request('stop_websocket');">Stop websocket</button>
        <div class="panel panel-default">
            <div class="panel-body">
                <span>{{ test_instance.name }}</span>
                {% if test_instance.public_ip %}
                    <a href="{{ url_for('testbatch.vnc', host = test_instance.public_ip) }}">Vnc</a>
                    <button {% if websocket_alive %}disabled=true {% endif %}name="startWebsocket" class="btn btn-default" onclick="Sijax.request('start_websocket', [host = '{{test_instance.public_ip}}']);">Start websocket</button>
                {% else %}
                    <h3> This instance have not vnc session available </h3>
                {% endif %}
            </div>
        </div>
    {% endfor %}
{% else %}
    <div class="text-center">
        <h1>There is no test instance alive!</h1>
    </div>
{% endif %}
{% endblock %}
