pari: branch 2.0 r3785 - /branches/2.0/config/welcome.html

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Sep 9 12:51:27 CDT 2008


Author: pari
Date: Tue Sep  9 12:51:27 2008
New Revision: 3785

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

 real time status for agents



Modified:
    branches/2.0/config/welcome.html

Modified: branches/2.0/config/welcome.html
URL: http://svn.digium.com/view/asterisk-gui/branches/2.0/config/welcome.html?view=diff&rev=3785&r1=3784&r2=3785
==============================================================================
--- branches/2.0/config/welcome.html (original)
+++ branches/2.0/config/welcome.html Tue Sep  9 12:51:27 2008
@@ -122,18 +122,30 @@
 		b.innerHTML = '<PRE>' + op + '</PRE><HR>';
 		_$('waitevent_Log').appendChild(b);
 	}
-
-	var tmp_chunks = ASTGUI.miscFunctions.getChunksFromManagerOutput(op, 1) ;
-	tmp_chunks.each(function(this_chunk){
-		
-		if(this_chunk.hasOwnProperty('Event') && this_chunk.Event == 'ExtensionStatus' ){
-			var tmp_user = this_chunk.Exten ;
-			var new_status = ASTGUI.getUser_DeviceStatus(tmp_user) ;
-			managerEvents.updateUserImage(tmp_user , new_status);
+	var op_LC = op.toLowerCase() ;
+
+	try{
+		if( op_LC.contains('event: queuememberstatus') ){
+
+			setTimeout( update_AgentsListing_Table , 1000 );
+
+		} else if ( op_LC.contains('event: extensionstatus') ) {
+
+			var tmp_chunks = ASTGUI.miscFunctions.getChunksFromManagerOutput(op, 1) ;
+			tmp_chunks.each(function(this_chunk){
+				if(this_chunk.hasOwnProperty('Event') && this_chunk.Event == 'ExtensionStatus' ){
+					var tmp_user = this_chunk.Exten ;
+					var new_status = ASTGUI.getUser_DeviceStatus(tmp_user) ;
+					managerEvents.updateUserImage(tmp_user , new_status);
+				}
+			});
+
 		}
-	});
-	
-	this.Watch();
+
+	}finally{
+		this.Watch();
+	}
+
 };
 
 managerEvents.Watch = function(){
@@ -477,6 +489,7 @@
 var update_AgentsListing_Table = function(){
 	var addCell = ASTGUI.domActions.tr_addCell; // temporarily store the function
 	var TBL = _$('table_Agents_list') ;
+	ASTGUI.domActions.removeAllChilds(TBL);
 
 	$.get( ASTGUI.paths.rawman, { action: 'Agents' }, function(op){
 		var tmp_chunks = ASTGUI.miscFunctions.getChunksFromManagerOutput(op, 1) ;




More information about the asterisk-gui-commits mailing list