1
0
Fork 0
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:
catborise 2020-05-14 19:34:28 +03:00 committed by catborise
parent 966da065b4
commit d384c914a4

View file

@ -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);
@ -2188,7 +2188,7 @@
</script>
<script>
backgroundJobRunning = false;
window.setInterval(function get_status() {
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) {
@ -2196,6 +2196,12 @@
}
});
}, 5000);
// Stop getting status info before delete instance
$('#delete_form').submit(function(){
window.clearInterval(status_interval);
return true;
});
</script>
<script>
var hash = location.hash;