Commit 338495b1 authored by Leonidas Poulopoulos's avatar Leonidas Poulopoulos
Browse files

Unneeded files' cleanup

parent 94571d8d
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Application submitted" %}{% endblock %}
{% block content %}
<div align="center">
{% if pending %}
<h2>{% trans "Pending applications" %}</h2>
<table>
<tr><th>{% trans "Hostname" %}</th><th>{% trans "User" %}</th><th>{% trans "Memory" %}</th><th>{% trans "vCPUs" %}</th><th>{% trans "Network" %}</th><th>{% trans "Filed" %}</th></tr>
{% for app in pending %}
<tr><td><a href="{% url application-review app.pk %}">{{ app.hostname }}</a></td><td>{{ app.applicant }}</td><td>{{ app.memory }}</td><td>{{ app.vcpus }}</td><td>{{ app.network|default_if_none:"&mdash;" }}</td><td>{{ app.filed|date }}</td></tr>
{% endfor %}
</table>
{% endif %}
<h2>{% trans "Completed applications" %}</h2>
<table>
<tr><th>{% trans "Hostname" %}</th><th>{% trans "User" %}</th><th>{% trans "Memory" %}</th><th>{% trans "vCPUs" %}</th><th>{% trans "Network" %}</th><th>{% trans "Filed" %}</th></tr>
{% for app in completed %}
<tr><td><a href="{% url application-review app.pk %}">{{ app.hostname }}</a></td><td>{{ app.applicant }}</td><td>{{ app.memory }}</td><td>{{ app.vcpus }}</td><td>{{ app.network|default_if_none:"&mdash;" }}</td><td>{{ app.filed|date }}</td></tr>
{% endfor %}
</table>
</div>
{% endblock %}
{% extends "base.html" %}
{% load i18n %}
{% block title %}{% trans "Review application" %} #{{ application.pk }}{% endblock %}
{% block content %}
<style type="text/css">
.comments {
font-style: italic;
max-width: 40em;
}
.notice {
text-align: center;
font-style: italic;
}
#review {
max-width: 50em;
margin-left: auto;
margin-right: auto;
}
</style>
<script>
function set_network(net){
$("#id_network").val(net);
}
</script>
<div align="center" id="review">
<h2>{% trans "Review application" %} #{{ application.pk }} {% trans "by" %} {{ application.applicant }}</h2>
<p>{% trans "Submitted" %} {{ application.filed|date }}</p>
{% if application.is_pending %}
<form method="POST" id="appform">
{% csrf_token %}
<fieldset>
<legend>{% trans "Instance information" %}</legend>
<table>
<tr><th>{{ appform.hostname.label_tag }}</th><td>{{ appform.hostname }}<span class="error">{{ appform.hostname.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.memory.label_tag }}</th><td>{{ appform.memory }}<span class="error">{{ appform.memory.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.vcpus.label_tag }}</th><td>{{ appform.vcpus }}<span class="error">{{ appform.vcpus.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.disk_size.label_tag }}</th><td>{{ appform.disk_size }}<span class="error">{{ appform.disk_size.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.organization.label_tag }}</th><td>{{ appform.organization }}<span class="error">{{ appform.organization.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.hosts_mail_server.label_tag }}</th><td>{{ appform.hosts_mail_server }}<span class="error">{{ appform.hosts_mail_server.errors|join:", " }}</span></td></tr>
<tr><th>{{ appform.operating_system.label_tag }}</th><td>{{ appform.operating_system }}<span class="error">{{ appform.operating_system.errors|join:", " }}</span></td></tr>
</table>
</fieldset>
{% if application.admin_contact_name %}
<fieldset>
<legend>{% trans "Administrative contact" %}</legend>
<table>
<tr><th>{% trans "Name" %}</th><td>{{ application.admin_contact_name }}</td></tr>
<tr><th>{% trans "Email" %}</th><td>{{ application.admin_contact_email }}</td></tr>
<tr><th>{% trans "Phone" %}</th><td>{{ application.admin_contact_phone }}</td></tr>
</table>
</fieldset>
{% endif %}
<fieldset>
<legend>{% trans "Comments" %}</legend>
<div class="comments">
{{ application.comments }}
</div>
</fieldset>
<fieldset>
<legend>{% trans "Placement" %}</legend>
{% if application.network %}
<div class="notice">
{% trans "The user has requested explicit network placement on" %} {{ application.network }} ({{ application.network.cluster.description }})
</div>
{% endif %}
<p>{% trans "Choose either a network, or a cluster from the quick list to use the cluster's default network." %}</p>
<p>{% trans "Network" %}: {{ appform.network }}</p>
{% if appform.network.errors %}
<p class="error">{{ appform.network.errors|join:", " }}</p>
{% endif %}
<p>{% for cl in fast_clusters %}<a href="#" onclick="set_network('{{ cl.get_default_network.pk }}');">{{ cl.description }} ({{ cl.slug }})</a> {% if not forloop.last %}| {% endif %}{% endfor %}</p>
</fieldset>
<fieldset>
<legend>{% trans "Decision" %}</legend>
<p>{% trans "Comments to the user" %}:</p>
{% if appform.admin_comments.errors %}
<p><span class="error">{{ appform.admin_comments.errors }}</span></p>
{% endif %}
<p>{{ appform.admin_comments }}</p>
<p><input type="submit" value="Accept" name="accept"/> <input type="submit" value="Reject" name="reject" /></p>
</legend>
</form>
{% else %}
<fieldset>
<legend>{% trans "Instance information" %}</legend>
<table>
<tr><th>{{ appform.hostname.label_tag }}</th><td>{{ application.hostname }}</td></tr>
<tr><th>{{ appform.memory.label_tag }}</th><td>{{ application.memory }}</td></tr>
<tr><th>{{ appform.vcpus.label_tag }}</th><td>{{ application.vcpus }}</td></tr>
<tr><th>{{ appform.disk_size.label_tag }}</th><td>{{ application.disk_size }}</td></tr>
<tr><th>{{ appform.organization.label_tag }}</th><td>{{ application.organization }}</td></tr>
<tr><th>{{ appform.hosts_mail_server.label_tag }}</th><td>{{ application.hosts_mail_server }}</td></tr>
<tr><th>{{ appform.operating_system.label_tag }}</th><td>{{ application.operating_system }}</td></tr>
</table>
</fieldset>
{% if application.admin_contact_name %}
<fieldset>
<legend>{% trans "Administrative contact" %}</legend>
<table>
<tr><th>{% trans "Name" %}</th><td>{{ application.admin_contact_name }}</td></tr>
<tr><th>{% trans "Email" %}</th><td>{{ application.admin_contact_email }}</td></tr>
<tr><th>{% trans "Phone" %}</th><td>{{ application.admin_contact_phone }}</td></tr>
</table>
</fieldset>
{% endif %}
<fieldset>
<legend>{% trans "Comments" %}</legend>
<div class="comments">
{{ application.comments }}
</div>
</fieldset>
<fieldset>
<legend>{% trans "Placement" %}</legend>
<p>{% trans "The instance has been placed on" %} {{ application.network }} ({{ application.cluster.description }})</p>
</fieldset>
{% endif %}
</div>
{% endblock %}
<div id="sshkeys_placeholder">
<script>
$(document).ajaxSend(function(event, xhr, settings) {
function getCookie(name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
var cookies = document.cookie.split(';');
for (var i = 0; i < cookies.length; i++) {
var cookie = jQuery.trim(cookies[i]);
// Does this cookie string begin with the name we want?
if (cookie.substring(0, name.length + 1) == (name + '=')) {
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
break;
}
}
}
return cookieValue;
}
function sameOrigin(url) {
// url could be relative or scheme relative or absolute
var host = document.location.host; // host + port
var protocol = document.location.protocol;
var sr_origin = '//' + host;
var origin = protocol + sr_origin;
// Allow absolute or scheme relative URLs to same origin
return (url == origin || url.slice(0, origin.length + 1) == origin + '/') ||
(url == sr_origin || url.slice(0, sr_origin.length + 1) == sr_origin + '/') ||
// or any other URL that isn't scheme relative or absolute i.e relative.
!(/^(\/\/|http:|https:).*/.test(url));
}
function safeMethod(method) {
return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));
}
if (!safeMethod(settings.type) && sameOrigin(settings.url)) {
xhr.setRequestHeader("X-CSRFToken", getCookie('csrftoken'));
}
});
$(function() {
$('.remove_btn').button({
icons: {
primary: "ui-icon-circle-close"
},
text: false
})
$('#add_ssh_key_btn').button();
$('#add_ssh_key_btn').click(function() {
str = $('#sshkeyform').serialize();
$.ajax({
type: "POST",
url: "{% url user-keys %}",
data: str,
success: function(response){
// var $response=$(response);
// var resdata = $response.filter("#sshkeys_placeholder").html();
$("#sshkeys_placeholder").html(response);
}
});
return false;
});
$('a[id^="remove_key_"]').click(function() {
var $this = $(this);
var id = $this.attr("id");
var key_id = id.replace("remove_key_", "")
$.ajax({
type: "GET",
url: "{% url delete-key %}"+key_id,
success: function(response){
// var $response=$(response);
// var resdata = $response.filter("#sshkeys_placeholder").html();
$("#sshkeys_placeholder").html(response);
}
});
return false;
});
});
</script>
<style type="text/css">
.fingerprint {
font-family: monospace;
}
</style>
{% load i18n %}
<p>{% trans "Upload your SSH public keys and have them automatically installed on all newly-created instances. Keys must be in OpenSSH format, either RSA, or DSA, with or without a trailing comment." %}</p>
{% if keys %}
<table>
<tr><th>{% trans "Fingerprint" %}</th><th>{% trans "Comment" %}</th></tr>
{% for key in keys %}
<tr><td class="fingerprint">{{ key.fingerprint }}</td><td>{{ key.comment|default:"&mdash;" }}</td><td><a class="remove_btn" id="remove_key_{{key.id}}" href="#">{% trans "Delete" %}</a></tr>
{% endfor %}
</table>
{% endif %}
<h2>{% trans "Add new key" %}</h2>
{% if msg %}
<div class="error">{{msg}}</div>
{% endif %}
<form method="POST" id="sshkeyform">
{% csrf_token %}
{% if form.ssh_pubkey.errors %}
<div class="error">{{ form.ssh_pubkey.errors }}</div>
{% endif %}
{{ form.ssh_pubkey }}<br />
<button id="add_ssh_key_btn">{% trans "Add key" %}</button>
</form>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment