{% extends "base.html" %}

{% block extra_css %}
    <link href="/static/css/xterm.min.css" rel="stylesheet" type="text/css"/>
    <link href="/static/css/fullscreen.min.css" rel="stylesheet" type="text/css"/>
{% endblock %}

{% block body %}
    <div id="waiter" style="display: none"> Connecting ... </div>

    <div class="container form-container" style="display: none">
      <form id="connect" action="" method="post" enctype="multipart/form-data">
        <div class="row">
          <div class="col-sm-6">
            <label for="username">Username</label>
            <input class="form-control" type="text" id="username" name="username" value="{{ username }}" required>
          </div>
          <div class="col-sm-6">
            <label for="password">Password</label>
            <input class="form-control" type="password" id="password" name="password" value="">
          </div>
        </div>
        <input type="hidden" name="port" value="{{ port }}">
        <input type="hidden" name="hostname" value="{{ hostname }}">
        <input type="hidden" id="term" name="term" value="xterm-256color">
        {% csrf_token %}
        <button type="submit" class="btn btn-primary">Connect</button>
        <button type="reset" class="btn btn-danger">Reset</button>
        <a href="{% url 'account_signup' %}" class="btn btn-secondary">Sign Up</a>
      </form>
    </div>

    <div class="container">
      <div id="status" style="color: red;"></div>
      <div id="terminal"></div>
    </div>
{% endblock %}

{% block extra_js %}
    <script src="/static/js/xterm.min.js"></script>
    <script src="/static/js/xterm-addon-fit.min.js"></script>
    <script src="/static/js/main.js"></script>
{% endblock %}
