Split HA and NOHA scenarios into 2 tables in reporting
[releng.git] / utils / test / reporting / reporting / functest / template / index-status-tmpl.html
1  <html>
2   <head>
3     <meta charset="utf-8">
4     <!-- Bootstrap core CSS -->
5     <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
6     <link href="../../css/default.css" rel="stylesheet">
7     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
8     <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
9     <script type="text/javascript" src="http://d3js.org/d3.v2.min.js"></script>
10     <script type="text/javascript" src="../../js/gauge.js"></script>
11     <script type="text/javascript" src="../../js/trend.js"></script>
12     <script>
13     function onDocumentReady() {
14         // Gauge management
15         {% for scenario in scenario_stats.iteritems() -%}
16             var gaugeScenario{{loop.index}} = gauge('#gaugeScenario{{loop.index}}');
17         {%- endfor %}
18
19         // assign success rate to the gauge
20         function updateReadings() {
21             {% for scenario,iteration in scenario_stats.iteritems() -%}
22                 gaugeScenario{{loop.index}}.update({{scenario_results[scenario].getScorePercent()}});
23              {%- endfor %}
24         }
25         updateReadings();
26         }
27
28         // trend line management
29         d3.csv("./scenario_history.txt", function(data) {
30        // ***************************************
31        // Create the trend line
32       {% for scenario,iteration in scenario_stats.iteritems() -%}
33        // for scenario {{scenario}}
34        // Filter results
35         var trend{{loop.index}} = data.filter(function(row) {
36              return row["scenario"]=="{{scenario}}" && row["installer"]=="{{installer}}";
37         })
38        // Parse the date
39         trend{{loop.index}}.forEach(function(d) {
40             d.date = parseDate(d.date);
41             d.score = +d.score
42         });
43         // Draw the trend line
44         var mytrend = trend("#trend_svg{{loop.index}}",trend{{loop.index}})
45         // ****************************************
46         {%- endfor %}
47     });
48     if ( !window.isLoaded ) {
49         window.addEventListener("load", function() {
50                         onDocumentReady();
51         }, false);
52     } else {
53         onDocumentReady();
54     }
55 </script>
56 <script type="text/javascript">
57 $(document).ready(function (){
58     $(".btn-more").click(function() {
59         $(this).hide();
60         $(this).parent().find(".panel-default").show();
61     });
62 })
63 </script>
64
65   </head>
66     <body>
67     <div class="container">
68       <div class="masthead">
69         <h3 class="text-muted">Functest status page ({{version}}, {{date}})</h3>
70         <nav>
71           <ul class="nav nav-justified">
72             <li class="active"><a href="../../index.html">Home</a></li>
73             <li><a href="status-apex.html">Apex</a></li>
74             <li><a href="status-compass.html">Compass</a></li>
75             <li><a href="status-daisy.html">Daisy</a></li>
76             <li><a href="status-fuel@x86.html">fuel@x86</a></li>
77             <li><a href="status-fuel@aarch64.html">fuel@aarch64</a></li>
78             <li><a href="status-joid.html">Joid</a></li>
79           </ul>
80         </nav>
81       </div>
82 <div class="row">
83     <div class="col-md-1"></div>
84     <div class="col-md-10">
85         <div class="page-header">
86             <h2>{{installer}}</h2>
87         </div>
88
89         <div class="scenario-overview">
90             <div class="panel-heading"><h4><b>List of last scenarios ({{version}}) run over the last {{period}} days </b></h4></div>
91                 <table class="table">
92                     <tr>
93                         <th width="40%">HA Scenario</th>
94                         <th width="20%">Status</th>
95                         <th width="20%">Trend</th>
96                         <th width="10%">Score</th>
97                         <th width="10%">Iteration</th>
98                     </tr>
99                         {% for scenario,iteration in scenario_stats.iteritems() -%}
100                             <tr class="tr-ok">
101                             {% if '-ha' in scenario -%}
102                                 <td><a href={{scenario_results[scenario].getUrlLastRun()}}>{{scenario}}</a></td>
103                                 <td><div id="gaugeScenario{{loop.index}}"></div></td>
104                                 <td><div id="trend_svg{{loop.index}}"></div></td>
105                                 <td>{{scenario_results[scenario].getScore()}}</td>
106                                 <td>{{iteration}}</td>
107                             {%- endif %}
108                             </tr>
109                             {%- endfor %}
110                             <br>
111                 </table>
112                 <br>
113                <table class="table">
114                     <tr>
115                         <th width="40%">NOHA Scenario</th>
116                         <th width="20%">Status</th>
117                         <th width="20%">Trend</th>
118                         <th width="10%">Score</th>
119                         <th width="10%">Iteration</th>
120                     </tr>
121                         {% for scenario,iteration in scenario_stats.iteritems() -%}
122                             <tr class="tr-ok">
123                             {% if '-noha' in scenario -%}
124                                 <td><a href={{scenario_results[scenario].getUrlLastRun()}}>{{scenario}}</a></td>
125                                 <td><div id="gaugeScenario{{loop.index}}"></div></td>
126                                 <td><div id="trend_svg{{loop.index}}"></div></td>
127                                 <td>{{scenario_results[scenario].getScore()}}</td>
128                                 <td>{{iteration}}</td>
129                             {%- endif %}
130                             </tr>
131                             {%- endfor %}
132                 </table>
133
134         </div>
135
136
137         {% for scenario, iteration in scenario_stats.iteritems() -%}
138         <div class="scenario-part">
139             <div class="page-header">
140                 <h3><span class="glyphicon glyphicon-chevron-right"> <b>{{scenario}}</b></h3>
141             </div>
142                     <div class="panel panel-default">
143                     <div class="panel-heading">
144                         <span class="panel-header-item">
145                         </span>
146                     </div>
147                     <table class="table">
148                         <tr>
149                             {% for test in items[scenario] -%}
150                             <th>
151                             {% if test.getCriteria() > -1 -%}
152                             {{test.getDisplayName() }}
153                             {%- endif %}
154                             {% if test.getTier() > 3 -%}
155                             *
156                             {%- endif %}
157                              </th>
158                             {%- endfor %}
159                         </tr>
160                         <tr class="tr-weather-weather">
161                             {% for test in items[scenario] -%}
162                             {% if test.getCriteria() > 2 -%}
163                                 <td><img src="../../img/weather-clear.png"></td>
164                             {%- elif test.getCriteria() > 1 -%}
165                                 <td><img src="../../img/weather-few-clouds.png"></td>
166                             {%- elif test.getCriteria() > 0 -%}
167                                 <td><img src="../../img/weather-overcast.png"></td>
168                             {%- elif test.getCriteria() > -1 -%}
169                                 <td><img src="../../img/weather-storm.png"></td>
170                             {%- endif %}
171                             {%- endfor %}
172                         </tr>
173                     </table>
174                 </div>
175         </div>
176         {%- endfor %}
177     see <a href="https://wiki.opnfv.org/pages/viewpage.action?pageId=6828617">Functest scoring wiki page</a> for details on scenario scoring
178      <div> <br>
179     <a href="./status-{{installer}}.pdf" class="myButtonPdf">Export to PDF</a>   <a href="./scenario_history_{{installer}}.txt" class="myButtonCSV">Export to CSV</a>
180     </div>
181     </div>
182     <div class="col-md-1"></div>
183 </div>