{% load i18n %}
{% load static %}

{% if not perms.vm.access_console %}
  <div class="alert alert-warning">
    {% trans "You are not authorized to access the VNC console." %}
  </div>
{% endif %}
<div class="row">
  <div class="col-xs-7">
    <div class="btn-toolbar">
    {% if perms.vm.access_console %}
      <button id="sendCtrlAltButton" class="btn btn-danger btn-sm">
        {% trans "Send" %}
      </button>
      <select id="chooseCtrlAlt" class="btn btn-danger btn-sm" >  
        <option value="0">Ctrl+Alt+Delete</option>  
        <option value="1">Ctrl+Alt+F1</option>  
        <option value="2">Ctrl+Alt+F2</option>  
        <option value="3">Ctrl+Alt+F3</option>  
        <option value="4">Ctrl+Alt+F4</option>  
        <option value="5">Ctrl+Alt+F5</option>  
        <option value="6">Ctrl+Alt+F6</option>  
        <option value="7">Ctrl+Alt+F7</option>  
        <option value="8">Ctrl+Alt+F8</option>  
        <option value="9">Ctrl+Alt+F9</option>  
        <option value="10">Ctrl+Alt+F10</option>  
        <option value="11">Ctrl+Alt+F11</option>  
        <option value="12">Ctrl+Alt+F12</option>  
      </select>  
      <button id="sendPasswordButton" class="btn btn-default btn-sm">
        {% trans "Type password" %}
      </button>
   {% endif %}
    </div>
  </div>
  <div class="col-xs-5 text-right">
    <button id="getScreenshotButton" class="btn btn-info btn-sm" data-vm-pk="{{ instance.pk }}">
      <i class="fa fa-photo"></i> {% trans "Screenshot" %}
    </button>
  </div>
</div>


{% if perms.vm.access_console %}
  <div class="alert alert-info" id="noVNC_status"></div>
{% endif %}

<div id="vm-console-screenshot">
  <h3>
    <button class="btn btn-danger btn-sm pull-right">{% trans "Close" %}</button>
    {% trans "Screenshot" %}
  </h3>
  <img alt="{% trans "Screenshot" %}"/>
  <hr />
</div>

{% if perms.vm.access_console %}
<canvas id="noVNC_canvas" width="640" height="20">Canvas not supported.
</canvas>

<script>
  var INCLUDE_URI = '{% static "no-vnc/include/" %}';
  var VNC_URL = "{{ vnc_url }}";
</script>
{% endif %}
