From 1282c1e523bc9e530f4efbdcf8e8fa6395f53497 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Tue, 17 Dec 2013 19:22:27 +0100 Subject: [PATCH] [FEATURE] Add JSP/CSS/JS needed for stats --- src/main/webapp/index.jsp | 317 +++++++++++++++++--- src/main/webapp/log.jsp | 366 +++++++++++++++++++++++ src/main/webapp/memory.jsp | 31 ++ src/main/webapp/plantuml002.css | 75 +++++ src/main/webapp/pstat.jsp | 286 ++++++++++++++++++ src/main/webapp/simpletabs.css | 16 + src/main/webapp/simpletabs_1.3.packed.js | 9 + 7 files changed, 1057 insertions(+), 43 deletions(-) create mode 100644 src/main/webapp/log.jsp create mode 100644 src/main/webapp/memory.jsp create mode 100644 src/main/webapp/plantuml002.css create mode 100644 src/main/webapp/pstat.jsp create mode 100644 src/main/webapp/simpletabs.css create mode 100644 src/main/webapp/simpletabs_1.3.packed.js diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp index 4d4f716..6a66195 100644 --- a/src/main/webapp/index.jsp +++ b/src/main/webapp/index.jsp @@ -1,19 +1,36 @@ <%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %> - - - - - - - - - - - - - +<% + long date0 = System.currentTimeMillis(); +String token = net.sourceforge.plantuml.pstat.Stats.getInstance().getNewToken(date0); + +String contextRoot = request.getContextPath(); +String host = "http://" + request.getServerName() + ":" + request.getServerPort(); +String encoded = ""; +String umltext = ""; +String imgurl = ""; +String svgurl = ""; +String txturl = ""; +String mapurl = ""; +Object mapNeeded = request.getAttribute("net.sourceforge.plantuml.servlet.mapneeded"); +Object encodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.encoded"); +if (encodedAttribute != null) { + encoded = encodedAttribute.toString(); + if (!encoded.isEmpty()) { + imgurl = host + contextRoot + "/img/" + encoded; + svgurl = host + contextRoot + "/svg/" + encoded; + txturl = host + contextRoot + "/txt/" + encoded; + if (mapNeeded != null) { + mapurl = host + contextRoot + "/map/" + encoded; + } + } +} +Object decodedAttribute = request.getAttribute("net.sourceforge.plantuml.servlet.decoded"); +if (decodedAttribute != null) { + umltext = decodedAttribute.toString(); +} +%> @@ -22,58 +39,272 @@ - - - + + + PlantUMLServer + + +
<%-- CONTENT --%> -
+

- +


You can enter here a previously generated URL: -
+

- +

- -
- View as SVG  - View as ASCII Art  - - View Map Data - -

- - - PlantUML diagram - - - - - - PlantUML diagram - - -

-
+ + <% if ( !imgurl.isEmpty()) { %> +
+ View as SVG  + View as ASCII Art + <% if (mapNeeded != null) { %> + View Map Data + <% } //endif %> + <% if (!encoded.isEmpty()) { %> +

+ +

+ <% } //endif %> + +

+ <% if (mapNeeded != null) { %> + PlantUML diagram + + + + <% } else { %> + PlantUML diagram + <% } %> +

+ <% } //endif %>
+
+ + + + +
+ +
( /  / )
<%-- FOOTER --%> <%@ include file="footer.jspf" %> + + + + + + + + + + diff --git a/src/main/webapp/log.jsp b/src/main/webapp/log.jsp new file mode 100644 index 0000000..f6211a7 --- /dev/null +++ b/src/main/webapp/log.jsp @@ -0,0 +1,366 @@ +<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %> + +<% +String contextRoot = request.getContextPath(); +%> + + + + + + + + + + + + + + PlantUML logs + + +

PlantUML site logs

+

Back to the server home page.

+ + + + + + + + + + + + + +
+
+ + +
+ +
+ +
+ + +
+ +
+ +
+ + +
+ +
+ +
+
+ +
+
+ +
+ +
+
+ +
+ +
+ + +
+<% +if (net.sourceforge.plantuml.pstat.Stats.USE_STATS) { + net.sourceforge.plantuml.pstat.tick.GraphData gd = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphData(); +%> + +
+ + +
+ +

Diagrams per minutes

+ <% gd.hminutes10().getHistogramBuilder().getHistogram(200, 30, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hminutes10().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.minutes10().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bminutes10().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bminutes10().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.minutes10().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.minutes10().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.minutes10().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.minutes10().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.minutes10().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per minutes

+ <% gd.hminutes60().getHistogramBuilder().getHistogram(200, 18, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hminutes60().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.minutes60().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bminutes60().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bminutes60().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.minutes60().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.minutes60().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.minutes60().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.minutes60().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.minutes60().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per hour

+ <% gd.hhours48().getHistogramBuilder().getHistogram(200, 22, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hhours48().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.hours48().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bhours48().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bhours48().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.hours48().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.hours48().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.hours48().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.hours48().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.hours48().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per day

+ <% gd.hdays15().getHistogramBuilder().getHistogram(200, 50, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hdays15().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.days15().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bdays15().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bdays15().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.days15().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.days15().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.days15().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.days15().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.days15().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per month

+ <% + net.sourceforge.plantuml.pstat.tick.GraphDataLongTerm gdl = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphDataLongTerm(); + gdl.getHistogramBuilder().getHistogram(400, 40, 12).printSvg(out); + %> + +
+
+ +<% +} +%> + + + + diff --git a/src/main/webapp/memory.jsp b/src/main/webapp/memory.jsp new file mode 100644 index 0000000..d5f4f0e --- /dev/null +++ b/src/main/webapp/memory.jsp @@ -0,0 +1,31 @@ +<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %> + +<% +String contextRoot = request.getContextPath(); +%> + + + + + + + + + + + + + + PlantUML memory + + + +

Memory

+<% net.sourceforge.plantuml.pstat.Stats.getInstance().memories(200, 12, 12).printSvg(out); %> +


+

Threads

+<% net.sourceforge.plantuml.pstat.Stats.getInstance().threads(200, 12, 12).printSvg(out); %> + + + + diff --git a/src/main/webapp/plantuml002.css b/src/main/webapp/plantuml002.css new file mode 100644 index 0000000..2b065e1 --- /dev/null +++ b/src/main/webapp/plantuml002.css @@ -0,0 +1,75 @@ +/****************************** +* PlantUMLServlet style sheet * +******************************/ + +/* Font */ +* { + font-family: arial,helvetica,sans-serif; +} + +/* Header */ +#header { + margin-left: 170px; + margin-right: 5px; + text-align: center; +} + +/* Content */ +#content { + margin-left: 170px; + margin-right: 5px; +} + +/* Form inputs */ +#content textarea, #content input[type=text] { + background-color: #ffc; + font-family: monospace; + width: 100%; +} + +/* XHTML tag */ +#content code { + font-family: 'courier new',courier,monospace; + letter-spacing: -1pt; +} + +/* Diagram */ +#content #diagram { + text-align: center; +} + +#content #diagram img { + border: medium solid green; + padding: 10px; +} + +/* Footer */ +#footer p { + margin-left: 170px; + background-color: #eee; + color: #666; + font-size: 0.7em; + padding: 2px; + text-align: center; +} + +#loading { + margin-left: 170px; + background-color: #eee; + color: #333; + font-size: 0.7em; + padding: 2px; + text-align: center; +} + +#side2 { + position: fixed !important; + position: absolute; /* IE6 reads this */ + height: 600px; + width: 160px; + bottom: 10px; + left: 5px; + padding-top: 0px; + z-index: 1; +} + diff --git a/src/main/webapp/pstat.jsp b/src/main/webapp/pstat.jsp new file mode 100644 index 0000000..738ad0b --- /dev/null +++ b/src/main/webapp/pstat.jsp @@ -0,0 +1,286 @@ +<%@ page info="index" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %> + +<% +String contextRoot = request.getContextPath(); +%> + + + + + + + + + + + + + + PlantUML logs + + + +<% +if (net.sourceforge.plantuml.pstat.Stats.USE_STATS) { + net.sourceforge.plantuml.pstat.tick.GraphData gd = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphData(); +%> + +
+ + +
+ +

Diagrams per minutes

+ <% gd.hminutes10().getHistogramBuilder().getHistogram(200, 30, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hminutes10().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.minutes10().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bminutes10().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bminutes10().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.minutes10().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.minutes10().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.minutes10().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.minutes10().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.minutes10().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per minutes

+ <% gd.hminutes60().getHistogramBuilder().getHistogram(200, 18, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hminutes60().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.minutes60().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bminutes60().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bminutes60().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.minutes60().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.minutes60().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.minutes60().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.minutes60().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.minutes60().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per hour

+ <% gd.hhours48().getHistogramBuilder().getHistogram(200, 22, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hhours48().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.hours48().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bhours48().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bhours48().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.hours48().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.hours48().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.hours48().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.hours48().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.hours48().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per day

+ <% gd.hdays15().getHistogramBuilder().getHistogram(200, 50, 12).printSvg(out); %> + + + + + + + + + + + + + + + + + +
+

Image Server Generation

+ <% gd.hdays15().getChartImageGeneration(150).printSvg(out); %> +
+

Diagrams generated

+ <% gd.days15().getChartType(150).printSvg(out); %> +
+

Page Load

+ <% gd.bdays15().getChartPageLoad(150).printSvg(out); %> +
+

Image Load

+ <% gd.bdays15().getChartImageLoad(150).printSvg(out); %> +
+

Browser

+ <% gd.days15().getChartBrowser(150).printSvg(out); %> +
+

Operation System

+ <% gd.days15().getChartOperationSystem(150).printSvg(out); %> +
+

Site using image generation

+ <% gd.days15().getChartIncomming(150).printSvg(out); %> +
+ +

Country & Language

+ + + + + +
+ <% gd.days15().getHistoListCountry(400, 20, 12).printSvg(out); %> + + <% gd.days15().getChartLanguage(150).printSvg(out); %> +
+ +
+ +
+ +

Diagrams per month

+ <% + net.sourceforge.plantuml.pstat.tick.GraphDataLongTerm gdl = net.sourceforge.plantuml.pstat.Stats.getInstance().getGraphDataLongTerm(); + gdl.getHistogramBuilder().getHistogram(400, 40, 12).printSvg(out); + %> + +
+
+ +<% +} +%> + + + + diff --git a/src/main/webapp/simpletabs.css b/src/main/webapp/simpletabs.css new file mode 100644 index 0000000..bf8fc7e --- /dev/null +++ b/src/main/webapp/simpletabs.css @@ -0,0 +1,16 @@ +/** + * @version 1.3 + * @package SimpleTabs + * @author Fotis Evangelou - http://nuevvo.com/labs/simpletabs + * @copyright Copyright (c) 2009-2011 Fotis Evangelou / Nuevvo Webware Ltd. All rights reserved. + * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html + */ + +div.simpleTabs { padding:10px; } +ul.simpleTabsNavigation { margin:0 10px; padding:0; text-align:left; } +ul.simpleTabsNavigation li { list-style:none; display:inline; margin:0; padding:0; } +ul.simpleTabsNavigation li a { border:1px solid #E0E0E0; padding:3px 6px; background:#F0F0F0; font-size:14px; text-decoration:none; font-family:Georgia, "Times New Roman", Times, serif; } +ul.simpleTabsNavigation li a:hover { background-color:#F6F6F6; } +ul.simpleTabsNavigation li a.current { background:#fff; color:#222; border-bottom:1px solid #fff; } +div.simpleTabsContent { border:1px solid #E0E0E0; padding:5px 15px 15px; margin-top:3px; display:none; } +div.simpleTabsContent.currentTab { display:block; } diff --git a/src/main/webapp/simpletabs_1.3.packed.js b/src/main/webapp/simpletabs_1.3.packed.js new file mode 100644 index 0000000..9a74363 --- /dev/null +++ b/src/main/webapp/simpletabs_1.3.packed.js @@ -0,0 +1,9 @@ +/** + * @version 1.3 + * @package SimpleTabs + * @author Fotis Evangelou - http://nuevvo.com/labs/simpletabs + * @copyright Copyright (c) 2009-2011 Fotis Evangelou / Nuevvo Webware Ltd. All rights reserved. + * @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html + */ + +eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('3 4={O:"Z",P:"10",9:"11",w:"12",x:"13",r:"14",Q:o(){5(!s.t)y E;5(!s.F)y E;3 b=s.t("G");u(3 i=0;i