<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:include page="head.jsp"/>

<body>

<div class="container" align="center">
    <jsp:include page="header.jsp"/>
    <jsp:include page="menu.jsp"/>

    <div class="content">
        <table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-weight: bold;font-family:tahoma;font-size:14pt;color:#808080;border-color:#6a5acd" >
            <tr><td>
                <fieldset><legend> WEB Camera Network Ping Information </legend>
                    <table align="center" border="1" cellpadding="1" cellspacing="0" style="border: 1px solid;font-weight: normal;font-family:tahoma;font-size:12pt;">
                        <thead>
                        <tr style="background-color: antiquewhite;">
                            <th>관리번호</th>
                            <th>Camera ID</th>
                            <th>Camera 명칭</th>
                            <th>IP Address</th>
                            <th>상태</th>
                            <th>마지막 PING 시간</th>
                            <th>명령</th>
                        </tr>
                        </thead>
                        <c:forEach var="entry" items="${list}" varStatus="status">
                            <tr>
                                <td align="center">${entry.value.CTLR_NMBR}</td>
                                <td align="center">${entry.value.CTLR_ID}</td>
                                <td>${entry.value.ISTL_LCTN_NM}</td>
                                <td>&nbsp;${entry.value.CTLR_IP}&nbsp;</td>
                                <td align="center">
                                    <c:choose>
                                        <c:when test="${entry.value.netState eq '0'}">
                                            &nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;
                                        </c:when>
                                        <c:otherwise>
                                            &nbsp;&nbsp;Alive&nbsp;&nbsp;
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td align="center">&nbsp;${entry.value.pingTime}&nbsp;</td>
                                <td align="center">
                                    &nbsp;&nbsp;<a href="javascript:controllerPing('${entry.value.CTLR_ID}', '${entry.value.ISTL_LCTN_NM}', '${entry.value.CTLR_IP}')">ping</a>&nbsp;&nbsp;</td>
                            </tr>
                        </c:forEach>
                    </table>
                    <br>
                    <table align="center" border="0" cellpadding="1" cellspacing="0" style="font-weight: normal;font-family:tahoma;font-size:12pt;">
                        <tr>
                            <td><button type="button" onclick="AllControllerPing()">전체 ping</button></td>
                        </tr>
                    </table>

            </fieldset>
            </td></tr>
        </table>
    </div>

    <div class="content">
        <div class="log" id="log">
            <fieldset id="FileForm">
                <legend name="fileName" id="logFileName">Ping Test</legend>
                <div id="logScroll" style="width: 98%;height: 660px;overflow: auto;margin:5px auto;">
                    <table >
                        <tbody id="fileTbody">

                        </tbody>
                    </table>
                </div>
            </fieldset>
        </div>
    </div>

</div>

<script type="text/javascript">
    function init(){
        _controllerList = ${objList};
    }

    $(document).ready(function() {
        init();
    });
</script>

</body>
</html>
