root / hci / trunk / eneraptor-web-app / grails-app / views / statistics / makeReport.gsp @ 70
History | View | Annotate | Download (2.4 KB)
1 | 50 | alexbesir | <html> |
---|---|---|---|
2 | |||
3 | <head> |
||
4 | <title>Statistics » Report</title> |
||
5 | <meta name="layout" content="main" /> |
||
6 | <flot:resources /> |
||
7 | </head> |
||
8 | |||
9 | <body> |
||
10 | |||
11 | <erptr:box title="Report info"> |
||
12 | |||
13 | <p>Description: <b>${graph.name}</b></p> |
||
14 | <p>Type: <b>${graph.type}</b> / <b>${graph.timeFrameType}</b></p> |
||
15 | <p>From <b>${graph.timeFrameStart}</b> till <b>${graph.timeFrameEnd}</b></p> |
||
16 | <p>Device ID: <b>${graph.deviceId}</b></p> |
||
17 | |||
18 | </erptr:box> |
||
19 | |||
20 | <erptr:box title="Graph"> |
||
21 | |||
22 | <g:javascript> |
||
23 | var data = [${data}]; |
||
24 | var options = { |
||
25 | lines: { show: true }, |
||
26 | points: { show: true }, |
||
27 | xaxis: { mode: "time", timeformat: "%y/%m/%d %H:%M" } |
||
28 | }; |
||
29 | </g:javascript> |
||
30 | <div class="chart"> |
||
31 | <flot:plot id="placeholder" style="width: 900px; height: 300px; padding:5px;" data="data" options="options" /> |
||
32 | </div> |
||
33 | |||
34 | </erptr:box> |
||
35 | |||
36 | <erptr:box title="Report data"> |
||
37 | |||
38 | <g:if test="${graph.timeFrameType == 'custom'}"> |
||
39 | <table> |
||
40 | <thead> |
||
41 | <tr> |
||
42 | <th><p>From</p></th> |
||
43 | <th><p>Till</p></th> |
||
44 | <th><p>Value (${graph.type})</p></th> |
||
45 | <th><p>Rounded</p></th> |
||
46 | </tr> |
||
47 | </thead> |
||
48 | <tbody> |
||
49 | <g:each in="${detailedData}" var="dent"> |
||
50 | <tr> |
||
51 | <td><p>${dent[0]}</p></td> |
||
52 | <td><p>${dent[1]}</p></td> |
||
53 | <td><p>${dent[2]}</p></td> |
||
54 | <td><p>${((double)dent[2]).round(1)}</p></td> |
||
55 | </tr> |
||
56 | </g:each> |
||
57 | </tbody> |
||
58 | </table> |
||
59 | </g:if> |
||
60 | <g:else> |
||
61 | <table> |
||
62 | <thead> |
||
63 | <tr> |
||
64 | <th><p>Time</p></th> |
||
65 | <th><p>Value (${graph.type})</p></th> |
||
66 | <th><p>Rounded</p></th> |
||
67 | </tr> |
||
68 | </thead> |
||
69 | <tbody> |
||
70 | <g:each in="${detailedData}" var="dent"> |
||
71 | <tr> |
||
72 | <td><p>${dent[0]}</p></td> |
||
73 | <td><p>${dent[1]}</p></td> |
||
74 | <td><p>${((double)dent[1]).round(1)}</p></td> |
||
75 | </tr> |
||
76 | </g:each> |
||
77 | </tbody> |
||
78 | </table> |
||
79 | </g:else> |
||
80 | |||
81 | </erptr:box> |
||
82 | |||
83 | <erptr:box title="Export (save) report"> |
||
84 | |||
85 | <g:form method="GET" name="exportReportForm" action="exportReport" target="_blank"> |
||
86 | |||
87 | <label for="exportType">Export type</label> |
||
88 | <g:select name="exportType" from="['Portable document format (.pdf)','Extensible markub language (.xml)','Comma-separated values (.csv)']" keys="['pdf','xml','csv']"></g:select> |
||
89 | <br /><br /> |
||
90 | |||
91 | <g:hiddenField name="reportId" value="${graph.id}" /> |
||
92 | |||
93 | <g:submitButton name="exportReportSubmit" value="Export" /> |
||
94 | |||
95 | </g:form> |
||
96 | |||
97 | </erptr:box> |
||
98 | |||
99 | </body> |
||
100 | |||
101 | </html> |