Merge pull request #94 from cloudbuilders/ajax-refreshing
Ajax refreshing updates and fixes
This commit is contained in:
@@ -25,21 +25,40 @@
|
||||
|
||||
{% block footer_js %}
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(function(){
|
||||
function loadInstances(){
|
||||
$(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);
|
||||
|
||||
$("a.refresh").click(function(e){
|
||||
e.preventDefault()
|
||||
loadInstances();
|
||||
})
|
||||
};
|
||||
}
|
||||
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 %}
|
||||
|
||||
@@ -27,19 +27,38 @@
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(function(){
|
||||
function loadInstances(){
|
||||
$('.refresh').addClass("refreshing");
|
||||
$('#instances').load('{% url dash_instances_refresh request.user.tenant %}', function(){
|
||||
$('.refresh').removeClass("refreshing");
|
||||
});
|
||||
if ($("#ajax_option_box").is(':checked')) {
|
||||
$('.refresh').addClass("refreshing");
|
||||
$('#instances').load('{% url syspanel_instances_refresh %}', 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 %}
|
||||
|
||||
Reference in New Issue
Block a user