1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

fix: please wait dialog.

This commit is contained in:
catborise 2021-10-04 16:18:36 +03:00
parent c1488eee52
commit 4d21a3184b
4 changed files with 13 additions and 7 deletions

View file

@ -652,7 +652,7 @@
</div> </div>
</div> </div>
{% if computes_count != 1 %} {% if computes_count != 1 %}
<button type="submit" class="btn btn-lg btn-success float-end" name="migrate" onclick="showPleaseWaitDialog();">{% trans "Migrate" %}</button> <button type="submit" class="btn btn-lg btn-success float-end" onclick="showPleaseWaitDialog()" name="migrate" >{% trans "Migrate" %}</button>
{% else %} {% else %}
<button class="btn btn-lg btn-success float-end disabled">{% trans "Migrate" %}</button> <button class="btn btn-lg btn-success float-end disabled">{% trans "Migrate" %}</button>
{% endif %} {% endif %}

View file

@ -11,6 +11,7 @@
{% block page_heading_extra %}{% include 'create_stg_vol_block.html' %}{% endblock page_heading_extra %} {% block page_heading_extra %}{% include 'create_stg_vol_block.html' %}{% endblock page_heading_extra %}
{% block content %} {% block content %}
{% include 'pleasewaitdialog.html' %}
<div class="row"> <div class="row">
<div class="col-lg-12"> <div class="col-lg-12">
@ -152,7 +153,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{% trans "Close" %}</button>
<button type="submit" class="btn btn-primary" name="cln_volume" onclick="showPleaseWaitDialog();">{% trans "Clone" %}</button> <button type="submit" class="btn btn-primary" name="cln_volume" onclick="showPleaseWaitDialog()">{% trans "Clone" %}</button>
</div> </div>
</form> </form>
</div> <!-- /.modal-content --> </div> <!-- /.modal-content -->
@ -190,7 +191,6 @@
{% endif %} {% endif %}
</div> </div>
{% include 'pleasewaitdialog.html' %}
{% endblock %} {% endblock %}
{% block script %} {% block script %}
<script src="{% static 'js/sortable.min.js' %}"></script> <script src="{% static 'js/sortable.min.js' %}"></script>

View file

@ -171,7 +171,7 @@ def storage(request, compute_id, pool):
name = conn.clone_volume(data["image"], data["name"], format, meta_prealloc) name = conn.clone_volume(data["image"], data["name"], format, meta_prealloc)
messages.success( messages.success(
request, request,
_("%(image)s image cloned as %(clone)s successfully") % {"image": data["image"], "name": name}, _("%(image)s image cloned as %(name)s successfully") % {"image": data["image"], "name": name},
) )
return HttpResponseRedirect(request.get_full_path()) return HttpResponseRedirect(request.get_full_path())
except libvirtError as lib_err: except libvirtError as lib_err:

View file

@ -1,6 +1,6 @@
{% load i18n %} {% load i18n %}
<!-- Please wait dialog --> <!-- Please wait dialog -->
<div class="modal fade" id="pleaseWaitDialog" tabindex="-1" role="dialog" aria-labelledby="pleaseWaitDialogLabel" data-backdrop="static" data-keyboard="false"> <div class="modal fade" id="pleaseWaitDialog" tabindex="-1" aria-labelledby="pleaseWaitDialogLabel" data-bs-backdrop="static" data-bs-keyboard="false">
<div class="modal-dialog modal-sm"> <div class="modal-dialog modal-sm">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -17,11 +17,17 @@
</div> </div>
<script> <script>
function showPleaseWaitDialog() { function showPleaseWaitDialog() {
$('#pleaseWaitDialog').modal(); var pleaseModal = new bootstrap.Modal(document.getElementById('pleaseWaitDialog'), {
keyboard: false
});
pleaseModal.show();
backgroundJobRunning = true; backgroundJobRunning = true;
} }
function hidePleaseWaitDialog() { function hidePleaseWaitDialog() {
$('#pleaseWaitDialog').modal('hide'); var pleaseModal = new bootstrap.Modal(document.getElementById('pleaseWaitDialog'), {
keyboard: false
})
pleaseModal.hide();
backgroundJobRunning = false; backgroundJobRunning = false;
} }
</script> </script>