mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
diagnostics: Show app name and fallback to app id if not exist
Tests performed: - The diagnostics app page and individual app diagnostics pages have app names. - When the app name is missing (the apache app), app id is shown instead. Signed-off-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
parent
8775137546
commit
dd6a03442e
@ -112,7 +112,7 @@ def run_on_all_enabled_modules():
|
||||
continue
|
||||
|
||||
apps.append((app.app_id, app))
|
||||
app_name = app.info.name or _('None')
|
||||
app_name = app.info.name or app.app_id
|
||||
current_results['results'][app.app_id] = {'name': app_name}
|
||||
|
||||
current_results['apps'] = apps
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
<h2>{% trans "Diagnostic Results" %}</h2>
|
||||
|
||||
<h3>{% blocktrans %}App: {{ app_id }}{% endblocktrans %}</h3>
|
||||
<h3>{% blocktrans %}App: {{ app_name }}{% endblocktrans %}</h3>
|
||||
|
||||
{% if results %}
|
||||
{% include "diagnostics_results.html" with results=results %}
|
||||
|
||||
@ -38,6 +38,7 @@ def diagnose_app(request, app_id):
|
||||
app = App.get(app_id)
|
||||
except KeyError:
|
||||
raise Http404('App does not exist')
|
||||
app_name = app.info.name or app_id
|
||||
|
||||
diagnosis = None
|
||||
diagnosis_exception = None
|
||||
@ -51,7 +52,7 @@ def diagnose_app(request, app_id):
|
||||
return TemplateResponse(
|
||||
request, 'diagnostics_app.html', {
|
||||
'title': _('Diagnostic Test'),
|
||||
'app_id': app_id,
|
||||
'app_name': app_name,
|
||||
'results': diagnosis,
|
||||
'exception': diagnosis_exception,
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user