<script language="javascript">
function checkState() {
$.post("<c:url value="/StateServlet"/>",{viewId:"<%=viewInfo.getId()%>"},check);
}
function check(state) {
if(state=='wait') {
document.all.prompt.innerHTML="正在初始化View的有关信息……";
}else if(state=='no'){
var successMsg='构建成功';
<%if(userRole.isBp(username)||userRole.isRm(username)) {%>
successMsg+='<a href="javascript:publish()"><img src="./images/button_public.gif" border="0"></a>';
successMsg+='<a href="javascript:publishTest()"><img src="./images/button_temp_pub.gif" border="0"></a>';
<%}%>
successMsg+='<p><a href="<%=serveraddress%>/projects/<%=viewInfo.getName()%>" target="content">查看结果</a> ';
successMsg+=' <a href="ViewHistoryServlet.do?projectName=<%=projectname%>&viewName=<%=viewInfo.getName()%>" target="content">历史版本</a>';
document.all.prompt.innerHTML=successMsg;
clearInterval(intervalId);
}else {
var successMsg='构建成功';
<%if(userRole.isBp(username)||userRole.isRm(username)) {%>
successMsg+='<a href="javascript:publish()"><img src="./images/button_public.gif" border="0"></a>';
successMsg+='<a href="javascript:publishTest()"><img src="./images/button_temp_pub.gif" border="0"></a>';
<%}%>
successMsg+='<p><a href="<%=serveraddress%>/projects/<%=viewInfo.getName()%>" target="content">查看结果</a> ';
successMsg+=' <a href="ViewHistoryServlet.do?projectName=<%=projectname%>&viewName=<%=viewInfo.getName()%>" target="content">历史版本</a>';
successMsg+=' 包所在目录: '+state+'</p>';
document.all.prompt.innerHTML=successMsg;
clearInterval(intervalId);
}
}
checkState();
var intervalId=setInterval('checkState()',5000);
</script>
function checkState() {
$.post("<c:url value="/StateServlet"/>",{viewId:"<%=viewInfo.getId()%>"},check);
}
function check(state) {
if(state=='wait') {
document.all.prompt.innerHTML="正在初始化View的有关信息……";
}else if(state=='no'){
var successMsg='构建成功';
<%if(userRole.isBp(username)||userRole.isRm(username)) {%>
successMsg+='<a href="javascript:publish()"><img src="./images/button_public.gif" border="0"></a>';
successMsg+='<a href="javascript:publishTest()"><img src="./images/button_temp_pub.gif" border="0"></a>';
<%}%>
successMsg+='<p><a href="<%=serveraddress%>/projects/<%=viewInfo.getName()%>" target="content">查看结果</a> ';
successMsg+=' <a href="ViewHistoryServlet.do?projectName=<%=projectname%>&viewName=<%=viewInfo.getName()%>" target="content">历史版本</a>';
document.all.prompt.innerHTML=successMsg;
clearInterval(intervalId);
}else {
var successMsg='构建成功';
<%if(userRole.isBp(username)||userRole.isRm(username)) {%>
successMsg+='<a href="javascript:publish()"><img src="./images/button_public.gif" border="0"></a>';
successMsg+='<a href="javascript:publishTest()"><img src="./images/button_temp_pub.gif" border="0"></a>';
<%}%>
successMsg+='<p><a href="<%=serveraddress%>/projects/<%=viewInfo.getName()%>" target="content">查看结果</a> ';
successMsg+=' <a href="ViewHistoryServlet.do?projectName=<%=projectname%>&viewName=<%=viewInfo.getName()%>" target="content">历史版本</a>';
successMsg+=' 包所在目录: '+state+'</p>';
document.all.prompt.innerHTML=successMsg;
clearInterval(intervalId);
}
}
checkState();
var intervalId=setInterval('checkState()',5000);
</script>