<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ page import="java.io.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/jsp/common/include/localemessage.jsp" %>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setHeader("Expires", "0");

%>
<html>
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<jsp:include page="/jsp/common/include/css.jsp"/>
	<jsp:include page="/jsp/common/include/script.jsp"/>
	<script language="javascript" >
		var url      ='<c:url value="/onl/admin/httpouttlsinfo/httpOutTlsInfoMan.json" />';
		var url_view ='<c:url value="/onl/admin/httpouttlsinfo/httpOutTlsInfoMan.view" />';


		$(document).ready(function() {
			$('#grid').jqGrid({
				datatype: "json",
				mtype: 'POST',
				url: url,
				postData: {
					cmd: 'LIST',
				},
				colNames: ['Client ID', 'Store Type', 'Keystore 파일명', 'Truststore 파일명', '생성일시', '수정일시'],
				colModel: [
					{ name: 'clientId', align: 'left', sortable: false },
					{ name: 'storeType', align: 'center', width:50 },
					{ name: 'keystoreFilename', align: 'center' },
					{ name: 'truststoreFilename', align: 'center' },
					{ name: 'createdAt', align: 'center', width:70},
					{ name: 'updatedAt', align: 'center', width:70}
				],
				jsonReader: {
					repeatitems: false
				},
				pager: $('#pager'),
				page: '${param.page}',
				rowNum: '${rmsDefaultRowNum}',
				autoheight: true,
				height: $("#container").height(),
				autowidth: true,
				viewrecords: true,
				rowList: eval('[${rmsDefaultRowList}]'),
				ondblClickRow: function(rowId) {
					var rowData = $(this).getRowData(rowId);
					var clientId = rowData['clientId'];
					var url2 = url_view;
					url2 += '?cmd=DETAIL';
					url2 += '&page=' + $(this).getGridParam("page");
					url2 += '&returnUrl=' + getReturnUrl();
					url2 += '&menuId=' + '${param.menuId}';
					url2 += '&clientId=' + clientId;
					goNav(url2);
				},
				gridComplete: function(d) {
					var colModel = $(this).getGridParam("colModel");
					for(var i = 0; i < colModel.length; i++){
						$(this).setColProp(colModel[i].name, {sortable: false});
					}
				},
				loadError: function(jqXHR, textStatus, errorThrown) {
					var location = '<%=request.getContextPath()%>/';
					comloadError(jqXHR, textStatus, errorThrown, location);
				}
			});

			resizeJqGridWidth('grid', 'content_middle', '1000');

			$("#btn_new").click(function(){
				var url2 = url_view;
				url2 += '?cmd=DETAIL';
				url2 += '&page=' + $("#grid").getGridParam("page");
				url2 += '&returnUrl=' + getReturnUrl();
				url2 += '&menuId=' + '${param.menuId}';
				url2 += '&searchClientId=';
				goNav(url2);
			});

			$("input[name^=search], select[name^=search]").keydown(function(key){
				if (key.keyCode == 13){
					$("#btn_search").click();
				}
			});

			buttonControl();
		});
	</script>
</head>
<body>
<div class="right_box">
	<div class="content_top">
		<ul class="path">
			<li><a href="#">${rmsMenuPath}</a></li>
		</ul>
	</div><!-- end content_top -->
	<div class="content_middle" id="content_middle">
		<div class="search_wrap">
			<button type="button" class="cssbtn" id="btn_new" level="W" ><i class="material-icons">add</i> <%= localeMessage.getString("button.new") %></button>
		</div>
		<div class="title">HTTP Client mTLS 정보<span class="tooltip">Manage HTTP Client mTLS Information</span></div>
		<table id="grid"></table>
		<div id="pager"></div>
	</div><!-- end content_middle -->
</div><!-- end right_box -->
</body>
</html>
