mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 19:04:21 +00:00
New Welcome page: ensure 'not connected' status for Introducer and Helper is shown via text as well as bullet colour. refs #1713
Signed-off-by: David-Sarah Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
parent
50c6562901
commit
1f38c92011
@ -1113,7 +1113,7 @@ class SystemTest(SystemTestMixin, RunBinTahoeMixin, unittest.TestCase):
|
||||
d.addCallback(lambda res: getPage(self.helper_webish_url))
|
||||
def _got_welcome_helper(page):
|
||||
html = page.replace('\n', ' ')
|
||||
self.failUnless(re.search('<div class="status-indicator connected-yes"></div>[ ]*Helper', html), page)
|
||||
self.failUnless(re.search('<div class="status-indicator connected-yes"></div>[ ]*<div>Helper</div>', html), page)
|
||||
self.failUnlessIn("Not running helper", page)
|
||||
d.addCallback(_got_welcome_helper)
|
||||
|
||||
|
@ -627,7 +627,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d.addCallback(_set_no_helper)
|
||||
def _check_no_helper(res):
|
||||
html = res.replace('\n', ' ')
|
||||
self.failUnless(re.search('<div class="status-indicator connected-not-configured"></div>[ ]*Helper', html), res)
|
||||
self.failUnless(re.search('<div class="status-indicator connected-not-configured"></div>[ ]*<div>Helper</div>', html), res)
|
||||
d.addCallback(_check_no_helper)
|
||||
|
||||
# enable helper, not connected
|
||||
@ -638,7 +638,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d.addCallback(_set_helper_not_connected)
|
||||
def _check_helper_not_connected(res):
|
||||
html = res.replace('\n', ' ')
|
||||
self.failUnless(re.search('<div class="status-indicator connected-no"></div>[ ]*Helper', html), res)
|
||||
self.failUnless(re.search('<div class="status-indicator connected-no"></div>[ ]*<div>Helper not connected</div>', html), res)
|
||||
d.addCallback(_check_helper_not_connected)
|
||||
|
||||
# enable helper, connected
|
||||
@ -649,7 +649,7 @@ class Web(WebMixin, WebErrorMixin, testutil.StallMixin, testutil.ReallyEqualMixi
|
||||
d.addCallback(_set_helper_connected)
|
||||
def _check_helper_connected(res):
|
||||
html = res.replace('\n', ' ')
|
||||
self.failUnless(re.search('<div class="status-indicator connected-yes"></div>[ ]*Helper', html), res)
|
||||
self.failUnless(re.search('<div class="status-indicator connected-yes"></div>[ ]*<div>Helper</div>', html), res)
|
||||
d.addCallback(_check_helper_connected)
|
||||
return d
|
||||
|
||||
|
@ -201,6 +201,11 @@ class Root(rend.Page):
|
||||
def data_introducer_furl(self, ctx, data):
|
||||
return self.client.introducer_furl
|
||||
|
||||
def data_introducer_description(self, ctx, data):
|
||||
if self.data_connected_to_introducer(ctx, data) == "no":
|
||||
return "Introducer not connected"
|
||||
return "Introducer"
|
||||
|
||||
def data_connected_to_introducer(self, ctx, data):
|
||||
if self.client.connected_to_introducer():
|
||||
return "yes"
|
||||
@ -214,8 +219,10 @@ class Root(rend.Page):
|
||||
furl, connected = uploader.get_helper_info()
|
||||
return furl
|
||||
|
||||
def data_connected_to_helper_description(self, ctx, data):
|
||||
return self.data_connected_to_helper(ctx, data).replace('-', ' ')
|
||||
def data_helper_description(self, ctx, data):
|
||||
if self.data_connected_to_helper(ctx, data) == "no":
|
||||
return "Helper not connected"
|
||||
return "Helper"
|
||||
|
||||
def data_connected_to_helper(self, ctx, data):
|
||||
try:
|
||||
|
@ -137,14 +137,14 @@
|
||||
<div>
|
||||
<h3>
|
||||
<div><n:attr name="class">status-indicator connected-<n:invisible n:render="string" n:data="connected_to_introducer" /></n:attr></div>
|
||||
Introducer
|
||||
<div n:render="string" n:data="introducer_description" />
|
||||
</h3>
|
||||
<div class="furl" n:render="string" n:data="introducer_furl" />
|
||||
</div>
|
||||
<div>
|
||||
<h3>
|
||||
<div><n:attr name="class">status-indicator connected-<n:invisible n:render="string" n:data="connected_to_helper" /></n:attr></div>
|
||||
Helper
|
||||
<div n:render="string" n:data="helper_description" />
|
||||
</h3>
|
||||
<div class="furl" n:render="string" n:data="helper_furl" />
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user