From: <sf...@us...> - 2008-01-08 10:12:00
|
Revision: 5727 http://smartfrog.svn.sourceforge.net/smartfrog/?rev=5727&view=rev Author: sfrits Date: 2008-01-08 02:11:59 -0800 (Tue, 08 Jan 2008) Log Message: ----------- Report viewing through GUI. Modified Paths: -------------- trunk/core/extras/avalanche/AvalancheGUI/web/log_reader.jsp trunk/core/extras/avalanche/AvalancheGUI/web/log_view.jsp Modified: trunk/core/extras/avalanche/AvalancheGUI/web/log_reader.jsp =================================================================== --- trunk/core/extras/avalanche/AvalancheGUI/web/log_reader.jsp 2008-01-08 10:11:03 UTC (rev 5726) +++ trunk/core/extras/avalanche/AvalancheGUI/web/log_reader.jsp 2008-01-08 10:11:59 UTC (rev 5727) @@ -26,17 +26,21 @@ <% String myURI = request.getRequestURI() + "?" + request.getQueryString(); String errMsg = null; - String filePath = request.getParameter("filePath"); + String fileName = request.getParameter("fileName"); String host = request.getParameter("host"); - String avalancheServer = request.getServerName(); - int avalanchePort = request.getServerPort(); + String reportPath = request.getParameter("reportPath"); // use only if startLine is null; String maxLinesStr = request.getParameter("maxLines"); SFAdapter adapter = new SFAdapter(factory); - adapter.getHostReport(host, filePath, avalancheServer, avalanchePort); +// adapter.getHostReport(host, fileName, reportPath); - File file = new File(filePath); + String homeDir = factory.getAvalancheHome(); + String logsDir = homeDir + File.separator + "logs"; + String filePath = logsDir + File.separator + fileName; + if(reportPath == null) { + File file = new File(filePath+".out"); + if( !file.exists() ){ errMsg = "Error! log file doesn't exist: " + filePath; }else if( !file.canRead() ){ @@ -84,6 +88,12 @@ <br/> <textarea readonly cols="auto" rows="10" style="width:100%;height:100%"><%=buf.toString()%></textarea> - - +<% +}else { + String reportFile = filePath + File.separator + "index.html"; +%> +<h2><a href=<%=reportFile%> TARGET="_blank"> Open Report</a></h2> +<% + } +%> <%@ include file="footer.inc.jsp" %> Modified: trunk/core/extras/avalanche/AvalancheGUI/web/log_view.jsp =================================================================== --- trunk/core/extras/avalanche/AvalancheGUI/web/log_view.jsp 2008-01-08 10:11:03 UTC (rev 5726) +++ trunk/core/extras/avalanche/AvalancheGUI/web/log_view.jsp 2008-01-08 10:11:59 UTC (rev 5727) @@ -112,6 +112,7 @@ if( st.length() > 100 ){ st = st.substring(0,100); } + %> <tr <%=rowClass %>> <td></td> @@ -120,8 +121,17 @@ <% if( null != logFile ){ %> - <td><a href="log_reader.jsp?filePath=<%=moduleStates[j].getLogFile()%>&host=<%=targetHosts[i]%>"><%=moduleStates[j].getState() %></a> + <td><a href="log_reader.jsp?fileName=<%=moduleStates[j].getLogFile()%>&host=<%=targetHosts[i]%>"><%=moduleStates[j].getState() %></a> + <br><br> +<% + if (moduleStates[j].getReportPath() != null){ +%> + <a href="log_reader.jsp?fileName=<%=moduleStates[j].getLogFile()%>&reportPath=<%=moduleStates[j].getReportPath()%>&host=<%=targetHosts[i]%>">View Report</a> +<% + } +%> </td> + <% }else{ %> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |