pari: branch 2.0 r4095 - /branches/2.0/config/js/astman.js

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Nov 11 16:48:42 CST 2008


Author: pari
Date: Tue Nov 11 16:48:42 2008
New Revision: 4095

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

 if an updateconfig request is Unsuccessfull
	* do not issue any further requests
	* pass false to the callback function with error message



Modified:
    branches/2.0/config/js/astman.js

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=4095&r1=4094&r2=4095
==============================================================================
--- branches/2.0/config/js/astman.js (original)
+++ branches/2.0/config/js/astman.js Tue Nov 11 16:48:42 2008
@@ -3024,9 +3024,16 @@
 			var f = treq[ 'act_' + st ];
 			if(f){
 				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);} });
+				$.ajax({ type: "GET", url: ASTGUI.paths.rawman, data: pre_uri + f , success: function(msg){
+					if( msg && typeof msg == 'string' && msg.contains('Response: Error') && msg.contains('Message:') ){
+						var err_msg = msg.afterStr('Message:');
+						callback(false, err_msg);
+					}else{
+						start_sqreqs(st+1);
+					}
+				}});
 			}else{
-				setTimeout( function(){ ajxs.style.display = 'none'; callback(); }, 500 ) ;
+				setTimeout( function(){ ajxs.style.display = 'none'; callback(true); }, 500 ) ;
 			}
 		};
 		start_sqreqs(1);




More information about the asterisk-gui-commits mailing list