pari: branch aadk r699 - in /branches/aadk/config: flashupdate.html upload2.html

asterisk-gui-commits at lists.digium.com asterisk-gui-commits at lists.digium.com
Wed Apr 18 12:53:41 MST 2007


Author: pari
Date: Wed Apr 18 14:53:41 2007
New Revision: 699

URL: http://svn.digium.com/view/asterisk-gui?view=rev&rev=699
Log:
(upload2.html) execute onunload only if the firmware is uploaded and minor improvements to flashupdate.html

Modified:
    branches/aadk/config/flashupdate.html
    branches/aadk/config/upload2.html

Modified: branches/aadk/config/flashupdate.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/flashupdate.html?view=diff&rev=699&r1=698&r2=699
==============================================================================
--- branches/aadk/config/flashupdate.html (original)
+++ branches/aadk/config/flashupdate.html Wed Apr 18 14:53:41 2007
@@ -33,7 +33,9 @@
 	parent.astmanEngine.run_tool(asterisk_guiapplyUimage + " " + asterisk_guiUploads_path_appliance + uImage_filename , onSuccess = function() {
 			_$('status_message').style.display = "none";
 			gui_feedback('Firmware upgraded','green', 5000 );
-			gui_alert("Finished upgrading firmware <BR> reboot to boot with new firmware");
+			var f= "Finished upgrading firmware <BR> note: new firmware will be loaded on reboot";
+			gui_alert(f);
+			_$('fstatus').innerHTML = f; 
 		}
 	);
 }
@@ -126,30 +128,38 @@
 				<input type=radio id="updatetype_tftp" name="updatetype" value="TFTP" onchange="switch_httptftp('t');"> TFTP Server
 			</LABEL>
 			<table>
-				<tr id="tr_1">
-					<td align=right>HTTP URL :</td>
-					<td> <input id="httpurl" size=35> </td>
-				</tr>
-				<tr id="tr_2">
-					<td align=right>TFTP Server :</td>
-					<td><input id="tftpurl" size=35></td>
-				</tr>
-				<tr id="tr_3">
-					<td align=right>File Name :</td>
-					<td><input id="tftp_filename" size=25></td>
-				</tr>
+			<tr>
+				<td>	<table>
+						<tr id="tr_1">
+							<td align=right>HTTP URL :</td>
+							<td> <input id="httpurl" size=35> </td>
+						</tr>
+						<tr id="tr_2">
+							<td align=right>TFTP Server :</td>
+							<td><input id="tftpurl" size=35></td>
+						</tr>
+						<tr id="tr_3">
+							<td align=right>File Name :</td>
+							<td><input id="tftp_filename" size=25></td>
+						</tr>
+					</table>
+				</td>
+				<td valign=top>
+					<input type="button" id="Update_Image" onclick="call_flashupdate();" value="Go">
+				</td>
+			</tr>
 			</table>
-			<BR>
-			<input type="button" id="Update_Image" onclick="call_flashupdate();" value="Go">
 			</fieldset>
 		</td>
 		</tr>
 		<tr>
 		<td align=center>
+			<BR>
 			<fieldset>
 				<legend><B>&nbsp;Upload a new image :&nbsp;</B></legend>
-			<IFRAME src="upload2.html" id="uploadiframe" width="300" height="100" frameborder="0" border="0" marginheight="0" marginwidth="0"></IFRAME>
+			<IFRAME src="upload2.html" id="uploadiframe" width="480" height="100" frameborder="0" border="0" marginheight="0" marginwidth="0"></IFRAME>
 			</fieldset>
+			<span id="fstatus"></span>
 		</td>
 		</tr>
 		</table>

Modified: branches/aadk/config/upload2.html
URL: http://svn.digium.com/view/asterisk-gui/branches/aadk/config/upload2.html?view=diff&rev=699&r1=698&r2=699
==============================================================================
--- branches/aadk/config/upload2.html (original)
+++ branches/aadk/config/upload2.html Wed Apr 18 14:53:41 2007
@@ -1,30 +1,49 @@
 <script>
+var starteduploading = 0 ;
 
-function test(){
+function beforeupload(){
+	
 	var fullpath = document.getElementById("uf1").value ;
 	if(!fullpath){
-		alert("Please select a uImage file to upload");
+		parent.gui_alert("Please select a uImage file to upload");
 		return;
 	}
 	var a = fullpath.lastIndexOf("\\");
 	if (a == -1){
-		var a = fullpath.lastIndexOf("/");
+		a = fullpath.lastIndexOf("/");
 	}
 	parent.uImage_filename = fullpath.substr(a+1); 
+
+	// here we should check if the 
+	//	[*] C.F is mounted 
+	//	[*] there are proper post_mappings defined in http.conf
+	//	[*] whether the uploads folder is there on the C.F
+
         parent._$('status_message').style.display = "";
+	parent.gui_feedback('File Upload in progress, please wait','default', 300000 );
+	parent._$('message_text').innerHTML ="Uploading firmware ..... ";
+	starteduploading = 1;
         document.getElementById('form22').submit();
 }
 
 
 function hidetheupload(){
+	if(!starteduploading){ return; }
         parent._$('uploadiframe').style.display="none";
         parent._$('status_message').style.display = "none";
         parent.gui_feedback("File Uploaded");
 	parent.execute_applyuimage();
 }
+
 </script>
 <body onunload="hidetheupload()">
+<div align=center>
 <FORM method="POST" action="/uploads" enctype="multipart/form-data" id="form22">
-        Choose a uImage file to upload: <input name="uploadedfile1" type="file" id="uf1"> <BR>
-        <input type="button" value="Upload Image" onclick="test();">
-</FORM>
+	<BR>
+	<nobr>
+        <font style="font-family:'trebuchet ms',helvetica,sans-serif;">Choose a uImage file:</font> <input name="uploadedfile1" type="file" id="uf1">
+	</nobr>
+	<BR><BR>
+        <div align=center><input type="button" value="Upload Image" onclick="beforeupload();"></div>
+</FORM>
+</div>



More information about the asterisk-gui-commits mailing list