pari: branch asterisknow r884 - in /branches/asterisknow: ./ config/ config/s...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon May 7 08:45:46 MST 2007


Author: pari
Date: Mon May  7 10:45:46 2007
New Revision: 884

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=884
Log:
Merged revisions 879,881-883 via svnmerge from 
https://origsvn.digium.com/svn/asterisk-gui/trunk

........
r879 | pari | 2007-05-04 18:20:17 -0500 (Fri, 04 May 2007) | 22 lines

** Major Change **

Until now we've been using pollEvents for keeping the http session alive.

We need an alternative because - 

*) If Esc key is pressed - all the background XHRs will be stopped including the waitevent
   effectively resulting in a session timeout
*) There is actually no need to monitor events on the server except for in status.html
*) If User takes more time for answering an alert box or a confirm dialog - 
   any new pollEvents will be called only after the user answers the dialog.
   This is often resulting in timeouts
*) This never worked in IE, Opera

The new model of making pings using setInterval should solve all these issues

For the timebeing I'm hardcoding the value 60 (60*250 milliseconds = 15 seconds) 
but this will be soon replaced by the actual httptimeout from manager.conf

-Pari


........
r881 | pari | 2007-05-07 10:23:50 -0500 (Mon, 07 May 2007) | 1 line

minor bug fix - element.value instead of element
........
r882 | pari | 2007-05-07 10:41:12 -0500 (Mon, 07 May 2007) | 1 line

Forgot to update used_fxos on 'deletion of trunks'
........
r883 | pari | 2007-05-07 10:44:20 -0500 (Mon, 07 May 2007) | 1 line

SetupWizard: Forgot to update used_fxos on 'deletion of trunks'
........

Modified:
    branches/asterisknow/   (props changed)
    branches/asterisknow/config/cfgbasic.html
    branches/asterisknow/config/home.html
    branches/asterisknow/config/localexts.html
    branches/asterisknow/config/setup/4.html
    branches/asterisknow/config/status.html
    branches/asterisknow/config/trunks.html

Propchange: branches/asterisknow/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Mon May  7 10:45:46 2007
@@ -1,1 +1,1 @@
-/trunk:1-449,489-540,542-557,559,561-577,580-586,588-872
+/trunk:1-449,489-540,542-557,559,561-577,580-586,588-883

Modified: branches/asterisknow/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/cfgbasic.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/cfgbasic.html (original)
+++ branches/asterisknow/config/cfgbasic.html Mon May  7 10:45:46 2007
@@ -45,6 +45,28 @@
 var copyright = "Copyright ©2006-2007 Digium, Inc.  All Rights Reserved.       ";
 var tooltip_default = "Move the mouse over to a field to see tooltips";
 var asterisk_guitools_inextconf = 0;
+eventeater.pingstatus = false;
+var keepPinging;
+
+function pingevery(a){
+	keepPinging = setInterval( makeping, a*250 );
+}
+
+function makeping(){
+	var tmp;
+	var opt = {
+		method: 'get',
+		parameters: "action=ping",
+		asynchronous: true,
+		onComplete: function(t){
+			//if( t.responseText.match("Authentication failed") || t.responseText =="" ){
+			//	window.clearInterval(keepPinging);
+			//}
+			// For some reason, I could not get clearInterval to work. I will fix this soon. - pari
+		}
+	};
+	tmp = new Ajax.Request( asterisk_rawmanPath, opt);
+}
 
 eventeater.eventcb = function(msgs) {
 	if (loggedon == 1){
@@ -136,7 +158,6 @@
 
 function loadscreen(srcbody) {
 	_$('mainscreen').style.display = '';
-	if (loggedon == 1){ astmanEngine.pollEvents(); }
 }
 
 function setstatus(status) {	_$('status').innerHTML = copyright + status;	}
@@ -201,7 +222,7 @@
 }
 
 astmanEngine.setURL(asterisk_rawmanPath );
-astmanEngine.setEventCallback(eventeater.eventcb);
+//astmanEngine.setEventCallback(eventeater.eventcb);
 
 function Logoff() {
 	if(!confirm("Are you sure ?")){ return true; }

Modified: branches/asterisknow/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/home.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/home.html (original)
+++ branches/asterisknow/config/home.html Mon May  7 10:45:46 2007
@@ -53,6 +53,11 @@
 
 	if( parent.asterisk_guitools_inextconf == 0){
 		checkessentials();
+	}
+
+	if(!parent.eventeater.pingstatus){
+		parent.eventeater.pingstatus = true;
+		parent.pingevery(60);
 	}
 
 	parent.setLoggedOn(1);
@@ -94,7 +99,7 @@
 	if ( msgs[0].headers['response'] == "Success" ){
 		parent.gui_feedback("Login Successful",'blue',6000);
 		_$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
-		parent.astmanEngine.pollEvents();
+		//parent.astmanEngine.pollEvents();
 		loggedOn();
 	}else if( msgs[0].headers['message'] == "Authentication failed" ){
 		parent.gui_feedback("Invalid Username/Password",'default',6000);

Modified: branches/asterisknow/config/localexts.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/localexts.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/localexts.html (original)
+++ branches/asterisknow/config/localexts.html Mon May  7 10:45:46 2007
@@ -98,7 +98,7 @@
 	if( lel.value == ub.value.length ) { 
 		return;
 	}else if( lel.value < ub.value.length ){
-		ub.value = ub.value.substr(0,lel);
+		ub.value = ub.value.substr(0,lel.value);
 		return;
 	}else if( lel.value > ub.value.length ){
 		while ( lel.value != ub.value.length  ){ ub.value = ub.value + "0" ; }

Modified: branches/asterisknow/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/setup/4.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/setup/4.html (original)
+++ branches/asterisknow/config/setup/4.html Mon May  7 10:45:46 2007
@@ -195,6 +195,8 @@
 callbacks.delchanges = function(box, value) {
 	deletesp_fromui(value);
 	delete_didcontext(value);
+	used_fxos.newvalue = "";
+	update_used_fxos();
 	var _hglobals = _$('hiddenglobals');
 	var oldvalue = _hglobals.stored_config.catbyname['globals'].fieldbyname[value];
 	if (oldvalue) {
@@ -932,6 +934,7 @@
 		if(_devices.options[i].value == trunk){
 			_devices.selectitem(i) ;
 			_$('delete').disabled = 0;
+			used_fxos.oldvalue = _devices.stored_config.catbyname[_devices.value].fieldbyname['zapchan'] ;
 			if( !_$('delete').click() ){ return; }
 			break;
 		}

Modified: branches/asterisknow/config/status.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/status.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/status.html (original)
+++ branches/asterisknow/config/status.html Mon May  7 10:45:46 2007
@@ -118,10 +118,11 @@
 	refreshChannelsList() ;
 	parent.astmanEngine.setEventCallback(parent.eventeater.eventcd );
 	parent.loadscreen(this);
+	parent.astmanEngine.pollEvents();
 }
 
 function localajaxend(){
-	parent.astmanEngine.setEventCallback(parent.eventeater.eventcb );
+	parent.astmanEngine.setEventCallback(null);
 	if( navigator.userAgent.indexOf("MSIE") != -1 ){ 
 		try{ purge( document.body ); } catch(e){ }	
 	}

Modified: branches/asterisknow/config/trunks.html
URL: http://svn.digium.com/view/asterisk-gui/branches/asterisknow/config/trunks.html?view=diff&rev=884&r1=883&r2=884
==============================================================================
--- branches/asterisknow/config/trunks.html (original)
+++ branches/asterisknow/config/trunks.html Mon May  7 10:45:46 2007
@@ -184,6 +184,8 @@
 callbacks.delchanges = function(box, value) {
 	deletesp_fromui(value);
 	delete_didcontext(value);
+	used_fxos.newvalue = "";
+	update_used_fxos();
 	var _hglobals = _$('hiddenglobals');
 	var oldvalue = _hglobals.stored_config.catbyname['globals'].fieldbyname[value];
 	if (oldvalue) {
@@ -917,6 +919,7 @@
 		if(_devices.options[i].value == trunk){
 			_devices.selectitem(i) ;
 			_$('delete').disabled = 0;
+			used_fxos.oldvalue = _devices.stored_config.catbyname[_devices.value].fieldbyname['zapchan'] ;
 			if( !_$('delete').click() ){ return; }
 			break;
 		}



More information about the asterisk-gui-commits mailing list