pari: trunk r165 - /trunk/config/backup.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Mon Dec 11 15:36:11 MST 2006


Author: pari
Date: Mon Dec 11 16:36:11 2006
New Revision: 165

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=165
Log:
Download backup Streamlined: Removed the 'I have Downloaded the file' which I was using to delete the created bkp file on server , instead now it first deletes conf_* in the bkps folder, that way the user can have a single link in the page and still the bkps folder is not cluttered with previous backups 

Modified:
    trunk/config/backup.html

Modified: trunk/config/backup.html
URL: http://svn.digium.com/view/asterisk-gui/trunk/config/backup.html?view=diff&rev=165&r1=164&r2=165
==============================================================================
--- trunk/config/backup.html (original)
+++ trunk/config/backup.html Mon Dec 11 16:36:11 2006
@@ -41,31 +41,35 @@
 }
 
 function removebkpfile(){
-	$('status_message').style.display='none';
+	$('message_text').innerHTML = "Please wait while the system <BR> Generates a Backup ... ";
+	$('status_message').style.display="block";
 	//remove bkpfile on server 
 			var opt = {
 				method: 'get',
 				asynchronous: true,
 				onSuccess: function(t) { 
 					// file deleted on server
+					download_bkp();
 				},
 				onFailure: function(t) {
 					// file not deleted on server
 				}
 			};
-			opt.parameters="action=originate&channel=" + encodeURIComponent("Local/removefile@" + asterisk_guitools) + "&Variable=var1%3d"+ encodeURIComponent( bkp_path+ bkpfile)+"&application=noop&timeout=60000";
+			opt.parameters="action=originate&channel=" + encodeURIComponent("Local/removefile@" + asterisk_guitools) + "&Variable=var1%3d"+ encodeURIComponent( bkp_path+ "conf_* -f")+"&application=noop&timeout=60000";
 			var tmp = new Ajax.Request("../../rawman", opt);	
+			return true;
 }
 
 
 function showremovebkpfile(){
-	$('message_text').innerHTML =  "<A href=\"#\" onclick=\"removebkpfile()\">I have downloaded the file</A><BR><BR>" + "<A href=\"./bkps/"+ bkpfile  +"\" onclick=\"showremovebkpfile()\">ReDownload</A>";
+	$('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>";
 }
 
 
 
 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);
@@ -74,8 +78,6 @@
 		var minute =addzero(today.getMinutes());
 		var seconds =addzero(today.getSeconds());
 		bkpfile =  "conf_" + year + month + day + hour  + minute +seconds  +".tar";
-
-		$('status_message').style.display="block";
 		var opt = {
 				method: 'get',
 				asynchronous: true,
@@ -90,8 +92,6 @@
 		};
 		opt.parameters="action=originate&channel=" + encodeURIComponent("Local/takebackup@"+asterisk_guitools) + "&Variable=var1%3d"+ encodeURIComponent( bkp_path + bkpfile)+"&application=noop&timeout=60000";
 		var tmp = new Ajax.Request("../../rawman", opt);
-
-
 }
 
 </script>
@@ -106,7 +106,7 @@
 	<tr>
 		<td valign="top" align="center">
 			<BR><BR>
-			<Input type="button" onclick="download_bkp()" value="Download a Configuration backup">	
+			<Input type="button" onclick="removebkpfile()" value="Download a Configuration backup">	
 		</td>
 	</tr>
 	<tr>



More information about the asterisk-gui-commits mailing list