How to display status message on web page
I have a bash script that checks for and deploys new .ear files to the JBoss server.I have linked this script to a web page, so that users can deploy their applications by clicking on the link. I have also been able to set a status 开发者_开发技巧message that the application is being deployed, when a user clicks on the link.(Done using Javascript inside the HTML file).However I am not able to set a 'Deployment completed' message when the script completes execution. Searching on the net was of little help,though I realized that what I wanted could be achieved using AJAX and requesting for the exit code of the script from the server.Being a system admin and having no knowledge of programming, I wish if somebody could help me out.Below is a part of my HTML file, if that would be of any help:
</table>
<FORM METHOD="LINK" ACTION="/cgi-bin/auto.sh">
<!--<INPUT TYPE="submit" VALUE="Deploy">--!>
<input type="submit" value="Deploy" onClick="showStatusMessage();">
<div id="statusMessage" style="display:none;">
<h3>Your application is being deployed.Please wait.</h3>
</div>
</FORM>
<script>
function showStatusMessage()
{
document.getElementById("statusMessage").style.display = "block";
}
function hideStatusMessage()
{
document.getElementById("statusMessage").style.display = "none";
}
</script>
</body>
</html>
Thanks.
The only way (i know of) to "know" once a server side deployment is complete. Would be to poll the server (with ajax) to check the status.
精彩评论