Make minor changes to status log page

This commit is contained in:
James Valleroy 2016-07-21 18:00:53 -04:00
parent 15a336613b
commit 561c7c1e6b
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
5 changed files with 34 additions and 19 deletions

View File

@ -4,11 +4,13 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- Added Disks module to show free space of mounted partitions and
allow expanding the root partition.
allow expanding the root partition.
- Added Persian (fa) locale.
- Added Indonesian (id) locale.
- Added options to toggle Tor relay and bridge relay modes.
- Added Security module to control login restrictions.
- Added a page to display recent status log from Plinth. It is
accessible from the 500 error page.
### Fixed
- Improved Dynamic DNS status message when no update needed.

View File

@ -74,14 +74,14 @@ def manual(request):
def status_logs(request):
""" Serves the last 100 lines of Status log"""
nr_lines = 100
logfile = open(cfg.status_log_file, "r")
"""Serve the last 100 lines of plinth's status log"""
num_lines = 100
logfile = open(cfg.status_log_file, 'r')
data = logfile.readlines()
data = "".join(data[-nr_lines:])
data = ''.join(data[-num_lines:])
context = {
"nr_lines": nr_lines,
"data": data
'num_lines': num_lines,
'data': data
}
logfile.close()
return TemplateResponse(request, "statuslog.html", context)
return TemplateResponse(request, 'statuslog.html', context)

View File

@ -14,8 +14,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not,see
<http://www.gnu.org/licenses/>.
# along with this program. If not,see <http://www.gnu.org/licenses/>.
#
{% endcomment %}
@ -24,10 +23,24 @@
{% block content %}
<p>
{% blocktrans trimmed %}
This is the last {{ nr_lines }} lines of status log.
If you want to report a bug use <a href="https://github.com/freedombox/Plinth/issues">bugtracker</a> and attach this status log with that.
<pre>{{ data }}</pre>
{% endblocktrans %}
{% blocktrans trimmed %}
This is the last {{ num_lines }} lines of the status log for this web
interface. If you want to report a bug, please use the
<a href="https://github.com/freedombox/Plinth/issues">bugtracker</a> and
attach this status log to the bug report.
{% endblocktrans %}
</p>
{% endblock %}
<p>
<b>
{% blocktrans trimmed %}
Caution: Please remove any passwords or other personal information from the
log, before submitting the bug report.
{% endblocktrans %}
</b>
</p>
<p>
<pre>{{ data }}</pre>
</p>
{% endblock %}

View File

@ -32,5 +32,5 @@ urlpatterns = [
url(r'^help/index/$', views.index, name='index_explicit'),
url(r'^help/about/$', views.about, name='about'),
url(r'^help/manual/$', views.manual, name='manual'),
url(r'^help/status-logs',views.status_logs,name='status-logs'),
url(r'^help/status-logs/$', views.status_logs, name='status-logs'),
]

View File

@ -29,8 +29,8 @@
This is an internal error and not something you caused or can
fix. Please report the error on
the <a href="https://github.com/freedombox/Plinth/issues">bug
tracker</a> so we can fix it.
Please Attatch the <a href="/plinth/help/status-logs">Status Log</a> along with the bug
tracker</a> so we can fix it. Also, please attach the
<a href="/plinth/help/status-logs">Status Log</a> to the bug report.
{% endblocktrans %}
</p>