Commit 38a788d5 authored by Alain Takoudjou's avatar Alain Takoudjou

prevent to load of large data for auto load slapgrid log

parent ea7bd536
...@@ -33,7 +33,8 @@ function getRunningState(){ ...@@ -33,7 +33,8 @@ function getRunningState(){
.scrollTop($("#salpgridLog")[0].scrollHeight - $("#salpgridLog") .scrollTop($("#salpgridLog")[0].scrollHeight - $("#salpgridLog")
.height()); .height());
} }
processState = (running && processState != "Running")?"Running":"Stopped"; if (running && processState=="Checking" && openedlogpage != ""){$("#salpgridLog").show();$("#manualLog").hide();}
processState = (running)?"Running":"Stopped";
}) })
.error(function() { clearAll(false); }) .error(function() { clearAll(false); })
.complete(function() { .complete(function() {
......
...@@ -13,17 +13,17 @@ $(document).ready( function() { ...@@ -13,17 +13,17 @@ $(document).ready( function() {
}); });
$("#live").change(function(){ $("#live").change(function(){
updatelogBox();$("#logconfigbox").find("input:radio").attr('checked', false);$("#live").attr('checked', true); updatelogBox();$("#logconfigbox").find("input:radio").attr('checked', false);$("#live").attr('checked', true);
setSpeed(500);setCookie("autoUpdate", "live");openedlogpage = $("input#type").val();}); setSpeed(100);setCookie("autoUpdate", "live");openedlogpage = $("input#type").val();});
$("#slow").change(function(){ $("#slow").change(function(){
updatelogBox();$("#logconfigbox").find("input:radio").attr('checked', false);$("#slow").attr('checked', true); updatelogBox();$("#logconfigbox").find("input:radio").attr('checked', false);$("#slow").attr('checked', true);
setSpeed(5000);setCookie("autoUpdate", "slow");openedlogpage = $("input#type").val();}); setSpeed(2500);setCookie("autoUpdate", "slow");openedlogpage = $("input#type").val();});
if(state){ if(state){
$("#"+state).attr('checked', true); $("#"+state).attr('checked', true);
updatelogBox(); updatelogBox();
if (state == "manual"){ if (state == "manual"){
openedlogpage = ""; setSpeed(0); openedlogpage = ""; setSpeed(0);
} }
else{setSpeed((state=="live")?500:5000);} else{setSpeed((state=="live")?100:2500);}
} }
else{$("#slow").attr('checked', true);} else{$("#slow").attr('checked', true);}
......
...@@ -483,8 +483,8 @@ def readFileFrom(f, lastPosition): ...@@ -483,8 +483,8 @@ def readFileFrom(f, lastPosition):
block = -1 block = -1
data = "" data = ""
length = bytes length = bytes
if lastPosition <= 0 and length > 50000: if lastPosition <= 0 and length > 30000:
lastPosition = 50000 lastPosition = length-30000
size = bytes - lastPosition size = bytes - lastPosition
while bytes > lastPosition: while bytes > lastPosition:
if abs(block*BUFSIZ) <= size: if abs(block*BUFSIZ) <= size:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment