<%--
 Copyright : All Rights Reserved. Copyright (C) 2006, Hitachi, Ltd.
 Title     : ServerConductor WebConsole
 Version   : 08-00
 Name      : envAgtAlt.jsp
 Date      : 2006/04/15
 Author    : Raman.V
 --%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page language = "java" %>
<%@ page errorPage = "errorDialog.jsp" %>
<%@ page import =
"JP.co.Hitachi.soft.System_Manager.webconsole.common.Const"%>
<%@ page import =
"JP.co.Hitachi.soft.System_Manager.webconsole.common.MessageConstant"%>
<%@ page import = "JP.co.Hitachi.soft.System_Manager.data.HsmConst" %>          <% // 800WA_WEBCONSOLE363 %>
<%@ page contentType = "text/html; charset=UTF-8" pageEncoding = "UTF-8" %>
<%@ taglib uri = "/WEB-INF/struts-bean.tld" prefix = "bean" %>
<%@ taglib uri = "/WEB-INF/struts-html.tld" prefix = "html" %>
<%@ taglib uri = "/WEB-INF/common-tags.tld" prefix = "util" %>

<% response.addHeader("Cache-Control","no-cache"); %>

<jsp:useBean id = "AgentAlertSettingBean" 
class="JP.co.Hitachi.soft.System_Manager.webconsole.model.bean
.AgentAlertSettingBean" 
scope = "request"/>

<util:checkURL/> 

     <%-- <!-- Session Validation will be done here --> --%>                    <% // 800WA_WEBCONSOLE300 %>
<html:html> 
    <head>         
        <script src = "js/common.js"> </script>                                 <% //800WA_WEBCONSOLE192 %>
        <script src = "js/envSet.js"> </script>
        <title></title> 
        <link rel = "stylesheet" type = "text/css" href = "css/common.css"> 
    </head> 
    <body onload = "initialize();" > 
        <%-- <html:form  action = "AgentAlertSettingAction" > --%>              <%-- 800WA_WEBCONSOLE451 --%>
        <html:form  action = "AgentAlertSettingAction" 
            onsubmit = "return ValidateAlertSetting();">                        <%-- 800WA_WEBCONSOLE451 --%>
            <table border = "0" cellspacing = "0" cellpadding ="3" width = 100%> 
               <tr bgcolor = "azure">  
                  <td>
                     <span class = "small">
                        <bean:message 
                           bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                           key = "envagt.detail.notify.alert"/>
                     </span>
                 </td>
                <td>
                </td> 
                <td>
                   <input type = "checkbox" name = "chk1" value = "" 
                    onclick = "isValueChanged();setObject(this);" >
                    <span class = "small">                                      <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %>  
                      <bean:message
                           bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                           key = "envagt.detail.notify.alert.info"/>
                    </span>                                                     <% // 800WA_WEBCONSOLE319 %>
                </td> 
           </tr> 
           <tr bgcolor = "azure"> 
              <td></td>
              <td></td> 
              <td>
                 <input type = "checkbox" name = "chk2" value = "" 
                   onclick = "isValueChanged();setObject(this);" >
                   <span class = "small">                                       <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %> 
                    <bean:message
                          bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                          key = "envagt.detail.notify.alert.attention"/>        <% //800WA_WEBCONSOLE197 %> 
                   </span>                                                      <% // 800WA_WEBCONSOLE319 %>                       
              </td>  
         </tr> 
              <tr bgcolor = "azure"> 
             <td></td>
            <td></td> 
            <td>
                <input type = "checkbox" name = "chk3" value = "" 
                onclick = "isValueChanged();setObject(this);">
               <span class = "small">                                           <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %>
                <bean:message
                      bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                      key = "envagt.detail.notify.alert.warning"/>              <% //800WA_WEBCONSOLE197 %>
               </span>                                                          <% // 800WA_WEBCONSOLE319 %>  
           </td>  
      </tr> 
      <tr bgcolor = "azure"> 
         <td></td>
         <td></td>  
         <td>
            <input type = "checkbox" name = "chk4" value = "" 
             onclick = "isValueChanged();setObject(this);">
             <span class = "small">                                             <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %>
              <bean:message 
                     bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                     key = "envagt.detail.notify.alert.trouble"/>
             </span>                                                            <% // 800WA_WEBCONSOLE319 %>
        </td>
    </tr> 
    <tr bgcolor = "lightyellow">  
       <td>
          <span class = "small">
              <bean:message 
                     bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                     key = "envagt.detail.alert.log"/></span>
       </td> 
       <td>
           <span class = "small">
              <bean:message
                     bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                     key = "envagt.detail.alert.log.save.label"/>
            </span>
        </td> 
        <td> 
            <%-- <html:text property = "logFileDays" 
             onchange = "isValueChanged();setObject(this);"
             onblur="removeSelection(this)" 
             value = 
                "<%= String.valueOf(AgentAlertSettingBean.getLogFileDays())%>" 
                size = "10" maxlength="2" styleClass = "small" /> --%>          <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %><% // 800WA_WEBCONSOLE409 %><%-- 800WA_WEBCONSOLE452 --%>
            <html:text property = "logFileDays" 
             onchange = "isValueChanged();setObject(this);"
             onblur="setAltHasChanged();removeSelection(this)" 
             value = 
                "<%= String.valueOf(AgentAlertSettingBean.getLogFileDays())%>" 
                size = "10" maxlength="2" styleClass = "small" />               <%-- 800WA_WEBCONSOLE452 --%>
            <span class = "small">
              <bean:message 
                   bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                   key = "envagt.detail.alert.log.save.value"/>
            </span> 
         </td> 
     </tr> 
     <tr bgcolor = "lightyellow"> 
        <td></td>
        <td></td> 
            <td>
            <span class = "small">
            <bean:message
                 bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                 key = "envagt.detail.alert.log.save.message"/> 
            </span>
        </td> 
    </tr> 
    <tr bgcolor = "lightyellow"> 
        <td></td> 
        <td>
            <span class = "small">
              <bean:message 
                    bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                    key = "envagt.detail.disk.capacity.label"/>
            </span>
        </td> 
        <td> 
          <%-- <html:text property = "logFileSize" 
          onchange = "isValueChanged();setObject(this);"
          onblur="removeSelection(this)" 
          value = "<%= String.valueOf(AgentAlertSettingBean.getLogFileSize())%>" 
          size = "10" maxlength = "7" styleClass = "small" /> --%>              <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %><% // 800WA_WEBCONSOLE409 %><%-- 800WA_WEBCONSOLE452 --%>
          <html:text property = "logFileSize" 
          onchange = "isValueChanged();setObject(this);"
          onblur="setAltHasChanged();removeSelection(this)" 
          value = "<%= String.valueOf(AgentAlertSettingBean.getLogFileSize())%>" 
          size = "10" maxlength = "7" styleClass = "small" />                   <%-- 800WA_WEBCONSOLE452 --%>
          <span class = "small">
            <bean:message 
                  bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                  key = "envagt.detail.disk.capacity.value"/>
          </span> 
        </td> 
    </tr> 
    <tr bgcolor = "lightyellow"> 
        <td></td>
        <td></td> 
        <td>
            <span class = "small">
               <bean:message
                   bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                   key = "envagt.detail.disk.capacity.message"/>
            </span>
        </td> 
    </tr> 
    <tr bgcolor = "seashell"> 
        <td>
            <span class = "small">
            <bean:message 
                  bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                  key = "envagt.detail.appli.log.label"/>
            </span>
        </td> 
        <td></td> 
        <td>
            <input type = "checkbox" name = "appLogFlag" 
            onclick = "isValueChanged();setObject(this);" />
           <span class = "small">                                               <% // 800WA_WEBCONSOLE319 %><% // 800WA_WEBCONSOLE371 %>
            <bean:message 
                    bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                    key = "envagt.detail.appli.log.value"/>                     <% // 800WA_WEBCONSOLE333 %>
           </span>                                                              <% // 800WA_WEBCONSOLE319 %>
        </td> 
    </tr> 
    <tr bgcolor = "seashell"> 
        <td></td>
        <td></td> 
        <td>
        <span class = "small">
        <bean:message
                 bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                 key = "envagt.detail.appli.log.message"/>
        </span>
        </td>
    </tr>
    <tr><td>&nbsp;</td></tr>                                                    <%-- 800WA_WEBCONSOLE404 --%>
    <tr>                                                                        <%-- 800WA_WEBCONSOLE404 --%>
        <td colspan = "3" align = "right" valign = "top">                       <%-- 800WA_WEBCONSOLE404 --%>
            <input type = "hidden" name = "hdnNodeId" value = ""/>              <%-- 800WA_WEBCONSOLE404 --%>
            <input type = "hidden" name = "hdnAlertLev" value = ""/>            <%-- 800WA_WEBCONSOLE404 --%>
             <input type = "hidden" name = "hdnSaveDay" >                       <%-- 800WA_WEBCONSOLE452 --%>
             <input type = "hidden" name = "hdnWarnThrsh" >                     <%-- 800WA_WEBCONSOLE452 --%>
            <%-- <html:submit property="submit" 
           onclick ="return ValidateAlertSetting();" styleClass = "small" > --%><%-- 800WA_WEBCONSOLE404 --%><%-- 800WA_WEBCONSOLE451 --%>
            <%-- <html:submit property="submit" styleClass = "small" > --%>     <%-- 800WA_WEBCONSOLE451 --%><%-- 800WA_WEBCONSOLE457 --%>
            <html:submit property="submit" styleClass = "small" disabled = "true"><%-- 800WA_WEBCONSOLE457 --%>
            <bean:message 
                bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                key = "envagt.common.set.button" />                             <%-- 800WA_WEBCONSOLE404 --%>
            </html:submit>                                                      <%-- 800WA_WEBCONSOLE404 --%>
        </td>                                                                   <%-- 800WA_WEBCONSOLE404 --%>
    </tr>                                                                       <%-- 800WA_WEBCONSOLE404 --%>
    </table> 
    <%-- <br> --%>                                                              <%-- 800WA_WEBCONSOLE404 --%>
    <%-- <div align = "right"> --%>                                             <%-- 800WA_WEBCONSOLE404 --%>
        <%-- <input type = "hidden" name = "hdnNodeId" value = ""/> --%>        <%-- 800WA_WEBCONSOLE404 --%>
        <%-- <input type = "hidden" name = "hdnAlertLev" value = ""/> --%>      <%-- 800WA_WEBCONSOLE404 --%>
        <%-- <html:submit property="submit" onclick ="return ValidateAlertSetting();"
                                        styleClass = "small" > --%>             <% //800WA_WEBCONSOLE316 %><%-- 800WA_WEBCONSOLE404 --%>
            <%-- <bean:message 
                bundle = "<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
                key = "envagt.common.set.button" /> --%>                        <%-- 800WA_WEBCONSOLE404 --%>
        <%-- </html:submit> --%>                                                <%-- 800WA_WEBCONSOLE404 --%>
    <%-- </div> --%>                                                            <%-- 800WA_WEBCONSOLE404 --%>
    </html:form> 
    </body> 
    
    <util:set name="AlertConstants">
		var SAVE_DAYS = '<bean:message 
			        	bundle="<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
			        	key="envagt.detail.alert.log.save.label" />';
		var USED_DISK_CAPACITY = '<bean:message 
			        	bundle="<%= Const.MESSAGE_RESOURCES_KEY_AGENT%>" 
			        	key="envagt.detail.disk.capacity.label" />';	        	
	</util:set>
	
    <util:set name = "SettingerrorArray">
    
        var MSG_KEEPTIME_CHECK = 
                        "<%=MessageConstant.MSG_KEEPTIME_CHECK%>";
        var MSG_DISKVOL_CHECK= 
                     "<%=MessageConstant.MSG_DISKVOL_CHECK%>";
        var MSG_COMMON_RANGE_CHECK =
                   "<%=MessageConstant.MSG_COMMON_RANGE_CHECK %>";
        var MSG_COMMON_ZERO_OR_POSITIVE_INTEGER_CHECK = 
      "<%=MessageConstant.MSG_COMMON_ZERO_OR_POSITIVE_INTEGER_CHECK %>";
    
        var MSG_AGENT_SETTING_RANGE_RETENTION_DAYS_MIN =
                "<%=Const.AGENT_SETTING_RANGE_RETENTION_DAYS_MIN%>";
        var MSG_AGENT_SETTING_RANGE_RETENTION_DAYS_MAX =
            "<%=Const.AGENT_SETTING_RANGE_RETENTION_DAYS_MAX%>";
        var MSG_AGENT_SETTING_RANGE_DISK_CAPACITY_MIN =
                    "<%=Const.AGENT_SETTING_RANGE_DISK_CAPACITY_MIN%>";
        var MSG_AGENT_SETTING_RANGE_DISK_CAPACITY_MAX =
                 "<%=Const.AGENT_SETTING_RANGE_DISK_CAPACITY_MAX%>";
        
        errorMsgArr[MSG_KEEPTIME_CHECK] = '<bean:message 
            bundle="<%=Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>" 
            key="<%=MessageConstant.MSG_KEEPTIME_CHECK%>"/>';
                        
 errorMsgArr[MSG_COMMON_ZERO_OR_POSITIVE_INTEGER_CHECK]=
     '<bean:message     
         bundle = "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>" 
         key = "<%=MessageConstant.MSG_COMMON_ZERO_OR_POSITIVE_INTEGER_CHECK%>" 
         arg0 = "{0}"/>';
        
        errorMsgArr[MSG_COMMON_RANGE_CHECK]='<bean:message 
            bundle = "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>" 
            key = "<%=MessageConstant.MSG_COMMON_RANGE_CHECK%>" 
            arg0 = "{0}" arg1 = "{1}" arg2 = "{2}" />';
        
        errorMsgArr[MSG_DISKVOL_CHECK]='<bean:message 
            bundle = "<%= Const.MESSAGE_RESOURCES_KEY_ERRMESSAGE%>" 
            key = "<%=MessageConstant.MSG_DISKVOL_CHECK%>"/>';        
            
    </util:set>

    <script>
           var nodeId = '<%= AgentAlertSettingBean.getNodeId() %>'
           var errorMsgArr = new Array();
           AlertArray = new Array();
        
          <%=pageContext.getAttribute("AlertConstants").toString()%>
          <%=pageContext.getAttribute("SettingerrorArray").toString()%>
          <%  String[] stAlertArray = AgentAlertSettingBean.getAlertLevel();
              for(int l_iCnt=0 ;l_iCnt < stAlertArray.length; l_iCnt++){
          %>
               AlertArray[<%=l_iCnt%>]='<%=stAlertArray[l_iCnt]%>';
          <%
            }
        %>
        ApplLog = '<%=AgentAlertSettingBean.isAppLogFlag()%>';
        NodeType = '<%=AgentAlertSettingBean.getHostType()%>';                  <% // 800WA_WEBCONSOLE363 %>
        HOST_LINUX = '<%=HsmConst.NODE_TYPE_HOST_LINUX%>';                      <% // 800WA_WEBCONSOLE363 %>
        HOST_HPUX = '<%=HsmConst.NODE_TYPE_HOST_HPUX%>';                        <% // 800WA_WEBCONSOLE363 %>
        document.forms[0].submit.disabled = false;                              <%-- 800WA_WEBCONSOLE457 --%>
    </script>
</html:html>