Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
5670 dpurdie 1
<% @LANGUAGE = VBScript %>
5623 dpurdie 2
<%
3
'=====================================================
4
'
5
'  Build Status and Plan Information
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
<!--#include file="common/daemon_instructions.asp"-->
6048 dpurdie 23
<% '------------ ACCESS CONTROL ------------------ %>
5623 dpurdie 24
<!--#include file="_access_control_login.asp"-->
6070 dpurdie 25
<!--#include file="_access_control_general.asp"-->
6052 dpurdie 26
<!--#include file="_access_control_action_project.asp"-->
5623 dpurdie 27
<% '------------ Scripts -------------------------- %>
28
<%
29
'------------ Variable Definition -------------
30
Dim objSortHelper
31
Dim rsQry
32
Dim parRtagId
33
Dim query_string
34
Dim rcon_id
35
Dim rsQry2
36
'------------ Constants Declaration -----------
37
'------------ Variable Init -------------------
38
parRtagId = Request("rtag_id")
39
objPMod.PersistInQryString("rtag_id")
40
 
41
'----------------------------------------------
42
%>
43
<%
44
'--------------------------------------------------------------------------------------------------------------------------
45
Function PrettyDelta( delta, daemonState,pkgId )
46
    Dim style
47
    style = ""
48
 
49
    If (delta > 600) AND (IsNull(pkgId) OR pkgId = "") Then
50
      style = "style=color:Red"
51
      If (delta > 86400 ) Then
52
        Dim bdate, dd,mm,yy
53
        bdate = DateAdd("s", - delta,Now())
54
        dd = Day(bdate)
55
        mm = MonthName(Month(bdate),1)
56
        yy = Year( bdate)
57
        delta = dd & "-" & mm & "-" & yy
58
        If ( daemonState >= 2 ) Then
59
            style = ""
60
        End If
61
      ElseIf ( delta > 60*60 ) Then
62
        'Dim bdate, hh, mins, ss
63
        bdate = DateAdd("s", - delta,Now())
64
        delta = TimeValue( bdate)
65
        'delta = hh & ":" & mins & ":" & ss
66
      End If
67
    End If
68
 
69
    If style <> "" Then
70
        delta = "<span " & style & ">" & delta & "</span>"
71
    End If
72
    PrettyDelta = delta
73
End Function
74
'--------------------------------------------------------------------------------------------------------------------------
75
Function Get_Daemon_Mode( cMode )
76
 
77
   If cMode = "S" Then
78
      Get_Daemon_Mode = "Slave"
79
   ElseIf cMode = "M" Then
80
      Get_Daemon_Mode = "Master"
81
   End If
82
 
83
End Function
84
'--------------------------------------------------------------------------------------------------------------------------
85
Function Get_Run_Level( nLevel, indefinitePause, astate)
86
 
87
   If indefinitePause Then
88
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
89
   ElseIf astate = 1 Then      ' if build daemon paused
90
      Get_Run_Level = "Paused"
91
   ElseIf astate = 2 Then      ' if build daemon disabled
92
      Get_Run_Level = "Disabled"
93
   ElseIf astate = 0 Then     ' if build daemon enabled
94
      If nLevel = 1 Then
95
         Get_Run_Level = "Cannot Continue"
96
      ElseIf nLevel = 2 Then
97
         Get_Run_Level = "Paused"
98
      ElseIf nLevel = 3 Then
99
         Get_Run_Level = "Building"
100
      ElseIf nLevel = 4 Then
101
         Get_Run_Level = "Idle"
102
      ElseIf nLevel = 5 Then
103
         Get_Run_Level = "Waiting"
104
      ElseIf nLevel = 6 Then
105
         Get_Run_Level = "Publishing"
106
      Else
107
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
108
      End If
109
   End If
110
 
111
End Function
112
 
113
'--------------------------------------------------------------------------------------------------------------------------
114
Function Get_Package_Name( sPackageName,nRtagId,nPkgPvid )
115
 
116
  If IsNull(sPackageName) Then
117
    Get_Package_Name = "None"
118
  ElseIf IsNull(nPkgPvid) or nPkgPvid <= 0 Then
119
    Get_Package_Name = sPackageName
120
  Else
121
    Get_Package_Name = "<a class=""txt_linked"" href=""dependencies.asp?pv_id=" +  nPkgPvid + "&rtag_id=" + nRtagId + """>" + sPackageName + "</a>"
122
  End If
123
 
124
End Function
125
'--------------------------------------------------------------------------------------------------------------------------
126
Function GetLastBuildAge( rtagid)
127
   Dim  query_string, rsQry
128
       query_string = "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta," &_
129
                      "       TO_CHAR(rl.LAST_BUILD, 'DD-Mon-YYYY') as last_build," &_
5670 dpurdie 130
                      "       TO_CHAR(rl.LAST_BUILD, 'HH:MI:SS PM') as last_build_hours," &_
5623 dpurdie 131
                      "       TRUNC (SYSDATE - rl.LAST_BUILD) as last_build_days" &_
132
                      " FROM RELEASE_CONFIG rc, RUN_LEVEL rl, BUILD_MACHINE_CONFIG bm " &_
133
                      " WHERE rc.RTAG_ID =" &rtagid &_
134
                      "   AND rc.bmcon_id is not null" &_
135
                      "   AND rl.RCON_ID = rc.RCON_ID" &_
136
                      "   AND rc.bmcon_id = bm.bmcon_id(+)"
137
 
138
        Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
139
        If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
140
            Dim delta, last_build, last_build_time, last_build_days
141
            If IsNull(rsQry("delta")) Then
142
                delta = 0
143
            Else
144
                delta = CLng(rsQry("delta"))
145
            End If
146
            last_build = rsQry("last_build")
147
            last_build_time = rsQry("last_build_hours")
148
            last_build_days = rsQry("last_build_days")
149
            If delta < (60*60*24) Then
150
                GetLastBuildAge = last_build_time  
151
            Else     
152
                GetLastBuildAge = last_build
153
            End If
154
        End If
155
        rsQry.Close()
156
        Set rsQry = nothing
157
 
158
End Function
159
 
160
'--------------------------------------------------------------------------------------------------------------------------
161
Function GetModifiedSeqNo( rtagid)
162
   Dim  query_string, rsQry
163
       query_string = "SELECT SEQNUM FROM RELEASE_MODIFIED WHERE RTAG_ID = " & rtagid
164
 
165
        Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
166
        If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
167
            GetModifiedSeqNo = rsQry("SEQNUM")
168
        Else
169
            GetModifiedSeqNo = "-"
170
        End If
171
        rsQry.Close()
172
        Set rsQry = nothing
173
 
174
End Function
175
'--------------------------------------------------------------------------------------------------------------------------
176
'------------ RUN BEFORE PAGE RENDER ----------
177
%>
178
<html>
179
   <head>
180
      <title>Release Manager</title>
181
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
182
      <meta http-equiv="Pragma" content="no-cache">
183
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
184
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
185
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
186
      <script language="JavaScript" src="images/common.js"></script>
187
      <!--#include file="_jquery_includes.asp"-->
188
      <!-- TIPS -->
189
      <script type="text/javascript" src="scripts/json2.js"></script>
190
      <script language="JavaScript" src="images/tipster.js"></script>
191
      <script language="JavaScript" src="images/_help_tips.js"></script>
192
      <script language="JavaScript" type="text/JavaScript">
193
      formTips.tips.h_buildplan       = stdTip(300, 'Build Plan', 'The build plan is a guess as to the order in which packages will be built.' +
194
                                                                  '<p>It will be recalculated before each build.' + 
195
                                                                  '<p>The plan includes test builds, new builds and resultant ripples.' 
196
                                                                  );
5670 dpurdie 197
      formTips.tips.h_buildDuration    = stdTip(300, 'Planned Duration', 'The build duration (seconds) of the last build of this package - if known.' +
5635 dpurdie 198
                                                                  '<p>This is used as a guess as to the duration of the planned build.' 
199
                                                                  );
5670 dpurdie 200
      formTips.tips.h_buildEnd         = stdTip(300, 'Planned Completion', 'An educated guess as to the build completion time of the package.' +
201
                                                                  '<p>It is based on the start time of the current build and the durations of each preceeding builds.' + 
202
                                                                  '<p>If the duration of a build is not known then a time of 300 seconds will be assumed.' +
203
                                                                  ' It also assumes 20 seconds to plan the next build.'
204
                                                                  );
5623 dpurdie 205
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
206
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
207
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
208
                                                                  );
209
 
210
      </script>
211
      <!-- DROPDOWN MENUS -->
212
      <!--#include file="_menu_def.asp"-->
213
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
214
   </head>
215
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
216
      <!-- HEADER -->
217
      <!--#include file="_header.asp"-->
218
      <!-- BODY ---->
219
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
220
         <tr>
221
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
222
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
223
               <table width="10" border="0" cellspacing="0" cellpadding="0">
224
                  <tr>
225
                     <td width="1%"></td>
226
                     <td width="100%">
227
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
228
                           <tr>
229
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
230
                                 <p>DAEMON STATUS INFORMATION</p>
231
                              </td>
232
                              <td  valign="bottom" class="body_rowg">
233
                                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
234
                              </td>
235
                              <td align="right" valign="bottom">
236
                                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
237
                              </td>
238
                           </tr>
239
                        </table>
240
                     </td>
241
                     <td width="1%"></td>
242
                  </tr>
243
                  <tr>
244
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
245
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
246
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
247
                  </tr>
248
                  <tr>
249
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
250
                     <td bgcolor="#FFFFFF" valign="top">
251
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
252
                        <!--#include file="messages/_msg_inline.asp"-->
253
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
254
                        <br>
255
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
256
                           <%
257
                           Dim indefinitelyPaused
258
                           indefinitelyPaused = FALSE
259
                           ' Insert a warning into the page if the build daemons are indefintely paused.
260
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
261
 
262
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
263
                           If rsQry.RecordCount > 0 Then
264
                              indefinitelyPaused = TRUE %>
265
                              <tr>
266
                                 <span class='err_alert'>
267
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
268
                                 </span>
269
                              </tr>
270
                           <%End If
271
 
272
                           rsQry.Close()
273
                           Set rsQry = nothing
274
                           %>
275
                           <td width="9%" valign="top"></td>
276
                           <tr>
277
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
278
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
279
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
280
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
281
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
282
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
283
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
284
                           </tr>
285
                           <%
286
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
287
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
288
                                          "  where rc.rtag_id = "& parRtagId &_
289
                                          "    and gm.gbe_id = rc.gbe_id"&_
290
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
291
                                          "  order by bm.display_name, rc.rcon_id"
292
 
293
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
294
 
295
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
296
                              rcon_id = rsQry("rcon_id")
297
 
298
                              Dim pkgName
299
                              Dim pkgPvid
300
                              Dim currentRunLevel
301
                              Dim daemonState
302
                              Dim delta
303
                              Dim pkgId
304
 
305
                              ' For this release configuration, get its entry from the run_level table. This table may not
306
                              ' have an entry so we must handle that outcome too.
307
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
308
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
309
                                             "   from run_level rl"&_
310
                                             "  where rl.rcon_id = "& rcon_id
311
 
312
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
313
 
314
                              currentRunLevel = -1
315
                              pkgId = Null
316
                              pkgName = NULL
317
                              pkgPvid = NULL
318
                              daemonState = 0
319
                              delta = NULL
320
 
321
                              If (rsQry2.RecordCount > 0) Then
322
                                ' Get the run level from the run_level table
323
                                currentRunLevel = rsQry2("current_run_level")
324
                                pkgId = rsQry2("current_pkg_id_being_built")
325
 
326
                                daemonState = rsQry2("pause")
327
                                If IsNull(daemonState) Then daemonState = 0
328
                                If daemonState = "2" Then pkgId = Null
329
 
330
                                delta = rsQry2("delta")
331
                              End If
332
 
333
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
334
                              ' package name from the packages table
335
                              Dim rsQry3
336
                              If NOT IsNull(pkgId) Then
337
                                 query_string = " select pkg_name,rl.current_pv_id from run_level rl, packages pk"&_
338
                                                "  where rl.rcon_id = "& rcon_id &_
339
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
340
 
341
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
342
                                 If (rsQry3.RecordCount > 0) Then
343
                                    pkgName = rsQry3("pkg_name")
344
                                    pkgPvid = rsQry3("current_pv_id")
345
                                 End If
346
                                 rsQry3.Close()
347
                                 Set rsQry3 = nothing
348
                              End If
349
 
350
                              ' --- Now render HTML for this release configuration ---
351
                              %>
352
                              <tr>
353
                                 <td colspan="7" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
354
                              </tr>
355
                              <tr>
356
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
357
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
358
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
359
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
360
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid)%></td>
361
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
362
                                 <td nowrap class="body_rowg">
363
                                    <%
364
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
365
                                       If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
366
                                          If daemonState = 0 Then
367
                                             Call Action_Buttons ( "Daemon Pause" )
368
                                          ElseIf daemonState = 1 Then
369
                                             Call Action_Buttons ( "Daemon Resume" )
370
                                          ElseIf daemonState = 2 Then
371
                                             Call Action_Buttons ( "Daemon Start" )
372
                                          Else
373
                                             Call Action_Buttons ( "Daemon Resume" )
374
                                          End If
375
                                       Else
376
                                          If daemonState = 0 Then
377
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
378
                                          ElseIf daemonState = 1 Then
379
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
380
                                          ElseIf daemonState = 2 Then
381
                                             Call Action_Buttons ( "Daemon Start Disabled" )
382
                                          Else
383
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
384
                                          End If
385
                                       End If
386
                                    Else
387
                                       %>Unavailable<%
388
                                    End If
389
                                    %>
390
                                 </td>
391
                              </tr>
392
                              <%
393
                              rsQry2.Close()
394
                              Set rsQry2 = nothing
395
                              rsQry.MoveNext
396
                           Loop
397
                           %>
398
                           <tr>
399
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
400
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
401
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
402
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
403
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
404
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
405
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
406
                             <%
407
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
408
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
409
                                   Call Action_Buttons ( "Daemon Control All" )
410
                                 Else 
411
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
412
                                 End If
413
                               Else
414
                                 %>&nbsp<%
415
                               End If
416
                             %>
417
                             </td>
418
                           </tr>
419
                           <%
420
                             rsQry.Close()
421
                             Set rsQry = nothing
422
                           %>
423
                        </table>
424
                     </td>
425
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
426
                  </tr>
427
                  <tr>
428
                     <input type="hidden" name="action" value="true">
429
                     <%=objPMod.ComposeHiddenTags()%>
430
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
431
                     <td background="images/lbox_bg_blue.gif"></td>
432
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
433
                  </tr>
434
               </table>
435
 
436
               <!-- Planned Builds Display -->
5670 dpurdie 437
               <%
438
               Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
439
                                                        " FROM release_config rc,  run_level rl " &_
440
                                                        " WHERE rc.rtag_id   = " & parRtagId &_
441
                                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id = rc.rcon_id", ORADYN_DEFAULT )
442
               Dim BuildStart
443
               Dim BuildDelta
444
               Dim BuildPvId
445
               Dim BuildNow
446
               If (rsQry.RecordCount > 0) Then
447
                    BuildStart = rsQry("BuildStart")
448
                    BuildDelta = rsQry("delta")
449
                    BuildPvId  = rsQry("current_pv_id")
450
                    BuildNow  = rsQry("SYSDATE")
451
               End If
452
               rsQry.Close()
453
               Set rsQry = nothing
454
               %>
5623 dpurdie 455
               <table width="10" border="0" cellspacing="0" cellpadding="0">
456
                  <tr>
457
                     <td width="1%"></td>
458
                     <td width="100%">
459
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
460
                           <tr>
461
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
462
                                 <p>DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%></p>
463
                              </td>
5670 dpurdie 464
                              <td  valign="bottom" class="body_rowg">
465
                                Now: <%=DisplayShortDateTimeSecs(BuildNow)%>
466
                              </td>
5623 dpurdie 467
                              <td align="right" valign="bottom"></td>
468
                           </tr>
469
                        </table>
470
                     </td>
471
                     <td width="1%"></td>
472
                  </tr>
473
                  <tr>
474
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
475
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
476
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
477
                  </tr>
478
                  <tr>
479
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
480
                     <td bgcolor="#FFFFFF" valign="top">
481
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
482
                           <tr>
483
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
484
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
5635 dpurdie 485
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
5670 dpurdie 486
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
5623 dpurdie 487
                           </tr>
488
                           <%
5670 dpurdie 489
                           Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
5623 dpurdie 490
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
5635 dpurdie 491
                                                                    "  pv.PKG_VERSION, pv.BUILD_TIME," &_
5623 dpurdie 492
                                                                    "  bp.PV_ID" &_
493
                                                                    " FROM build_plan bp," &_
494
                                                                    "  packages p," &_
495
                                                                    "  package_versions pv" &_
496
                                                                    " WHERE bp.PV_ID = pv.pv_id" &_
497
                                                                    " AND RTAG_ID = " & parRtagId &_
498
                                                                    " AND pv.PKG_ID  = p.pkg_id" &_
499
                                                                    " ORDER BY build_order" , ORADYN_DEFAULT )
500
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
5670 dpurdie 501
                               completionText = ""
502
                               buildDuration = rsQry("BUILD_TIME")
503
                               durationDisplay = buildDuration
504
 
505
                               ' If the current package build it taking longer than expected , then bump the build times
506
                               ' and allow another 30 seconds.
507
                               If BuildPvId = rsQry("PV_ID") Then
508
                                   completionText = "&nbsp;<"
509
                                   durationDisplay = durationDisplay & " ["& BuildDelta &"]"
510
                                   If BuildDelta > buildDuration Then
511
                                        buildDuration = BuildDelta + 30
512
                                        completionText = "&nbsp;+"
513
                                   End If
514
                               End If
515
 
516
                               ' If the duration is not known - guess at 300 sconds
517
                               durationText = ""
518
                               If ISNULL(buildDuration)  OR buildDuration = 0 Then
519
                                    buildDuration = 300
520
                                    durationText = "&nbsp;~"
521
                              End If
522
 
523
                              BuildStart = DateAdd("s", buildDuration, BuildStart)
5623 dpurdie 524
                              %>
525
                              <tr>
526
 
527
                                 <td align="left" valign="top" class="body_txt">
528
                                    <%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"))%>
529
                                 </td>
530
                                 <td align="left" valign="top" class="body_txt">
531
                                    <%=rsQry("PKG_VERSION")%>
532
                                 </td>
5635 dpurdie 533
                                 <td align="left" valign="top" class="body_txt">
5670 dpurdie 534
                                    <%=durationDisplay%>
5635 dpurdie 535
                                 </td>
5670 dpurdie 536
                                 <td align="left" valign="top" class="body_txt">
537
                                    <%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%>
538
                                 </td>
5623 dpurdie 539
                              </tr>
540
                              <tr>
541
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
542
                              </tr>
543
                              <%
5670 dpurdie 544
                              ' Allow for 20 seconds of planning between builds
545
                              BuildStart = DateAdd("s", 20, BuildStart)
5623 dpurdie 546
                              rsQry.MoveNext()
547
                           Wend
548
                           rsQry.Close()
549
                           Set rsQry = nothing
550
                           %>
551
                        </table>
552
                     </td>
553
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
554
                  </tr>
555
                  <tr>
556
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
557
                     <td background="images/lbox_bg_blue.gif"></td>
558
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
559
                  </tr>
560
               </table>
561
 
562
            </td>
563
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
564
         </tr>
565
         <tr>
566
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
567
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
568
            </td>
569
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
570
            </td>
571
         </tr>
572
      </table>
573
      <!-- FOOTER -->
574
      <!--#include file="_footer.asp"-->
575
   </body>
576
</html>