From 2eabd989ce59a99121838721d614c50cfb6ceb66 Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Sat, 25 Apr 2009 20:58:56 +0000 Subject: [PATCH] - added a log viewer to RichClient (alpha version, very slow) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5878 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/ViewLog_p.java | 10 ++-- htroot/ViewLog_p.json | 13 +++++ htroot/yacy/ui/index.html | 28 ++++++---- htroot/yacy/ui/yacyui-view-log.html | 84 +++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+), 14 deletions(-) create mode 100644 htroot/ViewLog_p.json create mode 100644 htroot/yacy/ui/yacyui-view-log.html diff --git a/htroot/ViewLog_p.java b/htroot/ViewLog_p.java index f07b70eb1..dbbd79032 100644 --- a/htroot/ViewLog_p.java +++ b/htroot/ViewLog_p.java @@ -45,6 +45,7 @@ public class ViewLog_p { final serverObjects prop = new serverObjects(); String[] log = new String[0]; boolean reversed = false; + boolean json = false; int maxlines = 400, lines = 200; String filter = ".*.*"; @@ -58,6 +59,9 @@ public class ViewLog_p { if(post.containsKey("filter")){ filter = post.get("filter"); } + if(post.containsKey("json")){ + json = true; + } } @@ -104,10 +108,10 @@ public class ViewLog_p { else if (nextLogLine.startsWith("W ")) level = 3; else if (nextLogLine.startsWith("S ")) level = 2; else if (nextLogLine.startsWith("I ")) level = 1; - else if (nextLogLine.startsWith("D ")) level = 0; - + else if (nextLogLine.startsWith("D ")) level = 0; prop.put("log_" + lc + "_level", level); - prop.putHTML("log_" + lc + "_line", nextLogLine); + if (json) prop.putJSON("log_" + lc + "_line", nextLogLine); + else prop.put("log_" + lc + "_line", nextLogLine); lc++; } prop.put("log", lc); diff --git a/htroot/ViewLog_p.json b/htroot/ViewLog_p.json new file mode 100644 index 000000000..cad3282c2 --- /dev/null +++ b/htroot/ViewLog_p.json @@ -0,0 +1,13 @@ +{ + "clientname": "#[clientname]#", + "line": "#[lines]#", + "maxlines": "#[maxlines]#", + "reverse": "#(reverseChecked)#false::true#(/reverseChecked)#", + "filter": "#[filter]#", + "loglines": [ + #{log}#{ + "loglevel": "#(level)#Debug::Info::System::Warning::Error#(/level)#", + "logline": "#[line]#" + },#{/log}#{loglevel: "", logline: ""} + ] +} \ No newline at end of file diff --git a/htroot/yacy/ui/index.html b/htroot/yacy/ui/index.html index abe6e3318..db07b618e 100644 --- a/htroot/yacy/ui/index.html +++ b/htroot/yacy/ui/index.html @@ -12,15 +12,14 @@ - + - - - + + @@ -52,6 +51,7 @@ return (this.match(str+"$")==str) } $(function() { + theme = "start"; qtag = ""; flex = {}; bmk_tab = 2; @@ -157,7 +157,7 @@ /* Select Theme Dialog */ $("#theme_select").dialog({ autoOpen: false, - height: 220, + height: 270, width: 275, position: ['top',200], modal: true, @@ -172,7 +172,7 @@ } }); $("#theme").change(function() { - var src = "css/themes/" + $("#theme").getValue() +"/images/theme.png"; + var src = "img/themes/"+$("#theme").getValue()+".png"; $("#theme_preview").attr("src", src).trigger("update"); }); /* Initialize Edit Tags Dialog */ @@ -310,7 +310,8 @@
  • About YaCy-UI
  • Admin Console
  • -
  • Bookmarks
  • +
  • Bookmarks
  • +
  • Server Log
  • @@ -380,16 +381,20 @@

    This dialog lets you select an alternate theme/skin for YaCy-UI.

    - + - + + - + +

    You can + download ready made themes or create + your own custom theme. Themes are installed into
    DATA/HTDOCS/yacy/ui/css/themes/

    @@ -397,3 +402,4 @@ + diff --git a/htroot/yacy/ui/yacyui-view-log.html b/htroot/yacy/ui/yacyui-view-log.html new file mode 100644 index 000000000..634411ae5 --- /dev/null +++ b/htroot/yacy/ui/yacyui-view-log.html @@ -0,0 +1,84 @@ + + + +
    \ No newline at end of file