<%@ page import="java.io.*, java.util.*"%>
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="com.eactive.eai.common.inflow.InflowControlManager"%>
<%@ page import="com.eactive.eai.common.inflow.InflowTargetVO"%>

<%
	InflowControlManager manager = InflowControlManager.getInstance();    
    String[] names = manager.getInterfaceAllKeys();
    String selectedName = request.getParameter("name");
    if(selectedName == null && names.length>0) selectedName = names[0];
    InflowTargetVO vo = manager.getInterfaceInflow(selectedName);
%>
<html>
    <head>
        <title>
            Inflow Interface Manager
        </title>
        <script>
        function doAction() {
            document.frm.submit();
        }
        </script>
    </head>
    <body>
        <p style="font-size:12pt;">
        <b>Infow Interface Configuration</b> <br><br>
        </p>
        <form name="frm" action="">
        <table width="450" border=0 bgcolor='black' cellpadding="1" cellspacing="1">
<%
	if(selectedName!=null) {
%>
        <tr bgcolor='white'>
            <td align='right' width='200' bgcolor="#ccccff">인터페이스명 : &nbsp;</td>
            <td align='left' width='250'>&nbsp;<select name="name" onchange="doAction();">
            <%
            	for(int i=0;i<names.length;i++) {
            %>
                <option value="<%=names[i]%>" <%=(names[i].equals(selectedName)) ? "selected" : ""%>><%=names[i]%>
            <%
            	}
            %></select>
            </td>
        </tr>
        <%
        	if (vo != null){
        %>
        
        <tr bgcolor='white'>            
            <td align='right' bgcolor="#ccccff">선택된 인터페이스명 : &nbsp;</td>
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getName()%>"></td>            
        </tr>
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">초당 임계치 : &nbsp;</td>            
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getThresholdPerSecond()%>"></td>
        </tr>
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">추가 임계치 : &nbsp;</td>            
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getThreshold()%>"></td>
        </tr>
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">추가 임계치 TimeUnit : &nbsp;</td>            
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getThresholdTimeUnit()%>"></td>
        </tr>
        <%
        	}
        %>
<% } else { %>
        
<% } %>
        </table>
        <table border='0' width="800" >
        <tr>
        <td align='left'>
            <!-- input type="submit" value="UPDATE"-->
        </td>
        </tr>
        </table><br>
        </form>
    </body>
</html>