<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "@(#)sm_pool_details.jsp    1.8    03/08/28     SMI"
   * 
   */
 --%>
<% try { %>
	
<%@ include file="/layout/toptags.jsp"%>
<!-- 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="pool.details.header"/>
	</title>
</head>
<%@ include file="/layout/bodytag.jsp"%>
<% selectedSubItem = "root.menu.item0.item2pooldetails"; %>
<html:form action="/root.menu.item0.item2pooldetails.do">

<!-- hidden form value to set the page we are coming from (for the manage volumes include) -->
<html:hidden name="<%=Constants.HttpSessionFields.POOLFORM_NAME%>" property="comingFrom" value="pooldetails"/>

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

<jsp:include page="../layout/section_header.jsp" flush="true">
	<jsp:param name="sectionname" value="pool.details.header" />
</jsp:include>

<%
com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolForm form = 
 (com.sun.netstorage.array.mgmt.cfg.ui.forms.PoolForm)
   session.getAttribute(Constants.HttpSessionFields.POOLFORM_NAME);

 // set the cancel link to be the current page by default
 //  this should be overwritten unless an exception occurs
 //   or if the crumb is not found
 String cancelLink = "root.menu.item0.item4edit.do";
 try {
   if(crumbs != null) {
     // get the cancel button link from the previous breadcrumb
     //  so it's the second to the last link (-2)
     crumb = 
      (com.sun.netstorage.array.mgmt.cfg.ui.core.action.Crumb)crumbs.get(crumbs.size() - 2);
     if(crumb != null) {
        cancelLink = crumb.getLink();
     }
   }
 } catch(Exception ex) {}
 

%>
<div class="content-layout">
<!-- Button row -->
<table border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td >
<!-- hidden element which specifies the action for this form -->
<input type="hidden" name="request_action" value="<%=request.getAttribute("request_action")%>">
<bean:message key="pool.details.instructions"/>
</td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
    <tr>
      <td nowrap>
      	<table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="left">
              <table border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td>
                    <component:button text="pool.details.applydiffprofile.button" href="javascript:document.forms[0].action='root.menu.item0.item2applydiffprofile.do';document.forms[0].submit();" title="pool.details.applydiffprofile.button" isEnabled="<%=!readOnly%>" />
				  </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="50%">

                <tr>
                  <td>
                    <table class="front-table" border="0" cellspacing="0" cellpadding="0" width="100%">
                      <tr class="header-row">
                        <td>
                          <div class="table-header-text">
                            <bean:message key="detail.property" />
                          </div>
                        </td>

                        <td>
                          <div class="table-header-text">
                            <bean:message key="detail.value" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.name" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="Pool" property="detailedPool.name"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="tray.table.id" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
			  <a href="root.menu.item0.item0trayedit.do?name=<bean:write name="Pool" property="detailedPool.trayId"/>&t4Name=<bean:write name="Pool" property="detailedPool.t4Name"/>">
                            <bean:write name="Pool" property="detailedPool.trayId"/>
			    </a>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.raid" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="Pool" property="detailedPool.raidLevel"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.numdrives" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="Pool" property="detailedPool.numberOfDrives"/>
                          </div>
                        </td>
                      </tr>

                      <%
                        RaidGroupInterface detailedPool = form.getDetailedPool();
                      %>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.drivesize" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:volumeSizeDisplay size="<%=detailedPool.getEffectiveDiskSize().toString()%>"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.profile" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <html:link href="root.menu.item0.item3profiledetails.do"
   	                          paramId="profileName" paramName="Pool" paramProperty="detailedPool.profileName">
                               <bean:write name="Pool" property="detailedPool.profileName"/>
                            </html:link>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.available" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:volumeSizeDisplay size="<%=detailedPool.getAvailableCapacity().toString()%>"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.total" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:volumeSizeDisplay size="<%=detailedPool.getTotalCapacity().toString()%>"/>
                          </div>
                        </td>
                      </tr>
		              <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.status" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                             <%
                               String status = "storage.mgmt.pool.status." + detailedPool.getStatus();  
                             %>
                             <bean:message key="<%=status%>"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="pools.table.state" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                             <%
                               String state = "storage.mgmt.pool.state." + detailedPool.getState();  
                             %>
                             <bean:message key="<%=state%>"/>
                          </div>
                        </td>
                      </tr>
                    </table>
                  </td>

                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

  <!-- add some spacing between tables -->
  <%@include file="/layout/spacer.jsp"%>
  <%@include file="/layout/spacer.jsp"%>

  <!-- include the volumes listing -->
  <%@include file="sm_manage_volumes_include.jsp"%>

</div>
</html:form>
</body>
</html:html> 

<% } catch (Throwable t) {
     Trace.error(this, "storage_management.jsp", "Page exception:" + t);} 
%>
