Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e6d2f2c508
Fetching contributors…

Cannot retrieve contributors at this time

205 lines (198 sloc) 8.836 kB
<head>
<link rel="stylesheet" href="{{ STATIC_URL }}css/reset.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/text.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/formalize.css" />
<link rel="stylesheet" href="{{ STATIC_URL }}css/launch.css" />
<script src="{{ STATIC_URL }}js/jquery.js"></script>
<script src="{{ STATIC_URL }}js/jquery.formalize.js"></script>
<title>BioCloudCentral</title>
<script>
var csrf_token;
function get_dynamic_fields(cloud_id) {
$.post("{% url dynamic_fields %}",
{'cloud_id': cloud_id,
csrfmiddlewaretoken: csrf_token},
function(data) {
if (data.instance_types.length > 0) {
var types = '';
for (var i=0; i<data.instance_types.length; i++) {
types += '<option value="' + data.instance_types[i][0] + '">'
+ data.instance_types[i][1] + "</option>";
}
$('#id_instance_type').html(types);
$('#id_instance_type').removeAttr('disabled');
} else {
$('#id_instance_type').attr('disabled', 'disabled');
$('#id_instance_type').html("<option>Choose cloud type first</option>");
}
if (data.image_ids.length > 0) {
var ids = '';
for (var i=0; i<data.image_ids.length; i++) {
// Ensure the default image is initially selected
// The assumption here is that the default image is marked
// as having '*' character in the description field (this
// char is automatically added in views.py->dynamicfields)
var selected = '';
if (data.image_ids[i][1].indexOf('*') > -1) {
selected = 'selected="selected"';
}
ids += '<option value="' + data.image_ids[i][0] + '" ' + selected + '>'
+ data.image_ids[i][1] + "</option>";
}
$('#id_image_id').html(ids);
$('#id_image_id').removeAttr('disabled');
} else {
$('#id_image_id').attr('disabled', 'disabled');
$('#id_image_id').html("<option>Choose cloud type first</option>");
}
});
}
function get_placements() {
$('#id_placement').attr('disabled', 'disabled');
$('#id_placement').html("<option>Fetching data...</option>");
var jqxhr = $.post("{% url get_placements %}",
{'cloud_id': $('#id_cloud').val(),
'a_key': $('#id_access_key').val(),
's_key': $('#id_secret_key').val(),
'instance_type': $('#id_instance_type').val(),
csrfmiddlewaretoken: csrf_token})
.success(function(data) {
if (data.placements.length > 0) {
var placements = '';
for (var i=0; i<data.placements.length; i++) {
placements += '<option value="' + data.placements[i] + '">'
+ data.placements[i] + "</option>";
}
$('#id_placement').html(placements);
$('#id_placement').removeAttr('disabled');
} else if (data.error) {
$('#id_placement').attr('disabled', 'disabled');
$('#id_placement').html("<option>" + data.error + "</option>");
} else {
$('#id_placement').attr('disabled', 'disabled');
$('#id_placement').html("<option>Click refresh to update</option>");
}
})
.error(function(data){
$('#id_placement').attr('disabled', 'disabled');
$('#id_placement').html("<option>" + data.error + "</option>");
});
}
$(document).ready(function() {
// Along with this, must add a macthing csrf_token in the body
csrf_token = $('#csrf_token >div >input').attr("value");
// Get instance types for the selected cloud on page load
// This also keeps the instance types selected after a submission
// of the form with errors
get_dynamic_fields($("#id_cloud option:selected").val());
// Toggle advanced startup options
$('#toggle_advanced_startup_options').click(function(){
if ($('.advanced_startup_options').is(":visible")){
$('.advanced_startup_options').hide();
$('#toggle_advanced_startup_options').text('Show advanced startup options');
}else{
$('.advanced_startup_options').show();
$('#toggle_advanced_startup_options').text("Hide advanced options");
}
});
});
</script>
</head>
<div class="banner">
<h2 class="banner">BioCloudCentral</h2>
Easily launch <a href="http://usecloudman.org">CloudMan</a>,
<a href="http://cloudbiolinux.org">CloudBioLinux</a> and
<a href="http://wiki.g2.bx.psu.edu/">Galaxy</a>
platforms on Cloud Computing resources (including
<a href="http://aws.amazon.com/">Amazon Web Services</a>).
</div>
{% if form.non_field_errors|length > 0 %}
<div class="awserror error">Cloud connection problem: <br/>
{{ form.non_field_errors }}
</div>
{% endif %}
<form action="/launch" method="post">{% csrf_token %}
<table>
{% for field in form %}
{% if field.field.required %}
<tr>
<td><div class="label">{{ field.label_tag }}</div></td>
<td>{{ field }}</td>
<td> {% for error in field.errors %}
<div class="error">{{ error }}</div>
{% endfor %}
</td>
<td><div class="help">
{% autoescape off %}
{{ field.help_text }}
{% endautoescape %}
</div></td>
</tr>
{% endif %}
{% endfor %}
{# Add the not required fields as the advanced startup options #}
{% for field in form %}
{% if not field.field.required %}
<tr class="advanced_startup_options" style="display:none">
<td>
<div class="label">
{{ field.label_tag }}
<span class="refresh_cont">
{% if field.label == 'Placement' %}
<a class="refresh_link" href="#" onClick="get_placements()"></a>
{% endif %}
</span>
</div>
</td>
<td>{{ field }}</td>
<td> {% for error in field.errors %}
<div class="error">{{ error }}</div>
{% endfor %}
</td>
<td><div class="help">
{% autoescape off %}
{{ field.help_text }}
{% endautoescape %}
</div></td>
</tr>
{% endif %}
{% endfor %}
</table>
<div id="toggle_advanced_startup_options_cont" class='form-row'>
<a id='toggle_advanced_startup_options' href="#">
Show advanced startup options
</a>
</div>
<div class="submit">
<input type="submit" value="Start an instance" />
</div>
</form>
<div class="about">
<p>
This website is an open service developed by the
<a href="http://cloudbiolinux.org">CloudBioLinux</a> and
<a href="http://usecloudman.org">CloudMan</a>
communities. The goal is to make it easy to get started doing
scalable biological analysis on cloud resources. See
<a href="http://youtu.be/AKu_CbbgEj0">this video</a> on how to
get started or
<a href="http://bcbio.wordpress.com/2011/11/29/making-next-generation-sequencing-analysis-pipelines-easier-with-biocloudcentral-and-galaxy-integration/">this guide</a>
for a detailed usage example when using the Amazon cloud. The
<a href="https://github.com/chapmanb/biocloudcentral">open source code</a>
is available on GitHub allowing you to also run this service locally.
</p>
<p>
This site can be used for any of the available clouds.
Note that you must have appropriate credentials for the
chosen cloud. If a desired cloud is not available and
you would like to see it there, please
<a href="mailto:cloudbiolinux@googlegroups.com">contact us</a>.
</p>
<p>
Launching servers on the Amazon cloud will incur
<a href="http://aws.amazon.com/ec2/#pricing">usage fees</a>
from Amazon for their resources. By using this service you acknowledge your
sole responsibility for any costs accrued.
</p>
<div id="csrf_token" style='display:none'>{% csrf_token %}</div>
</div>
Jump to Line
Something went wrong with that request. Please try again.