<%@page trimDirectiveWhitespaces="true"%>
<%@page import="java.util.*"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="gen" uri="http://help.jspgen.com/taglib/jstl"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<title>静态化</title>
<link type="text/css" href="${config.statie}images/style.css" rel="stylesheet">
<script type="text/javascript" src="${config.statie}js/jquery.js"></script>
<script type="text/javascript">
//htmlMessage(json); 	// {'status':false|true, 'message':'message'}
//htmlLoading(json); 	// {'loading':'88', 'usedTime':'10秒', 'remainTime':'20秒'}
function htmlMessage(json){
	var msg = '<span>';
	if(json.status) msg = '<span class="green">';
	if(!json.status) msg = '<span class="red">'; // msg = '<span class="orange">';
	$('#message').append( msg + json.message + '</span>');
}
function htmlLoading(json){
	$('#loading').html(json.loading+'%');
	$('#usedTime').html(json.usedTime);
	$('#remainTime').html(json.remainTime);
	$('#loading_bar').animate({width:json.loading+'%'},{duration:0});
	if(json.loading >= 100){
		$('#loading_ico').html('<img src="${config.statie}images/html_success.gif" border="0" align="absmiddle">');
		htmlMessage({'status':true, 'message':json.completed});
	}else{
		stat = json.stat + 1;
		$('#htmlLoad').attr('src', buildUrl+'&id='+idsArr[stat-1]+'&stat='+stat);
	}
}
function htmlCreate(json){
	htmlMessage(json);
	if(json.status) $('#htmlLoad').attr('src', buildUrl+'&id='+idsArr[stat-1]+'&stat='+stat);
}
</script>
</head>
<body>
<p>&nbsp;</p>
<h3 align="center">静态化进度</h3>
<p>&nbsp;</p>
<table width="900" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="50" valign="middle"><span id="loading_ico"><img src="${config.statie}images/html_loading.gif" border="0" align="absmiddle"></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;进度：<span id="loading" class="blue">0%</span>&nbsp;&nbsp;&nbsp;&nbsp;已用时间：<span id="usedTime" class="green">0</span>&nbsp;&nbsp;&nbsp;&nbsp;估计剩余时间：<span id="remainTime" class="blue">0</span></td>
  </tr>
  <tr>
    <td height="30"><div id="loading_bar" style="width:0%;">&nbsp;</div></td>
  </tr>
  <tr>
    <td ><div id="message"></div></td>
  </tr>
</table>
<p>&nbsp;</p>
<iframe src="about:blank" id="htmlLoad" name="htmlLoad" scrolling="no" style="display:none;"></iframe>
<script type="text/javascript">
$(document).ready(function() {
	${jspgen_html_create}
	${jspgen_html_message}
});
var stat = 1;
var buildUrl = '${hc.buildUrl}';
var idsArr = '${hc.list}'.replace('[','').replace(']','').split(',');
</script>
</body>
</html>