Subversion Repositories DevTools

Rev

Rev 6576 | Rev 6579 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6576 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|          Edit/View Build Configuration            |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0   ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
22
<% '------------ ACCESS CONTROL ------------------ %>
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_action_project.asp"-->
26
<%
27
'------------ Variable Definition -------------
28
Dim parRtagId
29
'------------ Constants Declaration -----------
30
'------------ Variable Init -------------------
31
parRtagId = Request("rtag_id")
32
objPMod.PersistInQryString("rtag_id")
33
'----------------------------------------------
34
%>
35
<%
36
'------------ RUN BEFORE PAGE RENDER ----------
37
'----------------------------------------------------
38
Sub LeftPanelContent
39
%>
6577 dpurdie 40
<fieldset class="body_rowg fset">
41
    <legend>Display</legend>
42
    <input id="noScroll" type="checkbox" name="noScroll" value="1"> No Scroll
43
</fieldset>
44
<fieldset class="body_rowg fset">
45
    <legend>Export</legend>
46
    <input id="btnExport"  name="btn" type="submit" class="form_btn" value="Test Counts as CSV"><%=Quick_Help("h_export")%>
47
</fieldset>
6576 dpurdie 48
<%
49
End Sub
50
 
51
Sub MainPanelContent
52
    Dim pkgCount : pkgCount= 0
53
    Dim pkgTestCount : pkgTestCount= 0
54
    Dim testCount: testCount = 0
55
    Dim rsQry
56
 
57
    OraDatabase.Parameters.Add "RTAG_ID", parRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
58
    Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("release_stats.sql"), 0 )
59
	OraDatabase.Parameters.Remove "RTAG_ID"
60
 
61
%>
62
   <table class="embedded_table" style="margin-bottom:20px">
63
      <tr>
64
         <td>
65
            <!-- Box Title -->
66
            <div class="form_ttl nowrap" align="left">
67
                 Package Unit Tests
68
            </div>
69
         </td>
70
      </tr>
71
      <tr>
72
         <td>
73
            <!-- Box Content -->
74
            <div class="rounded_box">
75
               <div style="background-color: white;border-left: white solid 10px;border-right: white solid 10px;">
76
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
77
                    <!--#include file="messages/_msg_inline.asp"-->
78
                    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
6577 dpurdie 79
                    <table id="packageStats" width="100%" class="embedded_table">
80
                        <thead class="envGroup">
81
                           <tr class="body_col envGroup">
82
                              <td valign="top" nowrap>Package</td>
83
                              <td valign="top" nowrap>Version</td>
84
                              <td valign="top" nowrap>Test&nbsp;Count</td>
85
                              <td valign="top" nowrap>Build&nbsp;Duration</td>
86
                              <td valign="top" nowrap>Build&nbsp;Date</td>
87
                           </tr>
88
                        </thead>
89
                        <tbody>
6576 dpurdie 90
                        <%
91
                        Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
92
                            pkgCount = pkgCount + 1
93
                            Dim tcount : tcount = NiceInt(rsQry("test_count"), 0)
94
                            If tcount > 0 Then
95
                                pkgTestCount = pkgTestCount + 1
96
                                testCount = testCount + tcount 
97
                            End If
98
 
99
                            Dim vrefStr, prefStr, crefStr
100
                            crefStr = "unit_test_log.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
101
                            prefStr = "view_by_version.asp?pkg_id=" & rsQry("pkg_id")  & "&listby=1"
102
                            vrefStr = "dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtagId 
103
                        %>
104
                       <tr>
105
                        <td nowrap class="body_rowg"><a href=<%=prefStr%>><%=rsQry("pkg_name")%></a></td>
106
                        <td nowrap class="body_rowg"><a href=<%=vrefStr%>><%=rsQry("pkg_version")%></a></td>
107
                        <td nowrap class="body_rowg"><a href=<%=crefStr%>><%=rsQry("test_count")%></a></td>
6577 dpurdie 108
                        <td nowrap class="body_rowg"><a href=<%=crefStr%>><%=rsQry("build_time")%></a></td>
6576 dpurdie 109
                        <td nowrap class="body_rowg"><%=rsQry("lastBuild")%></td>
110
                       </tr>
111
                       <%
112
                       rsQry.MoveNext
113
                       Loop
114
                       %>
6577 dpurdie 115
                        <tbody>
116
                        <tfoot>
117
                            <tr class="body_col envGroup"><th colspan=4>Summary</th></tr>
118
                            <tr class="body_rowg"><td colspan=3>Total Packages</td><td><%=pkgCount%></td></tr>
119
                            <tr class="body_rowg"><td colspan=3>Total Packages with Tests</td><td><%=pkgTestCount%></td></tr>
120
                            <tr class="body_rowg"><td colspan=3>Total Unit Tests</td><td><%=testCount%></td></tr>
6576 dpurdie 121
                       </td></tr>
6577 dpurdie 122
                        </tfoot>
6576 dpurdie 123
                  </table>
124
               </div>
125
            </div>
126
         </td>
127
      </tr>
128
   </table>
129
<%
130
    rsQry.close
131
    Set rsQry = nothing
132
End Sub
133
%>
134
<NOSCRIPT LANGUAGE="VBScript" RUNAT=SERVER SRC="common/VarDump.vbs"></NOSCRIPT> 
135
<html>
136
   <head>
137
      <title>Release Manager</title>
138
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
139
      <meta http-equiv="Pragma" content="no-cache">
140
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
141
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
142
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
143
      <script language="JavaScript" src="images/common.js"></script>
144
      <!-- DROPDOWN MENUS -->
6577 dpurdie 145
      <%bJqueryDataTables = TRUE%>
6576 dpurdie 146
      <!--#include file="_jquery_includes.asp"-->
147
      <!--#include file="_menu_def.asp"-->
148
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
6577 dpurdie 149
      <script language="JavaScript" src="images/tipster.js"></script>
150
      <script language="JavaScript" src="images/_help_tips.js"></script>
151
      <script language="JavaScript" type="text/JavaScript">
152
      formTips.tips.h_export       = stdTip(300, 'Export Test Count', 'Unit test counts will be copied to the users clipboard is CSV format.' +
153
                                                                  '<p>The data is to be integrated into other reports.' 
154
                                                                  );
155
      </script>
156
      <script type="text/javascript" charset="utf-8">
157
        var pkgStats = {};
158
        var pkgStatsScrollBody;
159
        var pkgStatsHeight = 0;
160
        var pkgStatsCurHeight = 0;
161
 
162
        $(document).ready(function() {
163
            // Create a basic DataTable
164
 
165
            pkgStats.table = $('#packageStats').DataTable( {
166
                    scrollY:        "65vh",
167
                    scrollCollapse: true,
168
                    paging:         false,
169
                });
170
 
171
            // Enable / disable full table display
172
            $('#noScroll').click(function(e){
173
                if ( pkgStats.Height === undefined ) {
174
                    pkgStats.ScrollBody = $('#packageStats').closest('.dataTables_scrollBody'); 
175
                    pkgStats.Height = pkgStats.ScrollBody.height();
176
                    pkgStats.CurHeight = pkgStatsHeight; 
177
                }
178
 
179
                if ( this.checked  ){
180
                    pkgStats.CurHeight = "100%";
181
                } else {
182
                    pkgStats.CurHeight = pkgStats.Height;
183
                }
184
                pkgStats.ScrollBody.css('max-height', pkgStats.CurHeight);
185
            });
186
 
187
            function copyToClipboard(string) {
188
                var $temp = $("<input>");
189
                $("body").append($temp);
190
                $temp.val(string).select();
191
                document.execCommand("copy");
192
                $temp.remove();
193
            }
194
 
195
            // Export Data
196
            $('#btnExport').click(function(e){
197
                var csv = [];
198
 
199
                //  Insert DateStamp as YYMMDD
200
                var date = new Date();
201
                var tstamp = (date.getFullYear() * 10000) + ((date.getMonth() + 1) * 100) + date.getDate()
202
                csv.push(tstamp);
203
 
204
                //  Insert Release ID
205
                csv.push(<%=DB_RTAG_ID%>);
206
                csv.push("<%=DB_PROJ_NAME%>::<%=DB_RTAG_NAME%>");
207
 
208
                // Generate a CSV representation of the data inthe table
209
                pkgStats.table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
210
                    var data = this.data();
211
                    csv.push($(data[0]).text(), $(data[2]).text());
212
                    });
213
                var csvString = csv.join(",");
214
                //console.log(csvString);
215
                copyToClipboard(csvString);
216
                vixConfirm("Data copied to Clipboard", {
217
                    title: "Notification",
218
                    icon : "images/i_info.png", 
219
                    cancel: false, 
220
                    button: null,
221
                    timeout : 100,
222
                    position : 'center', 
223
                    modal : false,
224
                    minHeight: 10, 
225
                    hide: {
226
                            effect: 'fade',
227
                            duration: 2000
228
                          }
229
                });
230
            });
231
        });
232
      </script>
233
 
6576 dpurdie 234
   </head>
235
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
236
      <!-- HEADER -->
237
      <!--#include file="_header.asp"-->
238
      <!-- BODY ---->
239
      <table class="full_table">
240
         <tr>
241
            <td width="146px" class="panel_bg" valign="top">
242
                <%Call LeftPanelContent%>
243
            </td>
6577 dpurdie 244
            <td width="90%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6576 dpurdie 245
                <%Call MainPanelContent%>
246
            </td>
247
         </tr>
248
         <tr>
249
            <td class="panel_bg" valign="bottom" align="center" height="350">
250
                <img src="images/release_stats.png" vspace="20" hspace="30"></td>
251
         </tr>
252
      </table>
253
      <!-- FOOTER -->
254
      <!--#include file="_footer.asp"-->
255
   </body>
256
</html>
257