]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
display the Helper FURL and our connection status on the welcome page. Closes #285.
authorBrian Warner <warner@allmydata.com>
Mon, 28 Jan 2008 20:56:22 +0000 (13:56 -0700)
committerBrian Warner <warner@allmydata.com>
Mon, 28 Jan 2008 20:56:22 +0000 (13:56 -0700)
src/allmydata/upload.py
src/allmydata/web/welcome.xhtml
src/allmydata/webish.py

index b1ea5702b806b01064c2ed144aa493c8b5e4b6e5..b33ec085ec3620944e5197a5bf5c58b65dde389d 100644 (file)
@@ -944,6 +944,10 @@ class Uploader(service.MultiService):
     def _got_helper(self, helper):
         self._helper = helper
 
+    def get_helper_info(self):
+        # return a tuple of (helper_furl_or_None, connected_bool)
+        return (self._helper_furl, bool(self._helper))
+
     def upload(self, uploadable):
         # this returns the URI
         assert self.parent
index 05192537ca421ad547f62ebf2ee35c27e9d78887..73ad3c9d674d7ada920f78ccb57c764145b82f7c 100644 (file)
@@ -18,8 +18,13 @@ tool</a> may also be useful.</div>
 
 <div>My nodeid: <span n:render="string" n:data="my_nodeid" /></div>
 <div>My version: <span n:render="string" n:data="version" /></div>
+
 <div>Introducer: <span n:render="string" n:data="introducer_furl" /></div>
 <div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div>
+
+<div>Helper: <span n:render="string" n:data="helper_furl" /></div>
+<div>Connected to helper?: <span n:render="string" n:data="connected_to_helper" /></div>
+
 <div>Known+Connected Peers: <span n:render="string" n:data="num_peers" /></div>
 
 <div>
index 93f534b40946a12c305d03a61d1749ceb1f36028..6c40446625aeed9d94705e220875fe9c19ea024f 100644 (file)
@@ -1319,6 +1319,18 @@ class Root(rend.Page):
         if IClient(ctx).connected_to_introducer():
             return "yes"
         return "no"
+
+    def data_helper_furl(self, ctx, data):
+        uploader = IClient(ctx).getServiceNamed("uploader")
+        furl, connected = uploader.get_helper_info()
+        return furl
+    def data_connected_to_helper(self, ctx, data):
+        uploader = IClient(ctx).getServiceNamed("uploader")
+        furl, connected = uploader.get_helper_info()
+        if connected:
+            return "yes"
+        return "no"
+
     def data_num_peers(self, ctx, data):
         #client = inevow.ISite(ctx)._client
         client = IClient(ctx)