{% load i18n %}
{% load staticfiles %}

{% 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="sendCtrlAltDelButton" class="btn btn-danger btn-sm">
        {% trans "Send Ctrl+Alt+Del" %}
      </button>
      <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 %}
