Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

small update for RichClient LogViewer

apfelmaennchen42d936288eaf
diff --git a/htroot/yacy/ui/css/base.css b/htroot/yacy/ui/css/base.css
index 53fc9f286..1f8c2b825 100644
--- a/htroot/yacy/ui/css/base.css
+++ b/htroot/yacy/ui/css/base.css
@@ -170,6 +170,28 @@ img.help {
.flexigrid div.fbutton .deleteTag {
background: url(../img/tags/tag_blue_delete.png) no-repeat center left;
}
+.flexigrid div.fbutton .log-debug {
+ background: url(../img-2/magnify.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-info {
+ background: url(../img-2/info.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-system {
+ background: url(../img-2/accept_green.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-warning {
+ background: url(../img/blacklist.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-error {
+ background: url(../img-2/stop.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-new {
+ background: url(../img-2/new.png) no-repeat center left;
+}
+.flexigrid div.fbutton .log-more {
+ /* background: url(../img/flexigrid/uup.png) no-repeat center left; */
+ margin-left: -20px;
+}
/* YaCy Bookmarks ---------------------------*/
.url {
diff --git a/htroot/yacy/ui/yacyui-view-log.html b/htroot/yacy/ui/yacyui-view-log.html
index a322737a2..1e2dc3e47 100644
--- a/htroot/yacy/ui/yacyui-view-log.html
+++ b/htroot/yacy/ui/yacyui-view-log.html
@@ -1,8 +1,7 @@
<script type="text/javascript">
//<![CDATA[
- $(document).ready(function() {
- var height = document.documentElement.clientHeight - 180;
-
+ $(document).ready(function() {
+ var height = document.documentElement.clientHeight - 230;
$("#ylog").flexigrid({
url: "/ViewLog_p.json",
dataType: 'json',
@@ -17,16 +16,38 @@
striped: true,
nowrap: false,
height: height,
- autoload: true,
+ autoload: true,
+ useRp: true,
+ rp: 50,
+ usepager: false,
+ rpOptions: [50,100,200,300,400],
+ searchitems : [
+ {display: 'Filter RegExp', name : 'filter'}
+ ],
+ query: '.*.*',
+ buttons: [
+ {name: '50', bclass: 'log-new', onpress: filter},
+ {name: '200', bclass: 'log-more', onpress: filter},
+ {name: '400', bclass: 'log-more', onpress: filter},
+ {separator: true},
+ {name: 'Debug', bclass: 'log-debug', onpress: filter},
+ {name: 'Info', bclass: 'log-info', onpress: filter},
+ {name: 'System', bclass: 'log-system', onpress: filter},
+ {name: 'Warning', bclass: 'log-warning', onpress: filter},
+ {name: 'Error', bclass: 'log-error', onpress: filter},
+ {separator: true},
+ {name: 'Help', bclass: 'help', onpress: function() {}},
+ ],
preProcess: function(data) {
var clientname = data.clientname;
var lines = data.line;
var maxlines = data.maxlines;
var reverse = data.reverse;
var rows = {};
+ var counter = 0;
$.each (
data.loglines,
- function(i,item) {
+ function(i,item) {
if (item) {
var icon = "";
if (item.loglevel == "Debug") icon = "<img style='margin-top: 8px;' src='img-2/magnify.png' alt='Debug' title='Debug'/>";
@@ -38,18 +59,25 @@
var type = item.logline.substring(22,40).split(' ');
var log = item.logline.substring(22+type[0].length);
rows[i] = {id: i, cell: [icon, date, type[0], log]};
+ counter++;
}
}
);
+ counter--;
+ this.pagestat = "Displaying "+counter+" matching log lines of "+this.rp+" parsed log lines";
var pdata = {
page: 1,
total: lines,
rows: rows
};
+ $('#ylog tbody').empty();
return pdata;
},
onSubmit: function() {
- var p = this;
+ $('#ylog').empty();
+ $('#ylog').append("<div class='yloading'><h3 class='linktitle'><em>Loading Server Log...</em><br/><img src='/yacy/ui/img/loading2.gif' align='absmiddle'/></h3></div>");
+
+ var p = this;
var g = $("#ylog");
$('.pPageStat',this.pDiv).html(p.procmsg);
@@ -61,25 +89,43 @@
if (p.page>p.pages) p.page = p.pages;
var param = [
- { name : 'lines', value : "200" }
+ { name : 'lines', value : p.rp }
,{ name : 'json', value : "true" }
- ,{ name : 'filter', value : ".*.*" }
+ ,{ name : 'filter', value : p.query }
,{ name : 'reverse', value : "true"}
- ];
-
+ ];
if (p.params) {
for (var pi = 0; pi < p.params.length; pi++) param[param.length] = p.params[pi];
}
$.getJSON(p.url, param,
- function(json, status){
+ function(json, status){
g.flexAddData(json);
}
);
}
});
- });
+ });
+ function filter(com) {
+ var f = ".*.*";
+ var rp = 400;
+ if(com == "50") { f=".*.*"; rp = 50; };
+ if(com == "200") { f=".*.*"; rp = 200; };
+ if(com == "400") { f=".*.*"; rp = 400; };
+ if(com == "Debug") f="^D.*";
+ if(com == "Info") f="^I.*";
+ if(com == "System") f="^S.*";
+ if(com == "Warning") f="^W.*";
+ if(com == "Error") f="^E.*";
+ $('#ylog').flexOptions({
+ query: f,
+ qtype: "filter",
+ rp: rp
+ });
+ $('#ylog').flexReload();
+ }
//]]>
</script>
+<!-- Flexigrid -->
<table id="ylog">
<tbody></tbody>
-</table>
\ No newline at end of file
+</table>