Subversion Repositories DevTools

Rev

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