Subversion Repositories DevTools

Rev

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

Rev 6268 Rev 6548
Line 26... Line 26...
26
<!--#include file="_access_control_general.asp"-->
26
<!--#include file="_access_control_general.asp"-->
27
<!--#include file="_access_control_action_project.asp"-->
27
<!--#include file="_access_control_action_project.asp"-->
28
<% '------------ Scripts -------------------------- %>
28
<% '------------ Scripts -------------------------- %>
29
<%
29
<%
30
'------------ Variable Definition -------------
30
'------------ Variable Definition -------------
31
Dim objSortHelper
-
 
32
Dim rsQry
31
Dim rsQry
33
Dim parRtagId
32
Dim parRtagId
34
Dim query_string
33
Dim query_string
35
Dim rcon_id
34
Dim rcon_id
36
Dim rsQry2
-
 
37
'------------ Constants Declaration -----------
35
'------------ Constants Declaration -----------
38
'------------ Variable Init -------------------
36
'------------ Variable Init -------------------
39
parRtagId = Request("rtag_id")
37
parRtagId = Request("rtag_id")
40
objPMod.PersistInQryString("rtag_id")
38
objPMod.PersistInQryString("rtag_id")
-
 
39
'-------------------------------------------------
-
 
40
' 
-
 
41
Sub ShowDaemonStatus
-
 
42
%>
-
 
43
<table class="embedded_table" style="margin-bottom:20px">
-
 
44
  <tr>
-
 
45
     <td>
-
 
46
        <table width="95%" align="center" class="embedded_table">
-
 
47
           <tr>
-
 
48
              <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
-
 
49
              </td>
-
 
50
              <td  valign="bottom" class="body_rowg">
-
 
51
                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
-
 
52
              </td>
-
 
53
              <td align="right" valign="bottom">
-
 
54
                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
-
 
55
              </td>
-
 
56
           </tr>
-
 
57
        </table>
-
 
58
     </td>
-
 
59
  </tr>
-
 
60
  <tr>
-
 
61
   <td>
-
 
62
   <table class="rounded_box embedded_table">
-
 
63
  <tr>
-
 
64
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
-
 
65
     <td bgcolor="#FFFFFF" valign="top">
-
 
66
        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
 
67
        <!--#include file="messages/_msg_inline.asp"-->
-
 
68
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
 
69
        <br>
-
 
70
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
-
 
71
           <%
-
 
72
           Dim bInactiveMachine : bInactiveMachine = false
-
 
73
           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
-
 
74
           ' Insert a warning into the page if the build daemons are indefintely paused.
-
 
75
           If indefinitelyPaused Then %>
-
 
76
              <tr>
-
 
77
                 <span class='err_alert'>
-
 
78
                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
-
 
79
                 </span>
-
 
80
              </tr>
-
 
81
           <%End If
-
 
82
           %>
-
 
83
           <td width="9%" valign="top"></td>
-
 
84
           <tr>
-
 
85
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
-
 
86
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
-
 
87
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
-
 
88
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
-
 
89
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
-
 
90
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
-
 
91
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
-
 
92
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
-
 
93
           </tr>
-
 
94
           <%
-
 
95
           ' Get the number of release configurations for this RTAG_ID, and iterate through them
-
 
96
           query_string = " select rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') as ACTIVE" &_
-
 
97
                          " from release_config rc, gbe_machtype gm, build_machine_config bm"&_
-
 
98
                          "  where rc.rtag_id = "& parRtagId &_
-
 
99
                          "    and gm.gbe_id = rc.gbe_id"&_
-
 
100
                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
-
 
101
                          "  order by bm.display_name, rc.rcon_id"
-
 
102
 
-
 
103
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
104
 
-
 
105
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
106
              rcon_id = rsQry("rcon_id")
-
 
107
 
-
 
108
              Dim pkgName
-
 
109
              Dim pkgPvid
-
 
110
              Dim pkgBuildTime
-
 
111
              Dim currentRunLevel
-
 
112
              Dim daemonState
-
 
113
              Dim delta
-
 
114
              Dim pkgId
-
 
115
              Dim bActive : bActive = rsQry("active")
-
 
116
              If bActive = "N" Then bInactiveMachine = true
-
 
117
 
-
 
118
              ' For this release configuration, get its entry from the run_level table. This table may not
-
 
119
              ' have an entry so we must handle that outcome too.
-
 
120
              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
-
 
121
                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
-
 
122
                             "   from run_level rl"&_
-
 
123
                             "  where rl.rcon_id = "& rcon_id
-
 
124
 
-
 
125
              Dim rsQry2
-
 
126
              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
127
 
-
 
128
              currentRunLevel = -1
-
 
129
              pkgId = Null
-
 
130
              pkgName = NULL
-
 
131
              pkgPvid = NULL
-
 
132
              pkgBuildTime = NULL
-
 
133
              daemonState = 0
-
 
134
              delta = NULL
-
 
135
 
-
 
136
              If (rsQry2.RecordCount > 0) Then
-
 
137
                ' Get the run level from the run_level table
-
 
138
                currentRunLevel = rsQry2("current_run_level")
-
 
139
                pkgId = rsQry2("current_pkg_id_being_built")
-
 
140
 
-
 
141
                daemonState = rsQry2("pause")
-
 
142
                If IsNull(daemonState) Then daemonState = 0
-
 
143
                If daemonState = "2" Then pkgId = Null
-
 
144
 
-
 
145
                delta = rsQry2("delta")
-
 
146
 
-
 
147
              End If
-
 
148
 
-
 
149
              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
-
 
150
              ' package name from the packages table
-
 
151
              Dim rsQry3
-
 
152
              If NOT IsNull(pkgId) Then
-
 
153
                 query_string = " select pkg_name,rl.current_pv_id, pv.build_time from run_level rl, packages pk, package_versions pv"&_
-
 
154
                                "  where rl.rcon_id = "& rcon_id &_
-
 
155
                                "   and  rl.current_pkg_id_being_built = pk.pkg_id" &_
-
 
156
                                "   and  rl.current_pv_id = pv.pv_id"
-
 
157
 
-
 
158
                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
159
                 If (rsQry3.RecordCount > 0) Then
-
 
160
                    pkgName = rsQry3("pkg_name")
-
 
161
                    pkgPvid = rsQry3("current_pv_id")
-
 
162
                    pkgBuildTime = rsQry3("build_time")
-
 
163
                 End If
-
 
164
                 rsQry3.Close()
-
 
165
                 Set rsQry3 = nothing
-
 
166
              End If
41
 
167
 
-
 
168
              ' --- Now render HTML for this release configuration ---
-
 
169
              %>
-
 
170
              <tr>
-
 
171
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
-
 
172
              </tr>
-
 
173
              <tr>
-
 
174
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
-
 
175
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
-
 
176
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
-
 
177
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
-
 
178
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
-
 
179
                 <td nowrap class="body_rowg"><%=IIF(rsQry("daemon_mode") = "M", pkgBuildTime, "")%></td>
-
 
180
                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
-
 
181
                 <td nowrap class="body_rowg">
-
 
182
                    <%
-
 
183
                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
-
 
184
                       If canActionControlInProject("BuildControl") Then
-
 
185
                          If bActive = "U" Then
-
 
186
                          ElseIf bActive = "N" Then
-
 
187
                             Call Action_Buttons ( "Daemon Unavailable" )
-
 
188
                          ElseIf daemonState = 0 Then
-
 
189
                             Call Action_Buttons ( "Daemon Pause" )
-
 
190
                          ElseIf daemonState = 1 Then
-
 
191
                             Call Action_Buttons ( "Daemon Resume" )
-
 
192
                          ElseIf daemonState = 2 Then
-
 
193
                             Call Action_Buttons ( "Daemon Start" )
-
 
194
                          Else
-
 
195
                             Call Action_Buttons ( "Daemon Resume" )
-
 
196
                          End If
-
 
197
                       Else
-
 
198
                          If bActive = "U" Then
-
 
199
                          ElseIf bActive = "N" Then
-
 
200
                             Call Action_Buttons ( "Daemon Unavailable" )
-
 
201
                          ElseIf daemonState = 0 Then
-
 
202
                             Call Action_Buttons ( "Daemon Pause Disabled" )
-
 
203
                          ElseIf daemonState = 1 Then
-
 
204
                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
205
                          ElseIf daemonState = 2 Then
-
 
206
                             Call Action_Buttons ( "Daemon Start Disabled" )
-
 
207
                          Else
-
 
208
                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
209
                          End If
-
 
210
                       End If
-
 
211
                    Else
-
 
212
                       %>Unavailable<%
-
 
213
                    End If
-
 
214
                    %>
-
 
215
                 </td>
-
 
216
              </tr>
-
 
217
              <%
-
 
218
              rsQry2.Close()
-
 
219
              Set rsQry2 = nothing
-
 
220
              rsQry.MoveNext
-
 
221
           Loop
-
 
222
           %>
-
 
223
           <tr>
-
 
224
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
-
 
225
             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
-
 
226
                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
-
 
227
                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
-
 
228
                </a>
-
 
229
             <%End If%>
-
 
230
             </td>
-
 
231
             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
-
 
232
             <%
-
 
233
               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
-
 
234
                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
-
 
235
                   Call Action_Buttons ( "Daemon Control All" )
-
 
236
                 Else 
-
 
237
                   Call Action_Buttons ( "Daemon Control All Disabled" )
-
 
238
                 End If
-
 
239
               Else
-
 
240
                 %>&nbsp<%
-
 
241
               End If
-
 
242
             %>
-
 
243
             </td>
-
 
244
           </tr>
-
 
245
           <%
-
 
246
             rsQry.Close()
-
 
247
             Set rsQry = nothing
-
 
248
           %>
-
 
249
        </table>
-
 
250
     </td>
-
 
251
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
-
 
252
  </tr>
-
 
253
  <tr>
-
 
254
     <input type="hidden" name="action" value="true">
-
 
255
     <%=objPMod.ComposeHiddenTags()%>
-
 
256
  </tr>
-
 
257
</table>
-
 
258
</td>
-
 
259
</table>
-
 
260
<%
-
 
261
End Sub
-
 
262
'-------------------------------------------------
-
 
263
' 
-
 
264
Sub ShowBuildPlan
-
 
265
%>
-
 
266
<!-- Planned Builds Display -->
-
 
267
<table class="embedded_table" style="margin-bottom:20px">
-
 
268
<%
-
 
269
Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
-
 
270
                                        " FROM release_config rc,  run_level rl " &_
-
 
271
                                        " WHERE rc.rtag_id   = " & parRtagId &_
-
 
272
                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id = rc.rcon_id", ORADYN_DEFAULT )
-
 
273
Dim BuildStart
-
 
274
Dim BuildDelta
-
 
275
Dim BuildPvId
-
 
276
Dim BuildNow
-
 
277
If (rsQry.RecordCount > 0) Then
-
 
278
    BuildStart = rsQry("BuildStart")
-
 
279
    BuildDelta = rsQry("delta")
-
 
280
    BuildPvId  = rsQry("current_pv_id")
-
 
281
    BuildNow  = rsQry("SYSDATE")
-
 
282
End If
-
 
283
rsQry.Close()
-
 
284
Set rsQry = nothing
-
 
285
%>
-
 
286
  <tr>
-
 
287
     <td>
-
 
288
        <table width="95%" class="embedded_table" align="center">
-
 
289
           <tr>
-
 
290
              <td nowrap class="form_ttl">DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%>
-
 
291
              </td>
-
 
292
              <td  valign="bottom" align="right" class="body_rowg nowrap">
-
 
293
                Now: <%=DisplayShortDateTimeSecs(BuildNow)%> AWST
-
 
294
              </td>
-
 
295
           </tr>
-
 
296
        </table>
-
 
297
     </td>
-
 
298
  </tr>
-
 
299
  <tr>
-
 
300
    <td>
-
 
301
        <table  class="rounded_box embedded_table" width="100%">
-
 
302
             <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
-
 
303
             <td bgcolor="#FFFFFF" valign="top">
-
 
304
                <table width="100%" border="0" cellspacing="2" cellpadding="0">
-
 
305
 
-
 
306
                   <tr>
-
 
307
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
-
 
308
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
-
 
309
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
-
 
310
                      <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
-
 
311
                   </tr>
-
 
312
                   <%
-
 
313
                   Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
-
 
314
                   Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
-
 
315
                                                            "  pv.PKG_VERSION, pv.BUILD_TIME," &_
-
 
316
                                                            "  bp.PV_ID" &_
-
 
317
                                                            " FROM build_plan bp," &_
-
 
318
                                                            "  packages p," &_
-
 
319
                                                            "  package_versions pv" &_
-
 
320
                                                            " WHERE bp.PV_ID = pv.pv_id" &_
-
 
321
                                                            " AND RTAG_ID = " & parRtagId &_
-
 
322
                                                            " AND pv.PKG_ID  = p.pkg_id" &_
-
 
323
                                                            " ORDER BY build_order" , ORADYN_DEFAULT )
-
 
324
                   While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
325
                       completionText = ""
-
 
326
                       buildDuration = rsQry("BUILD_TIME")
-
 
327
                       durationDisplay = buildDuration
-
 
328
 
-
 
329
                       ' If the current package build it taking longer than expected , then bump the build times
-
 
330
                       ' and allow another 30 seconds.
-
 
331
                       If BuildPvId = rsQry("PV_ID") Then
-
 
332
                           completionText = "&nbsp;<"
-
 
333
                           durationDisplay = durationDisplay & " ["& BuildDelta &"]"
-
 
334
                           If BuildDelta > buildDuration Then
-
 
335
                                buildDuration = BuildDelta + 30
-
 
336
                                completionText = "&nbsp;+"
-
 
337
                           End If
-
 
338
                       End If
-
 
339
 
-
 
340
                       ' If the duration is not known - guess at 300 sconds
-
 
341
                       durationText = ""
-
 
342
                       If ISNULL(buildDuration)  OR buildDuration = 0 Then
-
 
343
                            buildDuration = 300
-
 
344
                            durationText = "&nbsp;~"
-
 
345
                      End If
-
 
346
 
-
 
347
                      BuildStart = DateAdd("s", buildDuration, BuildStart)
-
 
348
                      %>
-
 
349
                      <tr align="left" valign="top" class="body_txt">
-
 
350
                         <td><%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"), "Y")%></td>
-
 
351
                         <td><%=rsQry("PKG_VERSION")%></td>
-
 
352
                         <td><%=durationDisplay%></td>
-
 
353
                         <td><%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%></td>
-
 
354
                      </tr>
-
 
355
                      <tr>
-
 
356
                         <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
-
 
357
                      </tr>
-
 
358
                      <%
-
 
359
                      ' Allow for 20 seconds of planning between builds
-
 
360
                      BuildStart = DateAdd("s", 20, BuildStart)
-
 
361
                      rsQry.MoveNext()
-
 
362
                   Wend
-
 
363
                   rsQry.Close()
-
 
364
                   Set rsQry = nothing
-
 
365
                   %>
-
 
366
                </table>
-
 
367
            </td>
-
 
368
            <td background="images/lbox_bgside_white.gif">&nbsp;</td>
-
 
369
        </table>
-
 
370
    </td>
-
 
371
  </tr>
-
 
372
</table>
-
 
373
<%
-
 
374
End Sub
42
'----------------------------------------------
375
'-------------------------------------------------
-
 
376
'
43
%>
377
%>
44
<html>
378
<html>
45
   <head>
379
   <head>
46
      <title>Release Manager</title>
380
      <title>Release Manager</title>
47
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
381
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
Line 70... Line 404...
70
                                                                  );
404
                                                                  );
71
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
405
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
72
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
406
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
73
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
407
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
74
                                                                  );
408
                                                                  );
75
                                                                  
-
 
76
      </script>
409
      </script>
77
      <!-- DROPDOWN MENUS -->
410
      <!-- DROPDOWN MENUS -->
78
      <!--#include file="_menu_def.asp"-->
411
      <!--#include file="_menu_def.asp"-->
79
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
412
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
80
   </head>
413
   </head>
81
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
414
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
82
      <!-- HEADER -->
415
      <!-- HEADER -->
83
      <!--#include file="_header.asp"-->
416
      <!--#include file="_header.asp"-->
84
      <!-- BODY ---->
417
      <!-- BODY ---->
85
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
418
      <table class="full_table">
86
         <tr>
419
         <tr>
87
            <td width="146px" class="panel_bg" valign="top"><%Call BuildMenuPane%></td>
420
            <td width="146px" class="panel_bg" valign="top">
-
 
421
                <%Call BuildMenuPane%>
-
 
422
            </td>
88
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
423
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
89
               <table width="10" border="0" cellspacing="0" cellpadding="0">
-
 
90
                  <tr>
-
 
91
                     <td width="1%"></td>
-
 
92
                     <td width="100%">
-
 
93
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
 
94
                           <tr>
-
 
95
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
-
 
96
                                 <p>DAEMON STATUS INFORMATION</p>
-
 
97
                              </td>
-
 
98
                              <td  valign="bottom" class="body_rowg">
-
 
99
                                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
-
 
100
                              </td>
-
 
101
                              <td align="right" valign="bottom">
-
 
102
                                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
-
 
103
                              </td>
-
 
104
                           </tr>
-
 
105
                        </table>
-
 
106
                     </td>
-
 
107
                     <td width="1%"></td>
-
 
108
                  </tr>
-
 
109
                  <tr>
-
 
110
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
-
 
111
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
-
 
112
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
-
 
113
                  </tr>
-
 
114
                  <tr>
-
 
115
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
-
 
116
                     <td bgcolor="#FFFFFF" valign="top">
-
 
117
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
 
118
                        <!--#include file="messages/_msg_inline.asp"-->
-
 
119
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
-
 
120
                        <br>
-
 
121
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
-
 
122
                           <%
-
 
123
                           Dim bInactiveMachine : bInactiveMachine = false
-
 
124
                           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
-
 
125
                           ' Insert a warning into the page if the build daemons are indefintely paused.
-
 
126
                           If indefinitelyPaused Then %>
-
 
127
                              <tr>
-
 
128
                                 <span class='err_alert'>
-
 
129
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
-
 
130
                                 </span>
-
 
131
                              </tr>
-
 
132
                           <%End If
-
 
133
                           %>
-
 
134
                           <td width="9%" valign="top"></td>
-
 
135
                           <tr>
-
 
136
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
-
 
137
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
-
 
138
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
-
 
139
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
-
 
140
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
-
 
141
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
-
 
142
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
-
 
143
                           </tr>
-
 
144
                           <%
-
 
145
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
-
 
146
                           query_string = " select rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') as ACTIVE" &_
-
 
147
                                          " from release_config rc, gbe_machtype gm, build_machine_config bm"&_
-
 
148
                                          "  where rc.rtag_id = "& parRtagId &_
-
 
149
                                          "    and gm.gbe_id = rc.gbe_id"&_
-
 
150
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
-
 
151
                                          "  order by bm.display_name, rc.rcon_id"
-
 
152
 
-
 
153
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
154
 
-
 
155
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
156
                              rcon_id = rsQry("rcon_id")
-
 
157
 
-
 
158
                              Dim pkgName
-
 
159
                              Dim pkgPvid
-
 
160
                              Dim currentRunLevel
-
 
161
                              Dim daemonState
-
 
162
                              Dim delta
-
 
163
                              Dim pkgId
-
 
164
                              Dim bActive : bActive = rsQry("active")
-
 
165
                              If bActive = "N" Then bInactiveMachine = true
-
 
166
 
-
 
167
                              ' For this release configuration, get its entry from the run_level table. This table may not
-
 
168
                              ' have an entry so we must handle that outcome too.
-
 
169
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
-
 
170
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
-
 
171
                                             "   from run_level rl"&_
-
 
172
                                             "  where rl.rcon_id = "& rcon_id
-
 
173
 
-
 
174
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
175
 
-
 
176
                              currentRunLevel = -1
-
 
177
                              pkgId = Null
-
 
178
                              pkgName = NULL
-
 
179
                              pkgPvid = NULL
-
 
180
                              daemonState = 0
424
                <%Call ShowDaemonStatus%>
181
                              delta = NULL
-
 
182
 
-
 
183
                              If (rsQry2.RecordCount > 0) Then
-
 
184
                                ' Get the run level from the run_level table
-
 
185
                                currentRunLevel = rsQry2("current_run_level")
-
 
186
                                pkgId = rsQry2("current_pkg_id_being_built")
-
 
187
 
-
 
188
                                daemonState = rsQry2("pause")
-
 
189
                                If IsNull(daemonState) Then daemonState = 0
-
 
190
                                If daemonState = "2" Then pkgId = Null
-
 
191
 
-
 
192
                                delta = rsQry2("delta")
-
 
193
 
-
 
194
                              End If
-
 
195
 
-
 
196
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
-
 
197
                              ' package name from the packages table
-
 
198
                              Dim rsQry3
-
 
199
                              If NOT IsNull(pkgId) Then
-
 
200
                                 query_string = " select pkg_name,rl.current_pv_id from run_level rl, packages pk"&_
-
 
201
                                                "  where rl.rcon_id = "& rcon_id &_
-
 
202
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
-
 
203
 
-
 
204
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
-
 
205
                                 If (rsQry3.RecordCount > 0) Then
-
 
206
                                    pkgName = rsQry3("pkg_name")
-
 
207
                                    pkgPvid = rsQry3("current_pv_id")
-
 
208
                                 End If
-
 
209
                                 rsQry3.Close()
-
 
210
                                 Set rsQry3 = nothing
-
 
211
                              End If
-
 
212
 
-
 
213
                              ' --- Now render HTML for this release configuration ---
-
 
214
                              %>
-
 
215
                              <tr>
-
 
216
                                 <td colspan="7" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
-
 
217
                              </tr>
-
 
218
                              <tr>
-
 
219
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
-
 
220
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
-
 
221
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
-
 
222
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
-
 
223
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
-
 
224
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
-
 
225
                                 <td nowrap class="body_rowg">
-
 
226
                                    <%
-
 
227
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
-
 
228
                                       If canActionControlInProject("BuildControl") Then
-
 
229
                                          If bActive = "U" Then
-
 
230
                                          ElseIf bActive = "N" Then
-
 
231
                                             Call Action_Buttons ( "Daemon Unavailable" )
-
 
232
                                          ElseIf daemonState = 0 Then
-
 
233
                                             Call Action_Buttons ( "Daemon Pause" )
-
 
234
                                          ElseIf daemonState = 1 Then
-
 
235
                                             Call Action_Buttons ( "Daemon Resume" )
-
 
236
                                          ElseIf daemonState = 2 Then
-
 
237
                                             Call Action_Buttons ( "Daemon Start" )
-
 
238
                                          Else
-
 
239
                                             Call Action_Buttons ( "Daemon Resume" )
-
 
240
                                          End If
-
 
241
                                       Else
-
 
242
                                          If bActive = "U" Then
-
 
243
                                          ElseIf bActive = "N" Then
-
 
244
                                             Call Action_Buttons ( "Daemon Unavailable" )
-
 
245
                                          ElseIf daemonState = 0 Then
-
 
246
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
-
 
247
                                          ElseIf daemonState = 1 Then
-
 
248
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
249
                                          ElseIf daemonState = 2 Then
-
 
250
                                             Call Action_Buttons ( "Daemon Start Disabled" )
-
 
251
                                          Else
-
 
252
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
-
 
253
                                          End If
-
 
254
                                       End If
-
 
255
                                    Else
-
 
256
                                       %>Unavailable<%
-
 
257
                                    End If
-
 
258
                                    %>
-
 
259
                                 </td>
-
 
260
                              </tr>
-
 
261
                              <%
-
 
262
                              rsQry2.Close()
-
 
263
                              Set rsQry2 = nothing
-
 
264
                              rsQry.MoveNext
-
 
265
                           Loop
-
 
266
                           %>
-
 
267
                           <tr>
-
 
268
                             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=6>
-
 
269
                             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
-
 
270
                                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
-
 
271
                                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
-
 
272
                                </a>
-
 
273
                             <%End If%>
-
 
274
                             </td>
-
 
275
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
-
 
276
                             <%
-
 
277
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
-
 
278
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
-
 
279
                                   Call Action_Buttons ( "Daemon Control All" )
-
 
280
                                 Else 
-
 
281
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
-
 
282
                                 End If
-
 
283
                               Else
-
 
284
                                 %>&nbsp<%
-
 
285
                               End If
-
 
286
                             %>
-
 
287
                             </td>
-
 
288
                           </tr>
-
 
289
                           <%
-
 
290
                             rsQry.Close()
-
 
291
                             Set rsQry = nothing
-
 
292
                           %>
-
 
293
                        </table>
-
 
294
                     </td>
-
 
295
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
-
 
296
                  </tr>
-
 
297
                  <tr>
-
 
298
                     <input type="hidden" name="action" value="true">
-
 
299
                     <%=objPMod.ComposeHiddenTags()%>
-
 
300
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
-
 
301
                     <td background="images/lbox_bg_blue.gif"></td>
-
 
302
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
-
 
303
                  </tr>
-
 
304
               </table>
-
 
305
 
-
 
306
               <!-- Planned Builds Display -->
-
 
307
               <%
-
 
308
               Set rsQry = OraDatabase.DbCreateDynaset( "SELECT TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) as delta, rl.LAST_BUILD as BuildStart, rl.current_pv_id, SYSDATE" &_
-
 
309
                                                        " FROM release_config rc,  run_level rl " &_
-
 
310
                                                        " WHERE rc.rtag_id   = " & parRtagId &_
-
 
311
                                                        " AND rc.daemon_mode = 'M' AND rl.rcon_id = rc.rcon_id", ORADYN_DEFAULT )
-
 
312
               Dim BuildStart
425
                <%Call ShowBuildPlan%>
313
               Dim BuildDelta
-
 
314
               Dim BuildPvId
-
 
315
               Dim BuildNow
-
 
316
               If (rsQry.RecordCount > 0) Then
-
 
317
                    BuildStart = rsQry("BuildStart")
-
 
318
                    BuildDelta = rsQry("delta")
-
 
319
                    BuildPvId  = rsQry("current_pv_id")
-
 
320
                    BuildNow  = rsQry("SYSDATE")
-
 
321
               End If
-
 
322
               rsQry.Close()
-
 
323
               Set rsQry = nothing
-
 
324
               %>
-
 
325
               <table width="10" border="0" cellspacing="0" cellpadding="0">
-
 
326
                  <tr>
-
 
327
                     <td width="1%"></td>
-
 
328
                     <td width="100%">
-
 
329
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
-
 
330
                           <tr>
-
 
331
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
-
 
332
                                 <p>DAEMON BUILD PLAN<%=Quick_Help("h_buildplan")%></p>
-
 
333
                              </td>
-
 
334
                              <td  valign="bottom" class="body_rowg">
-
 
335
                                Now: <%=DisplayShortDateTimeSecs(BuildNow)%>
-
 
336
                              </td>
-
 
337
                              <td align="right" valign="bottom"></td>
-
 
338
                           </tr>
-
 
339
                        </table>
-
 
340
                     </td>
-
 
341
                     <td width="1%"></td>
-
 
342
                  </tr>
-
 
343
                  <tr>
-
 
344
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
-
 
345
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
-
 
346
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
-
 
347
                  </tr>
-
 
348
                  <tr>
-
 
349
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
-
 
350
                     <td bgcolor="#FFFFFF" valign="top">
-
 
351
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
-
 
352
                           <tr>
-
 
353
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
-
 
354
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
-
 
355
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Duration<%=Quick_Help("h_buildDuration")%></td>
-
 
356
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Build Completion<%=Quick_Help("h_buildEnd")%></td>
-
 
357
                           </tr>
-
 
358
                           <%
-
 
359
                           Dim PkgVersion, buildDuration, durationDisplay, durationText, completionText
-
 
360
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT p.PKG_NAME," &_
-
 
361
                                                                    "  pv.PKG_VERSION, pv.BUILD_TIME," &_
-
 
362
                                                                    "  bp.PV_ID" &_
-
 
363
                                                                    " FROM build_plan bp," &_
-
 
364
                                                                    "  packages p," &_
-
 
365
                                                                    "  package_versions pv" &_
-
 
366
                                                                    " WHERE bp.PV_ID = pv.pv_id" &_
-
 
367
                                                                    " AND RTAG_ID = " & parRtagId &_
-
 
368
                                                                    " AND pv.PKG_ID  = p.pkg_id" &_
-
 
369
                                                                    " ORDER BY build_order" , ORADYN_DEFAULT )
-
 
370
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
371
                               completionText = ""
-
 
372
                               buildDuration = rsQry("BUILD_TIME")
-
 
373
                               durationDisplay = buildDuration
-
 
374
 
-
 
375
                               ' If the current package build it taking longer than expected , then bump the build times
-
 
376
                               ' and allow another 30 seconds.
-
 
377
                               If BuildPvId = rsQry("PV_ID") Then
-
 
378
                                   completionText = "&nbsp;<"
-
 
379
                                   durationDisplay = durationDisplay & " ["& BuildDelta &"]"
-
 
380
                                   If BuildDelta > buildDuration Then
-
 
381
                                        buildDuration = BuildDelta + 30
-
 
382
                                        completionText = "&nbsp;+"
-
 
383
                                   End If
-
 
384
                               End If
-
 
385
 
-
 
386
                               ' If the duration is not known - guess at 300 sconds
-
 
387
                               durationText = ""
-
 
388
                               If ISNULL(buildDuration)  OR buildDuration = 0 Then
-
 
389
                                    buildDuration = 300
-
 
390
                                    durationText = "&nbsp;~"
-
 
391
                              End If
-
 
392
 
-
 
393
                              BuildStart = DateAdd("s", buildDuration, BuildStart)
-
 
394
                              %>
-
 
395
                              <tr>
-
 
396
 
-
 
397
                                 <td align="left" valign="top" class="body_txt">
-
 
398
                                    <%=Get_Package_Name(rsQry("PKG_NAME"), parRtagId, rsQry("PV_ID"), "Y")%>
-
 
399
                                 </td>
-
 
400
                                 <td align="left" valign="top" class="body_txt">
-
 
401
                                    <%=rsQry("PKG_VERSION")%>
-
 
402
                                 </td>
-
 
403
                                 <td align="left" valign="top" class="body_txt">
-
 
404
                                    <%=durationDisplay%>
-
 
405
                                 </td>
-
 
406
                                 <td align="left" valign="top" class="body_txt">
-
 
407
                                    <%=DisplayShortDateTimeSecs(BuildStart) & durationText  & completionText%>
-
 
408
                                 </td>
-
 
409
                              </tr>
-
 
410
                              <tr>
-
 
411
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
-
 
412
                              </tr>
-
 
413
                              <%
-
 
414
                              ' Allow for 20 seconds of planning between builds
-
 
415
                              BuildStart = DateAdd("s", 20, BuildStart)
-
 
416
                              rsQry.MoveNext()
-
 
417
                           Wend
-
 
418
                           rsQry.Close()
-
 
419
                           Set rsQry = nothing
-
 
420
                           %>
-
 
421
                        </table>
-
 
422
                     </td>
-
 
423
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
-
 
424
                  </tr>
-
 
425
                  <tr>
-
 
426
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
-
 
427
                     <td background="images/lbox_bg_blue.gif"></td>
-
 
428
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
-
 
429
                  </tr>
-
 
430
               </table>
-
 
431
 
-
 
432
            </td>
426
            </td>
433
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
-
 
434
         </tr>
427
         </tr>
435
         <tr>
428
         <tr>
436
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
429
            <td class="panel_bg" valign="bottom" align="center" height="350">
437
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
430
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
438
            </td>
-
 
439
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
-
 
440
            </td>
-
 
441
         </tr>
431
         </tr>
442
      </table>
432
      </table>
443
      <!-- FOOTER -->
433
      <!-- FOOTER -->
444
      <!--#include file="_footer.asp"-->
434
      <!--#include file="_footer.asp"-->
445
   </body>
435
   </body>
446
</html>
436
</html>
-
 
437