From: Brian Warner <warner@lothar.com>
Date: Tue, 5 Dec 2006 19:51:32 +0000 (-0700)
Subject: webish: add queen pburl and connection status to welcome page
X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~447
X-Git-Url: https://git.rkrishnan.org/pf/frontends/status?a=commitdiff_plain;h=3e01ef171a365cfaf9c632649137a6e8307c2909;p=tahoe-lafs%2Ftahoe-lafs.git

webish: add queen pburl and connection status to welcome page
---

diff --git a/allmydata/web/welcome.xhtml b/allmydata/web/welcome.xhtml
index 9c0fda17..8ceb6c6f 100644
--- a/allmydata/web/welcome.xhtml
+++ b/allmydata/web/welcome.xhtml
@@ -13,6 +13,8 @@
 
 <h2>Mesh Status</h2>
 
+<div>Queen: <span n:render="string" n:data="queen_pburl" /></div>
+<div>Connected to queen?: <span n:render="string" n:data="connected_to_queen" /></div>
 <div>Known Peers: <span n:render="string" n:data="num_peers" /></div>
 <div>Connected Peers: <span n:render="string" n:data="num_connected_peers" /></div>
 
diff --git a/allmydata/webish.py b/allmydata/webish.py
index 83eb8b15..2346e0f9 100644
--- a/allmydata/webish.py
+++ b/allmydata/webish.py
@@ -52,6 +52,12 @@ class Welcome(rend.Page):
     addSlash = True
     docFactory = getxmlfile("welcome.xhtml")
 
+    def data_queen_pburl(self, ctx, data):
+        return IClient(ctx).queen_pburl
+    def data_connected_to_queen(self, ctx, data):
+        if IClient(ctx).queen:
+            return "yes"
+        return "no"
     def data_num_peers(self, ctx, data):
         #client = inevow.ISite(ctx)._client
         client = IClient(ctx)