Subversion Repositories DevTools

Rev

Rev 6579 | Rev 6582 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6579 Rev 6580
Line 58... Line 58...
58
            pkgTestCount = pkgTestCount + 1
58
            pkgTestCount = pkgTestCount + 1
59
            testCount = testCount + tcount 
59
            testCount = testCount + tcount 
60
        End If
60
        End If
61
 
61
 
62
        Dim vrefStr, prefStr, crefStr
62
        Dim vrefStr, prefStr, crefStr
63
        Dim buildTime, lastBuild
63
        Dim buildId, buildTime, lastBuild, codeLines, isDeployable, viewName
64
 
64
 
-
 
65
        buildId = rsQry("build_id")
65
        crefStr = "unit_test_log.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
66
        crefStr = "unit_test_log.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
66
        prefStr = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")  & "&listby=1"
67
        prefStr = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")  & "&listby=1"
67
        vrefStr = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId
68
        vrefStr = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId
68
        buildTime = rsQry("build_time")
69
        buildTime = rsQry("build_time")
69
        If isNull(buildTime) Then buildTime = ""
70
        If isNull(buildTime) Then buildTime = ""
70
        lastBuild = rsQry("lastBuild")
71
        lastBuild = rsQry("lastBuild")
71
        If isNull(lastBuild) Then lastBuild = ""
72
        If isNull(lastBuild) Then lastBuild = ""
-
 
73
        codeLines = rsQry("code_lines")
-
 
74
        If isNull(codeLines) Then codeLines = ""
-
 
75
        isDeployable = rsQry("is_deployable")
-
 
76
        If isNull(isDeployable) Then isDeployable = "N"
-
 
77
        viewName = rsQry("view_name")
-
 
78
        If IsNull(buildId) Then tcount = ""
72
 
79
 
73
        Response.Write "["
80
        Response.Write "["
74
        Response.Write """<a href=" + prefStr + ">" + rsQry("pkg_name") + "</a>"""
81
        Response.Write """<a href=" + prefStr + ">" + rsQry("pkg_name") + "</a>"""
75
        Response.Write ",""<a href=" + vrefStr + ">" + rsQry("pkg_version") + "</a>"""
82
        Response.Write ",""<a href=" + vrefStr + ">" + rsQry("pkg_version") + "</a>"""
76
        Response.Write ",""<a href=" + crefStr + ">" + rsQry("test_count") + "</a>"""
83
        Response.Write ",""<a href=" + crefStr + ">" & tcount & "</a>"""
-
 
84
        Response.Write ",""" + codeLines + """"
77
        Response.Write ",""" + buildTime + """"
85
        Response.Write ",""" + buildTime + """"
78
        Response.Write ",""" + lastBuild + """"
86
        Response.Write ",""" + lastBuild + """"
-
 
87
        Response.Write ",""" + isDeployable + """"
-
 
88
        Response.Write ",""" + viewName + """"
79
        Response.Write "],"  + vbCRLF
89
        Response.Write "],"  + vbCRLF
80
    rsQry.MoveNext
90
    rsQry.MoveNext
81
    Loop
91
    Loop
82
    Response.Write "]"  + vbCRLF
92
    Response.Write "]"  + vbCRLF
83
    Response.Write "</script>"  + vbCRLF
93
    Response.Write "</script>"  + vbCRLF
Line 89... Line 99...
89
Sub LeftPanelContent
99
Sub LeftPanelContent
90
%>
100
%>
91
<fieldset class="body_rowg fset">
101
<fieldset class="body_rowg fset">
92
    <legend>Display</legend>
102
    <legend>Display</legend>
93
    <input id="noScroll" type="checkbox" name="noScroll" value="1"> No Scroll
103
    <input id="noScroll" type="checkbox" name="noScroll" value="1"> No Scroll
-
 
104
    <br><input id="noGroups" type="checkbox" name="noGroups" value="1"> No Groups
94
    <br><input id="noCots" type="checkbox" name="noCots" value="1"> Ignore Cots
105
    <br><input id="noCots" type="checkbox" name="noCots" value="1"> Ignore Cots
-
 
106
    <br><input id="noDeploy" type="checkbox" name="noDeploy" value="1"> Ignore Deployable
95
</fieldset>
107
</fieldset>
96
<fieldset class="body_rowg fset">
108
<fieldset class="body_rowg fset">
97
    <legend>Export</legend>
109
    <legend>Export</legend>
98
    <input id="btnExport"  name="btn" type="submit" class="form_btn" value="Test Counts as CSV"><%=Quick_Help("h_export")%>
110
    <input id="btnExport"  name="btn" type="submit" class="form_btn" value="Test Counts as CSV"><%=Quick_Help("h_export")%>
99
</fieldset>
111
</fieldset>
Line 122... Line 134...
122
                    <table id="packageStats" width="100%" class="embedded_table">
134
                    <table id="packageStats" width="100%" class="embedded_table">
123
                        <thead class="envGroup">
135
                        <thead class="envGroup">
124
                           <tr class="body_col envGroup">
136
                           <tr class="body_col envGroup">
125
                              <td valign="top" nowrap>Package</td>
137
                              <td valign="top" nowrap>Package</td>
126
                              <td valign="top" nowrap>Version</td>
138
                              <td valign="top" nowrap>Version</td>
127
                              <td valign="top" nowrap>Test&nbsp;Count</td>
139
                              <td valign="top" nowrap>Test<br>Count</td>
-
 
140
                              <td valign="top" nowrap>Code<br>Lines</td>
128
                              <td valign="top" nowrap>Build&nbsp;Duration</td>
141
                              <td valign="top" nowrap>Build<br>Duration</td>
129
                              <td valign="top" nowrap>Build&nbsp;Date</td>
142
                              <td valign="top" nowrap>Build Date</td>
-
 
143
                              <td valign="top" nowrap>Deployable</td>
-
 
144
                              <td valign="top" nowrap>View Name</td>
130
                           </tr>
145
                           </tr>
131
                        </thead>
146
                        </thead>
132
                  </table>
147
                  </table>
133
                  <table width="100%" class="embedded_table">
148
                  <table width="100%" class="embedded_table">
134
                  <tr class="body_col envGroup"><th colspan=4>Summary</th></tr>
149
                  <tr class="body_col envGroup"><th colspan=5>Summary</th></tr>
135
                  <tr class="body_rowg"><td colspan=3>Total Packages</td><td id="pkgCount"></td></tr>
150
                  <tr class="body_rowg"><td colspan=4>Total Packages</td><td id="pkgCount"></td></tr>
136
                  <tr class="body_rowg"><td colspan=3>Total Packages with Tests</td><td id="pkgTestCount"></td></tr>
151
                  <tr class="body_rowg"><td colspan=4>Total Packages with Tests</td><td id="pkgTestCount"></td></tr>
137
                  <tr class="body_rowg"><td colspan=3>Total Unit Tests</td><td id="testCount"></td></tr>
152
                  <tr class="body_rowg"><td colspan=4>Total Unit Tests</td><td id="testCount"></td></tr>
138
                  </table>
153
                  </table>
139
               </div>
154
               </div>
140
            </div>
155
            </div>
141
         </td>
156
         </td>
142
      </tr>
157
      </tr>
Line 165... Line 180...
165
      formTips.tips.h_export       = stdTip(300, 'Export Test Count', 'Unit test counts will be copied to the users clipboard is CSV format.' +
180
      formTips.tips.h_export       = stdTip(300, 'Export Test Count', 'Unit test counts will be copied to the users clipboard is CSV format.' +
166
                                                                  '<p>The data is to be integrated into other reports.' 
181
                                                                  '<p>The data is to be integrated into other reports.' 
167
                                                                  );
182
                                                                  );
168
      </script>
183
      </script>
169
      <%Call GenerateData%>
184
      <%Call GenerateData%>
-
 
185
      <style type="text/css">
-
 
186
          table.dataTable tbody tr.baseGroup{background:#dad7c8;}
-
 
187
          table.dataTable tbody tr.baseGroup td{border-bottom:1pt solid black;;border-top:1pt solid black;}
-
 
188
          table.dataTable tbody tr td.header{color:black;font-weight:bold;}
-
 
189
          table.dataTable tbody tr td.info{color:gray;font-weight:normal;}
-
 
190
      </style>
170
      <script type="text/javascript" charset="utf-8">
191
      <script type="text/javascript" charset="utf-8">
171
        var pkgStats = {};
192
        var pkgStats = {};
172
        var pkgStatsScrollBody;
-
 
173
        var pkgStatsHeight = 0;
-
 
174
        var pkgStatsCurHeight = 0;
-
 
175
 
-
 
176
        $(document).ready(function() {
193
        $(document).ready(function() {
177
 
194
 
178
            // Create a basic DataTable
195
            // Create a basic DataTable
179
            // The populate it
196
            // The populate it
180
            pkgStats.table = $('#packageStats').DataTable( {
197
            pkgStats.table = $('#packageStats').DataTable( {
181
                    dom:            "lfrti",
198
                    dom:            "lfrti",
182
                    scrollY:        "65vh",
199
                    scrollY:        "65vh",
183
                    scrollCollapse: true,
200
                    scrollCollapse: true,
184
                    paging:         false,
201
                    paging:         false,
185
                    language : { info: "Showing _TOTAL_ entries" }
202
                    language : { info: "Showing _TOTAL_ entries" },
-
 
203
                    columnDefs: [
-
 
204
                        { "visible": false, "targets": [6] },
-
 
205
                        { "orderData" : [7,0], targets : 0 },
-
 
206
                        { "orderData" : [7,1], targets : 1 },
-
 
207
                        { "orderData" : [7,2], targets : 2 },
-
 
208
                        { "orderData" : [7,3], targets : 3 },
-
 
209
                        { "orderData" : [7,4], targets : 4 },
-
 
210
                        { "orderData" : [7,5], targets : 5 },
-
 
211
                        { "orderData" : [7,0], targets : 7 },
-
 
212
                    ],
-
 
213
                    order: [[7,'asc']],
-
 
214
                    drawCallback: function ( settings ) {
-
 
215
                        var api = this.api();
-
 
216
 
-
 
217
                        var orderCol = api.order()[0][0];
-
 
218
                        if ( orderCol != 7 ) {
-
 
219
                            $('#noGroups').prop('checked', true);
-
 
220
                            //return;
-
 
221
                        }
-
 
222
                        $('#noGroups').prop('checked', false)
-
 
223
                        var rows = api.rows( { page: 'current' }).nodes();
-
 
224
                        var last=null;
-
 
225
                        api.column(7, {page:'current'} ).data().each( function ( group, i ) {
-
 
226
                            if ( last !== group ) {
-
 
227
                                last = group;
-
 
228
                                var gdata = pkgStats.groupinfo[group];
-
 
229
                                var gtext = new Array();
-
 
230
                                gtext.push('Packages: ' + gdata.total + '.');
-
 
231
                                gtext.push('With Tests: ' + gdata.withTests + '.');
-
 
232
                                gtext.push('Unit Tests: ' + gdata.testCount + '.');
-
 
233
                                $(rows).eq( i ).before(
-
 
234
                                    '<tr class="baseGroup"><td class="header" colspan="2">'+group+ '</td><td class="info" colspan="4">'+gtext.join(' ') + '</td></tr>'
-
 
235
                                );
-
 
236
                            }
-
 
237
                        });
-
 
238
                    }
186
                });
239
                });
-
 
240
            pkgStats.init = pkgStats.table.init();
-
 
241
            pkgStats.noGroup = false;
187
            insertAllData(false);
242
            insertAllData();
188
 
243
 
189
            //
244
            //
190
            //  Filter data and insert into the table
245
            //  Filter data and insert into the table
191
            function insertAllData(filterCots) {
246
            function insertAllData() {
-
 
247
                var noDeploy = $('#noDeploy').get(0).checked; 
-
 
248
                var noCots   = $('#noCots').get(0).checked; 
-
 
249
 
192
                var ii;
250
                var ii;
193
                pkgStats.table.clear();
251
                pkgStats.table.clear();
194
                pkgStats.info = {};
252
                pkgStats.info = {};
-
 
253
                pkgStats.groupinfo = {};
195
                pkgStats.info.total = 0;
254
                pkgStats.info.total = 0;
196
                pkgStats.info.withTests = 0;
255
                pkgStats.info.withTests = 0;
197
                pkgStats.info.testCount = 0;
256
                pkgStats.info.testCount = 0;
198
 
257
 
199
                for (ii = 0; ii < dataSet.length; ii++) {
258
                for (ii = 0; ii < dataSet.length; ii++) {
200
                    var vdata = $(dataSet[ii][1]).text();
-
 
201
                    if( !( filterCots && ( vdata.match(/.cots$/) || vdata.match(/.tool$/))) ){
-
 
202
                        pkgStats.table.row.add( dataSet[ii]);
-
 
203
                        pkgStats.info.total ++;
259
                    if ( noCots ) {
204
                        var count = parseInt($(dataSet[ii][2]).text());
260
                        var vdata = $(dataSet[ii][1]).text();
205
                        if ( !isNaN(count) && count > 0 ) {
261
                        if ( vdata.match(/.cots$/) || vdata.match(/.tool$/) ) {
206
                            pkgStats.info.withTests++;
262
                            continue;
207
                            pkgStats.info.testCount += count;
-
 
208
                        }
263
                        }
209
                    }
264
                    }
-
 
265
 
-
 
266
                    if ( noDeploy ) {
-
 
267
                        var dData = dataSet[ii][6];
-
 
268
                        if ( dData == 'Y' ) {
-
 
269
                            continue;
-
 
270
                        }
-
 
271
                    }
-
 
272
 
-
 
273
                    var group = dataSet[ii][7];
-
 
274
                    var gdata = pkgStats.groupinfo[group];
-
 
275
                    if ( gdata == null ) {
-
 
276
                        pkgStats.groupinfo[group] = {};
-
 
277
                        gdata = pkgStats.groupinfo[group];
-
 
278
                        gdata.total = 0;
-
 
279
                        gdata.withTests = 0;
-
 
280
                        gdata.testCount = 0;
-
 
281
                    }
-
 
282
                    
-
 
283
                    pkgStats.table.row.add( dataSet[ii]);
-
 
284
                    pkgStats.info.total ++;
-
 
285
                    gdata.total++;
-
 
286
                    var count = parseInt($(dataSet[ii][2]).text());
-
 
287
                    if ( !isNaN(count) && count > 0 ) {
-
 
288
                        pkgStats.info.withTests++;
-
 
289
                        gdata.withTests++;
-
 
290
                        pkgStats.info.testCount += count;
-
 
291
                        gdata.testCount += count;
-
 
292
                    }
210
                }
293
                }
211
                pkgStats.table.draw();
294
                pkgStats.table.draw();
212
 
295
 
213
                $('#pkgCount').text(pkgStats.info.total);
296
                $('#pkgCount').text(pkgStats.info.total);
214
                $('#pkgTestCount').text(pkgStats.info.withTests);
297
                $('#pkgTestCount').text(pkgStats.info.withTests);
Line 218... Line 301...
218
            // Enable / disable full table display
301
            // Enable / disable full table display
219
            $('#noScroll').click(function(e){
302
            $('#noScroll').click(function(e){
220
                if ( pkgStats.Height === undefined ) {
303
                if ( pkgStats.Height === undefined ) {
221
                    pkgStats.ScrollBody = $('#packageStats').closest('.dataTables_scrollBody'); 
304
                    pkgStats.ScrollBody = $('#packageStats').closest('.dataTables_scrollBody'); 
222
                    pkgStats.Height = pkgStats.ScrollBody.height();
305
                    pkgStats.Height = pkgStats.ScrollBody.height();
223
                    pkgStats.CurHeight = pkgStatsHeight; 
306
                    pkgStats.CurHeight = pkgStats.Height; 
224
                }
307
                }
225
 
308
 
226
                if ( this.checked  ){
309
                if ( this.checked  ){
227
                    pkgStats.CurHeight = "100%";
310
                    pkgStats.CurHeight = "100%";
228
                } else {
311
                } else {
Line 232... Line 315...
232
                pkgStats.ScrollBody.css('max-height', pkgStats.CurHeight);
315
                pkgStats.ScrollBody.css('max-height', pkgStats.CurHeight);
233
                pkgStats.ScrollBody.css('height', pkgStats.CurHeight);
316
                pkgStats.ScrollBody.css('height', pkgStats.CurHeight);
234
            });
317
            });
235
 
318
 
236
            // Hide / Show the the COTS packages
319
            // Hide / Show the the COTS packages
-
 
320
            // Hide / Show the the Deployed packages
-
 
321
            $('#noCots,#noDeploy').click(function(e){
-
 
322
                insertAllData();
-
 
323
            });
-
 
324
 
-
 
325
            //  Use / Don't use base View groups
-
 
326
 
237
            $('#noCots').click(function(e){
327
            $('#noGroups').click(function(e){
238
                insertAllData(this.checked);
328
                pkgStats.noGroup = this.checked;
-
 
329
                if ( !pkgStats.noGroup ) {
-
 
330
                    pkgStats.table.order([[7,'asc']]);
-
 
331
                } else {
-
 
332
                    pkgStats.table.order([[0,'asc']]);
-
 
333
                }
-
 
334
                pkgStats.table.draw();
239
            });
335
            });
240
 
336
 
-
 
337
            // Copy data to the users clipboard
241
            function copyToClipboard(string) {
338
            function copyToClipboard(string) {
242
                var $temp = $("<input>");
339
                var $temp = $("<input>");
243
                $("body").append($temp);
340
                $("body").append($temp);
244
                $temp.val(string).select();
341
                $temp.val(string).select();
245
                document.execCommand("copy");
342
                document.execCommand("copy");