perfsonar-dev - perfsonar: r4471 - in branches/WebAdmin: . perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary/stitching
Subject: perfsonar development work
List archive
perfsonar: r4471 - in branches/WebAdmin: . perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary/stitching
Chronological Thread
- From:
- To:
- Subject: perfsonar: r4471 - in branches/WebAdmin: . perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary/stitching
- Date: Tue, 9 Sep 2008 13:01:07 -0400
Author: pgerakios
Date: 2008-09-09 13:01:07 -0400 (Tue, 09 Sep 2008)
New Revision: 4471
Added:
branches/WebAdmin/liveclock.js
Modified:
branches/WebAdmin/index.jsp
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
Log:
Modified: branches/WebAdmin/index.jsp
===================================================================
--- branches/WebAdmin/index.jsp 2008-09-09 11:55:27 UTC (rev 4470)
+++ branches/WebAdmin/index.jsp 2008-09-09 17:01:07 UTC (rev 4471)
@@ -6,6 +6,7 @@
<link rel="stylesheet" type="text/css" href="main.css"/>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script src="Service_Admin.js"></script>
+ <script language="javascript" src="liveclock.js"/>
<style type="text/css">
<!--
@@ -50,7 +51,7 @@
-->
</style>
</head>
- <body>
+ <body >
<%
java.text.DateFormat dateFormat = new java.text.SimpleDateFormat("EEE
MMM dd HH:mm:ss zzz yyyy");
java.util.Date now= new java.util.Date();
@@ -78,7 +79,21 @@
</td>
<td>
<table>
- <tr><td
id="date"><%=date.toString()%></td></tr>
+ <tr><td id="date">
+ <script
type="text/javascript">
+ <!--
+ // For Version 4+
browsers, write the appropriate HTML to the
+ // page for
the clock, otherwise, attempt to write a static
+ // date to the page.
+ if (ie4||ns6)
{
+ document.write('<span
id="LiveClockIE" style="width:'+mywidth+'px" ></span>'); }
+ else if (document.layers) { document.write('<ilayer
bgColor="'+myback_color+'" id="ClockPosNS" visibility="hide"><layer
width="'+mywidth+'" id="LiveClockNS"></layer></ilayer>'); }
+ else { old = "true"; show_clock(); }
+ show_clock();
+ //-->
+ </script>
+
+ </td></tr>
<tr><td id="serviceName"><%=serviceName %>
<%=serviceVersion%></td></tr>
</table>
</td>
Added: branches/WebAdmin/liveclock.js
Modified:
branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-09-09 11:55:27 UTC (rev 4470)
+++ branches/WebAdmin/perfSONARWebAdmin/admin/stitching/StitchingServlet.java
2008-09-09 17:01:07 UTC (rev 4471)
@@ -597,7 +597,7 @@
}
newFile = new
File(servicePath
+ "/WEB-INF/classes/perfsonar/conf/"
-
+ fileName + ".xml");
+
+ fileName + ".xml"); //FIXME
PerfsonarProperties properties = new PerfsonarPropertiesImpl();
properties.loadProperties(new FileInputStream(
new File(servicePath
@@ -876,8 +876,14 @@
processIfaces(ifaces), hosts,
hostsInfo, host, hostInfo,
message);
} else
+ {
+ if( hosts == null )
+ System.out.println("STITCHING SERVLET : Warning:
hosts == null. Displaying empty page");
+ else
+ System.out.println("STITCHING SERVLET : Warning:
hosts.empty() == true . Displaying empty page");
output.main_page(filename.substring(filename.lastIndexOf("/") + 1),
null, null, null, null, null,
message);
+ }
}
/**
Modified:
branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
===================================================================
--- branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
2008-09-09 11:55:27 UTC (rev 4470)
+++ branches/WebAdmin/perfSONARWebAdmin/auxiliary/stitching/HTMLOutput.java
2008-09-09 17:01:07 UTC (rev 4471)
@@ -116,17 +116,22 @@
out.println("</tr>");
String hostsMetrics = "";
- if (hostsInfo[2] != null) {
+ if( hostsInfo != null )
+ {
+ if (hostsInfo[2] != null) {
hostsMetrics += hostsInfo[2];
- }
- if (hostsInfo[3] != null) {
+ }
+ if (hostsInfo[3] != null) {
hostsMetrics += ",";
hostsMetrics += hostsInfo[3];
- }
- if (hostsInfo[4] != null) {
+ }
+ if (hostsInfo[4] != null) {
hostsMetrics += ",";
hostsMetrics += hostsInfo[4];
- }
+ }
+ }
+ else hostsMetrics = "NOT AVAILABLE";
+
out.println("<tr>");
out.println("<td colspan=\"2\">");
out.println("<div id=\"file_info\">");
@@ -134,10 +139,10 @@
out
.println("<tr><td id=\"file_info_header\"
colspan=\"2\">Configuration file content: Showing file "
+ file + " </td></tr>");
- out.println("<tr><td>- " + hosts.size()
- + " devices</td><td>- Total of " +
hostsInfo[1]
+ out.println("<tr><td>- " + (hosts != null ? hosts.size() :
"NOT AVAILABLE")
+ + " devices</td><td>- Total of " + (hostsInfo
!= null ? hostsInfo[1] : "NOT AVAILABLE")
+ " data points or counters</td></tr>");
- out.println("<tr><td>- Total of " + hostsInfo[0]
+ out.println("<tr><td>- Total of " + (hostsInfo != null ?
hostsInfo[0] : "NOT AVAILABLE" )
+ " configured interfaces</td><td>- Metrics
configured: "
+ hostsMetrics + "</td></tr>");
out.println("</table>");
@@ -149,41 +154,55 @@
out.println("<td id=\"panel_body_sidebar\">");
out.println("<div id=\"panel_body_sidebar_devices\">");
out.println("<table>");
- Iterator it = hosts.iterator();
- while (it.hasNext()) {
+
+ if( hosts != null )
+ {
+ Iterator it = hosts.iterator();
+ while (it.hasNext()) {
String hostName = (String) it.next();
out.println("<tr>");
out.println("<td><a href=\"?ifaces=true&Host=" +
hostName + "\">"
+ hostName + "</a></td>");
out.println("</tr>");
+ }
}
- String hostMetrics = "";
- if (hostInfo[2] != null) {
+ String hostMetrics = "";
+
+ if( hostInfo != null ){
+ if (hostInfo[2] != null) {
hostMetrics += hostInfo[2];
- }
- if (hostInfo[3] != null) {
+ }
+ if (hostInfo[3] != null) {
hostMetrics += ",";
hostMetrics += hostInfo[3];
- }
- if (hostInfo[4] != null) {
+ }
+ if (hostInfo[4] != null) {
hostMetrics += ",";
hostMetrics += hostInfo[4];
- }
+ }
+ }
+ else hostMetrics = "NOT AVAILABLE";
+
out.println("</table>");
out.println("</div>");
out.println("</td>");
out.println("<td>");
out.println("<div id=\"panel_body_ifaces\" >");
- out.println("<p id=\"host_name\">" + host + "
Interfaces</p>");
+
+ if( host == null )
+ out.println("<p id=\"host_name\"> Unknown </p>");
+ else
+ out.println("<p id=\"host_name\">" + host + "
Interfaces</p>");
+
out.println("<table id=\"ifaces_table\" >");
out.println("<tr class=\"ifaces_header1\" >");
out.println("<td colspan=\"7\">Contains: </td>");
out.println("</tr>");
out.println("<tr>");
- out.println("<td colspan=\"7\">- " + hostInfo[0] + "
Interfaces</td>");
+ out.println("<td colspan=\"7\">- " + (hostInfo != null?
hostInfo[0] : "NOT AVAILABLE") + " Interfaces</td>");
out.println("</tr>");
out.println("<tr>");
- out.println("<td colspan=\"7\">- " + hostInfo[1]
+ out.println("<td colspan=\"7\">- " + (hostInfo != null?
hostInfo[1] : "NOT AVAILABLE")
+ " data points or counters</td>");
out.println("</tr>");
out.println("<tr>");
@@ -194,10 +213,13 @@
out
.println("<td>Name</td><td>Address</td><td>Project</td><td>Util
In</td><td>Util Out</td><td>Errors</td><td>Discards</td> ");
out.println("</tr>");
- it = ifaces.iterator();
boolean change = false;
String cssclass = "lightgrey";
+
+ if( ifaces != null )
+ {
+ Iterator it = ifaces.iterator();
while (it.hasNext()) {
String[] ifaceInfo = (String[]) it.next();
if (change) {
@@ -207,6 +229,7 @@
cssclass = "lightgrey";
change = true;
}
+ if( ifaceInfo == null ) continue;
String utilIn = ifaceInfo[4].equals("true") ? "<td
style=\"text-align:center;\" onmouseover=\"setTip(null,'"
+ ifaceInfo[5]
@@ -231,6 +254,8 @@
+ utilIn + utilOut + errors +
discards);
out.println("</tr>");
}
+ }
+
out.println("</table>");
out.println("</div>");
- perfsonar: r4471 - in branches/WebAdmin: . perfSONARWebAdmin/admin/stitching perfSONARWebAdmin/auxiliary/stitching, svnlog, 09/09/2008
Archive powered by MHonArc 2.6.16.