mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
help: Minor updates and fixes to status log
- Refactor reading status log file. - Fix hardcoded URL path into 500.html. - Rename 'status logs' to 'status log' for consistency. - Decorate the personal information warning. Avoid <b>. - Add heading to status log page. - Indentation and grammer fixes.
This commit is contained in:
1 parent
ddc7e07ea1
commit
037944e5fc
4 files changed
+45
-41
No files matched your search
@@ -73,15 +73,15 @@ def manual(request):
|
||||
'content': content})
|
||||
|
||||
|
||||
def status_logs(request):
|
||||
def status_log(request):
|
||||
"""Serve the last 100 lines of plinth's status log"""
|
||||
num_lines = 100
|
||||
logfile = open(cfg.status_log_file, 'r')
|
||||
data = logfile.readlines()
|
||||
with open(cfg.status_log_file, 'r') as log_file:
|
||||
data = log_file.readlines()
|
||||
|
||||
data = ''.join(data[-num_lines:])
|
||||
context = {
|
||||
'num_lines': num_lines,
|
||||
'data': data
|
||||
}
|
||||
logfile.close()
|
||||
return TemplateResponse(request, 'statuslog.html', context)
|
||||
Reference in new issue
Block a user