pari: branch 2.0 r3978 - in /branches/2.0/config: ./ js/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Mon Oct 20 15:44:59 CDT 2008


Author: pari
Date: Mon Oct 20 15:44:59 2008
New Revision: 3978

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=3978
Log:

 Improving on the Error/Debug log functions

	ASTGUI.Log.(Debug/Error/Info/Warn/Console)

		instead of

	ASTGUI.(ErrorLog/debugLog/FirebugLog)

	


Modified:
    branches/2.0/config/asterisklogs.html
    branches/2.0/config/backup.html
    branches/2.0/config/bulkadd.html
    branches/2.0/config/dialplans.html
    branches/2.0/config/flashupdate.html
    branches/2.0/config/hardware.html
    branches/2.0/config/hardware_aa50.html
    branches/2.0/config/home.html
    branches/2.0/config/incoming.html
    branches/2.0/config/js/astman.js
    branches/2.0/config/js/index.js
    branches/2.0/config/js/pbx.js
    branches/2.0/config/sysinfo.html
    branches/2.0/config/timezone.html
    branches/2.0/config/upload_abe_overlay.html
    branches/2.0/config/upload_form.html

Modified: branches/2.0/config/asterisklogs.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/asterisklogs.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/asterisklogs.html (original)
+++ branches/2.0/config/asterisklogs.html Mon Oct 20 15:44:59 2008
@@ -38,7 +38,7 @@
 	var lm = sel_date.split(' ')[1]; lm = lm.trim();
 	var tmp_cmd = "/bin/grep /var/log/asterisk/messages -e '" + lm + space + ld + " ' " ;
 	parent.ASTGUI.dialog.waitWhile(' Loading Asterisk Logs ...');
-	ASTGUI.debugLog(tmp_cmd);
+	ASTGUI.Log.Debug(tmp_cmd);
 	ASTGUI.systemCmdWithOutput( tmp_cmd , function(output){
 		parent.ASTGUI.dialog.hide();
 		_$('todaylog').innerHTML = (output) ? "<PRE>" + output.escapeHTML() + "</PRE>" : "No log messages found on this Day" ;

Modified: branches/2.0/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/backup.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/backup.html (original)
+++ branches/2.0/config/backup.html Mon Oct 20 15:44:59 2008
@@ -67,7 +67,7 @@
 		return;
 	}
 	if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
-		ASTGUI.ErrorLog('AG102');
+		ASTGUI.Log.Error('AG102');
 		$('#uploadForm_container').hide();
 		return ;
 	}

Modified: branches/2.0/config/bulkadd.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/bulkadd.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/bulkadd.html (original)
+++ branches/2.0/config/bulkadd.html Mon Oct 20 15:44:59 2008
@@ -111,7 +111,6 @@
 		}
 	};
 
-	// ASTGUI.debugLog( NEW_USERS , 'parse');
 	create_NEW_USERS();
 };
 
@@ -131,7 +130,7 @@
 		}
 
 		newusers_list.push(tmp_nu);
-			ASTGUI.debugLog( 'adding user ' + tmp_nu , 'parse');
+			ASTGUI.Log.Debug( 'adding user ' + tmp_nu);
 			NEW_USERS[ tmp_nu ] = {} ;
 			NEW_USERS[ tmp_nu ]['fullname'] = 'User ' + tmp_nu;
 			NEW_USERS[ tmp_nu ]['cid_number'] = tmp_nu;

Modified: branches/2.0/config/dialplans.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/dialplans.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/dialplans.html (original)
+++ branches/2.0/config/dialplans.html Mon Oct 20 15:44:59 2008
@@ -194,7 +194,7 @@
 					}
 				}
 			}catch(err){
-				ASTGUI.ErrorLog(err.description);
+				ASTGUI.Log.Error(err.description);
 			}
 
 			addCell( newRow , { html: dr_woPfx.join(', ') } );

Modified: branches/2.0/config/flashupdate.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/flashupdate.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/flashupdate.html (original)
+++ branches/2.0/config/flashupdate.html Mon Oct 20 15:44:59 2008
@@ -226,7 +226,7 @@
 
 var onUploadForm_load = function(){
 	if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
-		ASTGUI.ErrorLog('AG102');
+		ASTGUI.Log.Error('AG102');
 		$('#uploadForm_container').hide();
 		return ;
 	}

Modified: branches/2.0/config/hardware.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/hardware.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/hardware.html (original)
+++ branches/2.0/config/hardware.html Mon Oct 20 15:44:59 2008
@@ -207,14 +207,14 @@
 	if(configured_devices.length == detected_devices.length){
 		for(var l=0; l < configured_devices.length; l++){
 			if(configured_devices[l] != detected_devices[l]){ // devices does not match - but the number of devices match
-				ASTGUI.debugLog("DEVICES or basechans does not MATCHED");
+				ASTGUI.Log.Debug("DEVICES or basechans does not MATCHED");
 				return true;
 			}
 		}
-		ASTGUI.debugLog("DEVICES and basechans MATCH");
+		ASTGUI.Log.Debug("DEVICES and basechans MATCH");
 		return false;
 	}else{	
-		ASTGUI.debugLog("DEVICES or basechans does not MATCHED");
+		ASTGUI.Log.Debug("DEVICES or basechans does not MATCHED");
 		return true;
 	}
 }
@@ -420,7 +420,7 @@
 	//   check if the channels in zapchan are within max and min
 	//   if yes then set the current range values
 	load_hwcfgfile: function(){ // read hwcfgfile (if exists) into CONFIGUREDHARDWARE 
-		ASTGUI.debugLog("load last configured hardware information, start function: loadConfigFiles.load_hwcfgfile()" , 'parse');
+		ASTGUI.Log.Debug("load last configured hardware information, start function: loadConfigFiles.load_hwcfgfile()");
 		var n = config2json({filename:hwcfgfile, usf:1});
 		if( n.getOwnProperties().length == 0 ){ // if file not found or no previous hardware detected
 				hwchanged = -1;
@@ -436,22 +436,22 @@
 			}}
 			loadConfigFiles.runZtscan();
 		}
-		ASTGUI.debugLog("end of function: loadConfigFiles.load_hwcfgfile()" , 'parse');
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.load_hwcfgfile()");
 	},
 
 	runZtscan: function(){
-		ASTGUI.debugLog("start function: loadConfigFiles.runZtscan()" , 'parse');
+		ASTGUI.Log.Debug("start function: loadConfigFiles.runZtscan()");
 
 		ASTGUI.miscFunctions.createConfig( 'applyzap.conf', function(){
 			parent.ASTGUI.systemCmd( ASTGUI.apps.Ztscan , function(){ // run ztscan and then try loading ztscan.conf
 				window.setTimeout( loadConfigFiles.readZtscanConf , 700 ); // leave some time for ztscan to generate ztscan.conf
 			});
-			ASTGUI.debugLog("end of function: loadConfigFiles.runZtscan()" , 'parse');
+			ASTGUI.Log.Debug("end of function: loadConfigFiles.runZtscan()");
 		});
 	},
 
 	readZtscanConf: function(){
-		ASTGUI.debugLog("start function: loadConfigFiles.readZtscanConf()" , 'parse');
+		ASTGUI.Log.Debug("start function: loadConfigFiles.readZtscanConf()");
 		var ztsc = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=ztscan.conf', async: false }).responseText;
 		var ztsc_Lower = ztsc.toLowerCase();
 		if( ztsc_Lower.contains('response: error') && ztsc_Lower.contains('message: config file not found') ){
@@ -516,12 +516,12 @@
 			}}
 		}}
 		if(hwchanged != -1){ hwchanged = detectHwChanges(); }
-		ASTGUI.debugLog("end of function: loadConfigFiles.readZtscanConf()" , 'parse');
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.readZtscanConf()");
 		loadConfigFiles.readUsersConf(); // read span_x (where T1/E1 trunks are defined)
 	},
 
 	readUsersConf: function(){
-		ASTGUI.debugLog("start function: loadConfigFiles.readUsersConf()" , 'parse');
+		ASTGUI.Log.Debug("start function: loadConfigFiles.readUsersConf()");
 
 		var usrs = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=users.conf', async: false }).responseText;
 		var usrs_Lower = usrs.toLowerCase();
@@ -590,12 +590,12 @@
 				}
 			}}
 		})();
-		ASTGUI.debugLog("end of function: loadConfigFiles.readUsersConf()" , 'parse');
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.readUsersConf()");
 		showtable();
 	},
 
 	load_zaptel_conf: function(){
-		ASTGUI.debugLog("start function: loadConfigFiles.load_zaptel_conf()" , 'parse');
+		ASTGUI.Log.Debug("start function: loadConfigFiles.load_zaptel_conf()");
 		// we parse zaptel.conf to get the loadzone and syncsrc for each span
 		var tmp_file = ASTGUI.globals.zaptelIncludeFile;
 		var parseZaptelconf = function(zp){
@@ -649,7 +649,7 @@
 				parseZaptelconf(q);
 			}
 		}
-		ASTGUI.debugLog("end of function: loadConfigFiles.load_zaptel_conf()" , 'parse');
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.load_zaptel_conf()");
 	}
 };
 
@@ -1108,7 +1108,7 @@
 
 
 var localajaxinit = function(){
-	ASTGUI.debugLog("Starting Loading Page digital.html .. start function: window.onload()" , 'parse');
+	ASTGUI.Log.Debug("Starting Loading Page digital.html .. start function: window.onload()");
 	portsSignalling = ASTGUI.cloneObject(parent.sessionData.PORTS_SIGNALLING);
 
 	ASTGUI.domActions.enableDisableByCheckBox ('enable_disable_checkbox_opermode', 'opermode') ;
@@ -1196,7 +1196,7 @@
 
 	ASTGUI.events.add( _$('edit_DefinedChans'), "change", edit_DefinedChans_changed );
 
-	ASTGUI.debugLog("end of function: window.onload()" , 'parse');
+	ASTGUI.Log.Debug("end of function: window.onload()");
 
 	(function(){ // load modprobe settings
 		var c = context2json ({ filename: ASTGUI.globals.configfile , context: 'general', usf: 1 });

Modified: branches/2.0/config/hardware_aa50.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/hardware_aa50.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/hardware_aa50.html (original)
+++ branches/2.0/config/hardware_aa50.html Mon Oct 20 15:44:59 2008
@@ -249,11 +249,11 @@
 
 
 var localajaxinit = function(){
-	ASTGUI.debugLog("Starting Loading Page hardware_aa50.html .. start function: window.onload()" , 'parse');
+	ASTGUI.Log.Debug("Starting Loading Page hardware_aa50.html .. start function: window.onload()");
 	ASTGUI.dialog.waitWhile('Detecting Hardware ...');
 	top.document.title = "Analog Hardware Setup & Configuration";
 	load_currentAnalogSettings();
-	ASTGUI.debugLog("end of function: window.onload()" , 'parse');
+	ASTGUI.Log.Debug("end of function: window.onload()");
 };
 
 
@@ -377,7 +377,7 @@
 				parseZaptelconf(q);
 			}
 		}
-		ASTGUI.debugLog("end of function: loadConfigFiles.load_zaptel_conf()" , 'parse');
+		ASTGUI.Log.Debug("end of function: loadConfigFiles.load_zaptel_conf()");
 	})();
 
 	(function(){ // load modprobe settings

Modified: branches/2.0/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/home.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/home.html (original)
+++ branches/2.0/config/home.html Mon Oct 20 15:44:59 2008
@@ -57,7 +57,7 @@
 	var f = makeSyncRequest({ action :'login', username: DOM_username.value, secret: DOM_secret.value });
 	f = f.toLowerCase();
 	if(f.match('authentication accepted')){
-		ASTGUI.debugLog("Login Success result: " + f , 'update');
+		ASTGUI.Log.Debug("Login Success result: " + f);
 		setLoggedIn( { welcome_redirect: false } );
 		DOM_secret.blur();
 		parent.ASTGUI.dialog.waitWhile(' <font color=#005119><b>Login Success</b></font>');
@@ -77,7 +77,7 @@
 		}
 		return;
 	}else if(f.match('authentication failed') ) {
-		ASTGUI.debugLog("Login failure result: " + f , 'update');
+		ASTGUI.Log.Debug("Login failure result: " + f);
 		ASTGUI.feedback({msg:'Invalid Username or Password', showfor: 4, color:'#c42421'}) ;
 		DOM_secret.focus();
 		DOM_secret.select();

Modified: branches/2.0/config/incoming.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/incoming.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/incoming.html (original)
+++ branches/2.0/config/incoming.html Mon Oct 20 15:44:59 2008
@@ -386,7 +386,7 @@
 		}
 
 		if( isNewIR == true ){ // create new Incoming Rule
-			ASTGUI.debugLog("create New Incoming Rule" , 'parse');
+			ASTGUI.Log.Debug("create New Incoming Rule");
 			parent.ASTGUI.dialog.waitWhile('Creating Incoming Rule ...');
 
 			if( ASTGUI.getFieldValue('edit_itrl_dest') == 'ByDID' ){
@@ -411,7 +411,7 @@
 
 				var TMP_MYCALLBACK = function(){
 					if( !EX_CF.hasOwnProperty( thisRule_context ) ){
-						ASTGUI.debugLog("creating [time interval did context]" , 'parse');
+						ASTGUI.Log.Debug("creating [time interval did context]");
 						x.new_action ( 'newcat', thisRule_context , '' , '' );
 					}
 	
@@ -422,7 +422,7 @@
 						x.new_action( 'append', thisRule_context, 'exten', ASTGUI.globals.sbcid_2 );
 						x.new_action( 'append', thisRule_context, 'exten', this_ActualRule );
 					}else{
-						ASTGUI.debugLog("NewRule is exten=" + this_ActualRule + 'in context [' + thisRule_context + ']' , 'parse');
+						ASTGUI.Log.Debug("NewRule is exten=" + this_ActualRule + 'in context [' + thisRule_context + ']');
 						x.new_action( 'append', thisRule_context, 'exten', this_ActualRule );
 					}
 
@@ -434,10 +434,10 @@
 				};
 	
 				if( PREVIOUS.contains(NEWTF_INCLUDE_STR) ){
-					ASTGUI.debugLog("No need to include time interval did context in DID_trunk_x" , 'parse');
+					ASTGUI.Log.Debug("No need to include time interval did context in DID_trunk_x");
 					TMP_MYCALLBACK();
 				}else{
-					ASTGUI.debugLog("adding 'include = time interval did context' in [DID_trunk_x]" , 'parse');
+					ASTGUI.Log.Debug("adding 'include = time interval did context' in [DID_trunk_x]");
 					PREVIOUS.splice(0,0,NEWTF_INCLUDE_STR);
 					ASTGUI.miscFunctions.empty_context({ filename: 'extensions.conf', context : ASTGUI.contexts.TrunkDIDPrefix + this_trunk, cb : function(){
 						PREVIOUS.each( function( this_newPreviousLine ){

Modified: branches/2.0/config/js/astman.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/astman.js?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Mon Oct 20 15:44:59 2008
@@ -442,7 +442,7 @@
 	},
 
 	cliCommand : function(cmd) { // ASTGUI.cliCommand(cmd);
-		ASTGUI.debugLog("Executing manager command : '" + cmd + "'" , 'manager');
+		ASTGUI.Log.Debug("Executing manager command : '" + cmd + "'");
 		return makeSyncRequest ( { action :'command', command: cmd } );
 	},
 
@@ -497,12 +497,12 @@
 	},
 
 	doTransfer : function(from, to) {
-		ASTGUI.debugLog("About to transfer " + from + " to " + to, 'manager');
+		ASTGUI.Log.Debug("About to transfer " + from + " to " + to);
 		return makeSyncRequest ( { action :'redirect', channel :from, exten :to, context :'default', priority :'1' } );
 	},
 
 	doHangup : function(chan) {
-		ASTGUI.debugLog("Executing hangup on channel : '" + chan + "'" , 'manager');
+		ASTGUI.Log.Debug("Executing hangup on channel : '" + chan + "'");
 		return makeSyncRequest ( { action :'hangup', channel: chan } );
 	},
 
@@ -688,38 +688,48 @@
 		return b;
 	},
 
-	debugLog: function(msg, color){ // Ex:		ASTGUI.debugLog('Some debug message', 'get');
-		if(!top.sessionData.DEBUG_MODE ){ return true; }
-
-		if( typeof msg == 'object' ){
-			msg = 'OBJECT : ' + ASTGUI.getObjectPropertiesAsString(msg) ;
-		}
-
-		if(!color){ color = '#324176'; }
-		switch(color){
-			case 'get':	// for getconfig and reading html files
-				color = '#9A9A9A';
-				break;
-			case 'update': // for updateconfig messages
-				color = '#CC0066';
-				break;
-			case 'manager': // for manager commands
-				color = '#2B6C36';
-				break;
-			case 'system': // for system commands
-				color = '#F47A00';
-				break;
-			case 'parse': // for logging parse errors
-				color = '#4C9996';
-				//msg = '<b>' + msg + '</b>' ;
-				break;
-		}
-		var now = new Date();
-		var h = now.getHours().addZero() + ':' + now.getMinutes().addZero() + ':' + now.getSeconds().addZero() ;
-		if( top.sessionData.DEBUG_LOG.length > 250){
-			top.sessionData.DEBUG_LOG = top.sessionData.DEBUG_LOG.slice(0,50);
-		}
-		top.sessionData.DEBUG_LOG.unshift( h + ' <font color='+ color +'>' + msg + '</font>' );
+	Log: {
+		doLog: function(msg, color){
+			if(!top.sessionData.DEBUG_MODE ){ return true; }
+			if( typeof msg == 'object' ){
+				msg = 'OBJECT : ' + ASTGUI.getObjectPropertiesAsString(msg) ;
+			}
+
+			var now = new Date();
+			var h = now.getHours().addZero() + ':' + now.getMinutes().addZero() + ':' + now.getSeconds().addZero() ;
+			if( top.sessionData.DEBUG_LOG.length > 250 ){
+				top.sessionData.DEBUG_LOG = top.sessionData.DEBUG_LOG.slice(0,50);
+			}
+			top.sessionData.DEBUG_LOG.unshift( h + ' <font color='+ color +'>' + msg + '</font>' );
+		},
+
+		Ajax: function(msg){ // ASTGUI.Log.Ajax(msg);
+			this.doLog( msg , '#96997C' );
+		},
+
+		Debug: function( msg ){ // ASTGUI.Log.Debug();
+			this.doLog( msg , '#4C9996' );
+		},
+
+		Error: function( msg ){ // ASTGUI.Log.Error();
+			if( msg.length <=5 && ASTGUI.errorCodes[msg] ){
+				this.doLog( '<B>' + ASTGUI.errorCodes[msg] + '</B>' , '#992b23' );
+			}else{
+				this.doLog( '<B>' + msg + '</B>' , '#992b23' );
+			}
+		},
+
+		Console: function( msg ){ // ASTGUI.Log.Console();
+			if( window.console && window.console.firebug ) console.log ( msg );
+		},
+
+		Info: function( msg ){ // ASTGUI.Log.Info(msg);
+			this.doLog( msg , '#9A9A9A' );
+		},
+
+		Warn: function( msg ){ // ASTGUI.Log.Warn( msg );
+			this.doLog( msg , '#F47A00' );
+		}
 	},
 
 	dialog : {
@@ -1057,18 +1067,6 @@
 			}
 			a['on'+b] = null ;
 		}
-	},
-
-	ErrorLog: function( Code ){// Ex: ASTGUI.ErrorLog('AG102');
-		if( Code.length <=5 && ASTGUI.errorCodes[Code] ){
-			ASTGUI.debugLog( '<B>' + ASTGUI.errorCodes[Code] + '</B>' , '#990033' );
-		}else{
-			ASTGUI.debugLog( '<B>' + Code + '</B>' , '#990033' );
-		}
-	},
-
-	FirebugLog: function( msg ){ // ASTGUI.FirebugLog( object );
-		if( window.console && window.console.firebug ) console.log ( msg );
 	},
 
 	feedback : function( fb ){
@@ -1574,7 +1572,7 @@
 					return q.substring(l+1);
 				}
 			}
-			ASTGUI.ErrorLog( "ASTGUI.parseContextLine.getAppWithArgs() could not parse \"" + q + "\" " );
+			ASTGUI.Log.Error( "ASTGUI.parseContextLine.getAppWithArgs() could not parse \"" + q + "\" " );
 			return '';
 		},
 
@@ -1592,7 +1590,7 @@
 
 			q = q.trim();
 			if ( !q.endsWith(')') || !q.contains('(') ){
-				ASTGUI.ErrorLog( "ASTGUI.parseContextLine.getArgs() - No Argument found for \"" + q + "\" " );
+				ASTGUI.Log.Error( "ASTGUI.parseContextLine.getArgs() - No Argument found for \"" + q + "\" " );
 				return [];
 			}
 			var y = ASTGUI.parseContextLine.getAppWithArgs(q);
@@ -1861,23 +1859,6 @@
 			return cr;
 		}
 	},
-
-// 	profiling : {
-// 		start: function(){
-// 			if(!top.sessionData.DEBUG_MODE ){ return true; }
-// 			var now = new Date();
-// 			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
-// 		},
-// 
-// 		snapShot: function(a){
-// 			if(!top.sessionData.DEBUG_MODE ){ return true; }
-// 			if ( !a || (typeof a != 'string') ){ a = ''; }
-// 			var now = new Date();
-// 			var diff = now.getTime() - top.sessionData.DEBUG_PROFILER_BEGIN ;
-// 			ASTGUI.debugLog( '<B> Profiler Time : '+ diff +' ms</B> ' + a , '#990033');
-// 			top.sessionData.DEBUG_PROFILER_BEGIN = now.getTime() ;
-// 		}
-// 	},
 
 	resetTheseFields : function( flds ){ // ASTGUI.resetTheseFields(arr) , flds = [ el1, el2 , el_3 ] ; - sets each element to blank value
 		if(!ASTGUI.isArray(flds)){ return; }
@@ -2358,7 +2339,7 @@
 	},
 
 	systemCmd: function(cmd, callbackfunction){ // ASTGUI.systemCmd(cmd, cbf);
-		ASTGUI.debugLog("Executing System Command : '" + cmd + "'" , 'system');
+		ASTGUI.Log.Debug("Executing System Command : '" + cmd + "'");
 		var delay_cb = function(){
 			if( parent.sessionData.PLATFORM.isAA50 ){
 				setTimeout( callbackfunction , 500 );
@@ -2492,7 +2473,7 @@
 				}
 				break;
 			case 'radio':
-				ASTGUI.ErrorLog('You are on your own with Radio Buttons');
+				ASTGUI.Log.Error('You are on your own with Radio Buttons');
 				break ;
 			case 'select-one':
 				ASTGUI.selectbox.selectOption(el, val);
@@ -2729,10 +2710,10 @@
 	if( params.action == "updateconfig" ){
 		params.srcfilename = params.filename;
 		params.dstfilename = params.filename;
-		if(top.sessionData.DEBUG_MODE ){ASTGUI.debugLog("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'" , 'update');}
+		if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 		delete params.filename;
 	}else{
-		if(top.sessionData.DEBUG_MODE ){ASTGUI.debugLog("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'" , 'get');}
+		if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 	}
 
 	$.get(ASTGUI.paths.rawman, params, cb);
@@ -2740,7 +2721,7 @@
 
 var makeSyncRequest = function( params){ // for making synchronus requests
 	// usage ::  makeSyncRequest ( { action :'getconfig', filename: 'something.conf' } ) // no need for call back function
-	if(top.sessionData.DEBUG_MODE ){ASTGUI.debugLog("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'" , 'update');}
+	if(top.sessionData.DEBUG_MODE ){ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(params) + "'");}
 	var s = $.ajax({ url: ASTGUI.paths.rawman, data: params , async: false });
 	return s.responseText;
 };
@@ -2791,7 +2772,7 @@
 		return (catfound)?cat : null ;
 	};
 
-	ASTGUI.debugLog("AJAX Request : reading '" +  params.filename + "'" , 'get');
+	ASTGUI.Log.Ajax("AJAX Request : reading '" +  params.filename + "'");
 
 	if( top.sessionData.FileCache.hasOwnProperty(params.filename) &&  top.sessionData.FileCache[params.filename].modified == false){ // if file is in cache and is not modified since
 		var s = top.sessionData.FileCache[params.filename].content ;
@@ -2810,9 +2791,9 @@
 	if(s.contains('Response: Error') && ( s.contains('Message: Config file not found') || s.contains('Message: Permission denied') ) ){
 		// return ASTGUI.globals.fnf; // return 'file not found'
 		if(s.contains('Message: Config file not found'))
-			ASTGUI.ErrorLog( ' config file(' + params.filename +') not found ' );	
+			ASTGUI.Log.Error( ' config file(' + params.filename +') not found ' );	
 		if(s.contains('Message: Permission denied'))
-			ASTGUI.ErrorLog('permission denied for reading file ' + params.filename );
+			ASTGUI.Log.Error('permission denied for reading file ' + params.filename );
 
 		return (params.usf) ? new ASTGUI.customObject : [] ;
 	}
@@ -2883,7 +2864,7 @@
 		return toJSO( params.configFile_output );
 	};
 
-	ASTGUI.debugLog("AJAX Request : reading '" +  params.filename + "'" , 'get');
+	ASTGUI.Log.Ajax("AJAX Request : reading '" +  params.filename + "'");
 
 	if( top.sessionData.FileCache.hasOwnProperty(params.filename) &&  top.sessionData.FileCache[params.filename].modified == false){ // if file is in cache and is not modified since
 		var s = top.sessionData.FileCache[params.filename].content ;
@@ -2897,11 +2878,11 @@
 
 	if( s.contains('Response: Error') && s.contains('Message: Config file not found') ){
 		// return ASTGUI.globals.fnf; // return 'file not found'
-		ASTGUI.ErrorLog( ' config file(' + params.filename +') not found ' );
+		ASTGUI.Log.Error( ' config file(' + params.filename +') not found ' );
 		return new ASTGUI.customObject;
 	}
 	if( s.contains('Response: Error') && s.contains('Message: Permission denied') ){
-		ASTGUI.ErrorLog('permission denied for reading file ' + params.filename );
+		ASTGUI.Log.Error('permission denied for reading file ' + params.filename );
 		return new ASTGUI.customObject;
 	}
 
@@ -2964,7 +2945,7 @@
 
 		var cnt = "" + this.actionCount;
 		if(this.actionCount > 5){
-			ASTGUI.ErrorLog('AG150'); // alert to developer
+			ASTGUI.Log.Error('AG150'); // alert to developer
 		}
 		while(cnt.length < 6){ cnt = "0" + cnt; }
 		this.params['Action-' + cnt] = action; // jquery takes care of encodeURIComponent(action) 
@@ -2987,7 +2968,7 @@
 	callActions: function(){
 		if(!this.actionCount){ return 'Response: Success'; }
 		if(top.sessionData.DEBUG_MODE ){
-			ASTGUI.debugLog("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(this.params) + "'" , 'update'); 
+			ASTGUI.Log.Ajax("AJAX Request : '" + ASTGUI.getObjectPropertiesAsString(this.params) + "'"); 
 		}
 		var s = $.ajax({ url: ASTGUI.paths.rawman, data: this.params , async: false });
 		return s.responseText;
@@ -3103,7 +3084,7 @@
 		var start_sqreqs = function(st){
 			var f = treq[ 'act_' + st ];
 			if(f){
-				ASTGUI.debugLog("AJAX Request : '" + pre_uri + f + "'" , 'update');
+				ASTGUI.Log.Ajax("AJAX Request : '" + pre_uri + f + "'");
 				$.ajax({ type: "GET", url: ASTGUI.paths.rawman, data: pre_uri + f , success: function(msg){start_sqreqs(st+1);} });
 			}else{
 				setTimeout( function(){ ajxs.style.display = 'none'; callback(); }, 500 ) ;
@@ -3118,7 +3099,7 @@
 	var onload_doThese = function(){
 		window.onerror = function(err, url, errcode ){ // Log any errors on this page
 			var msg = 'ErrorCode / LineNumber : ' + errcode  + '<BR> Error : ' + err + '<BR> Location: ' + url ;
-			ASTGUI.ErrorLog(msg);
+			ASTGUI.Log.Error(msg);
 			ASTGUI.dialog.hide();
 			if( parent.sessionData.DEBUG_MODE ){ // show alerts only in debug mode
 				var alertmsg = 'ErrorCode / LineNumber : ' + errcode  + '\n Error : ' + err + '\n Location: ' + url ;

Modified: branches/2.0/config/js/index.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/index.js?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/js/index.js (original)
+++ branches/2.0/config/js/index.js Mon Oct 20 15:44:59 2008
@@ -24,7 +24,7 @@
 	makePings: {
 		noServer: function(){
 			try{
-				ASTGUI.debugLog("PING Request: REQUEST FAILED " , 'update');
+				ASTGUI.Log.Debug("PING Request: REQUEST FAILED ");
 				if( onLogInFunctions.makePings.isRetryPing ){
 					alert("No Response !");
 				}else{
@@ -48,7 +48,7 @@
 						//ASTGUI.dialog.hide();
 						$('#mainscreen').show();
 					}else{
-						ASTGUI.debugLog('PING Request: INVALID SESSION' , 'update');
+						ASTGUI.Log.Debug('PING Request: INVALID SESSION');
 						if( parent.sessionData.DEBUG_MODE ){
 							alert('PING Request: INVALID SESSION' + '\n' + 'Click OK to reload');
 						}
@@ -64,14 +64,14 @@
 			var makePingRequest = function(){
 				var verifyPingResult = function(t) {
 					if(!t.toLowerCase().contains('pong')){
-						ASTGUI.debugLog('PING Request: INVALID SESSION' , 'update');
+						ASTGUI.Log.Debug('PING Request: INVALID SESSION');
 						if( parent.sessionData.DEBUG_MODE ){
 							alert('PING Request: INVALID SESSION' + '\n' + 'Click OK to reload');
 						}
 						onLogInFunctions.makePings.stop();
 						top.window.location.replace(top.window.location.href); return true; 
 					}else{
-						ASTGUI.debugLog('PING Request: Success' , 'get');
+						ASTGUI.Log.Debug('PING Request: Success');
 					}
 				};
 				$.ajax({
@@ -235,7 +235,7 @@
 		onLogInFunctions.detectPlatform(resp); // <-- PLATFORM Detection
 
 		if(s.responseText.toLowerCase().match('pong')){
-			ASTGUI.debugLog('Got PONG , session is active');
+			ASTGUI.Log.Debug('Got PONG , session is active');
 
 			$('div.ui-accordion-link:eq(0)')[0].innerHTML = 'System Status';
 			$('div.ui-accordion-desc:eq(0)')[0].innerHTML = 'Please click on a panel to manage related features';
@@ -265,8 +265,8 @@
 			ASTGUI.dialog.waitWhile('Parsing Config Files ..');
 			onLogInFunctions.parseConfigFiles();
 		}else{
-			ASTGUI.ErrorLog('NO active session : show login page');
-			ASTGUI.debugLog('s.responseText is "' + s.responseText + '"' );
+			ASTGUI.Log.Error('NO active session : show login page');
+			ASTGUI.Log.Debug('s.responseText is "' + s.responseText + '"' );
 			$('div.ui-accordion-desc:eq(0)')[0].innerHTML = 'Please login ';
 			sessionData.isLoggedIn = false;
 			ASTGUI.dialog.hide();
@@ -284,55 +284,55 @@
 				// check extensions.conf (macro trunkdial, guitools , other required contexts etc), check [general] in users.conf etc
 				if( sessionData.continueParsing == false )return;
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.checkEssentials()' + '<BR>error msg: ' + er.description );
+				ASTGUI.Log.Error('Error in readcfg.checkEssentials()' + '<BR>error msg: ' + er.description );
 			}
 
 			try{
 				readcfg.ExtensionsConf();
 				if( sessionData.continueParsing == false )return;
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.ExtensionsConf()');
+				ASTGUI.Log.Error('Error in readcfg.ExtensionsConf()');
 			}
 
 			try{
 				readcfg.guiPreferencesConf();
 				if( sessionData.continueParsing == false )return;
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.guiPreferencesConf()');
+				ASTGUI.Log.Error('Error in readcfg.guiPreferencesConf()');
 			}
 
 			try{
 				readcfg.httpConf();
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.httpConf()');
+				ASTGUI.Log.Error('Error in readcfg.httpConf()');
 			}
 
 			try{
 				astgui_manageConferences.loadMeetMeRooms();
 			}catch(er){
-				ASTGUI.ErrorLog('Error in astgui_manageConferences.loadMeetMeRooms()');
+				ASTGUI.Log.Error('Error in astgui_manageConferences.loadMeetMeRooms()');
 			}
 
 			try{
 				astgui_manageQueues.loadQueues();
 			}catch(er){
-				ASTGUI.ErrorLog('Error in astgui_manageQueues.loadQueues()');
+				ASTGUI.Log.Error('Error in astgui_manageQueues.loadQueues()');
 			}
 
 			try{
 				readcfg.UsersConf();
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.UsersConf()');
+				ASTGUI.Log.Error('Error in readcfg.UsersConf()');
 			}
 
 			try{
 				readcfg.MisdnConf();
 			}catch(er){
-				ASTGUI.ErrorLog('Error in readcfg.MisdnConf()');
+				ASTGUI.Log.Error('Error in readcfg.MisdnConf()');
 			}
 
 		}catch(err){
-			ASTGUI.ErrorLog('Error in onLogInFunctions.parseConfigFiles()');
+			ASTGUI.Log.Error('Error in onLogInFunctions.parseConfigFiles()');
 		}finally{
 			if( sessionData.continueParsing == false ){
 				return;
@@ -462,7 +462,7 @@
 			}
 
 		} catch(e) {
-			ASTGUI.debugLog("Error listOfChannels: " + e);
+			ASTGUI.Log.Debug("Error listOfChannels: " + e);
 			return to_return;
 		}
 		return to_return;
@@ -875,7 +875,7 @@
 		return;
 	}
 
-	ASTGUI.debugLog('Start localAjaxinit in Parent window', 'parse');
+	ASTGUI.Log.Debug('Start localAjaxinit in Parent window');
 	//if( typeof readcfg == 'undefined' ){
 	//	alert('readcfg undefined');
 	//}
@@ -932,7 +932,7 @@
 		DOM_mainscreen.style.top = DOM_accordion_div.offsetTop ;
 		miscFunctions.resizeMainIframe();
 		window.onresize = miscFunctions.resizeMainIframe;
-		ASTGUI.debugLog('calling onLogInFunctions.checkifLoggedIn()', 'parse');
+		ASTGUI.Log.Debug('calling onLogInFunctions.checkifLoggedIn()');
 		onLogInFunctions.checkifLoggedIn();
 		if(sessionData.DEBUG_MODE){
 			miscFunctions.DEBUG_START();

Modified: branches/2.0/config/js/pbx.js
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/js/pbx.js?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/js/pbx.js (original)
+++ branches/2.0/config/js/pbx.js Mon Oct 20 15:44:59 2008
@@ -178,7 +178,7 @@
 	}, // end of readcfg.checkEssentials();
 
 	guiPreferencesConf: function(){ //readcfg.guiPreferencesConf();
-		ASTGUI.debugLog("AJAX Request : reading '" +  ASTGUI.globals.configfile + "'" , 'get');
+		ASTGUI.Log.Ajax("AJAX Request : reading '" +  ASTGUI.globals.configfile + "'");
 		var s = $.ajax({ url: ASTGUI.paths.rawman+'?action=getconfig&filename=' + ASTGUI.globals.configfile , async: false }).responseText;
 		if( s.contains('Response: Error') && s.contains('Message: Config file not found') ){
 			sessionData.continueParsing = false ;
@@ -317,7 +317,7 @@
 				// sessionData.pbxinfo['timebasedRules'][d] = astgui_manageTimeBasedRules.parseContext( d , c[d] );
 			}
 		}}
-		ASTGUI.debugLog('parsed all contexts in extensions.conf');
+		ASTGUI.Log.Debug('parsed all contexts in extensions.conf');
 		(function(){ // parse voicemenu extensions
 			var vm = c[ASTGUI.contexts.VoiceMenuExtensions] ;
 			var vm_default = c['default'] ; // Backward compatibility for old GUI
@@ -1366,7 +1366,7 @@
 				}
 			});
 		}catch(err){
-			ASTGUI.debugLog('Error Parsing VoiceMenu' , 'parse');
+			ASTGUI.Log.Debug('Error Parsing VoiceMenu');
 		}finally{
 			return ASTGUI.toCustomObject(vm);
 		}

Modified: branches/2.0/config/sysinfo.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/sysinfo.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/sysinfo.html (original)
+++ branches/2.0/config/sysinfo.html Mon Oct 20 15:44:59 2008
@@ -103,7 +103,7 @@
 							try{
 								percentage_usage(output);
 							}catch(err){
-								ASTGUI.debugLog( '<B>Error Trying to calculate CF usage %');
+								ASTGUI.Log.Debug( '<B>Error Trying to calculate CF usage %');
 							}
 						}
 						$('.hideall').hide();

Modified: branches/2.0/config/timezone.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/timezone.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/timezone.html (original)
+++ branches/2.0/config/timezone.html Mon Oct 20 15:44:59 2008
@@ -52,7 +52,7 @@
 
 onUploadForm_load = function(){
 	if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['timezone'] ){
-		ASTGUI.ErrorLog('AG102');
+		ASTGUI.Log.Error('AG102');
 		$('#tdupload').hide(); //
 		return ;
 	}

Modified: branches/2.0/config/upload_abe_overlay.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/upload_abe_overlay.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/upload_abe_overlay.html (original)
+++ branches/2.0/config/upload_abe_overlay.html Mon Oct 20 15:44:59 2008
@@ -25,7 +25,7 @@
 
 var onUploadForm_load = function(){
 	if(!top.sessionData.httpConf.postmappings_defined || !top.sessionData.httpConf.uploadPaths['backups'] ){
-		ASTGUI.ErrorLog('AG102');
+		ASTGUI.Log.Error('AG102');
 		$('#uploadOVERLAY_iframe_container').hide();
 		return ;
 	}
@@ -87,4 +87,4 @@
 
 </table>
 
-</body>
+</body>

Modified: branches/2.0/config/upload_form.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/upload_form.html?view=diff&rev=3978&r1=3977&r2=3978
==============================================================================
--- branches/2.0/config/upload_form.html (original)
+++ branches/2.0/config/upload_form.html Mon Oct 20 15:44:59 2008
@@ -14,7 +14,7 @@
 
 function beforeupload(){
 	if(!frm.action){
-		parent.ASTGUI.ErrorLog('AG101');
+		parent.ASTGUI.Log.Error('AG101');
 		alert('Aborting Upload : Error Code  AG101');
 		return;
 	}




More information about the asterisk-gui-commits mailing list