<!DOCTYPE HTML>
<html>
<head>
<#include "/adminPage/common.html"/>

</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.stream}</legend>
				</fieldset>

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

				<table class="layui-table">
					<thead>
						<tr>
							<th>${commonStr.name}</th>
							<th>${commonStr.value}</th>
							<th>${commonStr.operation}</th>
						</tr>
					</thead>
					<tbody>
						<#list streamList as stream>
						<tr>
							<td>${stream.name}</td>
							<td style="width: 50%;">${stream.value}</td>
							<td>
								<button class="layui-btn layui-btn-sm" onclick="edit('${stream.id}')">${commonStr.edit}</button>
								<button class="layui-btn layui-btn-danger layui-btn-sm" onclick="del('${stream.id}')">${commonStr.del}</button>
								
								<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="setOrder('${stream.id}', -1)">${commonStr.up}</button>
								<button class="layui-btn layui-btn-normal layui-btn-sm" onclick="setOrder('${stream.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>

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


</html>