Merge "Reload env components page after deployment of empty environment"
This commit is contained in:
commit
7a334ac144
@ -20,6 +20,7 @@ from django.core.urlresolvers import reverse_lazy
|
||||
from django import http
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.views import generic
|
||||
from horizon import conf
|
||||
from horizon import exceptions
|
||||
from horizon.forms import views
|
||||
from horizon import tables
|
||||
@ -88,6 +89,7 @@ class EnvironmentDetails(tabs.TabbedTableView):
|
||||
context["actions"] = table.render_row_actions(env)
|
||||
# recover the origin row_action for EnvironmentsTable Meta
|
||||
table._meta.row_actions = ori_row_actions
|
||||
context['poll_interval'] = conf.HORIZON_CONFIG['ajax_poll_interval']
|
||||
return context
|
||||
|
||||
def get_tabs(self, request, *args, **kwargs):
|
||||
|
@ -32,6 +32,23 @@ $(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// Reload page using horizon ajax_poll_interval
|
||||
// until deployment of empty environment is finished
|
||||
$(function() {
|
||||
"use strict";
|
||||
if ($("div#environment_details__services").find("div.drop_component").length === 0 &&
|
||||
$("table#services.datatable").find("tr.empty").length &&
|
||||
$("button#services__action_deploy_env").length === 0) {
|
||||
var $pollInterval = $("input#pollInterval")[0].value;
|
||||
setTimeout(function () {
|
||||
if (reloadCalled === false) {
|
||||
reloadCalled = true;
|
||||
location.reload(true);
|
||||
}
|
||||
}, $pollInterval);
|
||||
}
|
||||
});
|
||||
|
||||
var reloadEnvironmentCalled = false;
|
||||
|
||||
$(function() {
|
||||
|
@ -11,6 +11,7 @@
|
||||
{% endblock page_header %}
|
||||
{% block main %}
|
||||
<input type="hidden" id="environmentId" value="{{ environment_id }}">
|
||||
<input type="hidden" id="pollInterval" value="{{ poll_interval }}">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
|
||||
{{ tab_group.render }}
|
||||
|
@ -0,0 +1,6 @@
|
||||
---
|
||||
|
||||
fixes:
|
||||
- Environment components page reloads after deployment of
|
||||
empty environment. It allows to add new components to
|
||||
the empty environment without manual page refresh.
|
Loading…
x
Reference in New Issue
Block a user