<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ include file="../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../common/top.jsp"%>
</head>
<body class="easyui-layout">
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../leftMenu/campus-admin.jsp"%>
	<div data-options="region:'center',title:'首页 -【基础数据维护】- 配置服务地址'">
			<form class="form-horizontal mr-t" action="${ctx }/admin/campus/config" method="post">
			  <div class="control-group">
			    <label class="control-label" for="inputEmail">学习中心</label>
			    <div class="controls mar">
			      <input type="hidden" id="campusId" name="campusId" value="${campus.id }">${campus.name}
			    </div>
			  </div>
			  <div class="control-group">
			    <label class="control-label" for="inputPassword">Hessian服务地址</label>
			    <div class="controls">
			      <input type="text" class="input-xlarge" id="hessianServer" name="hessianServer" value="${config.hessianServer }">
			    </div>
			  </div>
			  <div class="control-group">
			    <label class="control-label" for="inputPassword">Report服务地址</label>
			    <div class="controls">
			      <input type="text" class="input-xlarge" id="reportServer" name="reportServer" value="${config.reportServer }">
			    </div>
			  </div>
			  <div class="control-group">
			    <div class="controls">
			      <button type="submit" class="btn btn-primary">保存</button>
			      <button type="button" class="btn" onclick="goList()">返回</button>
			    </div>
			  </div>
			</form>
	</div>
</body>
<script type="text/javascript">

$(document).ready(function() {
	var hessianServer = [];
	var reportServer = [];
	var url='${ctx}/admin/campus/gethessianserver.json';
    $.ajax( {
    url : url,
    type : "POST", 
    data: null,
    success : function(val) {
    	hessianServer.push(val);
    },
	error:function(e){
    	alert('通信发生错误，稍等片刻再重新提交！');
    }
    });
    var url='${ctx}/admin/campus/getreportserver.json';
    $.ajax( {
    url : url,
    type : "POST", 
    data: null,
    success : function(val) {
    	reportServer.push(val);
    },
	error:function(e){
    	alert('通信发生错误，稍等片刻再重新提交！');
    }
    });
    $("#hessianServer").bigAutocomplete({
		width:604,
		data:hessianServer,
		callback:function(data){
	}});
    $("#reportServer").bigAutocomplete({
		width:604,
		data:reportServer,
		callback:function(data){
	}});
});
function goList(){
	window.location.href="${ctx}/admin/campus/list";
}
</script>
</html>
