summaryrefslogtreecommitdiff
path: root/htroot
diff options
context:
space:
mode:
authororbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-13 11:46:20 +0000
committerorbiter <orbiter@6c8d7289-2bf4-0310-a012-ef5d649a1542>2008-05-13 11:46:20 +0000
commitdb032fb6de659bf635df32d1257273deac0ea28a (patch)
treef287fd3c4b06d03f9e8472416278db6eef1f058d /htroot
parent239cc4428d3b404a33e72063296c48e288907985 (diff)
- added RWI transmissions to the event terminal
- fixed bug in Collage - added 'embedded mode' to collage - integrated Collage to terminal_p as iframe in embedded mode (Pictures now visible in terminal_p) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4797 6c8d7289-2bf4-0310-a012-ef5d649a1542
Diffstat (limited to 'htroot')
-rwxr-xr-xhtroot/Collage.html11
-rwxr-xr-xhtroot/Collage.java38
-rw-r--r--htroot/Status.html2
-rwxr-xr-xhtroot/terminal_p.html10
-rw-r--r--htroot/yacy/transferRWI.java3
-rw-r--r--htroot/yacy/transferURL.java5
6 files changed, 49 insertions, 20 deletions
diff --git a/htroot/Collage.html b/htroot/Collage.html
index 61d2b1821..f47cbacef 100755
--- a/htroot/Collage.html
+++ b/htroot/Collage.html
@@ -18,7 +18,12 @@ form dd {
</style>
<meta http-equiv="REFRESH" content="#[refresh]#" />
</head>
-<body style="margin:0px;">
+<body>
+#(emb)#
+<script type="text/javascript">
+document.body.style.background = "#000";
+</script>
+::
#%env/templates/header.template%#
#%env/templates/submenuWebStructure.template%#
<h2>Collage</h2>
@@ -33,13 +38,15 @@ form dd {
</dl>
</form>
</div>
-
+#(/emb)#
#(imgurl)#
::
#{list}#
#[url]#
#{/list}#
#(/imgurl)#
+#(emb)#::
#%env/templates/footer.template%#
+#(/emb)#
</body>
</html> \ No newline at end of file
diff --git a/htroot/Collage.java b/htroot/Collage.java
index 1f01cfc6a..80594db11 100755
--- a/htroot/Collage.java
+++ b/htroot/Collage.java
@@ -46,9 +46,7 @@ import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
public class Collage {
- private static final int fifoMax = 20;
- private static final int posXMax = 800;
- private static final int posYMax = 500;
+ private static int fifoMax = 20;
private static int fifoPos = -1;
private static int fifoSize = 0;
@@ -65,12 +63,24 @@ public class Collage {
public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch<?> env) {
final serverObjects prop = new serverObjects();
final plasmaSwitchboard sb = (plasmaSwitchboard) env;
- final boolean authenticated = sb.adminAuthenticated(header) >= 2;
+ final boolean authenticated = sb.verifyAuthentication(header, false);
ResultImages.OriginEntry nextOrigin = ResultImages.next(!authenticated);
+ int posXMax = 800;
+ int posYMax = 500;
+ boolean embed = false;
+
+ if (post != null) {
+ embed = post.containsKey("emb");
+ posXMax = post.getInt("width", posXMax);
+ posYMax = post.getInt("height", posYMax);
+ if (post.containsKey("max")) fifoMax = post.getInt("max", fifoMax);
+ }
+ prop.put("emb", (embed) ? "0" : "1");
if (nextOrigin != null) {
+ System.out.println("NEXTORIGIN=" + nextOrigin.imageEntry.url().toNormalform(true, false));
if (fifoSize == 0 || origins[fifoPos] != nextOrigin) {
- fifoPos = fifoPos + 1 == fifoMax ? 0 : fifoPos + 1;
+ fifoPos = fifoPos + 1 >= fifoMax ? 0 : fifoPos + 1;
fifoSize = fifoSize + 1 > fifoMax ? fifoMax : fifoSize + 1;
origins[fifoPos] = nextOrigin;
@@ -78,8 +88,8 @@ public class Collage {
imgWidth[fifoPos] = (int) (((float)nextOrigin.imageEntry.width()) / scale);
imgHeight[fifoPos] = (int) (((float)nextOrigin.imageEntry.height()) / scale);
- imgPosX[fifoPos] = rand.nextInt(posXMax);
- imgPosY[fifoPos] = rand.nextInt(posYMax);
+ imgPosX[fifoPos] = rand.nextInt((imgWidth[fifoPos] == 0) ? posXMax / 2 : Math.max(1, posXMax - imgWidth[fifoPos]));
+ imgPosY[fifoPos] = rand.nextInt((imgHeight[fifoPos] == 0) ? posYMax / 2 : Math.max(1, posYMax - imgHeight[fifoPos]));
imgZIndex[fifoPos] = zIndex;
zIndex += 1;
@@ -92,11 +102,13 @@ public class Collage {
for (int i = 0; i < fifoSize; i++)
prop.put("imgurl_list_" + i + "_url",
"<a href=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"
- + "<img src=\"" + origins[i].imageEntry.url().toNormalform(true, false) + "\" style=\"width:" + imgWidth[i]
- + "px;height:" + imgHeight[i]
- + "px;position:absolute;top:" + imgPosY[i]
+ + "<img src=\"" + origins[i].imageEntry.url().toNormalform(true, false) + "\" "
+ + "style=\""
+ + ((imgWidth[i] == 0 || imgHeight[i] == 0) ? "" : "width:" + imgWidth[i] + "px;height:" + imgHeight[i] + "px;")
+ + "position:absolute;top:" + imgPosY[i]
+ "px;left:" + imgPosX[i]
- + "px;z-index:" + imgZIndex[i] + "\" title=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"
+ + "px;z-index:" + imgZIndex[i] + "\""
+ + "title=\"" + origins[i].baseURL.toNormalform(true, false) + "\">"
+ "</a><br>");
prop.put("imgurl_list", fifoSize);
@@ -105,8 +117,8 @@ public class Collage {
}
prop.putNum("refresh", Math.max(2, Math.min(5, 500 / (1 + ResultImages.queueSize(!authenticated)))));
- prop.put("privateQueueSize", ResultImages.privateQueueHighSize() + "+" + ResultImages.privateQueueLowSize());
- prop.put("publicQueueSize", ResultImages.publicQueueHighSize() + "+" + ResultImages.publicQueueLowSize());
+ prop.put("emb_privateQueueSize", ResultImages.privateQueueHighSize() + "+" + ResultImages.privateQueueLowSize());
+ prop.put("emb_publicQueueSize", ResultImages.publicQueueHighSize() + "+" + ResultImages.publicQueueLowSize());
return prop;
}
} \ No newline at end of file
diff --git a/htroot/Status.html b/htroot/Status.html
index f1f1fc190..4e3563edc 100644
--- a/htroot/Status.html
+++ b/htroot/Status.html
@@ -37,7 +37,7 @@
<div class="welcome">
<center>
<h2>Welcome to YaCy!</h2><br />
- <iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING&width=468px&height=200px&maxlines=18&maxwidth=95"
+ <iframe src="rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING,INDEXRECEIVE&width=468px&height=200px&maxlines=18&maxwidth=95"
width="482" height="220" scrolling="no" name="newsframe"
marginheight="0" marginwidth="0" frameborder="0"></iframe><br />
<img src="Banner.png?textcolor=000000&amp;bgcolor=ddeeee&amp;bordercolor=aaaaaa" alt="banner" />
diff --git a/htroot/terminal_p.html b/htroot/terminal_p.html
index 716e8b6b3..9781af388 100755
--- a/htroot/terminal_p.html
+++ b/htroot/terminal_p.html
@@ -46,15 +46,19 @@ function init() {
<div id="left"> <!-- begin left side -->
<div class="navouter">
-<div class="navheader">Terminal</div>
+<div class="navheader">Event Terminal</div>
<div class="navcontent">
-<iframe src="/rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING&width=430px&height=200px&maxlines=24&maxwidth=95&color=fff&background=000"
+<iframe src="/rssTerminal.html?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING,INDEXRECEIVE&width=430px&height=200px&maxlines=24&maxwidth=95&color=fff&background=000"
width="430" height="220" scrolling="no" name="newsframe"
marginheight="0" marginwidth="0" frameborder="0">
</iframe>
</div>
</div>
-
+<h1>Image Terminal</h1>
+<iframe src="/Collage.html?emb=&width=468&height=460&max=3"
+ width="468" height="460" scrolling="no" name="newsframe"
+ marginheight="0" marginwidth="0" frameborder="0">
+</iframe>
</div> <!-- end left side -->
diff --git a/htroot/yacy/transferRWI.java b/htroot/yacy/transferRWI.java
index 297637c7e..ace2ed616 100644
--- a/htroot/yacy/transferRWI.java
+++ b/htroot/yacy/transferRWI.java
@@ -58,6 +58,8 @@ import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.tools.nxTools;
+import de.anomic.xml.RSSFeed;
+import de.anomic.xml.RSSMessage;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacyDHTAction;
import de.anomic.yacy.yacyNetwork;
@@ -198,6 +200,7 @@ public final class transferRWI {
} else {
final double avdist = (yacyDHTAction.dhtDistance(sb.wordIndex.seedDB.mySeed().hash, wordhashes[0]) + yacyDHTAction.dhtDistance(sb.wordIndex.seedDB.mySeed().hash, wordhashes[received - 1])) / 2.0;
sb.getLog().logInfo("Received " + received + " Entries " + wordc + " Words [" + wordhashes[0] + " .. " + wordhashes[received - 1] + "]/" + avdist + " from " + otherPeerName + ", processed in " + (System.currentTimeMillis() - startProcess) + " milliseconds, requesting " + unknownURL.size() + "/" + receivedURL + " URLs, blocked " + blocked + " RWIs");
+ RSSFeed.channels(RSSFeed.INDEXRECEIVE).addMessage(new RSSMessage("Received " + received + " RWIs [" + wordhashes[0] + " .. " + wordhashes[received - 1] + "]/" + avdist + " from " + otherPeerName + ", requesting " + unknownURL.size() + " URLs, blocked " + blocked, "", ""));
}
result = "ok";
diff --git a/htroot/yacy/transferURL.java b/htroot/yacy/transferURL.java
index d88f6303e..535f50a23 100644
--- a/htroot/yacy/transferURL.java
+++ b/htroot/yacy/transferURL.java
@@ -56,6 +56,8 @@ import de.anomic.server.serverCore;
import de.anomic.server.serverObjects;
import de.anomic.server.serverSwitch;
import de.anomic.server.serverDate;
+import de.anomic.xml.RSSFeed;
+import de.anomic.xml.RSSMessage;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacyNetwork;
import de.anomic.yacy.yacySeed;
@@ -169,7 +171,8 @@ public final class transferURL {
// return rewrite properties
final int more = sb.wordIndex.countURL() - sizeBefore;
doublevalues = Integer.toString(received - more);
- sb.getLog().logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, Blocked " + blocked + " URLs");
+ sb.getLog().logInfo("Received " + received + " URLs from peer " + otherPeerName + " in " + (System.currentTimeMillis() - start) + " ms, blocked " + blocked + " URLs");
+ RSSFeed.channels(RSSFeed.INDEXRECEIVE).addMessage(new RSSMessage("Received " + received + " URLs from peer " + otherPeerName + ", blocked " + blocked, "", ""));
if ((received - more) > 0) sb.getLog().logSevere("Received " + doublevalues + " double URLs from peer " + otherPeerName);
result = "ok";
}