<%--
  /**
   * Copyright (c) 2003 by Sun Microsystems, Inc. All rights reserved.
   * Use is subject to license terms.
   *
   * "%Z%%M%    %I%    %E%     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="login.title"/>
	</title>
</head>
<%@ include file="/layout/bodytag.jsp"%>
<html:form action="/root.menu.item0.item4edit.do">
<%@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="storage.mgmt.volumes.details" />
</jsp:include>

<%
 // 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) {}
 
VolumeForm form = (VolumeForm)session.getAttribute("volume");
%>
<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")%>">
<input type="hidden" name="name" value='<bean:write name="volume" property="name"/>'>
<bean:message key="storage.mgmt.volumes.details.help"/>
</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>
		  <% boolean vgmember = form.getVolumeGroup() != null;
		  %>
                    <component:button text="button.save" href="javascript:submitForm('save');" title="storage.mgmt.volumes.save" isEnabled="<%=!readOnly%>" />
				  </td>
				  <td>
				  	<img width="10" height="1" border="0" src="images/general/dot.gif">
				  </td>
				  <td>
				    <component:button text="storage.mgmt.volumes.button.add" href="javascript:document.forms[0].action='root.menu.item0.item4addvoltovg.do';document.forms[0].submit();" title="storage.mgmt.volumes.button.add" isEnabled="<%=!readOnly && !vgmember%>" />
				  </td>
				  <td>
				  	<img width="10" height="1" border="0" src="images/general/dot.gif">
				  </td>
				  <td>
				    <component:button text="storage.mgmt.volumes.button.remove" href="javascript:submitForm('removefromgroups')" title="storage.mgmt.volumes.button.remove" isEnabled="<%=!readOnly && vgmember%>" />
				  </td>
				  <td>
				  	<img width="10" height="1" border="0" src="images/general/dot.gif">
				  </td>
				  <td>
				    <component:button text="button.cancel" href="<%=cancelLink%>" title="storage.mgmt.volumes.cancel" isEnabled="true" />
				  </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="storage.mgmt.volumes.name" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="volume" property="name"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.status" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="volume" property="statusString"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.trayid" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="volume" property="tray_Id"/>
                          </div>
                        </td>
                      </tr>

                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.poolname" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:write name="volume" property="raidGroup_Name" />
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.size" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <component:volumeSizeDisplay size="<%=form.getSize().toString()%>"/>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.lun" />
                          </div>
                        </td>

                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <% int volLun = form.getLUN();
                               if(volLun == -1) {
                            %>
                                 <html:select name="volume" property="selectedLUN" size="3">
                                   <html:options name="volume" property="availableLUNs" />
                                 </html:select>
                            <% } else { %>
                                 <bean:write name="volume" property="LUN"/>
                            <% } %>
                          </div>
                        </td>
                      </tr>
                      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.defaultpermissions" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <html:select property="volumePermissions" disabled="<%=readOnly%>">
                              <html:option value="None" key="selectlist.volumepermissions.none" />
                              <html:option value="Read/Write" key="selectlist.volumepermissions.readwrite" />
                              <html:option value="Read-only" key="selectlist.volumepermissions.readonly" />
                            </html:select>
                          </div>
                        </td>
                      </tr>
		      <tr>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
                            <bean:message key="storage.mgmt.volumes.volumegroupmember" />
                          </div>
                        </td>
                        <td align="left" nowrap>
                          <div class="table-normal-text">
			  <%if(vgmember) {
			  	String vgName  = URLEncoder.encode(form.getVolumeGroup());
			   %>
                            <a href="root.menu.item1.item0edit.do?name=<%=vgName%>"><%=vgName%></a>
			  <% } else { %>
			  -
			  <% } %>
                          </div>
                        </td>
                      </tr>
                    </table>
                  </td>

                </tr>
              </table>
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</div>
</html:form>
</body>
</html:html> 

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