<!DOCTYPE HTML>
<html>
<head>
<#include "/adminPage/common.html"/>
<style type="text/css">

.long{
	width: 210px;
}

.short{
	width: 110px!important;
}

input[name='param']{
	width: 100px;
}
</style>
</head>
<body class="layui-layout-body">
	<div class="layui-layout layui-layout-admin">

		<#include "/adminPage/header.html"/>
		<#include "/adminPage/menu.html"/>

		<div class="layui-body">
			<!-- 内容主体区域 -->
			<div style="padding: 15px">
				<fieldset class="layui-elem-field layui-field-title">
					<legend>${menuStr.http}</legend>
				</fieldset>

				<form action="${ctx}/adminPage/http" id="searchForm" method="post">
					<div class="layui-form">
						<div class="layui-inline">
							<button type="button" class="layui-btn layui-btn-normal" onclick="add()">${httpStr.add}</button>
							
							<button type="button" class="layui-btn" onclick="guide()">${httpStr.guide}</button>
							
							<button type="button" class="layui-btn layui-btn-normal" onclick="preview(null,'http')">${commonStr.preview}</button>
									
						</div>
					</div>
				</form>

				<table class="layui-table" style="table-layout:fixed; WORD-BREAK:break-all;">
					<thead>
						<tr>
							<th>${commonStr.name}</th>
							<th>${commonStr.value}</th>
							<th>${commonStr.operation}</th>
						</tr>
					</thead>
					<tbody>
						<#list httpList as http>
						<tr>
							<td>${http.name}</td>
							<td>${http.value}</td>
							<td>
								<button class="layui-btn layui-btn-sm" onclick="edit('${http.id}')">${commonStr.edit}</button>
								<button class="layui-btn layui-btn-danger layui-btn-sm" onclick="del('${http.id}')">${commonStr.del}</button>
								
								<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="setOrder('${http.id}', -1)">${commonStr.up}</button>
								<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="setOrder('${http.id}', 1)">${commonStr.down}</button>
							</td>
						</tr>
						</#list>
					</tbody>
				</table>
			</div>
		</div>
	</div>

	<div style="height: 0px; width: 0px; overflow: hidden;">
		<!-- 弹出框 -->
		<div class="layui-form" id="windowDiv" style="padding: 15px; display: none">
			<form id="addForm">
				<input type="hidden" name="id" id="id">

				<div class="layui-form-item">
					<label class="layui-form-label">${commonStr.name}</label>
					<div class="layui-input-block">
						<input type="text" name="name" id="name" class="layui-input">
					</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label">${commonStr.value}</label>
					<div class="layui-input-block">
						<textarea  name="value" id="value" class="layui-textarea" ></textarea>
					</div>
				</div>

				<div class="layui-form-item">
					<button type="button" class="layui-btn layui-btn-normal" onclick="addOver()">${commonStr.submit}</button>
					<button type="button" class="layui-btn" onclick="layer.closeAll()">${commonStr.close}</button>
				</div>
			</form>
		</div>

		<div class="layui-form" id="guideDiv" style="padding: 15px; display: none">
			<form id="addForm">
				<div class="layui-form-item">
					<label class="layui-form-label long">keepalive_timeout</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="keepalive_timeout" class="layui-input" value="75" lang="s">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.second}，${httpStr.timeout}</div>
				</div>

				<div class="layui-form-item">
					<label class="layui-form-label long">gzip</label>
					<div class="layui-input-inline short">
						<input type="checkbox" name="param" id="gzip" lay-skin="primary" checked lang="">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.gzip}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">gzip_min_length</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="gzip_min_length" class="layui-input" value="8" lang="k">
					</div>
					<div class="layui-form-mid layui-word-aux">KB，${httpStr.gzipMinLength}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">gzip_comp_level</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="gzip_comp_level" class="layui-input" value="2" lang="">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.gzipCompLevel}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">client_max_body_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="client_max_body_size" class="layui-input" value="1024" lang="m">
					</div>
					<div class="layui-form-mid layui-word-aux">MB，${httpStr.maxBodySize}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">client_header_buffer_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="client_header_buffer_size" class="layui-input" value="32" lang="k">
					</div>
					<div class="layui-form-mid layui-word-aux">KB，${httpStr.headerBufferSize}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">client_body_buffer_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="client_body_buffer_size" class="layui-input" value="8" lang="m">
					</div>
					<div class="layui-form-mid layui-word-aux">MB，${httpStr.bodyBufferSize}</div>
				</div>
				
				
				
				
				<div class="layui-form-item">
					<label class="layui-form-label long">server_names_hash_bucket_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="server_names_hash_bucket_size" class="layui-input" value="512" lang="">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.serverNamesHash}</div>
				</div>
				
				
				<div class="layui-form-item">
					<label class="layui-form-label long">proxy_headers_hash_max_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="proxy_headers_hash_max_size" class="layui-input" value="51200" lang="">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.proxyHeadersMax}</div>
				</div>
				
				
				<div class="layui-form-item">
					<label class="layui-form-label long">proxy_headers_hash_bucket_size</label>
					<div class="layui-input-inline short">
						<input type="text" name="param" id="proxy_headers_hash_bucket_size" class="layui-input" value="6400" lang="">
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.proxyHeadersHash}</div>
				</div>
				
				
				
				
				<div class="layui-form-item">
					<label class="layui-form-label long">${httpStr.logStatus}</label>
					<div class="layui-input-inline short">
						<input type="checkbox" name="logStatus" id="logStatus" value="on" lay-skin="primary" >
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.logStatusTips}</div>
				</div>
				
				<div class="layui-form-item">
					<label class="layui-form-label long">${httpStr.webSocket}</label>
					<div class="layui-input-inline short">
						<input type="checkbox" name="webSocket" id="webSocket" value="on" lay-skin="primary" >
					</div>
					<div class="layui-form-mid layui-word-aux">${httpStr.webSocketTips}</div>
				</div>
				
				<div class="layui-form-item">
					<button type="button" class="layui-btn layui-btn-normal" onclick="addGiudeOver()">${commonStr.submit}</button>
					<button type="button" class="layui-btn" onclick="layer.closeAll()">${commonStr.close}</button>
				</div>
			</form>
		</div>
		
	</div>

	<#include '/adminPage/script.html'/>
	<#include '/adminPage/select_preview.html'/>
	<script src="${ctx}/js/adminPage/http/index.js?v=${jsrandom}" type="text/javascript"></script>
</body>


</html>