pari: branch appliance r197 - in /branches/appliance/config: ./ setup/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Dec 28 13:17:57 MST 2006


Author: pari
Date: Thu Dec 28 14:17:56 2006
New Revision: 197

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=197
Log:
some customization for the appliance

Added:
    branches/appliance/config/gui_sysinfo
Modified:
    branches/appliance/config/backup.html
    branches/appliance/config/cfgadvanced.html
    branches/appliance/config/cfgappliance.html
    branches/appliance/config/homeapp.html
    branches/appliance/config/setup/1.html
    branches/appliance/config/setup/10.html
    branches/appliance/config/setup/3.html
    branches/appliance/config/setup/4.html
    branches/appliance/config/setup/5.html
    branches/appliance/config/setup/6.html
    branches/appliance/config/setup/7.html
    branches/appliance/config/setup/install.html
    branches/appliance/config/sysinfo.html

Modified: branches/appliance/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/backup.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/backup.html (original)
+++ branches/appliance/config/backup.html Thu Dec 28 14:17:56 2006
@@ -41,22 +41,20 @@
 }
 
 function removebkpfile(){
-	$('message_text').innerHTML = "Please wait while the system <BR> Generates a Backup ... ";
-	$('status_message').style.display="block";
+	$('status_message').style.display='none';
 	//remove bkpfile on server 
-	parent.astmanEngine.run_tool("/bin/rm " + bkp_path+ "conf_* -f", download_bkp );
+	parent.astmanEngine.run_tool("/bin/rm " +  bkp_path+ bkpfile , callback=function(){} );
 }
 
 
 function showremovebkpfile(){
-	$('status_message').style.display='none';
-//	$('message_text').innerHTML =  "<A href=\"#\" onclick=\"removebkpfile()\">I have downloaded the file</A><BR><BR>" + "<A href=\"./bkps/"+ bkpfile  +"\" onclick=\"showremovebkpfile()\">ReDownload</A>";
+	$('message_text').innerHTML =  "<A href=\"#\" onclick=\"removebkpfile()\">I have downloaded the file</A><BR><BR>" + "<A href=\"./bkps/"+ bkpfile  +"\">ReDownload</A>";
 }
 
 
 
 function download_bkp(){
-
+		$('message_text').innerHTML = "Please wait while the system <BR> Generates a Backup ... ";
 		var today=new Date()
 		var year = today.getFullYear();
 		var month = addzero(today.getMonth() + 1);
@@ -65,12 +63,14 @@
 		var minute =addzero(today.getMinutes());
 		var seconds =addzero(today.getSeconds());
 		bkpfile =  "conf_" + year + month + day + hour  + minute +seconds  +".tar";
+
+		$('status_message').style.display="block";
 		parent.astmanEngine.run_tool("/bin/tar -cf "+ bkp_path + bkpfile +" /etc/asterisk/", callback=function(){
-							$('status').innerHTML = " <I> Finished generating Backup ! </I>";
-							$('status_message').style.display="none";
-							window.location.href = "./bkps/"+ bkpfile ;
-							//$('message_text').innerHTML = "<A href=\"./bkps/"+ bkpfile  +"\" onclick=\"showremovebkpfile()\">Click Here to Download</A>";
-		} );
+ 							$('status').innerHTML = " <I> Finished generating Backup ! </I>";
+ 							$('message_text').innerHTML = "<A href=\"./bkps/"+ bkpfile  +"\" onclick=\"showremovebkpfile()\">Click Here to Download</A>";
+			}
+		);
+
 }
 
 </script>
@@ -85,7 +85,7 @@
 	<tr>
 		<td valign="top" align="center">
 			<BR><BR>
-			<Input type="button" onclick="removebkpfile()" value="Download a Configuration backup">	
+			<Input type="button" onclick="download_bkp()" value="Download a Configuration backup">	
 		</td>
 	</tr>
 	<tr>

Modified: branches/appliance/config/cfgadvanced.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/cfgadvanced.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/cfgadvanced.html (original)
+++ branches/appliance/config/cfgadvanced.html Thu Dec 28 14:17:56 2006
@@ -41,6 +41,7 @@
 	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)

Modified: branches/appliance/config/cfgappliance.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/cfgappliance.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/cfgappliance.html (original)
+++ branches/appliance/config/cfgappliance.html Thu Dec 28 14:17:56 2006
@@ -41,6 +41,7 @@
 	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)

Added: branches/appliance/config/gui_sysinfo
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/gui_sysinfo?view=auto&rev=197
==============================================================================
--- branches/appliance/config/gui_sysinfo (added)
+++ branches/appliance/config/gui_sysinfo Thu Dec 28 14:17:56 2006
@@ -1,0 +1,24 @@
+#!/bin/sh
+UNAME="`uname -a`"
+/bin/echo "<div id=si_uname>$UNAME</div>" > /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+                
+UPTIME="`uptime`"
+/bin/echo "<div id=si_uptime>$UPTIME</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+                  
+ASTERISK="`/sbin/asterisk -V`"
+/bin/echo "<div id=si_astver>$ASTERISK</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+                
+TODAY="`date`"
+/bin/echo "<div id=si_date>$TODAY</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+
+HOSTNAME="`hostname -f`"
+/bin/echo "<div id=si_hostname>$HOSTNAME</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+     
+IFCONFIG=`ifconfig`
+/bin/echo "<div id=si_ifconfig>$IFCONFIG</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+                         
+DISKUSAGE=`df -k`
+/bin/echo "<div id=si_du>$DISKUSAGE</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html
+                        
+MEMORYUSAGE=`free`
+/bin/echo "<div id=si_free>$MEMORYUSAGE</div>" >> /var/lib/asterisk/static-http/config/bkps/sysinfo.html

Modified: branches/appliance/config/homeapp.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/homeapp.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/homeapp.html (original)
+++ branches/appliance/config/homeapp.html Thu Dec 28 14:17:56 2006
@@ -26,6 +26,8 @@
 <script>
 	var demo = new Object;
 	var localloggedon = -1;
+	var asterisk_guitools = parent.asterisk_guitools;
+
 	function updateButtons()
 	{
 		if (parent.loggedon) {
@@ -51,6 +53,9 @@
 	function loggedOn() {
 		if ((parent.loggedon == 1) && (localloggedon == 1))
 			return;
+		if( parent.asterisk_guitools_inextconf == 0){
+			checkessentials();
+		}
 		parent.setLoggedOn(1);
 		parent.loggedon = 1;
 		localloggedon = 1;
@@ -153,6 +158,37 @@
 				doLogin();
 				return false;
 			}
+	}
+
+	function checkessentials(){
+		// see if asterisk_guitools exists in extensions.conf
+		//if everything ok set  asterisk_guitools_inextconf = 1;
+			var opt = {
+				method: 'get',
+				asynchronous: true,
+				onComplete: checkExtconfig
+			};
+			opt.parameters="action=getconfig&filename=extensions.conf" ;
+			var tmp = new Ajax.Request("../../rawman", opt);
+	}
+
+
+	function checkExtconfig(originalRequest){
+		var lines = originalRequest.responseText.split("\n");
+		for( var i=0 ; i < lines.length ; i++){
+				if ( lines[i].substr(0,9) == "Category-"  ){
+					var tmp = lines[i].split(": ");
+					if( tmp[1].match(asterisk_guitools) ){
+							parent.asterisk_guitools_inextconf = 1;
+					}
+				}
+		}
+		
+		if(parent.asterisk_guitools_inextconf == 0 ){
+			// not found
+			parent.window.location.href = "./setup/install.html";
+		}
+
 	}
 </script>
 <body id="foo" onload="localinit()"  bgcolor="EFEFEF">

Modified: branches/appliance/config/setup/1.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/1.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/1.html (original)
+++ branches/appliance/config/setup/1.html Thu Dec 28 14:17:56 2006
@@ -155,7 +155,7 @@
 	$('loginform').style.display = "none";
 	$('zapinfo').style.display = "block";
 	parent.$('next').disabled = false;
-	parent.$('next').onclick = function(){	 window.location.href="2.html"; };
+	parent.$('next').onclick = function(){	 window.location.href="3.html"; };
 	$('menu').style.display = "block";
 }
 
@@ -194,7 +194,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td class="slselected">Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>

Modified: branches/appliance/config/setup/10.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/10.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/10.html (original)
+++ branches/appliance/config/setup/10.html Thu Dec 28 14:17:56 2006
@@ -13,7 +13,7 @@
 
 function localinit(){
 	//parent.$('next').disabled = true;
-	parent.$('next').onclick = function(){	 parent.window.location.href ="../cfgbasic.html"; };
+	parent.$('next').onclick = function(){	 parent.window.location.href ="../cfgappliance.html"; };
 	parent.$('back').disabled = false;
 	parent.$('back').onclick  = function(){	 window.location.href="7.html"; };
 	rawman_url = parent.rawman_url ;
@@ -52,7 +52,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>

Modified: branches/appliance/config/setup/3.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/3.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/3.html (original)
+++ branches/appliance/config/setup/3.html Thu Dec 28 14:17:56 2006
@@ -12,7 +12,7 @@
 var widgets = new Array;
 var go = "";
 var nextpage = "4.html";
-var prevpage = "2.html";
+var prevpage = "1.html";
 
 function localinit(){
 	parent.$('next').disabled = true;
@@ -113,7 +113,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td class="slselected">Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>
@@ -127,7 +126,7 @@
 			<td valign=top align=center>
 			<!--  this page -->
 					<select id="devices" style="display:none"></select> <input type=button id="save" value="Submit" style="display:none">
-					<div class="heading">Step 3 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Local Extension Settings</div>
+					<div class="heading">Step 2 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Local Extension Settings</div>
 					<p class="subheading">	Local Extensions are <select id="localextenlength">
 																	<option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option></select> digits long&nbsp;
 					</p>

Modified: branches/appliance/config/setup/4.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/4.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/4.html (original)
+++ branches/appliance/config/setup/4.html Thu Dec 28 14:17:56 2006
@@ -536,7 +536,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td class="slselected">Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>
@@ -552,7 +551,7 @@
 
 <select disabled size="1" id="devices" style="display:none"></select><input type='button' id='delete' value='Delete' style="display:none">
 <center>
-	<div class="heading">Step 4 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Service Providers</div>
+	<div class="heading">Step 3 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;- Service Providers</div>
 <table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=500 id="table_one">
 	<tr>	<td width=40>S.No</td>
 			<td width="200">Service Provider</td>

Modified: branches/appliance/config/setup/5.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/5.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/5.html (original)
+++ branches/appliance/config/setup/5.html Thu Dec 28 14:17:56 2006
@@ -446,7 +446,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td class="slselected">Calling Rules</td></tr>
@@ -460,7 +459,7 @@
 			<td valign=top align=center>
 			<!--  this page -->
 					<select id="extensions" style="display:none"></select>
-					<div class="heading">Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Calling Rules</div>
+					<div class="heading">Step 4 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Calling Rules</div>
 			<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=90>RuleName</td>

Modified: branches/appliance/config/setup/6.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/6.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/6.html (original)
+++ branches/appliance/config/setup/6.html Thu Dec 28 14:17:56 2006
@@ -194,7 +194,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>
@@ -210,7 +209,7 @@
 					<select id='hiddenvoicemail' style="display:none"></select>
 					<select id="extensions" style="display:none"></select>
 
-					<div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Voicemail Settings</div>
+					<div class="heading">Step 5 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  Voicemail Settings</div>
 		<table cellpadding=2 cellspacing=2 border=0 align=center  class="subheading">
 					<tr><td>Extension for checking messages:</td><td>&nbsp;<input size='5' id='name' pattern='^\d*$' onKeyUp="$('cancel').disabled=false;"  class="input8" ></td></tr>
 					<tr><td>Attach recordings to e-mail:</td><td><input type='checkbox' id='attach'></td></tr>

Modified: branches/appliance/config/setup/7.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/7.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/7.html (original)
+++ branches/appliance/config/setup/7.html Thu Dec 28 14:17:56 2006
@@ -265,7 +265,6 @@
 					<table cellpadding=3 cellspacing=2 border=0 id="sidelist">
 						<tr><td width=3></td><td>Start</td></tr>
 						<tr><td></td><td>Verify Analog Ports</td></tr>
-						<tr><td></td><td>Date & Time</td></tr>
 						<tr><td></td><td>Local Extension Settings</td></tr>
 						<tr><td></td><td>Service Providers</td></tr>
 						<tr><td></td><td>Calling Rules</td></tr>
@@ -350,7 +349,7 @@
 						</TR>
 						</TABLE>
 				</div>
-				<div class="heading">Step 7 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  User Extensions </div>
+				<div class="heading">Step 6 of <script>document.write(parent.numberofsteps);</script>&nbsp;&nbsp;-  User Extensions </div>
 				<div class="subheading">List of User Extensions</div>
 				<table class="table_black" cellpadding=2 cellspacing=2 border=0 align=center width=600>
 					<tr>	<td width=40>S.no</td>

Modified: branches/appliance/config/setup/install.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/setup/install.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/setup/install.html (original)
+++ branches/appliance/config/setup/install.html Thu Dec 28 14:17:56 2006
@@ -31,7 +31,7 @@
 var asterisk_guitools = "asterisk_guitools";
 var fxoports = new Array();
 var fxsports = new Array();
-var numberofsteps = 7;
+var numberofsteps = 6;
 function localinit(){
 
 }

Modified: branches/appliance/config/sysinfo.html
URL: http://svn.digium.com/view/asterisk-gui/branches/appliance/config/sysinfo.html?view=diff&rev=197&r1=196&r2=197
==============================================================================
--- branches/appliance/config/sysinfo.html (original)
+++ branches/appliance/config/sysinfo.html Thu Dec 28 14:17:56 2006
@@ -26,80 +26,8 @@
 <link href="stylesheets/schwing.css" media="all" rel="Stylesheet" type="text/css" />
 <script>
 var sysinfocallbacks = new Object;
-var tabs = new Array('tab1', 'tab2', 'tab3','tab4');
-var divs_tohide = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div','ifconfig_div','df_div','memory_div','today_log');
-
-sysinfocallbacks.format = function(t, x) {
-		if ( t.name == 'uname' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'uname' && x==0 ){	 // if is a subcategory
-			$('osversion').innerHTML = t.fields[x] ; 
-		}else if ( t.name == 'uptime' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'uptime' ){	 // if is a subcategory
-			$('uptime').innerHTML =  t.fields[x] ; 
-		}else if ( t.name == 'asterisk' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'asterisk' ){	 // if is a subcategory
-			asterisk_guiversion = asterisk_guiversion.slice(0, -1);
-			$('asterisk').innerHTML =  t.fields[x] +"<BR>" + "Asterisk GUI-version " + asterisk_guiversion.substr(1) ;
-		}else if ( t.name == 'today' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'today' ){	 // if is a subcategory
-			$('today').innerHTML =  t.fields[x] ; 
-		}else if ( t.name == 'hostname' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'hostname' ){	 // if is a subcategory
-			$('hostname').innerHTML =  t.fields[x] ; 
-		}else if ( t.name == 'ifconfig' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'ifconfig' ){	 // if is a subcategory
-			$('ifconfig').innerHTML =  $('ifconfig').innerHTML + t.fields[x]  + "<BR>"; 
-		}else if ( t.name == 'du' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'du' ){	 // if is a subcategory
-			$('diskusage').innerHTML =  $('diskusage').innerHTML + t.fields[x]  + "<BR>"; 
-		}else if ( t.name == 'free' && x==undefined ){	 				// if is a category
-			return t.name;
-		}else if( t.name == 'free' ){	 // if is a subcategory
-			$('memoryusage').innerHTML =  $('memoryusage').innerHTML + t.fields[x]  + "<BR>"; 
-		}else{	
-			return false;
-		}
-}
-sysinfocallbacks.loaded = function(){
-
-	load_todayslog();
-	var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
-	for(var i=0; i < divs_toshow.length; i++ ){
-		$(divs_toshow[i]).style.display = "block";
-	}
-	document.getElementById(tabs[0]).style.background = 'white';
-	document.getElementById(tabs[0]).style.borderBottom = '4px solid #000000';
-	document.getElementById(tabs[0]).style.fontWeight = 'bold';
-	document.getElementById(tabs[0]).style.fontSize = '13px';
-}
-sysinfocallbacks.eachline = true;
-sysinfocallbacks.includecats = true;
-
-
-function 	load_todayslog(){
-		var opt = {
-			method: 'get',
-			asynchronous: true,
-			onComplete: function(originalRequest){
-				$('todaylog').innerHTML = originalRequest.responseText;
-			},
-			onFailure: function(t) {
-				$('status_message').style.display='none';
-				alert("Config Error: " + t.status + ": " + t.statusText);
-			}
-		};
-		opt.parameters="";
-		var tmp = new Ajax.Request("./bkps/today_log.html", opt);
-		return true;
-}
-
+var tabs = new Array('tab1', 'tab2', 'tab3');
+var divs_tohide = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div','ifconfig_div','df_div','memory_div');
 
 function show_window(x){
 		for(i=0; i < tabs.length ; i++){
@@ -125,9 +53,6 @@
 			case 3:
 			var divs_toshow = new Array('df_div','memory_div');
 			break;
-			case 4:
-			var divs_toshow = new Array('today_log');
-			break;
 		}
 		
 		for(var i=0; i < divs_tohide.length; i++ )
@@ -142,14 +67,46 @@
 function update_sysinfo(){
 	parent.astmanEngine.run_tool("sh /etc/asterisk/gui_sysinfo", onSuccess = function() { 
 					$('status_message').style.display='none';
-					parent.astmanEngine.config2list("gui_sysinfo.conf", $('sysinfo'), new Array(), sysinfocallbacks);
+					getsysinfohtml();
 				}
 	);
 	return;
 }
 
-function showResponse(originalRequest)	{
-		var v = originalRequest.responseText;
+function getsysinfohtml(){
+		var opt = {
+			method: 'get',
+			asynchronous: true,
+			onComplete: function(originalRequest){
+				$('sysinfohtml').innerHTML = originalRequest.responseText;
+				$('osversion').innerHTML = $('si_uname').innerHTML;
+				$('uptime').innerHTML = $('si_uptime').innerHTML;
+				$('asterisk').innerHTML =$('si_astver').innerHTML;
+				$('today').innerHTML = $('si_date').innerHTML;
+				$('hostname').innerHTML =$('si_hostname').innerHTML;
+				$('ifconfig').innerHTML =$('si_ifconfig').innerHTML;
+				$('diskusage').innerHTML = $('si_du').innerHTML;
+				$('memoryusage').innerHTML =$('si_free').innerHTML;
+
+				var divs_toshow = new Array('osversion_div', 'uptime_div', 'asterisk_div', 'today_div','hostname_div');
+				for(var i=0; i < divs_toshow.length; i++ ){
+					$(divs_toshow[i]).style.display = "block";
+				}
+
+				document.getElementById(tabs[0]).style.background = 'white';
+				document.getElementById(tabs[0]).style.borderBottom = '4px solid #000000';
+				document.getElementById(tabs[0]).style.fontWeight = 'bold';
+				document.getElementById(tabs[0]).style.fontSize = '13px';
+
+			},
+			onFailure: function(t) {
+				$('status_message').style.display='none';
+				alert("Config Error: " + t.status + ": " + t.statusText);
+			}
+		};
+		opt.parameters="";
+		var tmp = new Ajax.Request("./bkps/sysinfo.html", opt);
+		return true;
 }
 
 function localajaxinit(){
@@ -175,8 +132,7 @@
 				<a href="#" class="tab" onclick="return show_window(1);" id="tab1">General</a>&nbsp;&nbsp;
 				<a href="#" class="tab" onclick="return show_window(2);" id="tab2">ifconfig</a>&nbsp;&nbsp;
 				<a href="#" class="tab" onclick="return show_window(3);" id="tab3">Resources</a>&nbsp;&nbsp;
-				<a href="#" class="tab" onclick="return show_window(4);" id="tab4">Logs</a>&nbsp;&nbsp;
-				<select id="sysinfo" style="display:none"></select>
+				<div id="sysinfohtml" style="display:none"></div>
 
 				<div id="information" style=" border: solid 0px black; background: transparent; padding: 4px; height:440px; width:95%;">
 						<BR>
@@ -204,9 +160,6 @@
 						<div id="memory_div" style="display:none;">
 								Memory Usage:<PRE><div id="memoryusage" style="font-family:courier; font-size:8.5pt;"></div></PRE>
 						</div>
-						<div id="today_log" style="display:none;">
-								Asterisk Log messages (today):<PRE><div id="todaylog" style="font-family:courier; font-size:8.5pt; width:522px; height:405px; overflow :auto;"></div></PRE>
-						</div>
 				</div>
 			</td>
 	</tr>



More information about the asterisk-gui-commits mailing list