From 3e01ef171a365cfaf9c632649137a6e8307c2909 Mon Sep 17 00:00:00 2001
From: Brian Warner <warner@lothar.com>
Date: Tue, 5 Dec 2006 12:51:32 -0700
Subject: [PATCH] webish: add queen pburl and connection status to welcome page

---
 allmydata/web/welcome.xhtml | 2 ++
 allmydata/webish.py         | 6 ++++++
 2 files changed, 8 insertions(+)

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)
-- 
2.45.2