pari: branch aadk r497 - in /branches/aadk/config: ./ scripts/ setup/ stylesh...

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Tue Mar 27 10:52:10 MST 2007


Author: pari
Date: Tue Mar 27 12:52:09 2007
New Revision: 497

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=497
Log:
merging recent changes in trunk 

Removed:
    branches/aadk/config/cfgadvanced.html
    branches/aadk/config/cfgappliance.html
    branches/aadk/config/homeapp.html
Modified:
    branches/aadk/config/backup.html
    branches/aadk/config/cfgbasic.html
    branches/aadk/config/gui_sysinfo
    branches/aadk/config/guialert.html
    branches/aadk/config/home.html
    branches/aadk/config/iax.html
    branches/aadk/config/incoming.html
    branches/aadk/config/jabber.html
    branches/aadk/config/jingle.html
    branches/aadk/config/localexts.html
    branches/aadk/config/meetme.html
    branches/aadk/config/menus.html
    branches/aadk/config/moh.html
    branches/aadk/config/networking.html
    branches/aadk/config/numberplan.html
    branches/aadk/config/options.html
    branches/aadk/config/queues.html
    branches/aadk/config/record.html
    branches/aadk/config/scripts/astman.js
    branches/aadk/config/scripts/prototype.js
    branches/aadk/config/scripts/tooltip.js
    branches/aadk/config/setup/10.html
    branches/aadk/config/setup/2.html
    branches/aadk/config/setup/3.html
    branches/aadk/config/setup/4.html
    branches/aadk/config/setup/6.html
    branches/aadk/config/setup/7.html
    branches/aadk/config/sip.html
    branches/aadk/config/status.html
    branches/aadk/config/stylesheets/schwing.css
    branches/aadk/config/sysinfo.html
    branches/aadk/config/trunks.html
    branches/aadk/config/users.html
    branches/aadk/config/voicemail.html
    branches/aadk/config/zapata.html

Modified: branches/aadk/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/backup.html?view=diff&rev=497&r1=496&r2=497
==============================================================================
--- branches/aadk/config/backup.html (original)
+++ branches/aadk/config/backup.html Tue Mar 27 12:52:09 2007
@@ -1,5 +1,5 @@
 <!--
- * Asterisk-GUI	-	an Asterisk configuration interface
+  * Asterisk-GUI	-	an Asterisk configuration interface
  *
  * "Backup / Restore" management
  *
@@ -27,44 +27,38 @@
 <script>
 var bkp_path = "/var/lib/asterisk/sounds/backups/";
 
-
 function localajaxinit() {
-	parent.astmanEngine.run_tool("sh /bin/gui_sysinfo", onSuccess = function() { 
-				var opt = { method: 'get', asynchronous: true,
-					onComplete: function(originalRequest){
-						$('sysinfohtml').innerHTML = originalRequest.responseText;
-						if( $('cf_status').innerHTML == "1"){
-							showlist_of_files();
-						}else{
-								gui_alert("You need a Compact Flash to use this feature");
-								parent.astmanEngine.pollEvents();
-						}
-					},
-					onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }
-				};
-				opt.parameters="";
-				var tmp = new Ajax.Request("./bkps/sysinfo.html", opt);
-				return true;
-			}
-	);
+	setWindowTitle("Backup");
+	showdiv_statusmessage();
+	var _nn = _$('newbkp_name') ; 
+	_nn.onfocus = function(){this.className = 'input9_hilight';}
+	_nn.onblur = function(){this.className = 'input9';}
+
+	parent.astmanEngine.run_tool("sh /bin/gui_sysinfo", callback = function() { 
+		var opt = { method: 'get', asynchronous: true,
+			onComplete: function(originalRequest){
+				_$('sysinfohtml').innerHTML = originalRequest.responseText;
+				if( $('cf_status').innerHTML == "1"){
+					showlist_of_files();
+				}else{
+					gui_alert("You need a Compact Flash to use this feature");
+					parent.astmanEngine.pollEvents();
+				}
+			},
+			onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }
+		};
+		opt.parameters="";
+		var tmp = new Ajax.Request("./sysinfo_output.html", opt);
+		return true;
+	});
 }
 
 
 function showlist_of_files(){
-	parent.loadscreen(this);
-	var k = $('bkp_files').innerHTML ;
+	var k = _$('bkp_files').innerHTML ;
 	var bkpfiles = k.split("<br>") ;
-	
+
 	clear_table();
-
-//	if( typeof bkpfiles[0] == "undefined"  || bkpfiles[0] == "" ){
-//		$('table_one').style.display="none";
-//		var newRow = $('bkpfilesTable').insertRow(-1);
-//		var newCell0 = newRow.insertCell(0);
-//		newCell0 .align = "center";
-//		newCell0 .innerHTML = "<BR><I>No Previous Backup Files !!</I><BR><BR> Please click on the 'Take a BackUp' button<BR> to  take a backup of the current system configuration<BR><BR>" ;
-//		return true;
-//	}
 
 	for( var i =0 ; i < bkpfiles.length ; i++){
 		if( typeof bkpfiles[i] == "undefined"  || bkpfiles[i] == "" ){
@@ -72,86 +66,95 @@
 		}
 		bkpfiles[i] = bkpfiles[i].replace(/^\s*|\s*$/g,'') ;
 		if( bkpfiles[i] == "" ){continue;	}
-
-		addrow_totable( bkpfiles[i], i );
-	}
+		addrow_totable( bkpfiles[i].stripTags(), i );
+	}
+
+
+	var _bft = _$('bkpfilesTable') ;
+	
+	if( _bft.rows.length == 0 ){
+		_$('table_one').style.display="none";
+		var newRow = _bft.insertRow(-1);
+		var newCell0 = newRow.insertCell(0);
+		newCell0 .align = "center";
+		newCell0 .innerHTML = "<BR><I> No Previous Backup configurations found !!</I> <BR><BR>" +
+			"Please click on the 'Take a BackUp' button<BR> to  take a backup of the current system configuration<BR><BR>" ;
+	}
+
+	parent.loadscreen(this);
 }
 
 function clear_table(){
-	for( var i=0; i <  $('bkpfilesTable').rows.length; ){
-			 $('bkpfilesTable').deleteRow(i);
+	var _bft = _$('bkpfilesTable') ;
+	for( var i=0; i <  _bft.rows.length; ){
+		 _bft.deleteRow(i);
 	}
 }
 
 
 function addrow_totable(filename, i ){
-		var fname = filename.split("__") ;
-		// var fname[1] = 2007mar12.tar
-		var filedate = fname[1].split(".tar");
-		var day = filedate[0].substr(7);
-		var month = filedate[0].substr(4,3);
-		var year = filedate[0].substr(0,4);
-
-		var newRow = $('bkpfilesTable').insertRow(-1);
-
-		var newCell0 = newRow.insertCell(0);
-		newCell0 .innerHTML = i+1 ;
-		newCell0 .width = 35;
-		newCell0.align = "center";
-
-		var newCell1 = newRow.insertCell(1);
-		newCell1 .innerHTML = fname[0] ;
-		newCell1.width = 180;
-
-		var newCell2 = newRow.insertCell(2);
-		newCell2 .innerHTML = month.capitalize()  + " " + day + ", "+year ;
-		newCell2.width = 95;
-
-		var newCell3 = newRow.insertCell(3);
-		newCell3 .innerHTML = "<input type=\"button\" onclick='restore_bkp(\""+ filename + "\")'  value=\"Restore\" class=\"splbutton\">&nbsp;"  +
-		"<input type=\"button\" onclick='delete_bkp(\""+ filename + "\")'  value=\"Delete\"  class=\"splbutton\">" ;
-		newCell3.align = "center";
+	var fname = filename.split("__") ;
+	// var fname[1] = 2007mar12.tar
+	var filedate = fname[1].split(".tar");
+	var day = filedate[0].substr(7);
+	var month = filedate[0].substr(4,3);
+	var year = filedate[0].substr(0,4);
+	
+	var newRow = _$('bkpfilesTable').insertRow(-1);
+	newRow.style.backgroundColor='#FFFFFF';
+	newRow.onmouseover= function(){ this.style.backgroundColor='#F9F0D1'; };
+	newRow.onmouseout=function(){ this.style.backgroundColor='#FFFFFF'; };
+	
+	var newCell0 = newRow.insertCell(0);
+	newCell0 .innerHTML = i+1 ;
+	newCell0 .width = 35;
+	newCell0.align = "center";
+	
+	var newCell1 = newRow.insertCell(1);
+	newCell1 .innerHTML = fname[0] ;
+	newCell1.width = 180;
+	
+	var newCell2 = newRow.insertCell(2);
+	newCell2 .innerHTML = month.capitalize()  + " " + day + ", "+year ;
+	newCell2.width = 95;
+	
+	var newCell3 = newRow.insertCell(3);
+	newCell3 .innerHTML = "<input type=\"button\" onclick='restore_bkp(\""+ filename + "\")'  value=\"Restore\" class=\"splbutton\">&nbsp;"  +
+	"<input type=\"button\" onclick='delete_bkp(\""+ filename + "\")'  value=\"Delete\"  class=\"splbutton\">" ;
+	newCell3.align = "center";
 }
 
 
 function restore_bkp(filename){
-	parent.astmanEngine.run_tool("rm /etc/asterick/* -rf ", callback=function(){
-			restore_bkp_step2(filename);
-		}
-	);
+	parent.astmanEngine.run_tool("rm /etc/asterick/* -rf ", callback=function(){ restore_bkp_step2(filename);} );
 }
 
 
 function restore_bkp_step2(filename){
-		parent.astmanEngine.run_tool("tar -xf " + bkp_path + filename +" -C /" , callback=function(){
-			alert("Configuration restored to "+ filename +"\n Click OK to Save and Reboot ");
-			parent.astmanEngine.run_tool("/bin/save_config",onSuccess = function() { 
-				gui_alert("Configuration Saved, Rebooting !"); 
-				parent.astmanEngine.run_tool("/bin/reboot",onSuccess = function() {  } );
-			} );
-		}
-	);
+	parent.astmanEngine.run_tool("tar -xf " + bkp_path + filename +" -C /" , callback=function(){
+		gui_alert("Configuration restored !!");
+		// give two seconds for extracting tar file before restarting asterisk 
+		window.setTimeout( function(){ parent.reloadConfig();}, 1500);
+	});
 }
 
 function delete_bkp( filename ){
-	var ans = confirm("Delete Backup file "+ filename +" ?");
-	if(ans){
-		parent.astmanEngine.run_tool("/bin/rm -f "+ bkp_path + filename , callback=function(){
-				$('status').innerHTML = " <I> Delete Request Successfull ! </I>";
-				window.location.href = window.location.href ;
-			}
-		);
-	}
+	if(!confirm("Delete selected Backup Configuration ?")){ return ; }
+	parent.astmanEngine.run_tool("/bin/rm -f "+ bkp_path + filename , callback=function(){
+		_$('status').innerHTML = " <I> Delete Request Successfull ! </I>";
+		window.location.href = window.location.href ;
+	});
 }
 
 function take_bkp(){
-	$('bg_transparent').style.display="" ;
-	$('newbkp_content').style.display="" ;
+	_$('bg_transparent').style.display="" ;
+	_$('newbkp_content').style.display="" ;
+	_$('newbkp_name').focus();
 }
 
 function cancel_newbackup(){
-	$('bg_transparent').style.display="none" ;
-	$('newbkp_content').style.display="none" ;
+	_$('bg_transparent').style.display="none" ;
+	_$('newbkp_content').style.display="none" ;
 }
 
 function addzero(x){
@@ -160,25 +163,26 @@
 }
 
 function backup_new(){
-		if( $('newbkp_name').value == "" ){
-			alert("Please Enter a name for the backup");
-			$('newbkp_name').focus();
-			return true;
+	var _nn = _$('newbkp_name');
+	if( _nn.value == "" ){
+		alert("Please Enter a name for the backup");
+		_nn.focus();
+		return true;
+	}
+	var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
+	var today=new Date()
+	var year = today.getFullYear();
+	var month = months[ today.getMonth() ];
+	var day = addzero(today.getDate());
+	//var hour =addzero(today.getHours());
+	//var minute =addzero(today.getMinutes());
+	//var seconds =addzero(today.getSeconds());
+	var bkpfile =  _nn.value +"__" + year + month + day +".tar";
+
+	parent.astmanEngine.run_tool("/bin/tar -cf "+ bkp_path + bkpfile +" /etc/asterisk/", callback=function(){
+			window.location.href = window.location.href ;
 		}
-		var months = ["jan", "feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];
-		var today=new Date()
-		var year = today.getFullYear();
-		var month = months[ today.getMonth() ];
-		var day = addzero(today.getDate());
-		//var hour =addzero(today.getHours());
-		//var minute =addzero(today.getMinutes());
-		//var seconds =addzero(today.getSeconds());
-		var bkpfile =  $('newbkp_name').value +"__" + year + month + day +".tar";
-
-		parent.astmanEngine.run_tool("/bin/tar -cf "+ bkp_path + bkpfile +" /etc/asterisk/", callback=function(){
-				window.location.href = window.location.href ;
-			}
-		);
+	);
 }
 
 </script>
@@ -189,57 +193,56 @@
 </div>
 <div class="mainscreenContentBox" id="userscontent">
 <table class="mainscreenTable" align="center">
-	<tr><td valign="top" align="center">
-			<BR>
-				<fieldset  style="height: 390px; "  id="fieldset2">
-						<legend>&nbsp;List of Previous Configuration Backups&nbsp;</legend>
-							<table class="table_blacksm" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
-								<tr>	<td width=35>S.No</td>
-										<td width="180">Name</td>
-										<td width="95">Date</td>
-										<td align="center">Options</td>
-								</tr>
-							</table>
-							<div id="bkpfilesTable_div" style="height:260px;width=100%; overflow :auto; padding : 0px 0px 0px 0px;">
-								<table id="bkpfilesTable" cellpadding=2 cellspacing=1 border=0 align=center width=500></table>
-							</div>
-						<center><div style="height:25px;color: #FF0000;" id='status'  class="field_text9"></div></center>
-						<BR>
-						<div STYLE="position: absolute; left:186; top: 460;"><input type="button" id="takebkp" value="Take a Backup" onclick="take_bkp();" ></div>
-				</fieldset>
+	<tr>
+	<td valign="top" align="center">
+	<BR>
+	<fieldset  style="height: 390px; "  id="fieldset2">
+		<legend>&nbsp;List of Previous Configuration Backups&nbsp;</legend>
+		<table class="table_blacksm" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
+			<tr>	<td width=35>S.No</td>
+				<td width="180">Name</td>
+				<td width="95">Date</td>
+				<td align="center">Options</td>
+			</tr>
+		</table>
+		<div id="bkpfilesTable_div" style="height:260px;width=100%; overflow :auto; padding : 0px 0px 0px 0px;">
+			<table id="bkpfilesTable" cellpadding=2 cellspacing=1 border=0 align=center width=500></table>
+		</div>
+		<center><div style="height:25px;color: #FF0000;" id='status'  class="field_text9"></div></center>
+		<BR>
+		<div STYLE="position: absolute; left:186; top: 460;">
+			<input type="button" id="takebkp" value="Take a Backup" onclick="take_bkp();" >
+		</div>
+	</fieldset>
 	</td>
 	</tr>
 </table>
 </div>
 <div id="newbkp_content" STYLE="display:none; position: absolute; left: 120; top: 144; width:350; height:125;  background-color:#F4EFE5;   border-width: 1px; border-color: #7E5538; border-style: solid; z-index:5">
-		<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'newbkp_content');">
-		<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">
-				<TD><font color="#FFFFFF"><B>Create New Backup</B></FONT></TD>
-				<TD Height="20" align="right" style="cursor: move">
-					<A href="#" onclick="$('cancel_a').click();"><font style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</font></A>
-				</TD>
-				<TD width=4></TD>
-		</TR>
-		</table>
-			<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
-				<tr>	<td colspan=2 height=20 valign=middle align=center class="field_text"></td>	</tr>
-				<tr><td class="field_text" align="right">File Name:&nbsp;</td>
-						<td><input id='newbkp_name' size=25 class="input8"></td>
-				</tr>
-				<tr>	<td colspan=2 align=center height=6></td></tr>
-				<tr>	<td colspan=2 align=center height=6>(do not enter any extension )</td></tr>
-				<tr>	<td colspan=2 align=center>
-				<input type="button" id='getbackup' Value="Backup" onclick="backup_new()" class="buttonbold">&nbsp;
-				<input type="button" id='cancel_a' Value="Cancel" onclick="cancel_newbackup()" class="buttonbold">
-				</td></tr>
-			</table>
+	<table width="100%" cellpadding=0 cellspacing=0  onmousedown="startDrag(event , 'newbkp_content');">
+	<TR bgcolor="#7E5538"  style="background-image:url('images/title_gradient.gif');">
+		<TD><font color="#FFFFFF">&nbsp;&nbsp;<B>Create New Backup</B></FONT></TD>
+		<TD Height="20" align="right" style="cursor: move">
+			<A href="#" onclick="$('cancel_a').click();" style="color:#FFFFFF; font-size: 12px; font-weight:bold;">X</A>
+		</TD>
+		<TD width=4></TD>
+	</TR>
+	</table>
+	<table cellpadding=2 cellspacing=2 border=0 width="100%" align="center">
+		<tr>	<td colspan=2 height=20 valign=middle align=center class="field_text"></td>	</tr>
+		<tr>	<td class="field_text" align="right">File Name:&nbsp;</td>
+			<td><input id='newbkp_name' size=25 class="input9"></td>
+		</tr>
+		<tr>	<td colspan=2 align=center height=6></td>	</tr>
+		<tr>	<td colspan=2 align=center height=6>(do not enter any extension )</td></tr>
+		<tr>	<td colspan=2 align=center>
+			<input type="button" id='getbackup' Value="Backup" onclick="backup_new()" class="buttonbold">&nbsp;
+			<input type="button" id='cancel_a' Value="Cancel" onclick="cancel_newbackup()" class="buttonbold">
+			</td>
+		</tr>
+	</table>
 </div>
 <div id="sysinfohtml" style="display:none"></div>
-<SCRIPT LANGUAGE="JavaScript">
-<!--
-showdiv_statusmessage();
-//-->
-</SCRIPT>
 <div id="bg_transparent" STYLE="display:none; position: absolute; left: 0; top: 24; width:100%; height:100%;  background-color:#EFEFEF; -moz-opacity:.50;opacity:.50; border-width: 1px; border-color: #EFEFEF; border-style: solid; z-index:4">
 </div>
 </body>

Modified: branches/aadk/config/cfgbasic.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/cfgbasic.html?view=diff&rev=497&r1=496&r2=497
==============================================================================
--- branches/aadk/config/cfgbasic.html (original)
+++ branches/aadk/config/cfgbasic.html Tue Mar 27 12:52:09 2007
@@ -1,5 +1,5 @@
 <!--
- * Asterisk-GUI	-	an Asterisk configuration interface
+* Asterisk-GUI	-	an Asterisk configuration interface
  *
  * Top level for configuration file
  *
@@ -20,7 +20,7 @@
  *
 -->
 <script>
-var browser_alert = "Asterisk Configuration GUI is currently supported in Firefox (recommended 1.5 or above) \n SeaMonkey (1.0 or above), Netscape (8.0 or above) and Opera (9.0 or above) \n\n" +	"Support for other browsers is under development \n" + 	" and will be supported in future versions";
+var browser_alert = "You owe it to yourself to try it out !<BR><A href='http://www.getfirefox.com' style='font-size: 13px; font-family:arial,sans-serif,Helvetica,Trebuchet MS; color : #6C74A3;' target='_blank'>Get Firefox</A>";
 </script>
 <script src="scripts/prototype.js"></script>
 <script src="scripts/rico.js"></script>
@@ -28,248 +28,267 @@
 <link href="stylesheets/rico.css" media="all" rel="Stylesheet" type="text/css" />
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
-	PanelDef = Class.create();
-	PanelDef.prototype = {
-		initialize: function(name, label, icon, content) {
-			this.name = name;
-			this.label = label;
-			this.icon = icon;
-			this.content = content;
-		}
-	}
-	var panels = new Array;
-	var eventeater = new Object;
-	var loggedon = -1;
-	var started = 0;
-	var accordion;
-	var copyright = "Copyright &copy;2006 Digium, Inc.  All Rights Reserved. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
-	var tooltip_default = "Move the mouse over to a field to see tooltips";
-	var asterisk_guitools_inextconf = 0;
-
-	eventeater.eventcb = function(msgs) {
-		if (loggedon == 1){
-			astmanEngine.pollEvents();
-		}
-	}
-
-
-	panels.push( 
-
-		new PanelDef("home", "Home", "home.png",
-			"Asterisk Configuration Panel - Please click on a panel to manage related features"),
-
-		new PanelDef("users", "Users", "accordion-icon.gif",
-			"Users is a short cut for quickly adding and removing all the necessary " +
-			"configuration components for any new phone."),
-
-		new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
-			"MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
-			"security."),
-
-		new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
-			"General settings for voicemail"),
-
-		new PanelDef("queues", "Call Queues", "accordion-icon.gif",
-			"Call queues allow calls to be sequenced to one or more agents."),
-
-		new PanelDef("trunks", "Service Providers", "accordion-icon.gif",
-			"Service Providers are outbound lines used to allow the system to make calls to the " +
-			"real world.  Trunks can be VoIP lines or traditional telephony lines."),
-
-		new PanelDef("numberplan", "Calling Rules", "accordion-icon.gif",
-			"The Calling Rules define dialing permissions and least cost routing rules."),
-
-		new PanelDef("incoming", "Incoming Calls", "accordion-icon.gif",
-			"Define how your incoming calls should be handled & configure DID (Direct inward Dialing)"),
-
-//		new PanelDef("musiconhold", "Music On Hold", "accordion-icon.gif",
-//			"Music on hold sometimes keeps people less angry while they wait for an answer."),
-
-		new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
-			"Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist"),
-
-		new PanelDef("record", "Record a Menu", "accordion-icon.gif",
-			"Allows you to record custom voicemenus over a phone"),
-		
-		new PanelDef("status", "Active Channels", "accordion-icon.gif", "Monitor active channels."),
-
-		new PanelDef("sysinfo", "System Info", "accordion-icon.gif", "System Information."),
-
-		new PanelDef("backup", "Backup", "accordion-icon.gif", "Backup Management."),
-
-		new PanelDef("localexts", "Options", "accordion-icon.gif", "Admin Settings")
-
+PanelDef = Class.create();
+PanelDef.prototype = {
+	initialize: function(name, label, icon, content) {
+		this.name = name;
+		this.label = label;
+		this.icon = icon;
+		this.content = content;
+	}
+}
+var panels = new Array;
+var eventeater = new Object;
+var loggedon = -1;
+var started = 0;
+var accordion;
+var copyright = "Copyright &copy;2006-2007 Digium, Inc.  All Rights Reserved. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
+var tooltip_default = "Move the mouse over to a field to see tooltips";
+var asterisk_guitools_inextconf = 0;
+
+eventeater.eventcb = function(msgs) {
+	if (loggedon == 1){
+		astmanEngine.pollEvents();
+	}
+}
+
+
+panels.push( 
+
+	new PanelDef("home", "Home", "home.png",
+		"Asterisk Configuration Panel - Please click on a panel to manage related features"),
+
+	new PanelDef("users", "Users", "accordion-icon.gif",
+		"Users is a short cut for quickly adding and removing all the necessary " +
+		"configuration components for any new phone."),
+
+	new PanelDef("meetme", "Conferencing", "accordion-icon.gif",
+		"MeetMe conference bridging allow quick, ad-hoc conferences with or without " +
+		"security."),
+
+	new PanelDef("voicemail", "Voicemail", "accordion-icon.gif",
+		"General settings for voicemail"),
+
+	new PanelDef("queues", "Call Queues", "accordion-icon.gif",
+		"Call queues allow calls to be sequenced to one or more agents."),
+
+	new PanelDef("trunks", "Service Providers", "accordion-icon.gif",
+		"Service Providers are outbound lines used to allow the system to make calls to the " +
+		"real world.  Trunks can be VoIP lines or traditional telephony lines."),
+
+	new PanelDef("numberplan", "Calling Rules", "accordion-icon.gif",
+		"The Calling Rules define dialing permissions and least cost routing rules."),
+
+	new PanelDef("incoming", "Incoming Calls", "accordion-icon.gif",
+		"Define how your incoming calls should be handled & configure DID (Direct inward Dialing)"),
+
+	new PanelDef("networking", "Networking", "accordion-icon.gif",
+		"Configures networking parameters"),
+
+	new PanelDef("menus", "Voice Menus", "accordion-icon.gif",
+		"Menus allow for more efficient routing of calls from incoming callers. Also known as IVR (Interactive Voice Response) menus or Digital Receptionist"),
+
+	new PanelDef("record", "Record a Menu", "accordion-icon.gif",
+		"Allows you to record custom voicemenus over a phone"),
+	
+	new PanelDef("status", "Active Channels", "accordion-icon.gif", "Monitor active channels."),
+
+	new PanelDef("sysinfo", "System Info", "accordion-icon.gif", "System Information."),
+
+	new PanelDef("backup", "Backup", "accordion-icon.gif", "Backup Management."),
+
+	new PanelDef("localexts", "Options", "accordion-icon.gif", "Admin Settings")
+
+);
+
+// show additional panels for advanced mode
+if(window.location.href.match("advanced=yes") ){
+panels.splice(10,0,
+	new PanelDef("moh", "Music On Hold", "accordion-icon.gif", " Music on hold sometimes keeps people less angry while they wait for an answer"),
+
+	new PanelDef("sip", "SIP", "accordion-icon.gif", "SIP (Session Initiation Protocol) Configuration"),
+
+	new PanelDef("iax", "IAX", "accordion-icon.gif", "IAX (Inter-Asterisk eXchange Protocol) Configuration"),
+
+	new PanelDef("jabber", "Jabber", "accordion-icon.gif", "Jabber users configuration"),
+
+	new PanelDef("jingle", "Jingle", "accordion-icon.gif", "Jingle configuration lets users connect to google talk networks"),
+
+	new PanelDef("zapata", "Zap Channel", "accordion-icon.gif", "Zapata telephony interface configuration")
 	);
-
-	function setLoggedOn(onoff) {
-		loggedon = onoff;
-		if (loggedon == 1) {
-			for (var i = 0; i < panels.length; i++) {
-				if (panels[i].name == 'home'){
-					continue;
-				}
-				$(panels[i].name).onclick = $(panels[i].name).realonclick;
-				$(panels[i].name).onmouseover = $(panels[i].name).realonmouseover;
-				$(panels[i].name).style.visibility = 'inherit';
-			}
-		} else {
-			for (var i = 0; i < panels.length; i++) {
-				if (panels[i].name == 'home'){
-					// class :: accordionTabContentBox panelHeight = 474;
-					continue;
-				}
-				$(panels[i].name).onClick = false;
-				$(panels[i].name).onMouseOver = false;
-				$(panels[i].name).style.visibility = 'hidden';
-
-			}
-		}
-	}
-	
-	function loadscreen(srcbody) {
-		$('mainscreen').style.display = '';
-		new Rico.Effect.FadeTo($('mainscreen'), 1, 100, 1);
-		if (loggedon == 1)
-			astmanEngine.pollEvents();
-	}
-	function finishfade(page) {	$('mainscreen').style.display = "none"; 	}
-	function setstatus(status) {	$('status').innerHTML = copyright + status;	}
-	function showmainscreen(page) {
-		if (started) {
-			var opt = {
-				method: 'get',
-				asynchronous: true,
-				onComplete: function (originalRequest){
-						if ( originalRequest.responseText.match("Error") ) {
-							window.location.href=window.location.href;
-							return ;
-						}
-						if ( originalRequest.responseText.match("Pong") ) {
-								$('mainscreen').src = page.titleBar.id + ".html";
-						}
-					}
-			};
-			opt.parameters="action=ping" ;
-			var tmp = new Ajax.Request("../../rawman" , opt);
-			//$('mainscreen').src = page.titleBar.id + ".html";
-		}
-	}
-
-	
-
-	function fademainscreen(page, newpage) {
-		// Confirm Discard Changes goes here 
-		$('tooltip').innerHTML = tooltip_default;
-		new Rico.Effect.FadeTo($('mainscreen'), 0, 100, 5, {complete:finishfade(page)});
-	}
-
-	function show_Acctooltip(name, tip){
-		if( loggedon != 1){ return; }
-			new Rico.Effect.FadeTo( 'tooltip_round', .01, 100, 10, {
-			complete:function() { 
-				$('tooltip').innerHTML = 	tip ; 
-				new Rico.Effect.FadeTo( 'tooltip_round', 1, 10, 1, {complete:function() { } } );		
-			} 
-		} );
-	}
-
-	function registerajax() {
-		Rico.Corner.round('tooltip_round', {compact:true});
-		if( navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Konqueror") != -1 || navigator.userAgent.indexOf("Safari") != -1 ){
-			gui_alert(browser_alert);
-		}
-		var pnameheight = 22;
-		var pheight = (503  - (pnameheight*panels.length) ) ;
-		accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
-		//$('borderbox').style.height = $('screenholder').clientHeight;
-		//$('titlebar').style.width = $('borderbox').clientWidth - 12;
-		for (var i = 0; i < panels.length; i++) {
-			if (panels[i].name == 'home'){
-				$(panels[i].name).style.height =  "19px";
-				continue;
-			}
-			$(panels[i].name).realonclick = $(panels[i].name).onclick;
-			$(panels[i].name).realonmouseover = $(panels[i].name).onmouseover;
-		}
-		started = 1;
-	}
-
-	astmanEngine.setURL('../../rawman');
-	astmanEngine.setEventCallback(eventeater.eventcb);
-
-
-	function Logoff() {
-		var t=confirm("Are you sure ?")
-		if(t == false)
-			return true;
-		var opt2 = {
+}
+
+
+function setLoggedOn(onoff) {
+	loggedon = onoff;
+	for (var i = 0; i < panels.length; i++) {
+		if (panels[i].name == 'home'){continue;}
+		var w = _$(panels[i].name); 
+		w.onClick = (loggedon == 1)?w.realonclick: false;
+		w.onMouseOver = (loggedon == 1)?w.realonmouseover:false;
+		w.style.visibility = (loggedon == 1)?'inherit':'hidden';
+	}
+}
+
+function loadscreen(srcbody) {
+	_$('mainscreen').style.display = '';
+	if (loggedon == 1){ astmanEngine.pollEvents(); }
+}
+
+function setstatus(status) {	_$('status').innerHTML = copyright + status;	}
+function showmainscreen(page) {
+	if (started) {
+		var opt = {
 			method: 'get',
 			asynchronous: true,
-			onSuccess: function() {	 
-					setLoggedOn(0);
-					loggedon == -1;
-					// reload the browser URL
+			onComplete: function (originalRequest){
+				if ( originalRequest.responseText.match("Error") ) {
 					window.location.href=window.location.href;
-			},
-			onFailure: function(t) {
-				gui_alert("Config Error: " + t.status + ": " + t.statusText);
+					return ;
+				}
+				if ( originalRequest.responseText.match("Pong") ) {
+						_$('mainscreen').src = page.titleBar.id + ".html";
+				}
 			}
 		};
-		opt2.parameters ="action=logoff";
-		var tmp2 = new Ajax.Request("../../rawman", opt2);
-	}
-
-	function system_link(){
-		var newwindow_href = location.protocol + '//' + location.hostname + ':8003';
-		window.open(newwindow_href ,'mainwindow','width=1024,height=768,resizable=no, scrollbars=no, toolbar=no, location=no,status=yes, menubar=no')
-	}
-
+		opt.parameters="action=ping" ;
+		var tmp = new Ajax.Request("../../rawman" , opt);
+		//$('mainscreen').src = page.titleBar.id + ".html";
+	}
+}
+
+function fademainscreen(page, newpage) {
+	// Confirm Discard Changes goes here 
+	_$('tooltip').innerHTML = tooltip_default;
+	_$('mainscreen').style.display = "none";
+}
+
+function show_Acctooltip(name, tip){
+	if( loggedon != 1){ return; }
+	_$('tooltip').innerHTML = tip ;
+
+}
+
+function registerajax() {
+	Rico.Corner.round('tooltip_round', {compact:true});
+		// if you want google style feedback boxes :-)
+		// _$('feedback_round').style.backgroundColor = "#EFEFEF";		 
+		// Rico.Corner.round('feedback_round', {compact:true}); 
+		 
+	if( navigator.userAgent.indexOf("MSIE") != -1 || navigator.userAgent.indexOf("Konqueror") != -1 || navigator.userAgent.indexOf("Safari") != -1 ){
+		gui_feedback(browser_alert, 'green');
+	}
+	var pnameheight = 22;
+	var pheight = (503  - (pnameheight*panels.length) ) ;
+	accordion = new Rico.Accordion( $('configpanel'), { panelHeight: pheight,onHideTab:fademainscreen,onShowTab:showmainscreen });
+	//$('borderbox').style.height = $('screenholder').clientHeight;
+	//$('titlebar').style.width = $('borderbox').clientWidth - 12;
+	for (var i = 0; i < panels.length; i++) {
+		var w = _$(panels[i].name) ;
+		if (panels[i].name == 'home'){
+			w.style.height =  "19px";
+			continue;
+		}
+		w.realonclick = w.onClick;
+		w.realonmouseover = w.onMouseOver;
+	}
+	started = 1;
+}
+
+astmanEngine.setURL('../../rawman');
+astmanEngine.setEventCallback(eventeater.eventcb);
+
+function Logoff() {
+	if(!confirm("Are you sure ?")){ return true; }
+	var opt2 = {
+		method: 'get',
+		asynchronous: true,
+		onSuccess: function() {	 
+			setLoggedOn(0);
+			loggedon == -1;
+			// reload the browser URL
+			window.location.href=window.location.href;
+		},
+		onFailure: function(t) {
+			gui_alert("Config Error: " + t.status + ": " + t.statusText);
+		}
+	};
+	opt2.parameters ="action=logoff";
+	var tmp2 = new Ajax.Request("../../rawman", opt2);
+}
+
+function system_link(){
+	var newwindow_href = location.protocol + '//' + location.hostname + ':8003';
+	window.open(newwindow_href ,'mainwindow','width=1024,height=768,resizable=no, scrollbars=no, toolbar=no, location=no,status=yes, menubar=no')
+}
+
+function reloadConfig(){
+	_$('reloadconfig').style.display = 'none'; 
+	window.setTimeout( function(){ _$('reloadconfig').style.display=""; }, asterisk_guifbt );
+	var opt = { 
+		method: 'get', 
+		asynchronous: true, 
+		onSuccess: function(t) { gui_feedback("Restarted Asterisk !!",'blue'); } ,
+		onFailure: function(t) { gui_alert("Config Error: " + t.status + ": " + t.statusText); }
+	};
+	var uri = parent.build_action('renamecat', 0, "","", "", ""); 
+	opt.parameters="action=updateconfig&reload=yes&srcfilename=" + encodeURIComponent("extensions.conf") + "&dstfilename=" + encodeURIComponent("extensions.conf") + uri;
+	var tmp = new Ajax.Request("../../rawman", opt);
+}
 </script>
 <head>
-	<meta http-equiv="refresh" content="0;url=cfgappliance.html">
 	<title>Asterisk Configuration GUI (Beta)</title>
 	<link rel="shortcut icon" href="images/favicon.ico" />
 </head>
 <body onload="registerajax( )" topmargin=1>
 <table border="0" align="center" cellspacing="0" cellpadding="0" bgcolor="#dddddd" width=950 height=570>
-<tr height=47><td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
-							<td valign='bottom' align='right' bgcolor='white' colspan=2>
-									<!-- <a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp; -->
-									<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
-									<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
-									<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
-									<input type="hidden" id="login_name">
-							</td>
+<tr height=47>
+	<td valign="bottom" align='right' bgcolor='white' height=47><img align='left' src="images/digiumlogo.gif" align="left"></td>
+	<td valign='middle' align='center' bgcolor='white'>
+		<div id="feedback_round" style="display:none;background-color: #FFFFFF; width:400px">
+			<div id='feedback' style="font-family: Arial, sans-serif, Helvetica, Trebuchet MS ;font-size: 13px;font-weight : bold;"></div>
+		</div>
+
+	</td>
+	<td valign='bottom' align='right' bgcolor='white'>
+		<!-- <a href="#" onclick=" system_link()">System Configuration</a>&nbsp;|&nbsp; -->
+		<a target='_extern' href="http://www.digium.com/en/company/profile/">About Digium</a>&nbsp;|&nbsp;
+		<a target='_extern' href="http://www.asterisknow.org/bugs">Report a Bug</a>&nbsp;|&nbsp;
+		<a target='_extern' href="http://www.asterisknow.org/help">Help</a>&nbsp;
+		<input type="hidden" id="login_name">
+	</td>
 </tr>
-<tr><td height="505"><div id="configpanel" style="width:150px; height: 505px;">
-										<script>
-												for (var i = 0; i < panels.length; i++) {
-													document.write("<div onmouseover='show_Acctooltip(\""+ panels[i].name +"\", \""+ panels[i].content +"\")'  onmouseout='show_Acctooltip(\""+ panels[i].name +"\", \"" + tooltip_default +"\")'>");
-													document.write("	<div id='" + panels[i].name + "' class='accordionTabTitleBar'>");
-													document.write("		<nobr><img style='vertical-align:middle' src='images/" + panels[i].icon + "'>");
-													document.write("		<span style='margin-left: 0px;font-weight:bold'>" + panels[i].label + "</span></nobr>");
-													document.write("    </div>");
-													document.write("	<div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>");
-													document.write(panels[i].content);
-													document.write("	</div>");
-													document.write("</div>");
-												}
-										</script>
-									</div>
-		</td>
-		<td width="550" height="505" bgcolor="#EFEFEF" valign="top" id="screenholder">
-				<div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:48px">
-						<span style="margin-left: 4px;font-weight:bold">Loading Screen&nbsp;<img src='images/dots.gif'></span>
-				</div>
-				<div id="borderbox" class="mainscreenBorderBox" height="100%"></div>
-				<iframe width="540" height="505" frameborder="0" border="0" marginheight="0" marginwidth="0" src="home.html" id="mainscreen" style="position:absolute;top:48px;" SCROLLING=no></iframe>
-		</td>
-		<td valign=top width=250 height="505">
-			<div id="logoutlink" class="mainscreenTooltipBar" align=right style="font-weight:bold;cursor: pointer; cursor: hand;">&nbsp;</div>
-			<div id="tooltip_round" class="tooltip_round">
-			<div id='tooltip' style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
-			</div>
-		</td>
+<tr><td height="505">
+	<div id="configpanel" style="width:150px; height: 505px;">
+	<script>
+	for (var i = 0; i < panels.length; i++) {
+		var t = "<div onmouseover='show_Acctooltip(\""+ panels[i].name +"\", \""+ panels[i].content +"\")'  onmouseout='show_Acctooltip(\""+ panels[i].name +"\", \"" + tooltip_default +"\")'>";
+		t += "	<div id='" + panels[i].name + "' class='accordionTabTitleBar'>";
+		t += "		<nobr><img style='vertical-align:middle' src='images/" + panels[i].icon + "'>";
+		t += "		<span style='margin-left: 0px;font-weight:bold'>" + panels[i].label + "</span></nobr>";
+		t += "  </div>";
+		t += "  <div class='accordionTabContentBox' style='background-image:url(images/panel.png)'>" +  panels[i].content + "</div>";
+		t += "</div>";
+		document.write(t);
+	}
+	</script>
+	</div>
+	</td>
+	<td width="550" height="505" bgcolor="#EFEFEF" valign="top" id="screenholder">
+		<div id="titlebar" class="mainscreenTitleBar" style="position:absolute;top:48px">
+			<span style="margin-left: 4px;font-weight:bold">Loading Screen&nbsp;<img src='images/dots.gif'></span>
+		</div>
+		<div id="borderbox" class="mainscreenBorderBox" height="100%"></div>
+		<iframe width="540" height="505" frameborder="0" border="0" marginheight="0" marginwidth="0" src="home.html" id="mainscreen" style="position:absolute;top:48px;" SCROLLING=no></iframe>
+	</td>
+	<td valign=top width=250 height="505">
+		<div class="mainscreenTooltipBar" align=right>
+		<span id="reloadconfig" style="display:none"></span>&nbsp;&nbsp;&nbsp;<span id="logoutlink" style="display:none"></span>&nbsp;
+		</div>
+		<div id="tooltip_round" class="tooltip_round">
+		<div id='tooltip' style="margin-left:4px; font-family : Trebuchet MS, Arial, Helvetica, sans-serif;font-size: 11px; "><script>document.write(tooltip_default);</script></div>
+		</div>
+	</td>
 </tr>
 <tr><td colspan="3" align=center height=18>
 		<div id="status" class="statusbar">Copyright &copy;2006-2007 Digium, Inc.  Digium&reg; and Asterisk&reg; are registered <a href="http://www.digium.com/en/company/profile/trademarkpolicy.php">trademarks</a> of Digium, Inc.  All Rights Reserved. <i><a href="#">Legal Information</a></i></div>

Modified: branches/aadk/config/gui_sysinfo
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/gui_sysinfo?view=diff&rev=497&r1=496&r2=497
==============================================================================
--- branches/aadk/config/gui_sysinfo (original)
+++ branches/aadk/config/gui_sysinfo Tue Mar 27 12:52:09 2007
@@ -1,49 +1,73 @@
 #!/bin/sh
+SYSINFO_OUTPUT = "/var/lib/asterisk/static-http/config/sysinfo_output.html";
+
 UNAME="`uname -a`"
-/bin/echo "<div id=si_uname>$UNAME</div>" > /var/lib/asterisk/static-http/config/bkps/sysinfo.html
-                
+/bin/echo "<div id=si_uname>$UNAME</div>" > $SYSINFO_OUTPUT
+
 UPTIME="`uptime`"
-/bin/echo "<div id=si_uptime>$UPTIME</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
-                  
+/bin/echo "<div id=si_uptime>$UPTIME</div>" >> $SYSINFO_OUTPUT
+
 ASTERISK="`/sbin/asterisk -V`"
-/bin/echo "<div id=si_astver>$ASTERISK</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
-                
+/bin/echo "<div id=si_astver>$ASTERISK</div>" >> $SYSINFO_OUTPUT
+
 TODAY="`date`"
-/bin/echo "<div id=si_date>$TODAY</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+/bin/echo "<div id=si_date>$TODAY</div>" >> $SYSINFO_OUTPUT
 
 HOSTNAME="`hostname -f`"
-/bin/echo "<div id=si_hostname>$HOSTNAME</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
-     
+/bin/echo "<div id=si_hostname>$HOSTNAME</div>" >> $SYSINFO_OUTPUT
+
 IFCONFIG=`ifconfig`
-/bin/echo "<div id=si_ifconfig>$IFCONFIG</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
-                         
+/bin/echo "<div id=si_ifconfig>$IFCONFIG</div>" >> $SYSINFO_OUTPUT
+
 DISKUSAGE=`df -k`
-/bin/echo "<div id=si_du>$DISKUSAGE</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html

[... 15902 lines stripped ...]


More information about the asterisk-gui-commits mailing list