- better domain graph, faster when more links exist, looks better

- new authorization rule: localhost is always authorized for administration. This solves many problems with ajax, and also fixed a problem in rssTerminal
- fix bug in RSSFeed which prevented that entries had been recognized as individual, new entries
- added reloading/updating of status image on status page

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4796 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 415b92bb07
commit 239cc4428d

@ -3,8 +3,21 @@
<head>
<title>YaCy '#[clientname]#': Console Status</title>
#%env/templates/metas.template%#
<script type="text/javascript">
function loadBanner() {
for (var i = 0; i < document.images.length; i++) {
if (document.images[i].src.indexOf("Banner.png") > 0) {
document.images[i].src = "/Banner.png?textcolor=000000&amp;bgcolor=ddeeee&amp;bordercolor=aaaaaa&time=" + (new Date()).getTime();
break;
}
}
}
function init() {
loaderBanner = window.setInterval("loadBanner()", 20000);
}
</script>
</head>
<body style="margin:0px;">
<body onload="init();">
#%env/templates/header.template%#
#%env/templates/submenuConfig.template%#

@ -42,7 +42,7 @@ public void setup() {
size(660, 400);
smooth();
frameRate( 12 );
frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@ -78,10 +78,11 @@ public void initializePhysics() {
}
public void draw() {
processRequestResponse(20);
processRequestResponse(50);
physics.tick( 1.0f );
HashSet invisible = invisibleParticles();
deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@ -90,7 +91,7 @@ public void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
drawNetwork(invisible);
drawNetwork();
}
public void initRequest(boolean update) {
@ -153,6 +154,7 @@ public void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@ -209,7 +211,19 @@ public HashSet invisibleParticles() {
return particles;
}
public void drawNetwork(HashSet invisible) {
public void deleteParticles(HashSet particles) {
Iterator j = nodes.values().iterator();
host h;
while (j.hasNext()) {
h = (host) j.next();
if (particles.contains(h.node)) {
h.node.kill();
j.remove();
}
}
}
public void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@ -220,7 +234,6 @@ public void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@ -236,9 +249,7 @@ public void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}

@ -42,7 +42,7 @@ void setup() {
size(660, 400);
smooth();
frameRate( 12 );
frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@ -78,10 +78,11 @@ void initializePhysics() {
}
void draw() {
processRequestResponse(20);
processRequestResponse(50);
physics.tick( 1.0 );
HashSet invisible = invisibleParticles();
deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@ -90,7 +91,7 @@ void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
drawNetwork(invisible);
drawNetwork();
}
void initRequest(boolean update) {
@ -153,6 +154,7 @@ void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@ -209,7 +211,19 @@ HashSet invisibleParticles() {
return particles;
}
void drawNetwork(HashSet invisible) {
void deleteParticles(HashSet particles) {
Iterator j = nodes.values().iterator();
host h;
while (j.hasNext()) {
h = (host) j.next();
if (particles.contains(h.node)) {
h.node.kill();
j.remove();
}
}
}
void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@ -220,7 +234,6 @@ void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@ -236,9 +249,7 @@ void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}

@ -42,7 +42,7 @@ void setup() {
size(660, 400);
smooth();
frameRate( 12 );
frameRate( 6 );
strokeWeight( 1 );
ellipseMode( CENTER );
@ -78,10 +78,11 @@ void initializePhysics() {
}
void draw() {
processRequestResponse(20);
processRequestResponse(50);
physics.tick( 1.0 );
HashSet invisible = invisibleParticles();
deleteParticles(invisible);
if (physics.numberOfParticles() > 1) updateCentroid(invisible);
centroid.tick();
@ -90,7 +91,7 @@ void draw() {
scale( centroid.z() );
translate( -centroid.x(), -centroid.y() );
drawNetwork(invisible);
drawNetwork();
}
void initRequest(boolean update) {
@ -153,6 +154,7 @@ void processCitation(HashMap props) {
}
h.time = System.currentTimeMillis();
host p = (host) nodes.get(parsingHostID); // this should be successful
if (p == null) return;
// prevent that a spring is made twice
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring(i);
@ -209,7 +211,19 @@ HashSet invisibleParticles() {
return particles;
}
void drawNetwork(HashSet invisible) {
void deleteParticles(HashSet particles) {
Iterator j = nodes.values().iterator();
host h;
while (j.hasNext()) {
h = (host) j.next();
if (particles.contains(h.node)) {
h.node.kill();
j.remove();
}
}
}
void drawNetwork() {
// draw vertices
fill( 120, 255, 120 );
@ -220,7 +234,6 @@ void drawNetwork(HashSet invisible) {
while (j.hasNext()) {
h = (host) j.next();
Particle v = h.node;
if (invisible.contains(v)) continue;
ellipse(v.position().x(), v.position().y(), NODE_SIZE, NODE_SIZE);
name = h.name;
text(name, v.position().x() - (name.length() * 26 / 10), v.position().y() + 14);
@ -236,9 +249,7 @@ void drawNetwork(HashSet invisible) {
for ( int i = 0; i < physics.numberOfSprings(); ++i ) {
Spring e = physics.getSpring( i );
Particle a = e.getOneEnd();
if (invisible.contains(a)) continue;
Particle b = e.getTheOtherEnd();
if (invisible.contains(b)) continue;
line(a.position().x(), a.position().y(), b.position().x(), b.position().y());
}

@ -36,6 +36,7 @@ var lastwait = 1000;
var tab = "&nbsp;&nbsp;";
var lastShow = new Date();
var set = "";
var requestCount = 0;
function fillLines() {
alert(maxlines);
@ -121,7 +122,8 @@ function idlepingExec() {
}
function load() {
getRSS("/xml/feed.rss?count=50&set=" + set);
getRSS("/xml/feed.rss?count=50&set=" + set + "&requestCount=" + requestCount + "&time=" + (new Date()).getTime());
requestCount++;
}
function init() {

@ -303,7 +303,10 @@ public final class httpdFileHandler {
int pos = path.lastIndexOf(".");
if ((path.substring(0,(pos==-1)?path.length():pos)).endsWith("_p") && (adminAccountBase64MD5.length() != 0)) {
if ((!clientIP.equals("localhost")) &&
(!clientIP.startsWith("0:0:0:0:0:0:0:1")) &&
(path.substring(0,(pos==-1)?path.length():pos)).endsWith("_p") &&
(adminAccountBase64MD5.length() != 0)) {
//authentication required
//userDB
if(sb.userDB.hasAdminRight(authorization, conProp.getProperty(httpHeader.CONNECTION_PROP_CLIENTIP), requestHeader.getHeaderCookies())){

@ -297,6 +297,7 @@ public final class plasmaSearchRankingProcess {
while ((stack.size() > 0) || (size() > 0)) {
if (((stack.size() == 0) && (size() == 0))) break;
kelondroSortStack<indexRWIVarEntry>.stackElement obrwi = bestRWI(skipDoubleDom);
if (obrwi == null) continue; // *** ? this happenened and the thread was suspended silently. cause?
indexURLReference u = wordIndex.getURL(obrwi.element.urlHash(), obrwi.element, obrwi.weight.longValue());
if (u != null) {
indexURLReference.Components comp = u.comp();

@ -2397,14 +2397,15 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<plasmaSwitchbo
public int adminAuthenticated(httpHeader header) {
String adminAccountBase64MD5 = getConfig(httpd.ADMIN_ACCOUNT_B64MD5, "");
//String adminAccountBase64MD5 = getConfig(httpd.ADMIN_ACCOUNT_B64MD5, "");
String authorization = ((String) header.get(httpHeader.AUTHORIZATION, "xxxxxx")).trim().substring(6);
// security check against too long authorization strings
if (authorization.length() > 256) return 0;
// authorization by encoded password, only for localhost access
if ((((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")).equals("localhost")) && (adminAccountBase64MD5.equals(authorization))) return 3; // soft-authenticated for localhost
String clientIP = (String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "");
if ((clientIP.equals("localhost") || clientIP.startsWith("0:0:0:0:0:0:0:1")) /*&& (adminAccountBase64MD5.equals(authorization))*/) return 3; // soft-authenticated for localhost
// authorization by hit in userDB
if (userDB.hasAdminRight((String) header.get(httpHeader.AUTHORIZATION, "xxxxxx"), ((String) header.get(httpHeader.CONNECTION_PROP_CLIENTIP, "")), header.getHeaderCookies())) return 4; //return, because 4=max

@ -691,7 +691,7 @@ public final class plasmaWordIndex implements indexRI {
"Anchors: " + ((document.getAnchors() == null) ? 0 : document.getAnchors().size()) +
"\n\tLinkStorageTime: " + (storageEndTime - startTime) + " ms | " +
"indexStorageTime: " + (indexingEndTime - storageEndTime) + " ms");
RSSFeed.channels((entry.initiator().equals(seedDB.mySeed().hash)) ? RSSFeed.LOCALINDEXING : RSSFeed.REMOTEINDEXING).addMessage(new RSSMessage("Indexed web page", "", entry.url().toNormalform(true, false)));
RSSFeed.channels((entry.initiator().equals(seedDB.mySeed().hash)) ? RSSFeed.LOCALINDEXING : RSSFeed.REMOTEINDEXING).addMessage(new RSSMessage("Indexed web page", dc_title, entry.url().toNormalform(true, false)));
}
// finished

@ -40,6 +40,9 @@ public class RSSFeed implements Iterable<RSSMessage> {
public static final String REMOTEINDEXING = "REMOTEINDEXING";
public static final String LOCALINDEXING = "LOCALINDEXING";
// test:
// http://localhost:8080/xml/feed.rss?set=PEERNEWS,REMOTESEARCH,LOCALSEARCH,REMOTEINDEXING,LOCALINDEXING
/**
* the following private channels are declared to prevent that an access to the feed servlet
* gets results from news channels that are not for the public
@ -152,7 +155,9 @@ public class RSSFeed implements Iterable<RSSMessage> {
private static final ConcurrentHashMap<String, RSSFeed> channels = new ConcurrentHashMap<String, RSSFeed>();
public static RSSFeed channels(String channelName) {
RSSFeed feed = channels.get(channelName);
ConcurrentHashMap<String, RSSFeed> channelss = channels;
RSSFeed feed = channelss.get(channelName);
if (feed == null) System.out.println("channel " + channelName + " is new");
if (feed != null) return feed;
feed = new RSSFeed();
feed.setChannel(new RSSMessage(channelName, "", ""));

@ -65,7 +65,7 @@ public class RSSMessage {
setValue("description", description);
setValue("link", link);
setValue("pubDate", new Date().toString());
setValue("guid", Integer.toHexString((title + description).hashCode()));
setValue("guid", Integer.toHexString((title + description + link).hashCode()));
}
public RSSMessage() {

Loading…
Cancel
Save