Subversion Repositories DevTools

Rev

Rev 5957 | Rev 6052 | 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"-->
25
<!--#include file="_access_control_project.asp"-->
26
<!--#include file="_access_control_general.asp"-->
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
      <!-- MENU LAYERS -------------------------------------->
217
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
218
      <!-- TIPS LAYERS -------------------------------------->
219
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
220
      <!----------------------------------------------------->
221
      <!-- HEADER -->
222
      <!--#include file="_header.asp"-->
223
      <!-- BODY ---->
224
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
225
         <tr>
226
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
227
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
228
               <table width="10" border="0" cellspacing="0" cellpadding="0">
229
                  <tr>
230
                     <td width="1%"></td>
231
                     <td width="100%">
232
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
233
                           <tr>
234
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
235
                                 <p>DAEMON STATUS INFORMATION</p>
236
                              </td>
237
                              <td  valign="bottom" class="body_rowg">
238
                                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
239
                              </td>
240
                              <td align="right" valign="bottom">
241
                                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
242
                              </td>
243
                           </tr>
244
                        </table>
245
                     </td>
246
                     <td width="1%"></td>
247
                  </tr>
248
                  <tr>
249
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
250
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
251
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
252
                  </tr>
253
                  <tr>
254
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
255
                     <td bgcolor="#FFFFFF" valign="top">
256
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
257
                        <!--#include file="messages/_msg_inline.asp"-->
258
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
259
                        <br>
260
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
261
                           <%
262
                           Dim indefinitelyPaused
263
                           indefinitelyPaused = FALSE
264
                           ' Insert a warning into the page if the build daemons are indefintely paused.
265
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
266
 
267
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
268
                           If rsQry.RecordCount > 0 Then
269
                              indefinitelyPaused = TRUE %>
270
                              <tr>
271
                                 <span class='err_alert'>
272
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
273
                                 </span>
274
                              </tr>
275
                           <%End If
276
 
277
                           rsQry.Close()
278
                           Set rsQry = nothing
279
                           %>
280
                           <td width="9%" valign="top"></td>
281
                           <tr>
282
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
283
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
284
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
285
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
286
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
287
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
288
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
289
                           </tr>
290
                           <%
291
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
292
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
293
                                          "  where rc.rtag_id = "& parRtagId &_
294
                                          "    and gm.gbe_id = rc.gbe_id"&_
295
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
296
                                          "  order by bm.display_name, rc.rcon_id"
297
 
298
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
299
 
300
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
301
                              rcon_id = rsQry("rcon_id")
302
 
303
                              Dim pkgName
304
                              Dim pkgPvid
305
                              Dim currentRunLevel
306
                              Dim daemonState
307
                              Dim delta
308
                              Dim pkgId
309
 
310
                              ' For this release configuration, get its entry from the run_level table. This table may not
311
                              ' have an entry so we must handle that outcome too.
312
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
313
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
314
                                             "   from run_level rl"&_
315
                                             "  where rl.rcon_id = "& rcon_id
316
 
317
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
318
 
319
                              currentRunLevel = -1
320
                              pkgId = Null
321
                              pkgName = NULL
322
                              pkgPvid = NULL
323
                              daemonState = 0
324
                              delta = NULL
325
 
326
                              If (rsQry2.RecordCount > 0) Then
327
                                ' Get the run level from the run_level table
328
                                currentRunLevel = rsQry2("current_run_level")
329
                                pkgId = rsQry2("current_pkg_id_being_built")
330
 
331
                                daemonState = rsQry2("pause")
332
                                If IsNull(daemonState) Then daemonState = 0
333
                                If daemonState = "2" Then pkgId = Null
334
 
335
                                delta = rsQry2("delta")
336
                              End If
337
 
338
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
339
                              ' package name from the packages table
340
                              Dim rsQry3
341
                              If NOT IsNull(pkgId) Then
342
                                 query_string = " select pkg_name,rl.current_pv_id from run_level rl, packages pk"&_
343
                                                "  where rl.rcon_id = "& rcon_id &_
344
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
345
 
346
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
347
                                 If (rsQry3.RecordCount > 0) Then
348
                                    pkgName = rsQry3("pkg_name")
349
                                    pkgPvid = rsQry3("current_pv_id")
350
                                 End If
351
                                 rsQry3.Close()
352
                                 Set rsQry3 = nothing
353
                              End If
354
 
355
                              ' --- Now render HTML for this release configuration ---
356
                              %>
357
                              <tr>
358
                                 <td colspan="7" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
359
                              </tr>
360
                              <tr>
361
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
362
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
363
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
364
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
365
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid)%></td>
366
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
367
                                 <td nowrap class="body_rowg">
368
                                    <%
369
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
370
                                       If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
371
                                          If daemonState = 0 Then
372
                                             Call Action_Buttons ( "Daemon Pause" )
373
                                          ElseIf daemonState = 1 Then
374
                                             Call Action_Buttons ( "Daemon Resume" )
375
                                          ElseIf daemonState = 2 Then
376
                                             Call Action_Buttons ( "Daemon Start" )
377
                                          Else
378
                                             Call Action_Buttons ( "Daemon Resume" )
379
                                          End If
380
                                       Else
381
                                          If daemonState = 0 Then
382
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
383
                                          ElseIf daemonState = 1 Then
384
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
385
                                          ElseIf daemonState = 2 Then
386
                                             Call Action_Buttons ( "Daemon Start Disabled" )
387
                                          Else
388
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
389
                                          End If
390
                                       End If
391
                                    Else
392
                                       %>Unavailable<%
393
                                    End If
394
                                    %>
395
                                 </td>
396
                              </tr>
397
                              <%
398
                              rsQry2.Close()
399
                              Set rsQry2 = nothing
400
                              rsQry.MoveNext
401
                           Loop
402
                           %>
403
                           <tr>
404
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
405
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
406
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
407
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
408
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
409
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
410
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
411
                             <%
412
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
413
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
414
                                   Call Action_Buttons ( "Daemon Control All" )
415
                                 Else 
416
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
417
                                 End If
418
                               Else
419
                                 %>&nbsp<%
420
                               End If
421
                             %>
422
                             </td>
423
                           </tr>
424
                           <%
425
                             rsQry.Close()
426
                             Set rsQry = nothing
427
                           %>
428
                        </table>
429
                     </td>
430
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
431
                  </tr>
432
                  <tr>
433
                     <input type="hidden" name="action" value="true">
434
                     <%=objPMod.ComposeHiddenTags()%>
435
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
436
                     <td background="images/lbox_bg_blue.gif"></td>
437
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
438
                  </tr>
439
               </table>
440
 
441
               <!-- Planned Builds Display -->
5670 dpurdie 442
               <%
443
               Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
444
                                                        " FROM release_config rc,  run_level rl " &_
445
                                                        " WHERE rc.rtag_id   = " & parRtagId &_
446
                                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id = rc.rcon_id", ORADYN_DEFAULT )
447
               Dim BuildStart
448
               Dim BuildDelta
449
               Dim BuildPvId
450
               Dim BuildNow
451
               If (rsQry.RecordCount > 0) Then
452
                    BuildStart = rsQry("BuildStart")
453
                    BuildDelta = rsQry("delta")
454
                    BuildPvId  = rsQry("current_pv_id")
455
                    BuildNow  = rsQry("SYSDATE")
456
               End If
457
               rsQry.Close()
458
               Set rsQry = nothing
459
               %>
5623 dpurdie 460
               <table width="10" border="0" cellspacing="0" cellpadding="0">
461
                  <tr>
462
                     <td width="1%"></td>
463
                     <td width="100%">
464
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
465
                           <tr>
466
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
467
                                 <p>DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%></p>
468
                              </td>
5670 dpurdie 469
                              <td  valign="bottom" class="body_rowg">
470
                                Now: <%=DisplayShortDateTimeSecs(BuildNow)%>
471
                              </td>
5623 dpurdie 472
                              <td align="right" valign="bottom"></td>
473
                           </tr>
474
                        </table>
475
                     </td>
476
                     <td width="1%"></td>
477
                  </tr>
478
                  <tr>
479
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
480
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
481
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
482
                  </tr>
483
                  <tr>
484
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
485
                     <td bgcolor="#FFFFFF" valign="top">
486
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
487
                           <tr>
488
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
489
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
5635 dpurdie 490
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
5670 dpurdie 491
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
5623 dpurdie 492
                           </tr>
493
                           <%
5670 dpurdie 494
                           Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
5623 dpurdie 495
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
5635 dpurdie 496
                                                                    "  pv.PKG_VERSION, pv.BUILD_TIME," &_
5623 dpurdie 497
                                                                    "  bp.PV_ID" &_
498
                                                                    " FROM build_plan bp," &_
499
                                                                    "  packages p," &_
500
                                                                    "  package_versions pv" &_
501
                                                                    " WHERE bp.PV_ID = pv.pv_id" &_
502
                                                                    " AND RTAG_ID = " & parRtagId &_
503
                                                                    " AND pv.PKG_ID  = p.pkg_id" &_
504
                                                                    " ORDER BY build_order" , ORADYN_DEFAULT )
505
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
5670 dpurdie 506
                               completionText = ""
507
                               buildDuration = rsQry("BUILD_TIME")
508
                               durationDisplay = buildDuration
509
 
510
                               ' If the current package build it taking longer than expected , then bump the build times
511
                               ' and allow another 30 seconds.
512
                               If BuildPvId = rsQry("PV_ID") Then
513
                                   completionText = "&nbsp;<"
514
                                   durationDisplay = durationDisplay & " ["& BuildDelta &"]"
515
                                   If BuildDelta > buildDuration Then
516
                                        buildDuration = BuildDelta + 30
517
                                        completionText = "&nbsp;+"
518
                                   End If
519
                               End If
520
 
521
                               ' If the duration is not known - guess at 300 sconds
522
                               durationText = ""
523
                               If ISNULL(buildDuration)  OR buildDuration = 0 Then
524
                                    buildDuration = 300
525
                                    durationText = "&nbsp;~"
526
                              End If
527
 
528
                              BuildStart = DateAdd("s", buildDuration, BuildStart)
5623 dpurdie 529
                              %>
530
                              <tr>
531
 
532
                                 <td align="left" valign="top" class="body_txt">
533
                                    <%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"))%>
534
                                 </td>
535
                                 <td align="left" valign="top" class="body_txt">
536
                                    <%=rsQry("PKG_VERSION")%>
537
                                 </td>
5635 dpurdie 538
                                 <td align="left" valign="top" class="body_txt">
5670 dpurdie 539
                                    <%=durationDisplay%>
5635 dpurdie 540
                                 </td>
5670 dpurdie 541
                                 <td align="left" valign="top" class="body_txt">
542
                                    <%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%>
543
                                 </td>
5623 dpurdie 544
                              </tr>
545
                              <tr>
546
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
547
                              </tr>
548
                              <%
5670 dpurdie 549
                              ' Allow for 20 seconds of planning between builds
550
                              BuildStart = DateAdd("s", 20, BuildStart)
5623 dpurdie 551
                              rsQry.MoveNext()
552
                           Wend
553
                           rsQry.Close()
554
                           Set rsQry = nothing
555
                           %>
556
                        </table>
557
                     </td>
558
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
559
                  </tr>
560
                  <tr>
561
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
562
                     <td background="images/lbox_bg_blue.gif"></td>
563
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
564
                  </tr>
565
               </table>
566
 
567
            </td>
568
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
569
         </tr>
570
         <tr>
571
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
572
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
573
            </td>
574
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
575
            </td>
576
         </tr>
577
      </table>
578
      <!-- FOOTER -->
579
      <!--#include file="_footer.asp"-->
580
   </body>
581
</html>