mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
If at least one related service/daemon is not running, show the alert if app is enabled, otherwise set alert as hidden (for functional tests). Closes #1752 Signed-off-by: Veiko Aasa <veiko17@disroot.org> [sunil: Minor code simplification in app template, status section] Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
19 lines
529 B
Python
19 lines
529 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
Views for the Cockpit module
|
|
"""
|
|
from plinth.modules.cockpit.utils import get_origin_domains, load_augeas
|
|
from plinth.views import AppView
|
|
|
|
|
|
class CockpitAppView(AppView):
|
|
app_id = 'cockpit'
|
|
template_name = 'cockpit.html'
|
|
|
|
def get_context_data(self, *args, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
urls = get_origin_domains(load_augeas())
|
|
context['urls'] = [url for url in urls if 'localhost' not in url]
|
|
|
|
return context
|