<%@page contentType="text/html" pageEncoding="UTF-8" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ page isELIgnored="false" %>
<!doctype html>
<html>
<head>
<!-- ace styles -->
<link rel="stylesheet" href="<s:url value="/assets/css/ace.min.css"/>"/>
<link rel="stylesheet" href="<s:url value="/assets/css/ace-rtl.min.css"/>"/>
<link rel="stylesheet" href="<s:url value="/assets/css/ace-skins.min.css"/>"/>
<script src="<s:url value="/assets/js/jquery-2.0.3.min.js"/>"></script>
<script src="<s:url value="/assets/js/jquery.qrcode.min.js"/>"></script>
<script src="<s:url value="/assets/js/jQuery.print.js"/>"></script>
</head>
<style>
.biaoge{ border:1px solid #e1e1e1;
padding:0;
margin:0;
border-collapse:collapse;
}
.biaoge td{
border:1px solid #e1e1e1;
text-align:center;
font-size:12px;
padding:6px;
text-align: center;
}
</style>
<body style="background: #fff">
<!--顶部-->
<!--右边div star-->
<%--<div class="main-container" id="main-container" style="text-align: center">--%>
<center>
<table width="240px" class="biaoge" id="printContent">
<tr>
<td align="center" colspan="2" >服务器相关信息</td>
</tr>
<tr>
<td width="80">名称:</td>
<td style="text-align: left">${server.name}</td>
</tr>
<tr>
<td>IP:</td><td style="text-align: left">${server.glip}</td>
</tr>
<tr>
<td>运维产商:</td>
<td style="text-align: left">${server.ywcs}</td>
</tr>
<tr>
<td>二维码:</td>
<td style="text-align: left">
<div id="qrcode"></div>
<img id="qrcodeimg" src=""/>
</td>
</tr>
</table>
<div class="box-footer">
<button class="btn btn-default pull-left" type="button"
onclick="javascript:history.back(1);">返回</button>
<button id="btnPrint" type="button"
class="btn btn-primary pull-right" style="margin-left :30px" onclick="dyInfo()">打印</button>
</div>
</center>
<%--</div>--%>
<div class="clear"></div>
</body>
<script type="text/javascript">
$(document).ready(function() {
$("#qrcode").show();
$("#qrcodeimg").hide();
//使用jQuery.qrcode.min.js生成二维码。
jQuery('#qrcode').qrcode({
80,
height: 80,
text: "${server.id} "//二维码的内容
}
);
}
);
function dyInfo() {
var qrcSrc = $("canvas")[0].toDataURL();
$("#qrcode").hide();
$("#qrcodeimg").show();
$('#qrcodeimg').attr('src',qrcSrc);
$("#printContent").print();
}
</script>
</html>