pari: branch aadk r735 - in /branches/aadk/config: cfgbasic.html home.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Apr 23 16:51:23 MST 2007


Author: pari
Date: Mon Apr 23 18:51:22 2007
New Revision: 735

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=735
Log:
Onlogin - Check whether the Compact Flash is mounted, this makes more sense than checking in every page - Record a menu, Backup, Update etc

Modified:
    branches/aadk/config/cfgbasic.html
    branches/aadk/config/home.html

Modified: branches/aadk/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/cfgbasic.html?view=diff&rev=735&r1=734&r2=735
==============================================================================
--- branches/aadk/config/cfgbasic.html (original)
+++ branches/aadk/config/cfgbasic.html Mon Apr 23 18:51:22 2007
@@ -45,6 +45,7 @@
 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;
+var CF_status = 0;
 
 eventeater.eventcb = function(msgs) {
 	if (loggedon == 1){

Modified: branches/aadk/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/home.html?view=diff&rev=735&r1=734&r2=735
==============================================================================
--- branches/aadk/config/home.html (original)
+++ branches/aadk/config/home.html Mon Apr 23 18:51:22 2007
@@ -111,10 +111,7 @@
 demo.logins = function(msgs) {
 	_$('statusbar').innerHTML = msgs[0].headers['message'];
 	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();
-		loggedOn();
+		gui_sysinfo_mount(1);
 	}else if( msgs[0].headers['message'] == "Authentication failed" ){
 		parent.gui_feedback("Invalid Username/Password",'default',6000);
 		_$('username').focus();
@@ -128,9 +125,7 @@
 demo.pongs  = function(msgs) {
 	resp = msgs[0].headers['response'];
 	if (resp == "Pong") {
-		_$('statusbar').innerHTML = "<i>Already connected...</i>";
-		loggedOn();
-		if( window.location.href.match("reload=yes") ){ parent._$('mainscreen').style.display = ''; reload_Config2(); }else{ parent.loadscreen(this); }
+		gui_sysinfo_mount(0);
 	} else {
 		_$('statusbar').innerHTML = "<i>Please login...</i>";
 		loggedOff();
@@ -278,6 +273,48 @@
 	_$('reloadconfig').disabled = r;
 	_$('saveconfig').disabled = r;
 }
+
+
+
+
+
+function gui_sysinfo_mount(m){
+
+	_$('message_text').innerHTML = " Checking for Compact Flash ";
+	_$('status_message').style.display ="" ;
+
+	parent.astmanEngine.run_tool(parent.asterisk_guiSysInfo , callback = function() {
+		var opt = { method: 'get', asynchronous: true,
+			onComplete: function(originalRequest){
+				_$('status_message').style.display ="none" ;
+				_$('sysinfohtml').innerHTML = originalRequest.responseText;
+				if( $('cf_status').innerHTML == "1"){
+					parent.CF_status = 1;
+					parent.gui_feedback("found Compact Flash ","green");
+				}else{
+					parent.gui_feedback("did not find any Compact Flash mounted");
+				}
+
+				if(m){
+					parent.gui_feedback("Login Successful",'blue',2000);
+					_$('statusbar').innerHTML = "<img src='images/tick.gif'><i>Connected!</i>";
+					parent.astmanEngine.pollEvents();
+					loggedOn();
+				}else{
+					_$('statusbar').innerHTML = "<i>Already connected...</i>";
+					loggedOn();
+					if( window.location.href.match("reload=yes") ){ parent._$('mainscreen').style.display = ''; reload_Config2(); }else{ parent.loadscreen(this); }
+				}
+
+			},
+			onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }
+		};
+		opt.parameters="";
+		var tmp = new Ajax.Request( parent.asterisk_guiSysInfo_output, opt);
+	});
+}
+
+
 </script>
 <body id="foo" onload="localinit()" topmargin=0  bgcolor="EFEFEF">
 <div class="mainscreenTitleBar">
@@ -322,4 +359,5 @@
 	</tr>
 </table>
 </div>
+<div id="sysinfohtml" style="display:none"></div>
 </body>



More information about the asterisk-gui-commits mailing list