<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<!DOCTYPE html>
<html>
<head lang="en">
	<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
 	<%@include file="../../../frame/assets/header-all.jsp"%>
	<style>
	.form-line .text-content{
		width:120px;
	}
	
	.formItemLine{    
		display: inline-block;
	    vertical-align: middle;
	    width: 818px;
	    height: 1px;
	    border-top: 1px solid green;
	}
    .formItem{padding-left: 30px;    padding-top: 20px;   padding-bottom: 8px;  color: green;}
    
    td{
    	width:150px;
    }
	</style>
</head>
<body class="easyui-layout">

	<div  class="formItem"><span style="display:inline-block;verticle-align:middle;width:90px;">主机信息</span><span class="formItemLine"></span></div>
	<div id="machine">
		 <table style="font-size:14px;margin-top:18px;margin-left: 20px;">
            <tr>
                <td><label>机器名称：</label></td> <td><label id="jqmc"></label></td>
                <td><label>机器编号：</label></td> <td><label id="jqbh"></label></td>
                <td><label>机器品牌：</label></td> <td><label id="jqpp"></label></td>
                <td><label>机器系统：</label></td> <td><label id="jqxt"></label></td>
            </tr>
            <tr>
                <td><label>机器IP：</label></td> <td><label id="ip"></label></td>
                <td><label>端口：</label></td>   <td><label id="port"></label></td>
                <td><label>账户：</label></td>   <td><label id="user"></label></td>
                <td><label>密码：</label></td>   <td><label id="psd"></label></td>
            </tr> 
        </table>
	</div>
	
	<div  class="formItem"><span style="display:inline-block;verticle-align:middle;width:90px;">cpu信息</span><span class="formItemLine"></span></div>
	<div >
		 <table id="cpu" style="font-size:14px;margin-top:18px;margin-left: 20px;">
            <tr>
                <td><label>cpu品牌</label></td>
                <td><label>cpu型号</label></td>
                <td><label>内核数量</label></td>
            </tr>          
        </table>
	</div>
	
	<div  class="formItem"><span style="display:inline-block;verticle-align:middle;width:90px;">内存信息</span><span class="formItemLine"></span></div>
	<div>
		 <table id="nc" style="font-size:14px;margin-top:18px;margin-left: 20px;">
            <tr>
                <td><label>内存品牌</label></td>
                <td><label>内存型号</label></td>
                <td><label>内存容量</label></td>
            </tr>
        </table>
	</div>
	
	<div  class="formItem"><span style="display:inline-block;verticle-align:middle;width:90px;">硬盘信息</span><span class="formItemLine"></span></div>
	<div>
		 <table id="yp" style="font-size:14px;margin-top:18px;margin-left: 20px;">
            <tr>
                <td><label>硬盘品牌</label></td>
                <td><label>硬盘型号</label></td>
                <td><label>盘符</label></td>
                <td><label>容量</label></td>
            </tr>
        </table>
	</div>
	
</body>
</html>
<script type="text/javascript">
	var machineid = $.getUrlParam("machineid");
		console.log("跳转iframe: ",machineid);
	$(function(){
		// 查询 主机信息 
		$.ajax({
			type : 'post',
			dataType : 'json',
			url : 'ywmachineinfoAction!get_Ywmachineinfo.do',
			data : {'machineid':machineid, 'tableparam':' limit 1'},
			success : function(res){
				console.log("主机信息：",res);
				if(res){
					$('#jqmc').html(res.machinename);
					$('#jqbh').html(res.machinenum);
					$('#jqpp').html(res.machinebrand);
					$('#jqxh').html(res.machineostype);
					$('#ip').html(res.machineip);
					$('#port').html(res.networkport);
					$('#user').html(res.machineloginuser);
					$('#psd').html(res.machineloginpwd);
				}
			}
		})
		
		// 查询  cpu信息
		$.ajax({
			type : 'post',
			dataType : 'json',
			url : 'ywmachinecpuAction!query_Ywmachinecpu.do',
			data : {'machineid':machineid, 'tableparam':' limit 1'},
			success : function(res){
				console.log("cpu信息：",res);
				var cpuhtml='';
				res.forEach(function(item){
					console.log(item);
					cpuhtml += '<tr>'+
									'<td>'+item.cpubrand+'<td>'+
									'<td>'+item.cpumodel+'<td>'+
									'<td>'+item.cpucoresnum+'<td>'+
								'<tr>';
				})
				console.log("cpu的html：",cpuhtml);
				$('#cpu').append(cpuhtml);
			}
		})
		
		// 查询  内存信息
		$.ajax({
			type : 'post',
			dataType : 'json',
			url : 'ywmachinememoryAction!query_Ywmachinememory.do',
			data : {'machineid':machineid, 'tableparam':' limit 1'},
			success : function(res){
				console.log("内存信息：",res);
				var nchtml='';
				res.forEach(function(item){
					nchtml += '<tr>'+
								'<td>'+item.memorybrand+'<td>'+
								'<td>'+item.memorybrandtype+'<td>'+
								'<td>'+item.memorycapacity+'<td>'+
							 '<tr>';
				})
				$('#nc').append(nchtml);
			}
		})
		
		// 查询  硬盘信息
		$.ajax({
			type : 'post',
			dataType : 'json',
			url : 'ywmachineharddiskAction!query_Ywmachineharddisk.do',
			data : {'machineid':machineid, 'tableparam':' limit 1'},
			success : function(res){
				console.log("硬盘信息：",res);
				var yphtml='';
				res.forEach(function(item){
					yphtml += '<tr>'+
								'<td>'+item.harddiskbrand+'<td>'+
								'<td>'+item.harddiskbrandtype+'<td>'+
								'<td>'+item.harddiskdrive+'<td>'+
								'<td>'+item.storagecapacity+'<td>'+
							 '<tr>';
				})
				$('#yp').append(yphtml);
			}
		})
		
	})
</script>
