bkruse: branch 2.0 r3996 - /branches/2.0/config/cdr.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Oct 21 16:04:09 CDT 2008


Author: bkruse
Date: Tue Oct 21 16:04:08 2008
New Revision: 3996

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3996
Log:
Fix for CDR page as reported by dkerr.
(patch by dkerr)
(closes issue #13748)

Modified:
    branches/2.0/config/cdr.html

Modified: branches/2.0/config/cdr.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/cdr.html?view=diff&rev=3996&r1=3995&r2=3996
==============================================================================
--- branches/2.0/config/cdr.html (original)
+++ branches/2.0/config/cdr.html Tue Oct 21 16:04:08 2008
@@ -115,8 +115,9 @@
 		e.innerHTML = "";
 		var d = document.createElement("TABLE");
 		d.style.overflow = "scroll" ;
-
-		_$("info").innerHTML = "Viewing " + (offset+1) + "-" + (offset+viewCount) + " of " + records.length;
+		var nCdrs = records.length - 1; /* used several places */
+
+		_$("info").innerHTML = "Viewing " + (offset+1) + "-" + Math.min(offset+viewCount,nCdrs) + " of " + nCdrs; /* find minimum of end of offset and total number of CDRs */
 
 		var tr = document.createElement("tr");
 		tr.className = "tr2";
@@ -129,10 +130,10 @@
 
 		d.appendChild(tr);
 
-		for(var i=0;c--&&isset(records[i+offset]);i++) {
+		for(var i=0;c--&&isset(records[nCdrs-(i+offset+1)]);i++) { /* working backwards from end */
 			var tr = document.createElement("tr");
 			tr.className = "tr"+(i%2);
-			var r = records[i+offset];
+			var r = records[nCdrs-(i+offset+1)]; /* working backwards from end */
 			
 			for(var j=-1;j<r.length;j++) {
 	
@@ -168,7 +169,6 @@
 	var localajaxinit = function() {
 
 		_$('engine').innerHTML = backend;
-		prefix = '/';
 		
 		var jc = context2json({filename: "cdr.conf", context: "general", usf:1 });
 		
@@ -178,10 +178,6 @@
 		
 		var c = context2json({ filename:'http.conf', context: 'general', usf:1 });
 
-		if (c['prefix'] != "undefined") {
-			prefix = "/" + c['prefix'] + "/";
-		}
-
 		if( c.hasOwnProperty('enablestatic') && !c['enablestatic'].isAstTrue() ) {
 			alert("You do not have static file support in http.conf. Set 'enablestatic' = yes in http.conf");
 		}
@@ -189,7 +185,7 @@
 		parent.ASTGUI.dialog.waitWhile(' Grabbing your Records... ');
 
 		parent.ASTGUI.systemCmd(ASTGUI.scripts.mastercsvexists, function (){
-			var content = ASTGUI.loadHTML(prefix + "static/config/Master.csv");
+			var content = ASTGUI.loadHTML("./Master.csv"); /* "./" is good enough. */
 			records = content.split("\n");
 			for(var i=0;i<records.length;i++)
 				records[i] = records[i].split(",");




More information about the asterisk-gui-commits mailing list