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,6 +14,7 @@
{% include "app-header.html" %} {% include "app-header.html" %}
{% if not operations %}
{% include "toolbar.html" with enabled=is_enabled %} {% include "toolbar.html" with enabled=is_enabled %}
{% block subsubmenu %} {% block subsubmenu %}
@ -58,5 +59,8 @@
{% block extra_content %} {% block extra_content %}
{% endblock %} {% endblock %}
{% else %}
{% include "operations.html" %}
{% endif %}
{% endblock %} {% endblock %}

View File

@ -256,6 +256,10 @@ class AppView(FormView):
context['has_diagnostics'] = self.app.has_diagnostics() context['has_diagnostics'] = self.app.has_diagnostics()
context['port_forwarding_info'] = get_port_forwarding_info(self.app) context['port_forwarding_info'] = get_port_forwarding_info(self.app)
context['app_enable_disable_form'] = self.get_enable_disable_form() 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 from plinth.modules.firewall.components import Firewall
context['firewall'] = self.app.get_components_of_type(Firewall) context['firewall'] = self.app.get_components_of_type(Firewall)