mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
stop getting status info before instance delete to prevent domain not found error
This commit is contained in:
parent
966da065b4
commit
d384c914a4
1 changed files with 17 additions and 11 deletions
|
@ -1629,7 +1629,7 @@
|
|||
{% ifequal status 3 %}
|
||||
<button class="btn btn-lg btn-success disabled pull-right" name="delete">{% trans "Destroy" %}</button>
|
||||
{% else %}
|
||||
<form class="form-group" method="post" role="form">{% csrf_token %}
|
||||
<form method="post" role="form" id="delete_form">{% csrf_token %}
|
||||
<div class="checkbox" style="margin-left: 8px;">
|
||||
<label>
|
||||
<input type="checkbox" name="delete_disk" value="true" checked>
|
||||
|
@ -2136,7 +2136,7 @@
|
|||
});
|
||||
{% endfor %}
|
||||
|
||||
window.setInterval(function graph_usage() {
|
||||
var graph_interval = window.setInterval(function graph_usage() {
|
||||
$.getJSON('{% url 'inst_graph' compute_id vname %}', function (data) {
|
||||
|
||||
cpuChart.data.labels.push(data.timeline);
|
||||
|
@ -2187,15 +2187,21 @@
|
|||
});
|
||||
</script>
|
||||
<script>
|
||||
backgroundJobRunning = false;
|
||||
window.setInterval(function get_status() {
|
||||
var status = {{ status|lower }};
|
||||
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
|
||||
if (data['status'] != status && !backgroundJobRunning) {
|
||||
window.location.reload()
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
backgroundJobRunning = false;
|
||||
var status_interval = window.setInterval(function get_status() {
|
||||
var status = {{ status|lower }};
|
||||
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
|
||||
if (data['status'] != status && !backgroundJobRunning) {
|
||||
window.location.reload()
|
||||
}
|
||||
});
|
||||
}, 5000);
|
||||
|
||||
// Stop getting status info before delete instance
|
||||
$('#delete_form').submit(function(){
|
||||
window.clearInterval(status_interval);
|
||||
return true;
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
var hash = location.hash;
|
||||
|
|
Loading…
Reference in a new issue