summaryrefslogtreecommitdiff
path: root/django-nova/src/django_nova/templates/django_nova/keypairs/index.html
blob: 2233f48130909e14210e952c625111314e094b45 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{% extends "django_nova/keypairs/base.html" %}

{% block title %} - Cloud Computing{% endblock %}

{% block headerjs %}
{{ block.super }}
<script type="text/javascript" src="/media/dashboard/js/jquery.form.js"></script>
{% endblock %}

{% block content %}
  <div id="page_head">
    <h2 id="page_heading">Keys</h2>
    <p id="page_description">Key pairs are ssh credentials which are injected into images when they are launched. Creating a new key pair registers the public key and downloads the private key (a pem file). <em>Protect and use the key as a normal private key.</em></p>
  </div>

  {% include "django_nova/_messages.html" %}

  <div id="instances">
  {% include "django_nova/keypairs/_list.html" %}
  </div>

  <div class="dash_block first">
    <form id="frm_key_create" action="{% url nova_keypairs_add project.projectname %}" method="post">
      {% csrf_token %}
      <input id="js" name="js" type="hidden" value="0" />
      <fieldset>
        <h3>Create New Keypair</h3>
        {% include "django_nova/keypairs/_create_form.html" %}
        <input id="keypair_create" class="create" type="submit" value="Create" />
      </fieldset>
    </form>
  </div>

  <div id="dlg_confirm" title="Confirm Termination">
    <p>Are you sure you wish to delete key <span id="spn_delete_key_name"></span>?</p>
  </div>
{% endblock %}

{% block footerjs %}
{{ block.super }}
<script type="text/javascript">
  $(function() { $('#js').val('1'); });

  {% if download_key %}
  $(function() { window.location = '{% url nova_keypairs_download project.projectname download_key %}'; });
  {% endif %}

  $(function() {
    $('.form-key-delete').submit(function() {
      _key_name = $(this).children(':first').val()
      $('#spn_delete_key_name').text(_key_name);
      $('#dlg_confirm').dialog('open');
      return false;
    });

    $('#dlg_confirm').dialog({
      buttons: {
       'Ok': onConfirmOK,
       'Cancel': function() { $(this).dialog('close'); }
      },
        autoOpen: false,
        resizable: false,
        width: 500,
        height: 200
      });

  });

  var _terminateID = null;

  function onConfirmOK() {
    $(this).dialog('close');
    form = document.getElementById('form_key_delete_' + _key_name);
    if(form) form.submit();
  }
</script>
{% endblock %}