mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-02-20 17:52:50 +00:00
Render a message when helper isn't running
This commit is contained in:
parent
6661b52c33
commit
65315c4ed0
@ -6,22 +6,29 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Helper Status</h1>
|
||||
<h2>Immutable Uploads</h2>
|
||||
<ul t:data="helper_stats">
|
||||
<li>Active: <span t:render="active_uploads" /></li>
|
||||
<li>--</li>
|
||||
<li>Bytes Fetched: <span t:render="upload_bytes_fetched" /></li>
|
||||
<li>Incoming: <span t:render="incoming" /></li>
|
||||
<li>Encoding: <span t:render="encoding" /></li>
|
||||
<li>Bytes Encoded: <span t:render="upload_bytes_encoded" /></li>
|
||||
<li>--</li>
|
||||
<li>Total Requests: <span t:render="upload_requests" /></li>
|
||||
<ul>
|
||||
<li>Already Present: <span t:render="upload_already_present" /></li>
|
||||
<li>Need Upload: <span t:render="upload_need_upload" /></li>
|
||||
|
||||
<div t:render="helper_running">
|
||||
<h1>Helper Status</h1>
|
||||
|
||||
<h2>Immutable Uploads</h2>
|
||||
<ul t:data="helper_stats">
|
||||
<li>Active: <span t:render="active_uploads" /></li>
|
||||
<li>--</li>
|
||||
<li>Bytes Fetched: <span t:render="upload_bytes_fetched" /></li>
|
||||
<li>Incoming: <span t:render="incoming" /></li>
|
||||
<li>Encoding: <span t:render="encoding" /></li>
|
||||
<li>Bytes Encoded: <span t:render="upload_bytes_encoded" /></li>
|
||||
<li>--</li>
|
||||
<li>Total Requests: <span t:render="upload_requests" /></li>
|
||||
<ul>
|
||||
<li>Already Present: <span t:render="upload_already_present" /></li>
|
||||
<li>Need Upload: <span t:render="upload_need_upload" /></li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
||||
<div>Return to the <a href="/">Welcome Page</a></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -9,6 +9,7 @@ from twisted.web.template import (
|
||||
XMLFile,
|
||||
renderer,
|
||||
renderElement,
|
||||
tags
|
||||
)
|
||||
from nevow import rend, tags as T
|
||||
from allmydata.util import base32, idlib
|
||||
@ -1154,7 +1155,10 @@ class HelperStatusElement(Element):
|
||||
:param _allmydata.immutable.offloaded.Helper helper
|
||||
"""
|
||||
super(HelperStatusElement, self).__init__()
|
||||
self._helper = helper
|
||||
|
||||
@renderer
|
||||
def helper_running(self, req, tag):
|
||||
# helper.get_stats() returns a dict of this form:
|
||||
#
|
||||
# {'chk_upload_helper.active_uploads': 0,
|
||||
@ -1171,7 +1175,11 @@ class HelperStatusElement(Element):
|
||||
# 'chk_upload_helper.upload_need_upload': 0,
|
||||
# 'chk_upload_helper.upload_requests': 0}
|
||||
#
|
||||
self._data = helper.get_stats()
|
||||
# If helper is running, we render the above data on the page.
|
||||
if self._helper:
|
||||
self._data = self._helper.get_stats()
|
||||
return tag
|
||||
return tags.h1("No helper is running")
|
||||
|
||||
@renderer
|
||||
def active_uploads(self, req, tag):
|
||||
|
Loading…
x
Reference in New Issue
Block a user