From: Jan Michel Date: Thu, 17 Oct 2013 13:55:40 +0000 (+0200) Subject: added auto refresh after write X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=6a4a42162c4d821b7d256db016fd93eb63edaaa1;p=daqtools.git added auto refresh after write --- diff --git a/web/htdocs/commands/xmlpage.pm b/web/htdocs/commands/xmlpage.pm index 9bec500..4cbfd58 100644 --- a/web/htdocs/commands/xmlpage.pm +++ b/web/htdocs/commands/xmlpage.pm @@ -3,25 +3,8 @@ package xmlpage; my $active = 0; -my $n = 0; my @setup; -sub getView { - my ($n) = @_; -# $active = $n; - - if($setup[$n]->{refresh}) { - print qq||; - } - print qq|
|; - print qq||; - - -} - sub initPage { my ($ref_setup,$page) = @_; @@ -44,7 +27,7 @@ sub initPage { EOF - printJavaScripts(); + printJavaScripts($active); print qq( @@ -58,7 +41,15 @@ for ( my $s = 0; $s < scalar @setup; $s++) { print qq(); if ($active!=-1) { - getView($active); + + if($setup[$active]->{refresh}) { + print qq||; + } + print qq|
|; + print qq||; } print <
Debug Output
- - +
- - EOF @@ -81,26 +69,30 @@ EOF sub printJavaScripts { - + my ($n) = @_; ####### javascript function land ################ - print < -EOF +|; } diff --git a/web/htdocs/index.html b/web/htdocs/index.html index ad76128..2d1c7be 100755 --- a/web/htdocs/index.html +++ b/web/htdocs/index.html @@ -37,8 +37,14 @@ The main documentation of the network can be found in these two documents:
  • CTS Control
  • TDC
  • TDC Debug +
  • TDC (xml-based) + + +
    • TrbNet status
    • GbE status
    • Network Map diff --git a/web/htdocs/scripts/scriptsnew.js b/web/htdocs/scripts/scriptsnew.js index 1bc169f..ae2e084 100644 --- a/web/htdocs/scripts/scriptsnew.js +++ b/web/htdocs/scripts/scriptsnew.js @@ -17,7 +17,7 @@ function getdata(command,callback) { } -function getdataprint(command,dId,async,time) { +function getdataprint(command,dId,async,time,callback) { //async==true : do what you can when you can do it :D //async==false : do the task after you finished the previous task! @@ -25,9 +25,9 @@ function getdataprint(command,dId,async,time) { // alert("caller is " + arguments.callee.caller.toString()); var xmlhttp = null; - //var cb = null; + var cb = null; xmlhttp=new XMLHttpRequest(); - //cb = callback; + cb = callback; var destId = dId; var cmd = command; var asynci = async; @@ -39,6 +39,9 @@ function getdataprint(command,dId,async,time) { if(document.getElementById(destId)){ document.getElementById(destId).innerHTML = xmlhttp.responseText; } + if(cb) { + cb(); + } if(time) { setTimeout("getdataprint('"+cmd+"','"+destId+"','"+asynci+"','"+timei+"')",timei); }