java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java | 17
++
java/code/src/com/redhat/rhn/domain/server/ServerNetAddress6.hbm.xml | 3
java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java | 18
++
java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml | 7
+
java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp | 70
++++++++++
5 files changed, 114 insertions(+), 1 deletion(-)
New commits:
commit da02a8c05eba97f76aab7c1d731b67db7ef42520
Author: Milan Zazrivec <mzazrivec(a)redhat.com>
Date: Wed Nov 9 20:20:32 2011 +0100
IPv6: SystemHardware.do (webui) modifications
diff --git a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
index f80b018..8c9f474 100644
--- a/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
+++ b/java/code/src/com/redhat/rhn/domain/server/NetworkInterface.java
@@ -25,6 +25,7 @@ import org.apache.commons.lang.builder.HashCodeBuilder;
import org.hibernate.Session;
import java.io.Serializable;
+import java.util.ArrayList;
/**
* NetworkInterface
@@ -39,6 +40,7 @@ public class NetworkInterface extends BaseDomainHelper implements
private String hwaddr;
private String module;
private ServerNetAddress4 sa4 = null;
+ private ArrayList<ServerNetAddress6> sa6 = null;
/**
* @return Returns the interfaceid.
@@ -243,4 +245,19 @@ public class NetworkInterface extends BaseDomainHelper implements
getIpaddr().equals("0.0.0.0"));
}
+ /**
+ * Retrieve list of IPv6 addresses
+ * @return List of ServerNetAddress6 objects
+ */
+ public ArrayList<ServerNetAddress6> getIPv6Addresses() {
+ if (sa6 == null) {
+ Session session = HibernateFactory.getSession();
+ sa6 = (ArrayList<ServerNetAddress6>)
+ session.getNamedQuery("ServerNetAddress6.lookup_by_id")
+ .setParameter("interface_id", this.interfaceId).list();
+ }
+
+ return sa6;
+ }
+
}
diff --git a/java/code/src/com/redhat/rhn/domain/server/ServerNetAddress6.hbm.xml
b/java/code/src/com/redhat/rhn/domain/server/ServerNetAddress6.hbm.xml
index 6994782..2ea121f 100644
--- a/java/code/src/com/redhat/rhn/domain/server/ServerNetAddress6.hbm.xml
+++ b/java/code/src/com/redhat/rhn/domain/server/ServerNetAddress6.hbm.xml
@@ -19,7 +19,8 @@ PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<query name="ServerNetAddress6.lookup_by_id">
<![CDATA[from com.redhat.rhn.domain.server.ServerNetAddress6 as sa
- where sa.interfaceId = :interface_id]]>
+ where sa.interfaceId = :interface_id
+ order by scope]]>
</query>
<query name="ServerNetAddress6.lookup_by_scope_and_id">
diff --git
a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
index 9b893ee..3c38684 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/systems/sdc/SystemHardwareAction.java
@@ -21,6 +21,7 @@ import com.redhat.rhn.domain.server.Device;
import com.redhat.rhn.domain.server.NetworkInterface;
import com.redhat.rhn.domain.server.Server;
import com.redhat.rhn.domain.server.ServerFactory;
+import com.redhat.rhn.domain.server.ServerNetAddress6;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.frontend.struts.RequestContext;
import com.redhat.rhn.frontend.struts.RhnAction;
@@ -131,6 +132,7 @@ public class SystemHardwareAction extends RhnAction {
request.setAttribute("network_hostname", server.getDecodedHostname());
request.setAttribute("network_ip_addr", server.getIpAddress());
+ request.setAttribute("network_ip6_addr", server.getIp6Address());
request.setAttribute("network_cnames", server.getDecodedCnames());
List<String> nicList = new ArrayList();
@@ -153,6 +155,22 @@ public class SystemHardwareAction extends RhnAction {
}
request.setAttribute("network_interfaces", nicList2);
+ List nicList3 = new ArrayList();
+ for (String nicName : nicList) {
+ NetworkInterface n = server.getNetworkInterface(nicName);
+ for (ServerNetAddress6 na6 : n.getIPv6Addresses()) {
+ Map nic = new HashMap();
+ nic.put("name", n.getName());
+ nic.put("hwaddr", n.getHwaddr());
+ nic.put("module", n.getModule());
+ nic.put("ip6", na6.getAddress());
+ nic.put("netmask", na6.getNetmask());
+ nic.put("scope", na6.getScope());
+ nicList3.add(nic);
+ }
+ }
+ request.setAttribute("ipv6_network_interfaces", nicList3);
+
List<String> hdd = new ArrayList();
List miscDevices = new ArrayList();
List videoDevices = new ArrayList();
diff --git a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
index 3ff73ba..66c0e54 100644
--- a/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
+++ b/java/code/src/com/redhat/rhn/frontend/strings/jsp/StringResource_en_US.xml
@@ -19678,6 +19678,13 @@ performing a kickstart or creating a new kickstart
distribution.</strong>
</context-group>
</trans-unit>
+ <trans-unit id="sdc.details.hardware.network_ip6_addr">
+ <source>IPv6 Address:</source>
+ <context-group name="ctx">
+ <context
context-type="sourcefile">/systems/details/SystemHardware.do</context>
+ </context-group>
+ </trans-unit>
+
<trans-unit id="sdc.details.notes.message">
<source>The following notes are associated with this
system.</source>
<context-group name="ctx">
diff --git a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
index 248cc4c..65fcfe9 100644
--- a/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
+++ b/java/code/webapp/WEB-INF/pages/systems/sdc/hardware.jsp
@@ -174,6 +174,16 @@
${network_ip_addr}
</td>
</tr>
+
+ <tr>
+ <th>
+ <bean:message key="sdc.details.hardware.network_ip6_addr"/>
+ </th>
+ <td>
+ ${network_ip6_addr}
+ </td>
+ </tr>
+
</table>
<br/>
<table class="list compare-list" width="90%"
cellspacing="0">
@@ -234,6 +244,66 @@
</tr>
</c:forEach>
</table>
+ <br/>
+ <table class="list compare-list" width="90%"
cellspacing="0">
+ <thead>
+ <tr>
+ <th>Interface</th>
+ <th>IPv6 Address</th>
+ <th>Netmask</th>
+ <th>Scope</th>
+ <th>Hardware Address</th>
+ <th>Driver Module</th>
+ </tr>
+ </thead>
+ <c:forEach items="${ipv6_network_interfaces}" var="current"
varStatus="loop">
+ <c:choose>
+ <c:when test ="${loop.count % 2 == 0}">
+ <c:set var ="style_class" value="list-row-even"/>
+ </c:when>
+ <c:otherwise>
+ <c:set var ="style_class" value="list-row-odd"/>
+ </c:otherwise>
+ </c:choose>
+ <tr class="${style_class}">
+ <td>${current.name}</td>
+ <c:choose>
+ <c:when test="${empty current.ip6}">
+ <td><span
class="no-details">(unknown)</span></td>
+ </c:when>
+ <c:otherwise>
+ <td>${current.ip6}</td>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${empty current.netmask}">
+ <td><span
class="no-details">(unknown)</span></td>
+ </c:when>
+ <c:otherwise>
+ <td>${current.netmask}</td>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${empty current.scope}">
+ <td><span
class="no-details">(unknown)</span></td>
+ </c:when>
+ <c:otherwise>
+ <td>${current.scope}</td>
+ </c:otherwise>
+ </c:choose>
+ <c:choose>
+ <c:when test="${empty current.hwaddr}">
+ <td><span
class="no-details">(unknown)</span></td>
+ </c:when>
+ <c:otherwise>
+ <td>${current.hwaddr}</td>
+ </c:otherwise>
+ </c:choose>
+ <td>${current.module}</td>
+ </tr>
+ </c:forEach>
+
+ </table>
<c:if test="${not empty storageDevices}">
<h2><bean:message
key="sdc.details.hardware.storage"/></h2>
Show replies by date