Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
5623 dpurdie 4
'
5
'  Build Status Information
6
'
5357 dpurdie 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"-->
6166 dpurdie 23
<!--#include file="common/common_daemon.asp"-->
6048 dpurdie 24
<% '------------ ACCESS CONTROL ------------------ %>
6181 dpurdie 25
<!--#include file="_access_control_login_optional.asp"-->
6070 dpurdie 26
<!--#include file="_access_control_general.asp"-->
6052 dpurdie 27
<!--#include file="_access_control_action_project.asp"-->
5357 dpurdie 28
<% '------------ Scripts -------------------------- %>
29
<%
30
'------------ Variable Definition -------------
31
Dim rsQry
32
Dim parRtagId
33
Dim query_string
34
Dim rcon_id
35
Dim shref_base
36
'------------ Constants Declaration -----------
37
'------------ Variable Init -------------------
38
parRtagId = Request("rtag_id")
39
objPMod.PersistInQryString("rtag_id")
40
'----------------------------------------------
6545 dpurdie 41
Sub IncludePackages()
5357 dpurdie 42
 
43
   On Error Resume Next
44
   objEH.ErrorRedirect = TRUE
45
   OraDatabase.Parameters.Add "PV_ID_LIST",  Request("pv_id_list"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
46
   OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,  ORAPARM_INPUT, ORATYPE_NUMBER
47
   OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
48
 
49
   objEH.TryORA ( OraSession )
6545 dpurdie 50
   OraDatabase.ExecuteSQL "BEGIN  Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
5357 dpurdie 51
   objEH.CatchORA ( OraSession )
52
 
53
   OraDatabase.Parameters.Remove "PV_ID_LIST"
54
   OraDatabase.Parameters.Remove "RTAG_ID"
55
   OraDatabase.Parameters.Remove "USER_ID"
56
 
57
End Sub
58
'--------------------------------------------------------------------------------------------------------------------------
59
'------------ RUN BEFORE PAGE RENDER ----------
60
shref_base = "http://" & archive_server & "/devl/abtlog/"
61
 
62
'----------------------------------------------------
63
' --- RUN onPostBack ---
64
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
65
 
66
  If objEH.Finally Then
67
    If Request("action") = "include" Then
6559 dpurdie 68
      Call IncludePackages ()
5357 dpurdie 69
      ' Redirect to the current page so that a refesh will not
70
      ' cause a form re-submit.
5957 dpurdie 71
      Call Destroy_All_Objects
5357 dpurdie 72
      Response.Redirect(ScriptName & "?rtag_id=" & parRtagId)
73
    Else
74
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
75
    End If
76
  End If
77
 
78
End If
79
 
80
'----------------------------------------------
6546 dpurdie 81
Sub ShowBuildStatus
82
    <!-- FORM START -->
83
    objFormComponent.FormName = "FormName"
84
    objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
85
    Call objFormComponent.FormStart()
86
    %>
87
    <table class="embedded_table" style="margin-bottom:20px">
88
      <tr>
89
         <td>
90
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
91
                <tr>
92
                    <td nowrap class="form_ttl" align="left">BUILD STATUS INFORMATION</td>
93
                </tr>
94
            </table>
95
                <tr>
96
                    <td>
97
                        <table class="rounded_box embedded_table">
98
                            <tr>
6548 dpurdie 99
                                <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10"></td>
6546 dpurdie 100
                                <td bgcolor="#FFFFFF" valign="top">
101
                                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
102
                                <!--#include file="messages/_msg_inline.asp"-->
103
                                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
104
                                <table width="100%" border="0" cellspacing="2" cellpadding="0">
105
                                    <tr>
106
                                        <td colspan=4 class='err_alert'><font size='2'><b>Packages Excluded From Build</b></font></td>
107
                                    </tr>
108
                                    <tr>
109
                                    <td></td>
110
                                    <td  colspan=3 class="body_row">
111
                                       <fieldset class="fset" align="right" style=" border: 1px groove;">
112
                                            Show
113
                                            <input type="checkbox" checked value=0 name="showManual"   id="manualCause"   onClick="toggleDispClass('manualCause',1);">Manual Exclusions
114
                                            <input type="checkbox" checked value=0 name="showCause"    id="rootCause"     onClick="toggleDispClass('rootCause',1);">Config Errors
115
                                            <input type="checkbox" checked value=0 name="showNoEnv"    id="rootNoEnv"     onClick="toggleDispClass('rootNoEnv',1);">Env Errors
116
                                            <input type="checkbox" checked value=0 name="showFile"     id="rootFile"      onClick="toggleDispClass('rootFile',1);">Build Errors
117
                                            <input type="checkbox" checked value=0 name="showIndirect" id="rootIndirect"  onClick="toggleDispClass('rootIndirect',1);">Indirect Exclusions
118
                                       </fieldset>
119
                                       </td>
120
                                    </tr>
121
 
122
                                   <tr>
123
                                      <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
124
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
125
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
126
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause</td>
127
                                   </tr>
128
                                   <tr>
129
               <%
130
               query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description, dnr.root_pv_id"&_
131
                              "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
132
                              "  where dnr.rtag_id = "& parRtagId &_
133
                              "    and pv.pv_id    = dnr.pv_id"&_
134
                              "    and pkg.pkg_id  = pv.pkg_id"&_
135
                              "    and nvl(dnr.root_pv_id, -1) < 0 " &_
136
                              "  order by pkg_name"
137
               Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
138
               '--- Render rows ---
139
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
140
                Dim rowClass
141
                Dim rowData
142
                '
143
                ' Manually excluded packages have no root_cause or root_file or root_pv_id
144
                '
145
                ' root_file, if supplied, indicates a build failure log file exists
146
                ' this should always prevail over the textual root_cause
147
                '
148
                If (IsNull(rsQry("root_file")) AND IsNull(rsQry("root_cause"))) Then
149
                    rowData = "Manually Excluded"
150
                    rowClass = "manualCause"
151
 
152
                ElseIf IsNull(rsQry("root_file")) Then
153
                   rowData = rsQry("root_cause")
154
                   If InStr(rowData, "no build env") Then
155
                       rowClass = "rootNoEnv"
156
                   Else
157
                       rowClass = "rootCause"
158
                   End If
159
 
160
                Else
161
                    rowClass = "rootFile"
162
                    rowData = "<a class=""txt_linked"" title=""" & rsQry("root_file") &_
163
                              " Log file may have expired."" " &_
164
                              "href=""" & shref_base & rsQry("root_file") & """>" &_
165
                              "Build Failure Log File</a>"
166
                End If
167
 
168
                Dim checkBoxData, checkBoxClass
169
                If NiceInt(rsQry("root_pv_id"), -1) = -1   Then
170
                    checkBoxData = ""
171
                    checkBoxClass = "directInclude"
172
                Else
173
                    checkBoxData = "disabled"
174
                    checkBoxClass = ""    
175
                End If
176
 
177
               %>
178
                  <tr class="<%=rowClass%>">
179
                     <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
180
                  </tr>
181
                  <tr class="<%=rowClass%>">
182
                     <td nowrap width="1%">
183
                        <a name="PkgName_<%=rsQry("pkg_name")%>">
184
                        <input class="<%=checkBoxClass%>" type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" <%=checkBoxData%>>
185
                        </a>
186
                     </td>
187
                     <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry("pv_id")%>&rtag_id=<%=rsQry("rtag_id")%>" title="<%=rsQry("pv_description")%>"><%=rsQry("pkg_name")%></a></td>
188
                     <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
189
                     <td nowrap class="body_rowg"><%=rowData%></td>
190
                  </tr>
191
               <%
192
                rsQry.MoveNext
193
               Loop
194
 
195
               query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
196
                              "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
197
                              "  where dnr.rtag_id = "& parRtagId &_
198
                              "    and pv.pv_id    = dnr.pv_id"&_
199
                              "    and pkg.pkg_id  = pv.pkg_id"&_
200
                              "    and qv.pv_id    = dnr.root_pv_id"&_
201
                              "    and qkg.pkg_id  = qv.pkg_id"&_
202
                              "    and nvl(dnr.root_pv_id, -1) > 0"&_
203
                              "  order by pkg.pkg_name"
204
               Dim rsQry2
205
               Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
206
               ' -- DISPLAY INDIRECTLY EXCLUDED PACKAGES
207
               '--- Render rows ---
208
                If rsQry2.recordCount > 0    Then 
209
                %>
210
                  <tr>
211
                  <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
212
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
213
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
214
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause Package</td>
215
                  </tr>
216
               <%
217
                End If
218
               Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
219
                  <tr class="rootIndirect">
220
                     <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
221
                  </tr>
222
                  <tr class="rootIndirect">
223
 
224
                     <td nowrap><input type="checkbox" value=0 disabled=true name="notused"></td>
225
                     <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry2(0)%>&rtag_id=<%=rsQry2(4)%>" title="<%=rsQry2(5)%>"><%=rsQry2(1)%></a></td>
226
                     <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
227
                     <td nowrap class="body_rowg"><a href="#PkgName_<%=rsQry2(3)%>" style="text-decoration: none;">&raquo;&nbsp;<%=rsQry2(3)%></a></td>
228
                  </tr>
229
                  <%
230
                  rsQry2.MoveNext
231
               Loop%>
232
            </table>
233
         </td>
234
         <td background="images/lbox_bgside_white.gif">&nbsp;</td>
235
      </tr>
236
      <tr background="images/bg_action_norm.gif">
237
         <td></td>
238
         <td>
239
         <table class="full_table">
240
             <tr>
241
                 <td><input id="toggleDirect" 
242
                            <%=Iif(rsQry.RecordCount > 0, "", " disabled ")%>
243
                            type="checkbox" title="Toggle all visible directly excluded packages"></td>
244
                 <td align="right">
245
                    <%
246
                    Response.Write(objFormComponent.SubmitButton ( "Include", "name='IncludeSubmit' id='IncludeSubmit' class='form_btn' disabled style='color:silver' onClick=""return vixConfirm('Are you sure you want to include these packages for building?',{title:'Include Packages', post : 'FormName'})""" ))
247
                    Response.Write(objPMod.ComposeHiddenTags())
248
                    %>
249
                 </td>
250
             </tr>
251
         </table>
252
         </td>
253
         <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
254
      </tr>
255
    </table>
256
    </td>
257
    </tr>
258
    </table>
259
    <!-- ACTION BUTTONS ---------------------------------------------->
260
    <input type="hidden" name="action" value="include">
261
    <!-- ACTION BUTTONS END  ------------------------------------------>
262
    <%Call objFormComponent.FormEnd()%>
263
    <!-- FORM END ----------------------------------------------------->
264
    <%
265
    rsQry.Close()
266
    Set rsQry = nothing
267
    rsQry2.Close()
268
    Set rsQry2 = nothing
269
End Sub
270
'-------------------------------------------------
271
' 
272
Sub ShowDaemonStatus
5357 dpurdie 273
%>
6546 dpurdie 274
<table class="embedded_table" style="margin-bottom:20px">
275
  <tr>
276
     <td>
277
        <table width="95%" align="center" class="embedded_table">
278
           <tr>
279
              <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
280
              </td>
281
              <td  valign="bottom" class="body_rowg">
282
                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
283
              </td>
284
              <td align="right" valign="bottom">
285
                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
286
              </td>
287
           </tr>
288
        </table>
289
     </td>
290
  </tr>
291
  <tr>
292
   <td>
293
   <table class="rounded_box embedded_table">
294
  <tr>
295
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
296
     <td bgcolor="#FFFFFF" valign="top">
297
        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
298
        <!--#include file="messages/_msg_inline.asp"-->
299
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
300
        <br>
301
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
302
           <%
303
           Dim bInactiveMachine : bInactiveMachine = false
304
           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
305
           ' Insert a warning into the page if the build daemons are indefintely paused.
306
           If indefinitelyPaused Then %>
307
              <tr>
308
                 <span class='err_alert'>
309
                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
310
                 </span>
311
              </tr>
312
           <%End If
313
           %>
314
           <td width="9%" valign="top"></td>
315
           <tr>
316
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
317
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
318
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
319
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
320
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
321
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
322
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
323
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
324
           </tr>
325
           <%
6566 dpurdie 326
           ' Get Build Information for this Release
327
           query_string = _
328
                "SELECT rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') AS ACTIVE," &_
329
                "       rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) AS delta," &_
330
                "       pk.pkg_name, rl.current_pv_id, pv.build_time, TRUNC (86400*(SYSDATE - rl.LAST_BUILD)) AS build_delta" &_
331
                " FROM release_config rc," &_
332
                "   gbe_machtype gm," &_
333
                "   build_machine_config bm," &_
334
                "   run_level rl," &_
335
                "   packages pk," &_
336
                "   package_versions pv" &_
337
                " WHERE rc.rtag_id     = " & parRtagId &_
338
                "  AND gm.gbe_id        = rc.gbe_id" &_
339
                "  AND rl.rcon_id       = rc.rcon_id" &_
340
                "  AND rc.bmcon_id      =bm.bmcon_id(+)" &_
341
                "  AND pk.pkg_id(+)     = rl.current_pkg_id_being_built" &_
342
                "  AND rl.current_pv_id = pv.pv_id(+)" &_
343
                " ORDER BY bm.display_name, rc.rcon_id"
6546 dpurdie 344
 
345
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
346
 
347
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
348
              Dim pkgName
349
              Dim pkgPvid
350
              Dim pkgBuildTime
351
              Dim currentRunLevel
352
              Dim daemonState
353
              Dim delta
6566 dpurdie 354
              Dim PkgBuildDelta
6546 dpurdie 355
              Dim pkgId
6566 dpurdie 356
              Dim bActive
357
              Dim estDuration
358
              Dim daemonMode 
359
              Dim lastChange
6546 dpurdie 360
 
6566 dpurdie 361
              rcon_id = rsQry("rcon_id")
362
              ' = rsQry("display_name")
363
              ' = rsQry("gbe_value")
364
              daemonMode = rsQry("daemon_mode")
365
              bActive = rsQry("ACTIVE")
366
              daemonState = rsQry("pause")
367
              currentRunLevel = rsQry("current_run_level")
368
              pkgId = rsQry("current_pkg_id_being_built")
369
              delta = rsQry("delta")
370
              pkgName = rsQry("pkg_name")
371
              pkgPvid = rsQry("current_pv_id")
372
              pkgBuildTime = rsQry("build_time")
373
              PkgBuildDelta = rsQry("build_delta")
374
              lastChange = NULL
375
              bInactiveMachine = FALSE
376
              estDuration = NULL
6546 dpurdie 377
 
6566 dpurdie 378
              If bActive = "N" Then bInactiveMachine = true
379
              If IsNull(daemonState) Then daemonState = 0
380
              If daemonState = "2" Then pkgId = Null
381
              If IsNull(currentRunLevel) Then currentRunLevel = -1
382
              If daemonMode = "M" AND not IsNull(pkgName) Then estDuration = pkgBuildTime & "[" & PkgBuildDelta & "]"
383
              If bActive <> "U" Then lastChange = PrettyDelta(delta, daemonState,pkgName )
6546 dpurdie 384
 
385
              ' --- Now render HTML for this release configuration ---
386
              %>
387
              <tr>
388
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
389
              </tr>
390
              <tr>
391
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
392
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
6566 dpurdie 393
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(daemonMode)%></td>
6546 dpurdie 394
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
6610 dpurdie 395
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, daemonState, bActive)%></td>
6566 dpurdie 396
                 <td nowrap class="body_rowg"><%=estDuration%></td>
397
                 <td nowrap class="body_rowg"><%=lastChange%></td>
6546 dpurdie 398
                 <td nowrap class="body_rowg">
399
                    <%
6566 dpurdie 400
                    If NOT indefinitelyPaused  Then
6546 dpurdie 401
                       If canActionControlInProject("BuildControl") Then
402
                          If bActive = "U" Then
403
                          ElseIf bActive = "N" Then
404
                             Call Action_Buttons ( "Daemon Unavailable" )
405
                          ElseIf daemonState = 0 Then
406
                             Call Action_Buttons ( "Daemon Pause" )
407
                          ElseIf daemonState = 1 Then
408
                             Call Action_Buttons ( "Daemon Resume" )
409
                          ElseIf daemonState = 2 Then
410
                             Call Action_Buttons ( "Daemon Start" )
411
                          Else
412
                             Call Action_Buttons ( "Daemon Resume" )
413
                          End If
414
                       Else
415
                          If bActive = "U" Then
416
                          ElseIf bActive = "N" Then
417
                             Call Action_Buttons ( "Daemon Unavailable" )
418
                          ElseIf daemonState = 0 Then
419
                             Call Action_Buttons ( "Daemon Pause Disabled" )
420
                          ElseIf daemonState = 1 Then
421
                             Call Action_Buttons ( "Daemon Resume Disabled" )
422
                          ElseIf daemonState = 2 Then
423
                             Call Action_Buttons ( "Daemon Start Disabled" )
424
                          Else
425
                             Call Action_Buttons ( "Daemon Resume Disabled" )
426
                          End If
427
                       End If
428
                    Else
429
                       %>Unavailable<%
430
                    End If
431
                    %>
432
                 </td>
433
              </tr>
434
              <%
435
              rsQry.MoveNext
436
           Loop
437
           %>
438
           <tr>
439
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
440
             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
441
                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
442
                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
443
                </a>
444
             <%End If%>
445
             </td>
446
             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
447
             <%
448
               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
449
                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
450
                   Call Action_Buttons ( "Daemon Control All" )
451
                 Else 
452
                   Call Action_Buttons ( "Daemon Control All Disabled" )
453
                 End If
454
               Else
455
                 %>&nbsp<%
456
               End If
457
             %>
458
             </td>
459
           </tr>
460
           <%
461
             rsQry.Close()
462
             Set rsQry = nothing
463
           %>
464
        </table>
465
     </td>
466
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
467
  </tr>
468
  <tr>
469
     <input type="hidden" name="action" value="true">
470
     <%=objPMod.ComposeHiddenTags()%>
471
  </tr>
472
</table>
473
</td>
474
</table>
475
<%
476
End Sub
477
'-------------------------------------------------
478
'
479
Sub ShowDaemonInstructions
480
%>
481
<!-- Daemon Instructions Display -->
482
<table class="embedded_table" style="margin-bottom:10px">
483
  <tr>
484
     <td>
485
        <table align="center" width="95%" class="embedded_table">
486
           <tr>
487
              <td nowrap class="form_ttl">DAEMON INSTRUCTIONS FOR THIS RELEASE</td>
488
           </tr>
489
        </table>
490
     </td>
491
  </tr>
492
  <tr>
493
   <td>
494
   <table class="rounded_box embedded_table">
495
  <tr>
496
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
497
     <td bgcolor="#FFFFFF" valign="top">
498
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
499
           <tr>
500
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Operation</td>
501
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
502
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
503
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Scheduled Time<%=Quick_Help("SchedTime")%>
504
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Repeat</td>
505
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">In Progress</td>
506
           </tr>
507
           <%
508
           Dim PkgVersion
509
           Dim UserName
510
           Dim UserEmail
511
           Dim bInProgress
512
           Dim bIsOverdue
513
           Dim bIsReady
514
 
515
           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
516
                                                  "       OP_CODE,"&_
517
                                                  "       RTAG_ID,"&_
518
                                                  "       PV_ID,"&_
519
                                                  "       SCHEDULED_DATETIME,"&_
520
                                                  "       REPEAT_SECS,"&_
521
                                                  "       ADDED_DATETIME,"&_
522
                                                  "       USER_ID,"&_
523
                                                  "       IN_PROGRESS,"&_
524
                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
525
                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
526
                                                  "  FROM DAEMON_INSTRUCTIONS "&_
527
                                                  "  WHERE RTAG_ID = "& parRtagId &_
528
                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
529
           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
530
 
531
              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
532
                 bInProgress = False
533
              Else
534
                 bInProgress = True
535
              End If
536
 
537
              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
538
              If rsQry("OVERDUE") AND NOT bInProgress Then
539
                 bIsOverdue = True
540
              Else
541
                 bIsOverdue = False
542
              End If
543
 
544
              If rsQry("READY") Then
545
                 bIsReady = True
546
              Else
547
                 bIsReady = False
548
              End If
549
 
550
              ' Get as much info about the package as we can
551
              Dim PkgId: PkgId = 0
552
              Dim PkgName : PkgName = "N/A"
553
              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
554
                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
555
              End If
556
              %>
557
              <tr>
558
                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
559
              </tr>
560
              <tr>
561
                 <td align="left" valign="top" class="body_rowg nowrap">
562
                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
563
                 </td>
564
 
565
                 <td align="left" valign="top" class="body_rowg">
566
                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
567
                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
568
                    <%Else%>
569
                       <%=PkgName%>
570
                    <%End If%>
571
                 </td>
572
 
573
                 <td align="left" valign="top" class="body_rowg">
574
                    <%=PkgVersion%>
575
                 </td>
576
 
577
                 <td align="left" valign="top" class="body_rowg" <%If bIsOverdue Then%>style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=DisplayDateTime(rsQry("SCHEDULED_DATETIME"))%></td>
578
 
579
                 <td align="left" valign="top" class="body_rowg"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
580
 
581
                 <td align="left" valign="top" class="body_rowg">
582
                    <%If bInProgress Then%>
583
                       YES
584
                    <%Else%>
585
                       NO
586
                    <%End If%>
587
                 </td>
588
              </tr>
589
              <%
590
              rsQry.MoveNext()
591
           Wend
592
           rsQry.Close()
593
           Set rsQry = nothing
594
           %>
595
        </table>
596
     </td>
597
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
598
  </td>
599
  </tr>
600
  </table>
601
  </td>
602
   </tr>
603
</table>
604
<%
605
End Sub
606
%>
5357 dpurdie 607
<html>
608
   <head>
609
      <title>Release Manager</title>
610
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
611
      <meta http-equiv="Pragma" content="no-cache">
612
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 613
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
614
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
615
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 616
      <!--#include file="_jquery_includes.asp"-->
617
      <!-- TIPS -->
6676 dpurdie 618
      <script type="text/javascript" src="scripts/json2.js?ver=<%=VixVerNum%>"></script>
6579 dpurdie 619
      <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
620
      <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 621
      <script language="JavaScript" type="text/JavaScript">
6538 dpurdie 622
      formTips.tips.h_buildtime       = stdTip(300, 'Est. Build Duration', 'Estimated build duration in seconds. Based simply on the last build duration for this package');
623
 
5623 dpurdie 624
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
625
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
626
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
627
                                                                  );
5357 dpurdie 628
      </script>
6544 dpurdie 629
    <script language="JavaScript" type="text/JavaScript">
630
    $(document).ready(function() {
6545 dpurdie 631
        //
632
        //  Init the check boxes
633
        InitShow();
6546 dpurdie 634
        isChecked('pv_id_list','IncludeSubmit');
6545 dpurdie 635
 
6610 dpurdie 636
<% If objAccessControl.UserLogedIn Then %>
6544 dpurdie 637
        // Attach function to toggle checkbox
638
        // toggle all visible checkboxes
639
         $('#toggleDirect').click(function(){
640
            var state = this.checked;
6545 dpurdie 641
            var list = $('.directInclude:visible:enabled');
6544 dpurdie 642
            list.prop('checked', state);
643
            isChecked('pv_id_list','IncludeSubmit');
644
         });
6545 dpurdie 645
 
646
         $('.directInclude').click(function(){
647
             isChecked('pv_id_list','IncludeSubmit');
648
         });
6610 dpurdie 649
<%Else%>
650
        {
651
        // Not logged in - disable boxes
652
        var list = $('.directInclude');
653
            list.prop('disabled', true);
654
         $('#toggleDirect').prop('disabled', true);    
655
        }
656
<%End If%>
6545 dpurdie 657
 
6544 dpurdie 658
    });
6545 dpurdie 659
 
660
    function InitShow(e)
661
    {
662
        toggleDispClass('rootCause',0);
663
        toggleDispClass('rootNoEnv',0);
664
        toggleDispClass('rootFile',0);
665
        toggleDispClass('rootIndirect',0);
666
        toggleDispClass('manualCause',0);
667
    }
668
 
669
    function toggleDispClass(cname,flip)
670
    {
671
        var cookieName = 'RELMGR_BUILDSTATUS';
672
        var cv = JSON.parse(getCookie(cookieName));
673
        if (!cv)
674
            cv = new Object;
675
        if (!cv.BuildStatus)
676
            cv.BuildStatus = new Object;
677
 
678
        var state = cv.BuildStatus[cname];
679
        if (state === undefined)
680
            state = true;
681
 
682
        if (flip>0)
683
            state = !state;
684
 
685
        cv.BuildStatus[cname] = state;
686
 
687
        // Reflect the current state in the checkbox
688
        var de = document.getElementById(cname);
689
        if (de)
690
            de.checked = state;
691
 
692
        var elements = new Array();
693
        elements = getElementsByClassName(cname);
694
        for(i in elements ){
695
            if (state) {
696
                elements[i].style.display = "";
697
            }
698
            else {
699
                elements[i].style.display = "none";
700
            }
701
        }
702
        setCookie(cookieName, JSON.stringify(cv), 365 );
703
    }
704
 
6544 dpurdie 705
    </script>
5357 dpurdie 706
      <!-- DROPDOWN MENUS -->
707
      <!--#include file="_menu_def.asp"-->
6579 dpurdie 708
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 709
   </head>
6546 dpurdie 710
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
5357 dpurdie 711
      <!-- HEADER -->
712
      <!--#include file="_header.asp"-->
713
      <!-- BODY ---->
6546 dpurdie 714
      <table class="full_table">
5357 dpurdie 715
         <tr>
6546 dpurdie 716
            <td width="146px" class="panel_bg" valign="top">
717
                <%Call BuildMenuPane%>
5357 dpurdie 718
            </td>
719
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6546 dpurdie 720
                <%Call ShowBuildStatus%>
721
                <%Call ShowDaemonStatus%>
722
                <%Call ShowDaemonInstructions%>
5357 dpurdie 723
            </td>
724
         </tr>
725
         <tr>
6546 dpurdie 726
            <td class="panel_bg" valign="bottom" align="center" height="350">
727
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
5357 dpurdie 728
         </tr>
729
      </table>
730
      <!-- FOOTER -->
731
      <!--#include file="_footer.asp"-->
732
   </body>
733
</html>
6546 dpurdie 734