<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>系统配置</title>
	
	<link type="text/css" rel="stylesheet" href="/easyui-1.4.2/themes/default/easyui.css" />
    <link type="text/css" rel="stylesheet" href="/easyui-1.4.2/themes/icon.css" />
	<link type="text/css" rel="stylesheet" href="/Styles/simon-common.css" />

	<script type="text/javascript" src="/Scripts/jquery.min.js"></script>
	<script type="text/javascript" src="/easyui-1.4.2/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="/Scripts/zh-CN.js"></script>
	<script type="text/javascript" src="/Scripts/common.js"></script>
	<script type="text/javascript" src="/Scripts/tools.js"></script>

	<style type="text/css">
		form {
			font-size: 12px;
			margin-top: 100px;
		}
		fieldset {
			width: 500px;
			margin: 0 auto;
			border: 1px solid #00A2EA;
		}
		fieldset legend {
			font-size: 13px;
			font-weight: bold;
		}
		fieldset table {
			margin: 0 auto;
		}
		fieldset table th {
			text-align: left;
			font-weight: normal;	
			cursor: pointer;
		}
	</style>
	<script type="text/javascript">
		function saveConfig() {
			var form = $('#configForm');
			if (form.form('enableValidation').form('validate')) {

				var entry = form.serializeJson();

				$.tools.post({ jsonData: JSON.stringify(entry) }, '/Home/SaveSystemConfig/', function (r) {
					$.tools.alert(r.Message);
				}, this);
			}
		}
	</script>
</head>
<body>
    <form id="configForm" class="easyui-form" method="post" action="javascript:void(0)">
		<fieldset>
			<legend>系统配置</legend>
			<table>
				<tr>
					<th><label>服务器IP：</label></th>
					<td>
						<select id="cbxServiceIp" name="MessageIP" class="easyui-combobox" style="width:130px;"
							data-optinos="
								required: true,
								panelHeight: 'auto',
								editable: false
							">
							<% foreach (var ip in Common.Tools.GetLocalIPList()) { %>
								<option value="<%: ip %>"><%: ip %></option>
							<% } %>
						</select>
					</td>
				</tr>
				<tr>
					<th><label>服务器端口：</label></th>
					<td>
						<input name="MessagePort" class="easyui-numberbox" style="width:130px;" 
							value="3339" 
							data-options="
								required: true,
								min: 1,
								max: 65535,
								precision: 0" 
							/>
					</td>
				</tr>
				<tr>
					<td colspan="2" style="text-align:center;">
						<a href="javascript:void(0)" onclick="saveConfig()" class="easyui-linkbutton" data-options="iconCls:'icon-save'">保存</a>
					</td>
				</tr>
			</table>
		</fieldset>
	</form>
</body>
</html>
