pari: trunk r65 - in /trunk/config: ./ scripts/

asterisk-gui-commits at lists.digium.internal asterisk-gui-commits at lists.digium.internal
Fri Oct 13 11:18:54 CDT 2006


Author: pari
Date: Fri Oct 13 11:18:54 2006
New Revision: 65

URL: http://svn.digium.com/view/asterisk-gui?rev=65&view=rev
Log:
'Gui - access settings (bindaddress & bindport of GUI)'  in options.html 

Modified:
    trunk/config/numberplan.html
    trunk/config/options.html
    trunk/config/record_vmenu.html
    trunk/config/scripts/astman.js

Modified: trunk/config/numberplan.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/numberplan.html?rev=65&r1=64&r2=65&view=diff
==============================================================================
--- trunk/config/numberplan.html (original)
+++ trunk/config/numberplan.html Fri Oct 13 11:18:54 2006
@@ -283,9 +283,7 @@
 		var tmp = new Object;
 		var x;
 		var gen;
-		tmp['name'] = $('extensions').stored_config.catbyname[$('extensions').value].fieldbyname['defaultpat'];
-		if (!tmp['name'] || !tmp['name'].length)
-			tmp['name'] = $('combosel').options[0].value;
+		tmp['name'] = $('combosel').options[0].value;
 		numplan = $('extensions').value ;
 		return new Array(numplan, 'exten', tmp);
 	}
@@ -350,7 +348,7 @@
 		adstatus = "hidden";
 		$('extensions').contentEditable = 'false';
 		
-		for (var x in fieldnames) {
+		for (var x =0; x < fieldnames.length ; x++) {
 			widgets[fieldnames[x]] = $(fieldnames[x]);
 			widgets[fieldnames[x]].disabled = true;
 		}

Modified: trunk/config/options.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/options.html?rev=65&r1=64&r2=65&view=diff
==============================================================================
--- trunk/config/options.html (original)
+++ trunk/config/options.html Fri Oct 13 11:18:54 2006
@@ -25,28 +25,16 @@
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
 var options = new Object;
+var options_fields = new Array('pwdbutton', 'currentpass', 'newpass','newpass_rep');
+var widgets = new Array;
+var fieldnames = new Array('status','bindaddr','bindport','save','cancel');
+var httpconf_callbacks = new Object;
 
 function loggedOff() {
-			$('pwdbutton').disabled = true;
-			$('currentpass').disabled = true;
-			$('newpass').disabled = true;
-			$('newpass_rep').disabled = true;
+			for(var x=0; x< options_fields.length; x++){
+				$(options_fields[x]).disabled = true;
+			}
 	return;
-}
-
-options.pongs = function(msgs){
-		var resp = msgs[0].headers['response'];
-		if (resp == "Pong") {
-			
-		} else {
-			$('status').innerHTML = "<i>Please login...</i>";
-			$('pwdbutton').disabled = true;
-			$('currentpass').disabled = true;
-			$('newpass').disabled = true;
-			$('newpass_rep').disabled = true;
-			//parent.setLoggedOn(0);
-			return;
-		}
 }
 
 options.logins = function(msgs) {
@@ -105,59 +93,66 @@
 		}
 }
 
+function compare_passwords(){
+	if( $('newpass').value==$('newpass_rep').value && $('newpass').value.length > 3 )
+		$('pwdbutton').disabled = false;
+	else
+		$('pwdbutton').disabled = true;
+}
+
 function localajaxinit(){
-	parent.loadscreen(this);
-	parent.astmanEngine.sendRequest('action=ping', options.pongs);
 	$('pwdbutton').disabled = true;
+
+	for (var x in fieldnames) {
+		widgets[fieldnames[x]] = $(fieldnames[x]);
+		widgets[fieldnames[x]].disabled = true;
+	}
+	parent.astmanEngine.config2list("http.conf", $('hiddenfield'), widgets, httpconf_callbacks);
 	return;
 }
 
-function compare_passwords(){
-	if( $('newpass').value==$('newpass_rep').value && $('newpass').value.length > 3 ){
-		$('pwdbutton').disabled = false;
-	}else{
-		$('pwdbutton').disabled = true;
-	}
+httpconf_callbacks.format = function(t) {
+		var tmp = t.name.split('general');
+		if(tmp.length>1)
+			return t.name;
+		else
+			return false;
+}
 
+httpconf_callbacks.loaded = function() {
+		$('hiddenfield').selectitem(0);
+		parent.loadscreen(this);
 }
 
 </script>
 <body id="foo" onload="localajaxinit()">
-<div class="mainscreenTitleBar">
-	<span style="margin-left: 4px;font-weight:bold">Admin Options</span>
-</div>
+<div class="mainscreenTitleBar"><span style="margin-left: 4px;font-weight:bold">Admin Options</span></div>
 <div class="mainscreenContentBox" id="userscontent">
 <table class="mainscreenTable" align="center">
-	<tr valign="top" height="18">
-		<td>
-		<B>Change Password: </B>
-		</td>
+	<tr valign="top" height="18">	<td>	<B>Change Password: </B></td></tr>
+	<tr>	<td align="center" valign="top" height=180>
+					<div id="channellist" class="chanlist">
+					<table>	<tr>	<td colspan=2 height=18></td></tr>
+									<tr>	<td>Current Password:</td><td><input type="password" id="currentpass" size=16></td></tr>
+									<tr>	<td>New Password:</td><td><input type="password" id="newpass" size=16 onkeyup="compare_passwords()">&nbsp;( min 4 characters )</td></tr>
+									<tr>	<td>Retype New Password:</td><td><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"></td></tr>
+									<tr>	<td align=center colspan=2><input type="button" id="pwdbutton" value="Update" onclick="askfor_updatepassword()"></td></tr>
+					</table>
+					</div>
+			</td>
 	</tr>
-	<tr>
-		<td align="center" valign="top">
-				<div id="channellist" class="chanlist">
-				<table>
-				<tr>	<td colspan=2 height=18></td>
-				</tr>
-
-				<tr>	<td>Current Password:</td>
-					<td><input type="password" id="currentpass" size=16></td>
-				</tr>
-				<tr>	<td>New Password:</td>
-					<td><input type="password" id="newpass" size=16 onkeyup="compare_passwords()">&nbsp;( min 4 characters )</td>
-				</tr>
-				<tr>	<td>Retype New Password:</td>
-					<td><input type="password" id="newpass_rep" size=16 onkeyup="compare_passwords()"></td>
-				</tr>
-				<tr>	<td align=center colspan=2>
-						<input type="button" id="pwdbutton" value="Update" onclick="askfor_updatepassword()">
-					</td>
-				</tr>
-				</table>
-				</div>
-		</td>
+	<tr valign="top" height="18">	<td><B>GUI - acess settings: </B></td></tr>
+	<tr>	<td align="center" valign="top" height=170>
+					<table>
+							<tr><td>Bind Address:</td>		<td><input size=14 id='bindaddr' dfalt="127.0.0.1"></td></tr>
+							<tr><td>Port:</td>						<td><input size=14 id='bindport' dfalt=80></td></tr>
+							<tr><td colspan=2><BR></td></tr>
+							<tr><td colspan=2 align=center><input type=button id=save value="Save">&nbsp;<input type=button id=cancel value="Cancel"></td></tr>
+					</table>
+					<select  size="5" id="hiddenfield" style="display:none; width:220px"></select>
+			</td>
 	</tr>
-	<tr><td valign="top"><div  id='status'></div></td></tr>
+	<tr><td valign="top" align=center><div  id='status'></div></td></tr>
 	<tr><td></td></tr>
 </table>
 </div>

Modified: trunk/config/record_vmenu.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/record_vmenu.html?rev=65&r1=64&r2=65&view=diff
==============================================================================
--- trunk/config/record_vmenu.html (original)
+++ trunk/config/record_vmenu.html Fri Oct 13 11:18:54 2006
@@ -27,7 +27,6 @@
 
 <script>
 function localajaxinit() {
-	// Load the jabber.conf->users into the Users, associate the field to other fields
 	parent.loadscreen(this);
 
 }
@@ -66,9 +65,6 @@
 
 
 
-
-
-
 			<BR><BR>
 			<table cellpadding=2 cellspacing=2 border=0>
 				<tr>	<td colspan=2 height=40 valign=middle align=center><B>Record a new voicemenu</B> </td>	</tr>

Modified: trunk/config/scripts/astman.js
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/scripts/astman.js?rev=65&r1=64&r2=65&view=diff
==============================================================================
--- trunk/config/scripts/astman.js (original)
+++ trunk/config/scripts/astman.js Fri Oct 13 11:18:54 2006
@@ -563,7 +563,7 @@
 		box.widgets['status'].innerHTML = "<i>Creating new entry!</i>";
 	if (box.widgets['name']){
 		box.widgets['name'].value = name;
-		box.widgets['name'].focus();
+		//box.widgets['name'].focus();
 	}
 }
 



More information about the asterisk-gui-commits mailing list