<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<title>全网监控智能分析平台</title>
<style>
.table-null .table{
	margin-bottom: 0px;
}
.table-null .table > tbody > tr > td, .table-null .table > thead > tr > th{
	text-align: center;
 	width: 25%;
}
.table-null td:first-child{	
 	text-align: right;
 	width: 36%;
}
.table-null tr td:last-child .form-control,.table-null tr td:last-child table{
	width: 400px;
}

</style>
<script type="text/javascript" src="${ctx}/static/js/validation.js"></script>
<script language="javascript">

	$(document).ready(function() {
		
	});

	function submitForm() {
		/* if(!$('#deployedServerName').val()) {
			alert("请填写任务组名称")
			return false;
		} */
		/* var url = '${ctx}/BaseManage/DeployedServer/checkName';
		var data = 'name=' + $('#name').val()+ '&code=' + $('#code').val()+ "&id=" + $('#taskgroupId').val();
		checkAndSubmit(url, data);  */
		if(!$('#serverName').val()) {
			alert("请填写服务器名称")
			return false;
		}
		if(!$('#serverIpAddress').val()) {
			alert("服务器IP地址")
			return false;
		}
		$('#detailForm').submit();
	}

	function validate() {
		/* if(!checkNameAndCode()) {
			return false;
		} */
		return true;
	}
</script>
</head>
<body>
	<div id="main-tab-container">
		<div id="content">
			<div class="section">
				<div class="tab-content">
					<div class="row me-row">
						<!-- this is for emulating position fixed of the nav -->
						<!-- /scroller-inner -->
						<!-- Top Navigation -->
						<div class="content clearfix">
							<div class="row">
								<div class="col-xs-12">
									<form id="detailForm" class="form-horizontal" role="form"
										action="${ctx}/BaseManage/DeployedServer/submitDeployedServerFrame" method="post">
										<input type="hidden" id="serverId" name="serverId" value="${deployedServer.serverId}">
										
										<table class="table-null">
											<tr>
												<td>服务器名称(<font color="red">必填</font>):</td>
												<td>
													<input class="form-control input-sm required" id="serverName" name="serverName" value="${deployedServer.serverName}">
												</td>
											</tr>
											
											<tr>
												<td>服务器IP地址(<font color="red">必填</font>):</td>
												<td>
													<input class="form-control input-sm required" id="serverIpAddress" name="serverIpAddress" value="${deployedServer.serverIpAddress}">
												</td>
											</tr>
											
											<tr>
												<td>服务器系统用户:</td>
												<td>
													<input class="form-control input-sm" id="serverIpAddress" name="linuxUser" value="${deployedServer.linuxUser}" maxlength="10">
												</td>
											</tr>
											
											<tr>
												<td>服务器系统用户密码:</td>
												<td>
													<input type="password" class="form-control input-sm" id="linuxPwd" name="linuxPwd" value="${deployedServer.linuxPwd}" maxlength="20">
												</td>
											</tr>
											
											<tr>
												<td>FTP用户名:</td>
												<td>
													<input class="form-control input-sm" id="ftpUser" name="ftpUser" value="${deployedServer.ftpUser}" maxlength="100">
												</td>
											</tr>
											
											<tr>
												<td>FTP密码:</td>
												<td>
													<input type="password" class="form-control input-sm" id="ftpPassword" name="ftpPassword" value="${deployedServer.ftpPassword}" maxlength="100">
												</td>
											</tr>
											
											<tr>
												<td>是否为Webserver服务器:</td>
												<td>
													<select name="ifWebserver" class="form-control">
														<option value="0" <c:if test="${deployedServer.ifWebserver == '0' }">selected</c:if> >否</option>
														<option value="1" <c:if test="${deployedServer.ifWebserver == '1' }">selected</c:if> >是</option>
													</select>
												</td>
											</tr>
											
											<tr>
												<td></td>
												<td>
													<button type="button" id="modelSubmit" class="btn btn-primary" onclick="saveForm('serverId');">确定</button>
													<!-- <button type="reset" class="btn btn-default" id="modelReset">清空</button> -->
													<button type="reset" class="btn btn-warning" id="modelBack" onclick="window.location.href='${ctx}/BaseManage/DeployedServer/deployedServerListFrame'">返回</button>
												</td>
											</tr>
										</table>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>