mirror of
https://github.com/retspen/webvirtcloud
synced 2025-01-12 08:25:18 +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 %}
|
{% ifequal status 3 %}
|
||||||
<button class="btn btn-lg btn-success disabled pull-right" name="delete">{% trans "Destroy" %}</button>
|
<button class="btn btn-lg btn-success disabled pull-right" name="delete">{% trans "Destroy" %}</button>
|
||||||
{% else %}
|
{% 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;">
|
<div class="checkbox" style="margin-left: 8px;">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" name="delete_disk" value="true" checked>
|
<input type="checkbox" name="delete_disk" value="true" checked>
|
||||||
|
@ -2136,7 +2136,7 @@
|
||||||
});
|
});
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
window.setInterval(function graph_usage() {
|
var graph_interval = window.setInterval(function graph_usage() {
|
||||||
$.getJSON('{% url 'inst_graph' compute_id vname %}', function (data) {
|
$.getJSON('{% url 'inst_graph' compute_id vname %}', function (data) {
|
||||||
|
|
||||||
cpuChart.data.labels.push(data.timeline);
|
cpuChart.data.labels.push(data.timeline);
|
||||||
|
@ -2187,15 +2187,21 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
backgroundJobRunning = false;
|
backgroundJobRunning = false;
|
||||||
window.setInterval(function get_status() {
|
var status_interval = window.setInterval(function get_status() {
|
||||||
var status = {{ status|lower }};
|
var status = {{ status|lower }};
|
||||||
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
|
$.getJSON('{% url 'inst_status' compute_id vname %}', function (data) {
|
||||||
if (data['status'] != status && !backgroundJobRunning) {
|
if (data['status'] != status && !backgroundJobRunning) {
|
||||||
window.location.reload()
|
window.location.reload()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
|
// Stop getting status info before delete instance
|
||||||
|
$('#delete_form').submit(function(){
|
||||||
|
window.clearInterval(status_interval);
|
||||||
|
return true;
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
var hash = location.hash;
|
var hash = location.hash;
|
||||||
|
|
Loading…
Reference in a new issue