pari: trunk r203 - /trunk/config/sysinfo.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Thu Dec 28 18:01:50 MST 2006


Author: pari
Date: Thu Dec 28 19:01:49 2006
New Revision: 203

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=203
Log:
New: In system info tab -> Show Log messages for a selected date

Modified:
    trunk/config/sysinfo.html

Modified: trunk/config/sysinfo.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/sysinfo.html?view=diff&rev=203&r1=202&r2=203
==============================================================================
--- trunk/config/sysinfo.html (original)
+++ trunk/config/sysinfo.html Thu Dec 28 19:01:49 2006
@@ -29,12 +29,29 @@
 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');
 
+function thisday_log(){
+	$('status_message').style.display="block";
+	var tmp_command = "/bin/grep /var/log/asterisk/messages -e '" + $('log_month').value + " " + $('log_day').value + "' > /var/lib/asterisk/static-http/config/bkps/today_log.html";
+	parent.astmanEngine.run_tool( tmp_command , onSuccess = function() { 
+					$('status_message').style.display='none';
+					load_todayslog();
+				}
+	);
+
+}
+
 function 	load_todayslog(){
+		$('status_message').style.display='block';
 		var opt = {
 			method: 'get',
 			asynchronous: true,
 			onComplete: function(originalRequest){
-				$('todaylog').innerHTML = originalRequest.responseText;
+				$('status_message').style.display='none';
+				if(originalRequest.responseText.length==0){
+					$('todaylog').innerHTML = "No log messages found on this Day" ;
+				}else{
+					$('todaylog').innerHTML = originalRequest.responseText;
+				}
 			},
 			onFailure: function(t) {
 				$('status_message').style.display='none';
@@ -185,7 +202,15 @@
 								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>
+								Asterisk Log messages (today): <select id="log_month"><option value="Jan">Jan</option><option value="Feb">Feb</option> <option value="Mar">Mar</option><option value="Apr">Apr</option>
+										<option value="May">May</option><option value="Jun">Jun</option><option value="Jul">Jul</option><option value="Aug">Aug</option><option value="Sep">Sep</option>
+										<option value="Oct">Oct</option><option value="Nov">Nov</option><option value="Dec">Dec</option></select>
+								<select id="log_day"><SCRIPT LANGUAGE="JavaScript">
+											for(var i=1; i < 32; i++){var x = ''; if( i < 10) { x = '0'; }
+												document.write( '<option value="' + x +i + '">' + x +i + '</option>' ); 
+											}
+									</SCRIPT></select><input type="button" value="Go" onclick="thisday_log();">
+								<PRE><div id="todaylog" style="font-family:courier; font-size:8.5pt; width:522px; height:405px; overflow :auto;"></div></PRE>
 						</div>
 				</div>
 			</td>



More information about the asterisk-gui-commits mailing list