bkruse: branch 1.4 r1435 - in /branches/1.4/config: cfgbasic.html home.html
SVN commits to the Asterisk-GUI project
asterisk-gui-commits at lists.digium.com
Thu Aug 23 14:36:30 CDT 2007
Author: bkruse
Date: Thu Aug 23 14:36:29 2007
New Revision: 1435
URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1435
Log:
Fixed so that digital detection checks on both login and refresh of the page.
Gives the user the option to continue and close out of the popup box.
Modified:
branches/1.4/config/cfgbasic.html
branches/1.4/config/home.html
Modified: branches/1.4/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/cfgbasic.html?view=diff&rev=1435&r1=1434&r2=1435
==============================================================================
--- branches/1.4/config/cfgbasic.html (original)
+++ branches/1.4/config/cfgbasic.html Thu Aug 23 14:36:29 2007
@@ -265,8 +265,7 @@
_$('status_message').innerHTML = '<TABLE border=0 cellpadding=0 cellspacing=4 align=center>' +
'<TR><TD><img src="/asterisk/static/config/images/loading.gif"></TD>' +
'<TD><div id=message_text></div></TD></TR></TABLE>';
-
- _$('message_text').innerHTML = "Time: <div id='counter'>10</div> Digital Cards Detected! Total Spans: " + tot_spans + "<BR><A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; _$('mainscreen').src = 'digital.html';\">Click Here</A><br>To go to the Digital Card Setup Wizard <br>";
+ _$('message_text').innerHTML = "Time: <div id='counter'>10</div> Digital Cards Detected! Total Spans: " + tot_spans + "<BR>Options:<br>1. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; _$('mainscreen').src = 'digital.html';\">Digital Card Setup Wizard</A><br>2. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none';>Continue<br></a>";
setTimeout("_$('status_message').style.display='none';", 10000);
int_handle = setInterval("_$('counter').innerHTML = (_$('counter').innerHTML - 1);", 1000);
setTimeout("clearInterval(int_handle);", 10000);
Modified: branches/1.4/config/home.html
URL: http://svn.digium.com/view/asterisk-gui/branches/1.4/config/home.html?view=diff&rev=1435&r1=1434&r2=1435
==============================================================================
--- branches/1.4/config/home.html (original)
+++ branches/1.4/config/home.html Thu Aug 23 14:36:29 2007
@@ -20,6 +20,7 @@
*
-->
<script src="scripts/prototype.js"></script>
+<script src="scripts/astman.js"></script>
<link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
<script>
var localloggedon = -1;
@@ -36,6 +37,7 @@
}
function localinit() {
+ showdiv_statusmessage();
top.document.title = "Asterisk GUI (Beta) -- Home";
var tmp;
var opt = {
@@ -134,12 +136,47 @@
parent.astmanEngine.sendRequest('action=login&username=' + encodeURIComponent( _$('username').value ) + "&secret=" + encodeURIComponent(_$('secret').value), afterlogin);
}
+function check_digital(n) {
+
+ var l, h;
+ for( l in n ){ if(n.hasOwnProperty(l)){
+ if( l =='general') {
+ if(n[l]['continue'] == "no") {
+ has_digital = 0; /* ztscan.conf was NOT found */
+ /* Maybe check to see if isnew is set to one, then redirect them on a setup wizard about modprobing the drivers and what not */
+ return false;
+ }
+ if(n[l]['continue'] == "yes") {
+ has_digital = 1;
+ var tot_spans = n[l]['totalspans'];
+ if(n[l]['isnew'] == "yes") {
+ _$('status_message').style.display="block";
+ _$('status_message').innerHTML = '<TABLE border=0 cellpadding=0 cellspacing=4 align=center>' +
+ '<TR><TD><img src="/asterisk/static/config/images/loading.gif"></TD>' +
+ '<TD><div id=message_text></div></TD></TR></TABLE>';
+ _$('message_text').innerHTML = "Time: <div id='counter'>10</div> Digital Cards Detected! Total Spans: " + tot_spans + "<BR>Options:<br>1. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none'; parent._$('mainscreen').src = 'digital.html';\">Digital Card Setup Wizard</A><br>2. <A href=\"#\" class=\"splbutton\" onclick=\"_$('status_message').style.display='none';>Continue<br></a>";
+ setTimeout("_$('status_message').style.display='none';", 10000);
+ int_handle = setInterval("_$('counter').innerHTML = (_$('counter').innerHTML - 1);", 1000);
+ setTimeout("clearInterval(int_handle);", 10000);
+ return true;
+ }
+ }
+ }
+
+ }}
+ return true;
+
+}
+
afterlogin = 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();
+ if(!config2json("ztscan.conf", 1, check_digital)) {
+ has_digital = 0; /* ztscan.conf was NOT found */
+ }
loggedOn();
}else if( msgs[0].headers['message'] == "Authentication failed" ){
parent.gui_feedback("Invalid Username/Password",'default',6000);
More information about the asterisk-gui-commits
mailing list