pari: trunk r654 - in /trunk: config/ scripts/

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Fri Apr 13 13:25:18 MST 2007


Author: pari
Date: Fri Apr 13 15:25:17 2007
New Revision: 654

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=654
Log:
making such that gui_sysinfo script does not have to list all the files everytime its called

Added:
    trunk/scripts/listfiles
    trunk/scripts/output_path
Modified:
    trunk/config/backup.html
    trunk/config/menus.html
    trunk/config/record.html
    trunk/scripts/gui_sysinfo

Modified: trunk/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/backup.html?view=diff&rev=654&r1=653&r2=654
==============================================================================
--- trunk/config/backup.html (original)
+++ trunk/config/backup.html Fri Apr 13 15:25:17 2007
@@ -30,7 +30,7 @@
 	setWindowTitle("Backup");
 	showdiv_statusmessage();
 
-	parent.astmanEngine.run_tool(asterisk_guiSysInfo, callback = function() { 
+	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_ConfigBkpPath, callback = function() { 
 		var opt = { method: 'get', asynchronous: true,
 			onComplete: function(originalRequest){
 				_$('sysinfohtml').innerHTML = originalRequest.responseText;
@@ -46,9 +46,8 @@
 
 
 function showlist_of_files(){
-	var k = _$('bkp_files').innerHTML ;
+	var k = _$('list_files').innerHTML ;
 	var bkpfiles = k.split("\n") ;
-
 	clear_table();
 
 	for( var i =0 ; i < bkpfiles.length ; i++){
@@ -170,7 +169,7 @@
 	//var seconds =addzero(today.getSeconds());
 	var bkpfile =  _nn.value +"__" + year + month + day +".tar";
 
-	parent.astmanEngine.run_tool("/bin/tar -cf "+ asterisk_ConfigBkpPath + bkpfile +" /etc/asterisk/", callback=function(){
+	parent.astmanEngine.run_tool("/bin/tar -cf "+ asterisk_ConfigBkpPath + bkpfile + " " + asterisk_configfolder, callback=function(){
 			gui_feedback('Backup Successfull!','blue');
 			window.location.href = window.location.href ;
 		}

Modified: trunk/config/menus.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/menus.html?view=diff&rev=654&r1=653&r2=654
==============================================================================
--- trunk/config/menus.html (original)
+++ trunk/config/menus.html Fri Apr 13 15:25:17 2007
@@ -967,12 +967,12 @@
 }
 
 extencallbacks.loaded = function() {
-	parent.astmanEngine.run_tool(asterisk_guiSysInfo, callback = function() { 
+	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_Sounds_path, callback = function() { 
 	var opt = { method: 'get', asynchronous: true,
 		onComplete: function(originalRequest){
 			_$('sysinfohtml').innerHTML = originalRequest.responseText;
 			// Add Default sound files to the list of sound files
-			var j = _$('sound_files').innerHTML ;
+			var j = _$('list_files').innerHTML ;
 			var sndfiles = j.split("\n") ;
 			var New_OPTION = document.createElement('option');
 			New_OPTION.text = "Default Sounds"  ;
@@ -1001,8 +1001,23 @@
 					_$('combosel_sounds').add(New_OPTION); // IE way
 				}
 			}
+			load_recordedfiles();
+		},
+		onFailure: function(t) { alert("Config Error: " + t.status + ": " + t.statusText); }
+	};
+	opt.parameters="";
+	var tmp = new Ajax.Request(asterisk_guiSysInfo_output , opt);
+	});
+}
+
+
+function load_recordedfiles(){
+	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_menusRecord_path, callback = function() { 
+	var opt = { method: 'get', asynchronous: true,
+		onComplete: function(originalRequest){
 			// Add Recorded Voiemenus to the list of sound files
-			var k = _$('rec_files').innerHTML ;
+			_$('sysinfohtml').innerHTML = originalRequest.responseText;
+			var k = _$('list_files').innerHTML ;
 			var recfiles = k.split("\n") ;
 			New_OPTION = document.createElement('option');
 			New_OPTION.text = "Recorded Voicemenus"  ;
@@ -1039,6 +1054,10 @@
 	var tmp = new Ajax.Request(asterisk_guiSysInfo_output , opt);
 	});
 }
+
+
+
+
 
 extencallbacks.eachline = true;
 

Modified: trunk/config/record.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/record.html?view=diff&rev=654&r1=653&r2=654
==============================================================================
--- trunk/config/record.html (original)
+++ trunk/config/record.html Fri Apr 13 15:25:17 2007
@@ -37,7 +37,7 @@
 }
 
 function showlist_of_files(){
-	var k = _$('rec_files').innerHTML ;
+	var k = _$('list_files').innerHTML ;
 	var recfiles = k.split("\n") ;
 
 	clear_table();
@@ -114,7 +114,7 @@
 }
 
 callbacks.loaded = function(){
-	parent.astmanEngine.run_tool(asterisk_guiSysInfo, callback = function() { 
+	parent.astmanEngine.run_tool(asterisk_guiListFiles + " " + asterisk_menusRecord_path, callback = function() { 
 		var opt = { method: 'get', asynchronous: true,
 			onComplete: function(originalRequest){
 				_$('sysinfohtml').innerHTML = originalRequest.responseText;

Modified: trunk/scripts/gui_sysinfo
URL: http://svn.digium.com/view/asterisk-gui/trunk/scripts/gui_sysinfo?view=diff&rev=654&r1=653&r2=654
==============================================================================
--- trunk/scripts/gui_sysinfo (original)
+++ trunk/scripts/gui_sysinfo Fri Apr 13 15:25:17 2007
@@ -1,5 +1,6 @@
 #!/bin/sh
-SYSINFO_OUTPUT="/var/lib/asterisk/static-http/config/sysinfo_output.html"
+. /etc/asterisk/scripts/output_path
+#SYSINFO_OUTPUT="/var/lib/asterisk/static-http/config/sysinfo_output.html"
 
 UNAME="`uname -a`"
 /bin/echo "<div id=si_uname>$UNAME</div>" > $SYSINFO_OUTPUT
@@ -31,21 +32,20 @@
 THIS_DAY=`/bin/date +%_d`
 /bin/grep /var/log/asterisk/messages -e "$THISMONTH\( $THISDAY\| $THIS_DAY\)" > /var/lib/asterisk/static-http/config/today_log.html
 
+#/bin/echo "<div id=bkp_files>" >> $SYSINFO_OUTPUT 
+#/bin/mkdir -p /var/lib/asterisk/gui_configbackups
+#/bin/ls /var/lib/asterisk/gui_configbackups/ >> $SYSINFO_OUTPUT
+#/bin/echo "</div>" >> $SYSINFO_OUTPUT 
 
-/bin/echo "<div id=bkp_files>" >> $SYSINFO_OUTPUT 
-/bin/mkdir -p /var/lib/asterisk/gui_configbackups
-/bin/ls /var/lib/asterisk/gui_configbackups/ >> $SYSINFO_OUTPUT
-/bin/echo "</div>" >> $SYSINFO_OUTPUT 
+#/bin/echo "<div id=rec_files>" >> $SYSINFO_OUTPUT 
+#/bin/mkdir -p /var/lib/asterisk/sounds/record
+#/bin/ls /var/lib/asterisk/sounds/record/ >> $SYSINFO_OUTPUT
+#/bin/echo "</div>" >> $SYSINFO_OUTPUT 
 
-/bin/echo "<div id=rec_files>" >> $SYSINFO_OUTPUT 
-/bin/mkdir -p /var/lib/asterisk/sounds/record
-/bin/ls /var/lib/asterisk/sounds/record/ >> $SYSINFO_OUTPUT
-/bin/echo "</div>" >> $SYSINFO_OUTPUT 
-
-/bin/echo "<div id=sound_files>" >> $SYSINFO_OUTPUT 
-/bin/mkdir -p /var/lib/asterisk/sounds
-/bin/ls /var/lib/asterisk/sounds/ >> $SYSINFO_OUTPUT
-/bin/echo "</div>" >> $SYSINFO_OUTPUT 
+#/bin/echo "<div id=sound_files>" >> $SYSINFO_OUTPUT 
+#/bin/mkdir -p /var/lib/asterisk/sounds
+#/bin/ls /var/lib/asterisk/sounds/ >> $SYSINFO_OUTPUT
+#/bin/echo "</div>" >> $SYSINFO_OUTPUT 
 
 
 

Added: trunk/scripts/listfiles
URL: http://svn.digium.com/view/asterisk-gui/trunk/scripts/listfiles?view=auto&rev=654
==============================================================================
--- trunk/scripts/listfiles (added)
+++ trunk/scripts/listfiles Fri Apr 13 15:25:17 2007
@@ -1,0 +1,7 @@
+#!/bin/sh
+. /etc/asterisk/scripts/output_path
+
+/bin/echo "<div id=list_files>" > $SYSINFO_OUTPUT
+/bin/mkdir -p $1
+/bin/ls $1 >> $SYSINFO_OUTPUT
+/bin/echo "</div>" >> $SYSINFO_OUTPUT

Added: trunk/scripts/output_path
URL: http://svn.digium.com/view/asterisk-gui/trunk/scripts/output_path?view=auto&rev=654
==============================================================================
--- trunk/scripts/output_path (added)
+++ trunk/scripts/output_path Fri Apr 13 15:25:17 2007
@@ -1,0 +1,3 @@
+
+SYSINFO_OUTPUT="/var/lib/asterisk/static-http/config/sysinfo_output.html"
+



More information about the asterisk-gui-commits mailing list