Author: Jogy
Date: 2006-12-17 01:52:27 +0000 (Sun, 17 Dec 2006)
New Revision: 11456
Modified:
trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
trunk/freenet/src/freenet/clients/http/staticfiles/themes/boxed/theme.css
trunk/freenet/src/freenet/clients/http/staticfiles/themes/clean/theme.css
trunk/freenet/src/freenet/clients/http/staticfiles/themes/grayandblue/theme.css
trunk/freenet/src/freenet/clients/http/staticfiles/themes/sky/theme.css
Log:
add a goofy "Peer Location Distribution Circle" to the darknet page
Modified: trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-12-16 22:13:18 UTC (rev 11455)
+++ trunk/freenet/src/freenet/clients/http/DarknetConnectionsToadlet.java
2006-12-17 01:52:27 UTC (rev 11456)
@@ -541,11 +541,21 @@
actionSelect.addChild("option", "value", "",
"-- -- --");
actionSelect.addChild("option", "value",
"remove", "Remove selected peers");
peerForm.addChild("input", new String[] {
"type", "name", "value" }, new String[] { "submit", "doAction", "Go" });
+
+ // BEGIN PEER LOCATION DISTRIBUTION CIRCLE
+ HTMLNode peerCircleTable =
peerTableInfobox.addChild("table", "class", "column");
+ HTMLNode peerCircleTableRow =
peerCircleTable.addChild("tr");
+ HTMLNode nextPeerCircleTableCell =
peerCircleTableRow.addChild("td", "class", "first");
+ //
+ HTMLNode peerCircleInfobox =
nextPeerCircleTableCell.addChild("div", "class", "infobox");
+ peerCircleInfobox.addChild("div", "class",
"infobox-header", "Peer Location Distribution");
+ HTMLNode peerCircleInfoboxContent =
peerCircleInfobox.addChild("div", "class", "infobox-content");
+ addPeerCircle(peerCircleInfoboxContent);
+ // END PEER LOCATION DISTRIBUTION CIRCLE
}
// END PEER TABLE
+ }
- }
-
// BEGIN PEER ADDITION BOX
HTMLNode peerAdditionInfobox = contentNode.addChild("div",
"class", "infobox infobox-normal");
peerAdditionInfobox.addChild("div", "class", "infobox-header",
"Add another peer");
@@ -605,6 +615,38 @@
this.writeReply(ctx, 200, "text/html", "OK",
pageBuffer.toString());
}
+ private void addPeerCircle (HTMLNode htmlNode)
+ {
+ HTMLNode peerCircleInfoboxContentDiv = htmlNode.addChild("div",
new String[] { "style", "class" }, new String[] {"position: relative;
height:210px", "peercircle" });
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.125), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.25), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.375), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.5), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.625), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.75), "mark"
}, "+");
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] { generatePeerCircleStyleString(0.875), "mark"
}, "+");
+ //
+ PeerNodeStatus[] peerNodeStatuses = node.getPeerNodeStatuses();
+ for (int peerIndex = 0, peerCount = peerNodeStatuses.length;
peerIndex < peerCount; peerIndex++) {
+ PeerNodeStatus peerNodeStatus =
peerNodeStatuses[peerIndex];
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] {
generatePeerCircleStyleString(peerNodeStatus.getLocation()),
((peerNodeStatus.isConnected())?"connected":"disconnected") }, "x");
+ }
+ //
+ peerCircleInfoboxContentDiv.addChild("span", new String[] {
"style", "class" }, new String[] {
generatePeerCircleStyleString(node.getLocation()), "me" }, "x");
+ }
+
+ private String generatePeerCircleStyleString (double peerLocation)
+ {
+ int radius = 100;
+ peerLocation *= Math.PI * 2;
+ //
+ double x = radius + Math.sin(peerLocation) * radius;
+ double y = radius - Math.cos(peerLocation) * radius;
+ //
+ return "position: absolute; top: " + y + "px; left: " + x + "px";
+ }
+
private String sortString(boolean isReversed, String type) {
return (isReversed ? ("?sortBy="+type) :
("?sortBy="+type+"&reversed"));
}
Modified:
trunk/freenet/src/freenet/clients/http/staticfiles/themes/boxed/theme.css
===================================================================
--- trunk/freenet/src/freenet/clients/http/staticfiles/themes/boxed/theme.css
2006-12-16 22:13:18 UTC (rev 11455)
+++ trunk/freenet/src/freenet/clients/http/staticfiles/themes/boxed/theme.css
2006-12-17 01:52:27 UTC (rev 11456)
@@ -186,6 +186,30 @@
color: #840;
}
+div.peercircle span.mark {
+ color: #d0d0d0;
+}
+
+div.peercircle span.me {
+ color: #0080ff;
+ font-weight: bold;
+}
+
+div.peercircle span.connected {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.backed_off {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.disconnected {
+ color: #d0d0d0;
+ font-weight: bold;
+}
+
th {
text-align: center;
background-color: #aaa;
Modified:
trunk/freenet/src/freenet/clients/http/staticfiles/themes/clean/theme.css
===================================================================
--- trunk/freenet/src/freenet/clients/http/staticfiles/themes/clean/theme.css
2006-12-16 22:13:18 UTC (rev 11455)
+++ trunk/freenet/src/freenet/clients/http/staticfiles/themes/clean/theme.css
2006-12-17 01:52:27 UTC (rev 11456)
@@ -37,7 +37,7 @@
}
form {
- margin: 0;
+ margin: 0 0 5px 0;
padding: 0;
}
@@ -358,6 +358,30 @@
font-size: 7pt;
}
+div.peercircle span.mark {
+ color: #d0d0d0;
+}
+
+div.peercircle span.me {
+ color: #0080ff;
+ font-weight: bold;
+}
+
+div.peercircle span.connected {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.backed_off {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.disconnected {
+ color: #d0d0d0;
+ font-weight: bold;
+}
+
/* queue page */
table.queue th, table.queue td {
Modified:
trunk/freenet/src/freenet/clients/http/staticfiles/themes/grayandblue/theme.css
===================================================================
---
trunk/freenet/src/freenet/clients/http/staticfiles/themes/grayandblue/theme.css
2006-12-16 22:13:18 UTC (rev 11455)
+++
trunk/freenet/src/freenet/clients/http/staticfiles/themes/grayandblue/theme.css
2006-12-17 01:52:27 UTC (rev 11456)
@@ -372,6 +372,30 @@
font-size: 7pt;
}
+div.peercircle span.mark {
+ color: #d0d0d0;
+}
+
+div.peercircle span.me {
+ color: #0080ff;
+ font-weight: bold;
+}
+
+div.peercircle span.connected {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.backed_off {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.disconnected {
+ color: #d0d0d0;
+ font-weight: bold;
+}
+
/* queue page */
table.queue th, table.queue td {
@@ -457,25 +481,25 @@
table.queue span.key_is {
}
-
-div.n2ntm-message-text {
- margin: 10px;
- padding: 10px;
- background-color: #ffffff;
-}
-
-td.n2ntm-send-sent {
- background-color: #a7ffbc;
-}
-
-td.n2ntm-send-delayed {
- background-color: #ffeba7;
-}
-
-td.n2ntm-send-queued {
- background-color: #ffa7a7;
-}
-
-td.n2ntm-send-failed {
- background-color: #ffb7b7;
-}
+
+div.n2ntm-message-text {
+ margin: 10px;
+ padding: 10px;
+ background-color: #ffffff;
+}
+
+td.n2ntm-send-sent {
+ background-color: #a7ffbc;
+}
+
+td.n2ntm-send-delayed {
+ background-color: #ffeba7;
+}
+
+td.n2ntm-send-queued {
+ background-color: #ffa7a7;
+}
+
+td.n2ntm-send-failed {
+ background-color: #ffb7b7;
+}
Modified:
trunk/freenet/src/freenet/clients/http/staticfiles/themes/sky/theme.css
===================================================================
--- trunk/freenet/src/freenet/clients/http/staticfiles/themes/sky/theme.css
2006-12-16 22:13:18 UTC (rev 11455)
+++ trunk/freenet/src/freenet/clients/http/staticfiles/themes/sky/theme.css
2006-12-17 01:52:27 UTC (rev 11456)
@@ -366,6 +366,30 @@
font-size: 7pt;
}
+div.peercircle span.mark {
+ color: #d0d0d0;
+}
+
+div.peercircle span.me {
+ color: #0080ff;
+ font-weight: bold;
+}
+
+div.peercircle span.connected {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.backed_off {
+ color: #008000;
+ font-weight: bold;
+}
+
+div.peercircle span.disconnected {
+ color: #d0d0d0;
+ font-weight: bold;
+}
+
#reftext {
width: 100%;
}