<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "%Z%%M%    %I%    %E%     SMI"
   * 
   */
 --%>
<%@ include file="layout/toptags.jsp"%>
<%@ page import="com.sun.netstorage.array.mgmt.cfg.ui.forms.T4Form"%>
<!-- locale stuff -->
<html:html locale="true">
<!-- end locale -->

<!-- Place Java Script Here -->

<!-- HTML -->
<head>
<%@include file="/layout/page_head_section.jsp"%>
    <title>
        <bean:message  key="storage.mgmt.system.expert.title"/>
    </title>
</head>

<%@include file="/layout/bodytag.jsp"%>
<%@include file="layout/top.jsp"%>
<%@include file="layout/breadcrumb.jsp"%>
<%@include file="layout/spacer.jsp"%>



<html:form action="root.menu.item0.item1custom.do">


<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">


<div class="content-layout">
  <%@ include file="/layout/user_messages.jsp"%>
  
  
  <!-- ACTIONS section -->
  
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.system.expert.actions"/>
              </div>
            </td>
           
            <td valign="bottom" width="99%">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td class="property-separator" valign="bottom"><img alt border="0" height="2" src="/images/general/dot.gif" width="1"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
  </table>

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
  <tr>
    <td><bean:message key="storage.mgmt.system.custom.actionmsg"/></td>
  </tr>
</table>
  
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>                                
            <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
            <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>
                                <component:button text="storage.mgmt.system.expert.tray.button" href="javascript:cloneTrayWizard();" title="storage.mgmt.system.expert.tray.button" isEnabled="<%=!readOnly%>" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
                 </tr>
              </table>
            </td>
            <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>
                                <component:button text="storage.mgmt.system.expert.manage.pools.button" href="javascript:document.forms[0].action='root.menu.item0.item2pools.do';document.forms[0].submit();" title="storage.mgmt.system.expert.manage.pools.button" isEnabled="true" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>                 
                 </tr>
              </table>
            </td>
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td><img alt border="0" src="images/general/dot.gif" width="1" height="5"></td>
          </tr>
         
        </table>
      </td>
    </tr>
  </table>
  
  
  
  <!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>
  
  
  <!-- ARRAY DETAILS Section -->    
  
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.system.section.title"/>
              </div>
            </td>
           
            <td valign="bottom" width="99%">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td class="property-separator" valign="bottom"><img alt border="0" height="2" src="/images/general/dot.gif" width="1"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td><bean:message key="storage.mgmt.system.custom.warning"/></td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
  </table>

<!-- spacer between two sections -->
<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="8" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td >
                                <component:button text="button.save" href="javascript:submitForm('save');" title="button.save" isEnabled="<%=!readOnly%>" /> 
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>                  
                </tr>
              </table>
            </td>            
          
            <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
        
            <td align="left" valign="middle">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td align="center" valign="middle" nowrap>
                                <component:button text="button.cancel" href="javascript:document.forms[0].action='root.menu.item0.item1.do';document.forms[0].submit();" title="button.cancel" isEnabled="<%=!readOnly%>" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>
                  <td width="10"><img alt width="10" height="1" border="0" src="images/general/dot.gif"></td>
                 </tr>
              </table>
            </td>
            <td>
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <table>
                      <tr>
                        <td>
                          <table>
                            <tr>
                              <td >
                                <component:button text="storage.mgmt.system.fcconfig.button" href="javascript:document.forms[0].action='root.menu.item0.item1fcconfig.do';document.forms[0].submit();" title="storage.mgmt.system.fcconfig.button" isEnabled="true" />
                              </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>
                  </td>                  
                </tr>
              </table>
            </td>            
          
                </tr>
              </table>
            </td>
          </tr>
          <tr>
            <td><img alt border="0" src="images/general/dot.gif" width="1" height="5"></td>
          </tr>
          <tr>            
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1" width="100%">
                <tr>
                  <td align="left" valign="middle">
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0" width="100%">
                      <tr class="header-row">                        
                        <td align="left">
                          <div class="table-header-text">
                            <bean:message key="detail.property"/>
                          </div>
                        </td>                                                
                        <td align="left">
                          <div class="table-header-text">
                            <bean:message key="detail.value"/>
                          </div>
                        </td>                        
                      </tr>
                      <logic:present name="t4Form">                                           
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.array.name" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="t4Form" property="name"/>                           
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.array.description" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <html:text name="t4Form" property="description" size="30" maxlength="39" disabled="<%=readOnly%>"/>                            
                          </div>
                        </td>
                      </tr>                     
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.health" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">           
                             <%                                
                                T4Form form = (T4Form)session.getAttribute("t4Form");
                                String health = "array.health.code." + ((T4Interface)session.getAttribute(Constants.HttpSessionFields.CURRENT_T4)).getHealthStatus();
                              %>
                            <bean:message key="<%=health%>" />                           
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.segmentsize" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                         <div class="table-normal-text">  
                          <html:select name="t4Form" property="blockSize" disabled="<%=readOnly%>">
                    		  <html:option key="array.blocksize.4096" value='<%="" + Constants.StorageSize._4K%>'/>
                    		  <html:option key="array.blocksize.8192" value='<%="" + Constants.StorageSize._8K%>'/>
                    		  <html:option key="array.blocksize.16384" value='<%="" + Constants.StorageSize._16K%>'/>
                    		  <html:option key="array.blocksize.32768" value='<%="" + Constants.StorageSize._32K%>'/>
                    		  <html:option key="array.blocksize.65536" value='<%="" + Constants.StorageSize._64K%>'/>
                    	  </html:select>
                    	 </div>
                        </td>                        
                      </tr> 
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.readahead" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <%
                             int raMode =
                              ((T4Interface)session.getAttribute("CurrentT4")).getReadaheadMode();
                            %>
                            <!--
                              The reason the struts html select tag is not used here is because
                               the values in this select box are different from the display values.
                               The display values are 'on' and 'off' where the actual values are
                                 1 and 0. In order to properly pre-select the values, the values
                                 and display values must match.
                            -->
                            <select name="readaheadMode" <%=(readOnly ? "disabled" : "")%>>
                              <%
                                if(raMode == 0) {
                              %>
                                  <option selected value="0"><bean:message key="array.readahead.0"/>
                                  <option value="1"><bean:message key="array.readahead.1"/>
                              <% } else { %>
                                  <option value="0"><bean:message key="array.readahead.0"/>
                                  <option selected value="1"><bean:message key="array.readahead.1"/>
                              <% } %>
                            </select>
                            <html:hidden name="t4Form" property="readaheadMode"/> 
                          </div>
                        </td>
                      </tr>
                      
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.diskrecon" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                             <html:select name="t4Form" property="diskReconRate" disabled="<%=readOnly%>">
                    		  <html:option key="array.diskrecon.1" value='<%="1"%>'/>
                    		  <html:option key="array.diskrecon.8" value='<%="8"%>'/>  
                    		  <html:option key="array.diskrecon.16" value='<%="16"%>'/>                    		  
                    	    </html:select>                            
                          </div>
                        </td>
                      </tr>  
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.failover" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <%
                               if(form != null) {
                                  String failover = form.getFailoverMode();
                                  if(Constants.T4.EXP_LUN_FAILOVER_MODE.equals(failover) ||
                                     Constants.T4.IMP_LUN_FAILOVER_MODE.equals(failover) ||
                                     Constants.T4.NO_LUN_FAILOVER_MODE.equals(failover)) { 
                            %>
                                    <html:select name="t4Form" property="failoverMode" disabled="<%=readOnly%>">
                              		  <html:option key="array.failover.mpxio" value='<%="mpxio"%>'/>
                             		  <html:option key="array.failover.readWrite" value='<%="readWrite"%>'/>                      		                     		  
                            		  <html:option key="array.failover.none" value='<%="none"%>'/>
                            	    </html:select>                             
                            <%
                                  } else {
                                      form.setFailoverMode(Constants.T4.UNSUPPORTED_LUN_FAILOVER_MODE);
                            %>
                                    <html:select name="t4Form" property="failoverMode" disabled="<%=readOnly%>">
                              		  <html:option key="array.failover.mpxio" value='<%="mpxio"%>'/>
                             		  <html:option key="array.failover.readWrite" value='<%="readWrite"%>'/>                      		                     		  
                            		  <html:option key="array.failover.none" value='<%="none"%>'/>
                    		          <html:option key="array.failover.unsupported" value='<%="Unsupported"%>'/>
                            	    </html:select>                             
                            <%
                                  }// end else
                               }// end form != null
                            %>
                          </div>
                        </td>
                      </tr>   
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.system.cache" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <html:select name="t4Form" property="cacheMode" disabled="<%=readOnly%>">
                    		  <html:option key="array.cachemode.disabled" value='<%="off"%>'/>
                    		  <html:option key="array.cachemode.writeThrough" value='<%="writeThrough"%>'/>  
                    		  <html:option key="array.cachemode.writeBehind" value='<%="writeBehind"%>'/>
                    		  <html:option key="array.cachemode.auto" value='<%="auto"%>'/>
                    	    </html:select>                            
                          </div>
                        </td>
                      </tr>
                      
                      </logic:present>                                
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>


<table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%">
  <tr>
    <td><img alt border="0" height="20" width="1" src="images/general/dot.gif"></td>
  </tr>
</table>

<!-- TRAYS in this ARRAY section -->

<!-- This portion is only to be displayed in expert mode-->
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
      <td>
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
          <tr>
            <td nowrap>
              <div class="major-category-text">
                <bean:message key="storage.mgmt.system.expert.tray.section" arg0='<%=((T4Form)session.getAttribute("t4Form")).getName()%>'/> 
              </div>
            </td>
            <td valign="bottom" width="99%">
              <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                  <td class="property-separator" valign="bottom"><img alt border="0" height="2" src="/images/general/dot.gif" width="1"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td><img alt border="0" height="5" src="/images/general/dot.gif" width="1"></td>
    </tr>
  </table>
  <table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td nowrap>
        <table border="0" cellspacing="0" cellpadding="0">          
          <tr>
            <td><img alt width="1" height="2" border="0" src="images/general/dot.gif"></td>
          </tr>
          <tr>
            <td nowrap>
              <table class="back-table" border="0" cellspacing="0" cellpadding="1">
                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0">
                      <tr class="header-row">
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.id"/>
                          </div>
                        </td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.type"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.role"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.state"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.status"/>
                          </div>
                        </td>                                               
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivenum"/> 
                          </div>
                        </td>
                        <td nowrap>
                          <div class="table-header-text">
                            <bean:message key="tray.table.drivecapacity"/> 
                          </div>
                        </td>
                      </tr>
                      <!-- Begin tray row listing(s) -->                                                    
                      <logic:present name="t4Form" property="trays">   
                                           
 				 	    <logic:iterate id="tray" name="t4Form" property="trays" type="TrayInterface" indexId="index">
                          <tr>                             
                            <td align="center">            
                                <html:link href="root.menu.item0.item0trayedit.do" paramId="index" paramName="index">             
                                <bean:write name="tray" property="id"/></html:link>
                            </td> 
                           
                            <td align="center">
                              <%
                                String typeStr = "tray.type." + tray.getTrayType();                                
                              %>
                              <bean:message key="<%=typeStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String roleStr = "tray.role." + tray.getRole();                                
                              %>
                              <bean:message key="<%=roleStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String stateStr = "tray.state." + tray.getState();                                
                              %>
                              <bean:message key="<%=stateStr%>"/>
                            </td>
                            <td align="center">
                              <%
                                String statusStr = "tray.status." + tray.getStatus();                                
                              %>
                              <bean:message key="<%=statusStr%>"/>
                            </td>
                            <td align="center">                         
                                <bean:write name="tray" property="numberOfDrives"/>
                            </td> 
                            <td align="center">                         
                                <%=nf.format(nf.parse(Convert.bytesToGB(tray.getDriveCapacity())))%>
                                <bean:message key="size.GB"/>
                            </td> 
                         </tr>
                        </logic:iterate>
                        
                      </logic:present>                 
                    </table>
                  </td>
                </tr>
              </table>
            </td>
          </tr>          
        </table>
      </td>
    </tr>
  </table>
</div>

</html:form>



</body>
</html:html> 
