65 lines
1.9 KiB
HTML
65 lines
1.9 KiB
HTML
{% extends 'django_openstack/dash/base.html' %}
|
|
|
|
{% block sidebar %}
|
|
{% with current_sidebar="instances" %}
|
|
{{block.super}}
|
|
{% endwith %}
|
|
{% endblock %}
|
|
|
|
{% block page_header %}
|
|
{% url dash_instances request.user.tenant as refresh_link %}
|
|
{# to make searchable false, just remove it from the include statement #}
|
|
{% include "django_openstack/common/_page_header.html" with title="Instances" refresh_link=refresh_link searchable="true" %}
|
|
{% endblock page_header %}
|
|
|
|
{% block dash_main %}
|
|
{% if instances %}
|
|
{% include 'django_openstack/dash/instances/_list.html' %}
|
|
{% else %}
|
|
<div class="message_box info">
|
|
<h2>Info</h2>
|
|
<p>There are currently no instances. You can launch an instance from the <a href='{% url dash_images request.user.tenant %}'>Images Page.</a></p>
|
|
</div>
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block footer_js %}
|
|
<script type="text/javascript" charset="utf-8">
|
|
$(function(){
|
|
function loadInstances(){
|
|
if ($("#ajax_option_box").is(':checked')) {
|
|
$('.refresh').addClass("refreshing");
|
|
$('#instances').load('{% url dash_instances_refresh request.user.tenant %}', function(){
|
|
$('.refresh').removeClass("refreshing");
|
|
});
|
|
};
|
|
}
|
|
setInterval(function(){
|
|
loadInstances();
|
|
}, 15000);
|
|
|
|
loadOptionsWidget();
|
|
|
|
$("a.refresh").click(function(e){
|
|
e.preventDefault()
|
|
loadInstances();
|
|
})
|
|
|
|
function loadOptionsWidget(){
|
|
checkbox = document.createElement("input");
|
|
cb = $(checkbox);
|
|
cb.attr('id', 'ajax_option_box');
|
|
cb.attr('class', 'refreshOption');
|
|
cb.attr('type', 'checkbox');
|
|
checkbox_label = document.createElement("label");
|
|
cbl = $(checkbox_label);
|
|
cbl.attr('class', 'refreshOption');
|
|
cbl.text('auto refresh');
|
|
cbl.attr('for', 'ajax_option_box');
|
|
$('.right').append(cb);
|
|
$('.right').append(cbl);
|
|
}
|
|
})
|
|
</script>
|
|
{% endblock footer_js %}
|