pari: trunk r1202 - in /trunk/config: ./ graphs/

SVN commits to the Asterisk-GUI project asterisk-gui-commits at lists.digium.com
Tue Jul 3 14:40:14 CDT 2007


Author: pari
Date: Tue Jul  3 14:40:14 2007
New Revision: 1202

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=1202
Log:
[*] cleanup to CPU graphs
[*] SIP & IAX pages - autoadjust to available screen size
[*] Display FullNames along with technologies in RingGroups


Modified:
    trunk/config/graphs.html
    trunk/config/graphs/graph_cpu.svgz
    trunk/config/iax.html
    trunk/config/ringgroups.html
    trunk/config/sip.html

Modified: trunk/config/graphs.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/graphs.html?view=diff&rev=1202&r1=1201&r2=1202
==============================================================================
--- trunk/config/graphs.html (original)
+++ trunk/config/graphs.html Tue Jul  3 14:40:14 2007
@@ -29,33 +29,6 @@
 var tabs = new Array('tab1'); 
 var divs_tohide = new Array('cpu_div');
 
-function update_graph(graph) {
-	var tmp_command = "sh " + asterisk_scriptsFolder + "graphs.sh cpu > /var/lib/asterisk/static-http/config/graphs/data_cpu.html";
-	parent.astmanEngine.run_tool(tmp_command);
-	return true;
-	}
-
-function load_graphs() {
-	var _sm = _$('status_message').style ;
-	_sm.display = "" ;	
-	
-	var opt = {
-		method: 'get',
-		asynchronous: true,
-		onComplete: function(originalRequest){
-			_sm.display = 'none' ;
-			_$('todaylog').innerHTML = (originalRequest.responseText) ? "<PRE>"+originalRequest.responseText.escapeHTML() +"</PRE>" : "No log messages found on this Day" ;
-			
-		},
-		onFailure: function(t) {
-			_sm.display = 'none' ;
-			gui_alert("Config Error: " + t.status + ": " + t.statusText);
-		}
-	};
-	opt.parameters="";
-	var tmp = new Ajax.Request("graphs/cpu_data", opt);
-	return true;
-}
 
 function show_window(x){
 	for(i=0; i < tabs.length ; i++){
@@ -65,14 +38,15 @@
 	document.getElementById(tabs[x-1]).className = "tabselected";
 	document.getElementById(tabs[x-1]).blur();
 
-	clearInterval(interval_handler); /*stop our other real-time refreshers... */
+	//clearInterval(interval_handler); /*stop our other real-time refreshers... */
 
 	switch(x){
 		case 1:
 		var divs_toshow = new Array('cpu_div');
-		var interval_handler = setInterval("update_graph()",5000);
+		//var interval_handler = setInterval(update_graph,5000);
 		break;
 	}
+
 	for(var i=0; i < divs_tohide.length; i++ )
 		_$(divs_tohide[i]).style.display = "none";
 	for(var i=0; i < divs_toshow.length; i++ )
@@ -111,8 +85,8 @@
 		<div id="information" style=" border: solid 0px black; background: transparent; padding: 4px; height:440px; width:95%;">
 			<BR>
 			<div id="cpu_div" style="display:none">
-					<div id="cpu" style="font-family:courier; font-size:10pt;"></div><BR>
-					<embed id="cpu_embed" type="image/svg+xml" src="graphs/graph_cpu.svgz"
+				<div id="cpu" style="font-family:courier; font-size:10pt;"></div><BR>
+				<embed id="cpu_embed" type="image/svg+xml" src="graphs/graph_cpu.svgz"
 						width="500" height="250" /> 
 			</div>
 		</div>

Modified: trunk/config/graphs/graph_cpu.svgz
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/graphs/graph_cpu.svgz?view=diff&rev=1202&r1=1201&r2=1202
==============================================================================
--- trunk/config/graphs/graph_cpu.svgz (original)
+++ trunk/config/graphs/graph_cpu.svgz Tue Jul  3 14:40:14 2007
@@ -107,7 +107,7 @@
   }
 }
 
-
+var TESTVAR = "FFRDDDDD";
 var SVGDoc = null;
 var last_cpu_total = 0;
 var last_cpu_idle = 0;
@@ -121,16 +121,31 @@
 function init(evt) {
 	SVGDoc = evt.target.ownerDocument;
 	fetch_data();
-	setInterval('fetch_data()', 5000);
-}
+	setInterval(fetch_data, 5000);
+	//setInterval(update_graph,5000);
+}
+
 
 function fetch_data() {
-	if (fetch_url) {
-		getURL(fetch_url, plot_cpu_data);
-	} else {
-		handle_error();
-	}
-}
+	var tmp_command = "sh " + top.asterisk_scriptsFolder + "graphs.sh cpu > /var/lib/asterisk/static-http/config/graphs/data_cpu.html";
+
+	top.astmanEngine.setURL('../'+top.asterisk_rawmanPath);
+	top.astmanEngine.run_tool(
+		tmp_command, 
+		function(){ 
+			top.astmanEngine.setURL(top.asterisk_rawmanPath);
+			if (fetch_url) {
+				getURL(fetch_url, plot_cpu_data);
+			} else {
+				handle_error();
+			}
+
+		}
+	);
+	return true;
+}
+
+
 
 function plot_cpu_data(obj) {
 	if (!obj.success || ''==obj.content) {

Modified: trunk/config/iax.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/iax.html?view=diff&rev=1202&r1=1201&r2=1202
==============================================================================
--- trunk/config/iax.html (original)
+++ trunk/config/iax.html Tue Jul  3 14:40:14 2007
@@ -44,6 +44,10 @@
 }
 
 function localajaxinit(){
+	var adjust_toScreen = function(){
+		_$('iaxsettings_form').style.height= ASTGUI.displayHeight() - 70 ;
+	};
+	ASTGUI.events.add( window , 'resize', adjust_toScreen);
 	setWindowTitle("IAX");
 	parent.loadscreen(this);
 		for (var x =0; x< fieldnames.length; x++ ) {
@@ -169,7 +173,7 @@
 	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>
 </div>
 <div class="mainscreenContentBox" id="userscontent">
-<div  style="height :425px;width : 530px ; overflow :auto;">
+<div  style="height :425px;width : 530px ; overflow :auto;" id='iaxsettings_form'>
 	<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
 	<tr>	<td align=right colspan=2>&nbsp;</td>	</tr>
 	<tr>	<td align=right>Bind Port:</td>

Modified: trunk/config/ringgroups.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/ringgroups.html?view=diff&rev=1202&r1=1201&r2=1202
==============================================================================
--- trunk/config/ringgroups.html (original)
+++ trunk/config/ringgroups.html Tue Jul  3 14:40:14 2007
@@ -90,13 +90,15 @@
 	var s = _$('select_listofchannels');
 	ASTGUI.selectbox.clear(s);
 	ASTGUI.selectbox.clear(r);
-	for (var y=0; y < this_ringgroup.rgchannels.length ; y++ ){
-		ASTGUI.selectbox.append(r,this_ringgroup.rgchannels[y], this_ringgroup.rgchannels[y]);
+	for (var y=0; y < this_ringgroup.rgchannels.length ; y++ ){ 
+		ASTGUI.selectbox.append(r,LISTOFCHANNELS[this_ringgroup.rgchannels[y]]['ChannelName'], this_ringgroup.rgchannels[y]);
+		//ASTGUI.selectbox.append(r,this_ringgroup.rgchannels[y], this_ringgroup.rgchannels[y]);
 	}
 
 	for( var u in LISTOFCHANNELS ){ if(LISTOFCHANNELS.hasOwnProperty(u)) {
 		if( !InArray(this_ringgroup.rgchannels, u) ){
-			ASTGUI.selectbox.append(s,u,u);
+			//ASTGUI.selectbox.append(s,u,u);
+			ASTGUI.selectbox.append( s, LISTOFCHANNELS[u]['ChannelName'] , u);
 		}
 	}}
 
@@ -315,8 +317,14 @@
 
 		if( !n[l]['trunkstyle'] ){ // all entries from users.conf other than trunks
 			UserExtensions.push(l);
-			if( n[l]['hassip']=='yes'){LISTOFCHANNELS['SIP/' + l] = true;}
-			if( n[l]['hasiax']=='yes'){LISTOFCHANNELS['IAX2/' + l] = true;}
+			if( n[l]['hassip']=='yes'){
+				LISTOFCHANNELS['SIP/' + l] = {};
+				LISTOFCHANNELS['SIP/' + l]['ChannelName'] = 'SIP/' + l + " -- " + n[l]['fullname'];
+			}
+			if( n[l]['hasiax']=='yes'){
+				LISTOFCHANNELS['IAX2/' + l] = {};
+				LISTOFCHANNELS['IAX2/' + l]['ChannelName'] = 'IAX2/' + l + " -- " + n[l]['fullname'];
+			}
 			ASTGUI.selectbox.append(el, l + " -- " + n[l]['fullname'] , 'Voicemail(' + l + ',b)');
 		}
 	}}
@@ -374,7 +382,8 @@
 function read_zapchannels(c){
 	for( var d in c ){
 		if ( c.hasOwnProperty(d) && c[d]['port'] && (c[d]['port'] == 'fxo' ) ) {
-			LISTOFCHANNELS['Zap/'+d] = true;
+			LISTOFCHANNELS['Zap/'+d] = {};
+			LISTOFCHANNELS['Zap/'+d]['ChannelName'] = 'Zap/' + d;
 		}
 	}
 
@@ -451,7 +460,7 @@
 	ASTGUI.selectbox.clear(y);
 
 	for( var u in LISTOFCHANNELS ){ if(LISTOFCHANNELS.hasOwnProperty(u)) {
-		ASTGUI.selectbox.append(y,u,u);
+		ASTGUI.selectbox.append( y, LISTOFCHANNELS[u]['ChannelName'], u );
 	}}
 }
 

Modified: trunk/config/sip.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/sip.html?view=diff&rev=1202&r1=1201&r2=1202
==============================================================================
--- trunk/config/sip.html (original)
+++ trunk/config/sip.html Tue Jul  3 14:40:14 2007
@@ -43,6 +43,10 @@
 }
 
 function localajaxinit(){
+	var adjust_toScreen = function(){
+		_$('sipsettings_form').style.height= ASTGUI.displayHeight() - 70 ;
+	};
+	ASTGUI.events.add( window , 'resize', adjust_toScreen);
 	ASTGUI.events.add(document, 'mouseover', show_tooltip);
 	setWindowTitle("SIP");
 	for (var x =0; x < fieldnames.length; x++ ) {
@@ -176,7 +180,7 @@
 	<span style="cursor: pointer; cursor: hand;" onclick="window.location.href=window.location.href;" >&nbsp;<img src="images/refresh.png" title=" Refresh " border=0 >&nbsp;</span>
 </div>
 <div class="mainscreenContentBox" id="userscontent">
-<div  style="height :425px;width : 530px ; overflow :auto;">
+<div  style="height :425px;width : 530px ; overflow :auto;" id="sipsettings_form">
 	<table class="field_text" align="center" width="100%" cellpadding=3 cellspacing=0 border=0>
 	<tr><td align=right colspan=2>&nbsp;</td></tr>
 	<tr>	<td align=right tip="en,sip_general,0">Context:</td>




More information about the asterisk-gui-commits mailing list