operation: Show operations on app page in addition to setup page

- Will be utilized by uninstall.

Tests:

- Operation progress is shown during uninstall of coturn app.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2022-08-18 21:49:25 -07:00 committed by James Valleroy
parent 6c67091ede
commit 145b3ecc65
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 43 additions and 35 deletions

View File

@ -14,49 +14,53 @@
{% include "app-header.html" %}
{% include "toolbar.html" with enabled=is_enabled %}
{% if not operations %}
{% include "toolbar.html" with enabled=is_enabled %}
{% block subsubmenu %}
{% if subsubmenu %}
{% show_subsubmenu subsubmenu %}
{% endif %}
{% endblock %}
{% block subsubmenu %}
{% if subsubmenu %}
{% show_subsubmenu subsubmenu %}
{% endif %}
{% endblock %}
{% block status %}
{% if is_running is not None and not is_running %}
<div id='service-not-running' role="alert"
class="alert alert-danger {{ is_enabled|yesno:',d-none' }}">
{% blocktrans trimmed with service_name=app_info.name %}
Service <em>{{ service_name }}</em> is not running.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}
{% block status %}
{% if is_running is not None and not is_running %}
<div id='service-not-running' role="alert"
class="alert alert-danger {{ is_enabled|yesno:',d-none' }}">
{% blocktrans trimmed with service_name=app_info.name %}
Service <em>{{ service_name }}</em> is not running.
{% endblocktrans %}
</div>
{% endif %}
{% endblock %}
{% block internal_zone %}
{% include "internal-zone.html" %}
{% endblock %}
{% block internal_zone %}
{% include "internal-zone.html" %}
{% endblock %}
{% block port_forwarding_info %}
{% include "port-forwarding-info.html" with service_name=app_info.name %}
{% endblock %}
{% block port_forwarding_info %}
{% include "port-forwarding-info.html" with service_name=app_info.name %}
{% endblock %}
{% block configuration %}
{% if form %}
<h3>{% trans "Configuration" %}</h3>
{% block configuration %}
{% if form %}
<h3>{% trans "Configuration" %}</h3>
<form id="app-form" class="form form-configuration" method="post">
{% csrf_token %}
<form id="app-form" class="form form-configuration" method="post">
{% csrf_token %}
{{ form|bootstrap }}
{{ form|bootstrap }}
<input type="submit" class="btn btn-primary"
value="{% trans "Update setup" %}"/>
</form>
{% endif %}
{% endblock %}
<input type="submit" class="btn btn-primary"
value="{% trans "Update setup" %}"/>
</form>
{% endif %}
{% endblock %}
{% block extra_content %}
{% endblock %}
{% block extra_content %}
{% endblock %}
{% else %}
{% include "operations.html" %}
{% endif %}
{% endblock %}

View File

@ -256,6 +256,10 @@ class AppView(FormView):
context['has_diagnostics'] = self.app.has_diagnostics()
context['port_forwarding_info'] = get_port_forwarding_info(self.app)
context['app_enable_disable_form'] = self.get_enable_disable_form()
context['operations'] = operation.manager.filter(self.app.app_id)
context['refresh_page_sec'] = None
if context['operations']:
context['refresh_page_sec'] = 3
from plinth.modules.firewall.components import Firewall
context['firewall'] = self.app.get_components_of_type(Firewall)