72 lines
1.8 KiB
HTML
72 lines
1.8 KiB
HTML
{% extends "django_openstack/nova/images/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %} - {% trans "Launch an Image" %}{% endblock %}
|
|
|
|
{% block headerjs %}
|
|
<script type="text/javascript" src="/media/django_openstack/js/jquery.form.js"></script>
|
|
{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
<div id="right_content">
|
|
<div id="page_head">
|
|
<h2 id="page_heading">{% trans "Images" %}</h2>
|
|
<p id="page_description">{% trans "Images are snapshots of running systems which can easily be deployed to run one or more instances." %}</p>
|
|
</div>
|
|
|
|
{% include "django_openstack/_messages.html" %}
|
|
|
|
{% for heading, images in image_lists.items %}
|
|
{% include "django_openstack/nova/images/_list.html" %}
|
|
{% endfor %}
|
|
|
|
</div>
|
|
|
|
<div id="dlg_launch" title="Launch Instance" style="display:none;">
|
|
<form id="frm_launch" action="#" method="post">
|
|
{% csrf_token %}
|
|
{% include "django_openstack/nova/images/_launch_form.html" %}
|
|
</form>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block footerjs %}
|
|
{{ block.super }}
|
|
<script type="text/javascript">
|
|
var options = {
|
|
success: handleResponse,
|
|
beforeSubmit: showRequest,
|
|
dataType: 'json'
|
|
}
|
|
|
|
// TODO: On dialog open, reset form and validation.
|
|
$(function() {
|
|
$('#dlg_launch').dialog({
|
|
buttons: {
|
|
'Ok': function() {
|
|
$('#frm_launch').ajaxSubmit(options);
|
|
},
|
|
'Cancel': function() {
|
|
$(this).dialog('close');
|
|
}
|
|
},
|
|
autoOpen: false,
|
|
resizable: false,
|
|
width: 400,
|
|
height: 400
|
|
});
|
|
});
|
|
|
|
function showRequest(formData, jqForm, options) {
|
|
var queryString = $.param(formData);
|
|
alert('About to submit: \n\n' + queryString);
|
|
return true;
|
|
}
|
|
|
|
function handleResponse(data, statusText, xhr, $form) {
|
|
alert('status: ' + statusText + '\nsuccess:\n\n' + data.success);
|
|
}
|
|
</script>
|
|
{% endblock %}
|