Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
121 hknight 5
'|              Build Status Information             |
119 ghuddy 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
121 hknight 12
Response.Expires = 0  ' always load the page, dont store
119 ghuddy 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"-->
147 ghuddy 22
<!--#include file="common/daemon_instructions.asp"-->
119 ghuddy 23
<%
24
objPMod.PersistInQryString("proj_id")
25
'------------ ACCESS CONTROL ------------------
133 ghuddy 26
'Let users view the build status without being logged in, but as soon as they try and submit the form, check
27
'their login status.
28
If Request("action") <> "" AND NOT objAccessControl.UserLogedIn Then%>
29
<!--#include file="_access_control_login.asp"-->
30
<!--#include file="_access_control_project.asp"-->
31
<%End If%>
119 ghuddy 32
<!--#include file="_access_control_general.asp"-->
3959 dpurdie 33
<% '------------ Scripts -------------------------- %>
119 ghuddy 34
<%
35
'------------ Variable Definition -------------
36
Dim objSortHelper
37
Dim rsQry
38
Dim parRtagId
39
Dim parSourceRtagId
40
Dim query_string
133 ghuddy 41
Dim rcon_id
177 brianf 42
Dim shref_base
119 ghuddy 43
'------------ Constants Declaration -----------
44
'------------ Variable Init -------------------
45
parRtagId = Request("rtag_id")
46
objPMod.PersistInQryString("rtag_id")
3959 dpurdie 47
 
119 ghuddy 48
'----------------------------------------------
49
%>
50
<%
51
'--------------------------------------------------------------------------------------------------------------------------
52
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
133 ghuddy 53
   Dim rsQry, query
54
   OraDatabase.Parameters.Add "RTAG_ID",   parRtagId,    ORAPARM_INPUT, ORATYPE_NUMBER
55
   query = _
56
   " SELECT * "&_
57
   "  FROM RELEASE_TAGS rt"&_
58
   " WHERE rt.RTAG_ID = :RTAG_ID"
127 ghuddy 59
 
133 ghuddy 60
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
127 ghuddy 61
 
133 ghuddy 62
   OraDatabase.Parameters.Remove "RTAG_ID"
127 ghuddy 63
 
133 ghuddy 64
   If rsQry.RecordCount > 0 Then
65
      outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
66
      outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
67
   Else
68
      Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
69
   End If
127 ghuddy 70
 
133 ghuddy 71
   rsQry.Close
72
   Set rsQry = Nothing
119 ghuddy 73
End Sub
74
'--------------------------------------------------------------------------------------------------------------------------
75
Sub RipplePackage (flag)
127 ghuddy 76
 
133 ghuddy 77
   On Error Resume Next
78
   objEH.ErrorRedirect = TRUE
79
   OraDatabase.Parameters.Add "PV_ID_LIST",  Request("pv_id_list"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
80
   OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,  ORAPARM_INPUT, ORATYPE_NUMBER
81
   OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 82
 
133 ghuddy 83
   objEH.TryORA ( OraSession )
127 ghuddy 84
 
133 ghuddy 85
   If flag Then
86
      OraDatabase.ExecuteSQL _
87
      "BEGIN  Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
88
   Else
89
      OraDatabase.ExecuteSQL _
90
      "BEGIN  UnRipple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
91
   End If
127 ghuddy 92
 
133 ghuddy 93
   objEH.CatchORA ( OraSession )
127 ghuddy 94
 
133 ghuddy 95
   OraDatabase.Parameters.Remove "PV_ID_LIST"
96
   OraDatabase.Parameters.Remove "RTAG_ID"
97
   OraDatabase.Parameters.Remove "USER_ID"
119 ghuddy 98
 
99
End Sub
100
'--------------------------------------------------------------------------------------------------------------------------
4028 dpurdie 101
Function PrettyDelta( delta, daemonState,pkgId )
102
    Dim style
103
    style = ""
104
 
105
    If (delta > 600) AND (IsNull(pkgId) OR pkgId = "") Then
106
      style = "style=color:Red"
107
      If (delta > 86400 ) Then
108
        Dim bdate, dd,mm,yy
109
        bdate = DateAdd("s", - delta,Now())
110
        dd = Day(bdate)
111
        mm = MonthName(Month(bdate),1)
112
        yy = Year( bdate)
113
        delta = dd & "-" & mm & "-" & yy
114
        If ( daemonState >= 2 ) Then
115
            style = ""
116
        End If
117
      ElseIf ( delta > 60*60 ) Then
118
        'Dim bdate, hh, mins, ss
119
        bdate = DateAdd("s", - delta,Now())
120
        delta = TimeValue( bdate)
121
        'delta = hh & ":" & mins & ":" & ss
122
      End If
123
    End If
124
 
125
    If style <> "" Then
126
        delta = "<span " & style & ">" & delta & "</span>"
127
    End If
128
    PrettyDelta = delta
129
End Function
130
'--------------------------------------------------------------------------------------------------------------------------
119 ghuddy 131
Function Get_Daemon_Mode( cMode )
132
 
127 ghuddy 133
   If cMode = "S" Then
134
      Get_Daemon_Mode = "Slave"
135
   ElseIf cMode = "M" Then
136
      Get_Daemon_Mode = "Master"
137
   End If
138
 
119 ghuddy 139
End Function
140
'--------------------------------------------------------------------------------------------------------------------------
171 brianf 141
Function Get_Run_Level( nLevel, indefinitePause, astate)
119 ghuddy 142
 
127 ghuddy 143
   If indefinitePause Then
144
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
171 brianf 145
   ElseIf astate = 1 Then      ' if build daemon paused
146
      Get_Run_Level = "Paused"
147
   ElseIf astate = 2 Then      ' if build daemon disabled
148
      Get_Run_Level = "Disabled"
149
   ElseIf IsNull(astate) Then  ' if build daemon enabled
133 ghuddy 150
      If nLevel = 1 Then
127 ghuddy 151
         Get_Run_Level = "Cannot Continue"
152
      ElseIf nLevel = 2 Then
153
         Get_Run_Level = "Paused"
154
      ElseIf nLevel = 3 Then
1326 dpurdie 155
         Get_Run_Level = "Building"
127 ghuddy 156
      ElseIf nLevel = 4 Then
157
         Get_Run_Level = "Idle"
133 ghuddy 158
      ElseIf nLevel = 5 Then
127 ghuddy 159
         Get_Run_Level = "Waiting"
135 mhunt 160
      ElseIf nLevel = 6 Then
161
         Get_Run_Level = "Publishing"
127 ghuddy 162
      Else
163
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
164
      End If
165
   End If
119 ghuddy 166
 
167
End Function
177 brianf 168
 
119 ghuddy 169
'--------------------------------------------------------------------------------------------------------------------------
170
Function Get_Package_Name( sPackageName )
171
 
121 hknight 172
  If IsNull(sPackageName) Then
173
    Get_Package_Name = "None"
174
  Else
175
    Get_Package_Name = sPackageName
176
  End If
119 ghuddy 177
 
178
End Function
179
'--------------------------------------------------------------------------------------------------------------------------
177 brianf 180
 
181
 
119 ghuddy 182
%>
183
<%
184
'------------ RUN BEFORE PAGE RENDER ----------
181 brianf 185
shref_base = "http://" & archive_server & "/devl/abtlog/"
177 brianf 186
 
119 ghuddy 187
' --- Get Form details from DB ---
188
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
189
 
190
' --- Load Validation Rules ---
121 hknight 191
'Call objForm.LoadValidationRules ( Array("rtag_name","rtag_description", "config_spec_branch"), OraDatabase )    ' Load Validation Rules
119 ghuddy 192
 
193
' --- Enter Form Validation Rule Changes here... ----
194
'----------------------------------------------------
195
 
196
' --- RUN onPostBack ---
133 ghuddy 197
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
119 ghuddy 198
 
121 hknight 199
  If objEH.Finally Then
200
    If Request("action") = "include" Then
201
      Call RipplePackage (True)
4061 dpurdie 202
      ' Redirect to the current page so that a refesh will not
203
      ' cause a form re-submit.
204
      Response.Redirect(ScriptName & "?rtag_id=" & parRtagId)
121 hknight 205
    Else
206
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
207
    End If
208
  End If
127 ghuddy 209
 
119 ghuddy 210
End If
211
 
212
'----------------------------------------------
213
%>
3959 dpurdie 214
<script language="JavaScript" type="text/JavaScript">
215
 
216
window.addEventListener ?
217
window.addEventListener("load",InitShow,false) :
218
window.attachEvent && window.attachEvent("onload",InitShow);
219
 
220
function InitShow(e)
221
{
222
    toggleDispClass('rootCause',0);
223
    toggleDispClass('rootFile',0);
224
}
225
 
226
function toggleDispClass(cname,flip)
227
{
228
    var cookieName = 'RELMGR_BUILDSTATUS';
229
    var cv = JSON.parse(getCookie(cookieName));
230
    if (!cv)
231
        cv = new Object;
232
    if (!cv.BuildStatus)
233
        cv.BuildStatus = new Object;
234
 
235
    var state = cv.BuildStatus[cname];
236
    if (state === undefined)
237
        state = true;
238
 
239
    if (flip>0)
240
        state = !state;
241
 
242
    cv.BuildStatus[cname] = state;
243
 
244
    // Reflect the current state in the checkbox
245
    var de = document.getElementById(cname);
246
    if (de)
247
        de.checked = state;
248
 
249
    var elements = new Array();
250
    elements = getElementsByClassName(cname);
251
    for(i in elements ){
252
        if (state) {
253
            elements[i].style.display = "";
254
        }
255
        else {
256
            elements[i].style.display = "none";
257
        }
258
    }
259
    setCookie(cookieName, JSON.stringify(cv), 365 );
260
}
261
 
262
</script>
263
 
119 ghuddy 264
<html>
127 ghuddy 265
   <head>
266
      <title>Release Manager</title>
267
      <meta http-equiv="Pragma" content="no-cache">
268
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
269
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
270
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
271
      <script language="JavaScript" src="images/common.js"></script>
157 ghuddy 272
      <!-- TIPS -->
4061 dpurdie 273
      <script type="text/javascript" src="scripts/json2.js"></script>
157 ghuddy 274
      <script language="JavaScript" src="images/tipster.js"></script>
275
      <script language="JavaScript" src="images/_help_tips.js"></script>
127 ghuddy 276
      <!-- DROPDOWN MENUS -->
277
      <!--#include file="_menu_def.asp"-->
278
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
279
   </head>
280
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="isChecked('pv_id_list','submit');">
281
      <!-- MENU LAYERS -------------------------------------->
282
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
283
      <!-- TIPS LAYERS -------------------------------------->
284
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
285
      <!----------------------------------------------------->
286
      <!-- HEADER -->
287
      <!--#include file="_header.asp"-->
288
      <!-- BODY ---->
289
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
290
         <%
291
         '-- FORM START ---------------------------------------------------------------------------------------------------------
292
         objFormComponent.FormName = "FormName"
293
         objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
294
         Call objFormComponent.FormStart()
295
         %>
296
         <tr>
297
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
298
            <td width="100%" rowspan="1" align="center" valign="top" bgcolor="#EEEFEF">
299
               <table width="10" border="0" cellspacing="0" cellpadding="0">
121 hknight 300
                  <tr>
127 ghuddy 301
                     <td width="1%"></td>
302
                     <td width="100%">
303
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
304
                           <tr>
305
                              <td nowrap class="body_txt"></td>
306
                           </tr>
307
                        </table>
308
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
309
                           <tr>
310
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
311
                                 <p>BUILD STATUS INFORMATION</p>
312
                              </td>
313
                              <td align="right" valign="bottom"></td>
314
                           </tr>
315
                        </table>
316
                     </td>
317
                     <td width="1%"></td>
121 hknight 318
                  </tr>
319
                  <tr>
127 ghuddy 320
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
321
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
322
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
121 hknight 323
                  </tr>
324
                  <tr>
127 ghuddy 325
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
326
                     <td bgcolor="#FFFFFF" valign="top">
327
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
328
                        <!--#include file="messages/_msg_inline.asp"-->
329
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
330
                        <br>
331
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
332
                           <span class='err_alert'>
333
                              <font size='2'><b>Packages Excluded From Build (Daemon Build Failure)</b></font>
334
                           </span>
335
                           <tr>
336
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
337
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
338
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
3959 dpurdie 339
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE</td>
127 ghuddy 340
                           </tr>
3959 dpurdie 341
                           <tr>
342
                           <td colspan=3></td>
343
                           <td class="body_row">
344
                           <fieldset class="fset" align="right">
345
                                Show
346
                                <input type="checkbox" checked value=0 name="showCause" id="rootCause" onClick="toggleDispClass('rootCause',1);">Config Errors
347
                                <input type="checkbox" checked value=0 name="showFile"  id="rootFile"  onClick="toggleDispClass('rootFile',1);">Build Errors
348
                           </fieldset>
349
                           </td>
350
                           </tr>
127 ghuddy 351
                           <%
352
                           query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description"&_
353
                                          "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
354
                                          "  where dnr.rtag_id = "& parRtagId &_
355
                                          "    and pv.pv_id    = dnr.pv_id"&_
356
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
357
                                          "    and dnr.root_pv_id is null"&_
358
                                          "  order by pkg_name"
359
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
360
                           '--- Render rows ---
361
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
3959 dpurdie 362
                            Dim rowClass
363
                            Dim rowData
364
                            ' root_file, if supplied, indicates a build failure log file exists
365
                            ' this should always prevail over the textual root_cause
366
 
367
                            If IsNull(rsQry("root_file")) Then
368
                               rowClass = "rootCause"
369
                               rowData = rsQry("root_cause")
370
                            Else
371
                                rowClass = "rootFile"
372
                                rowData = "<a class=""txt_linked"" title=""" & rsQry("root_file") &_
373
                                          " Log file may have expired."" " &_
374
                                          "href=""" & shref_base & rsQry("root_file") & """>" &_
375
                                          "Build Failure Log File</a>"
376
                            End If
127 ghuddy 377
                           %>
3959 dpurdie 378
                              <tr class="<%=rowClass%>">
127 ghuddy 379
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
380
                              </tr>
3959 dpurdie 381
                              <tr class="<%=rowClass%>">
127 ghuddy 382
                                 <td nowrap width="1%">
383
                                    <!-- The use of the isChecked() javascript function below, enables the submit button if any checkboxes are checked, -->
384
                                    <!-- else it will disable the submit button. The function is badly named, but nevertheless, that is what it does.   -->
385
                                    <input type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" id="pv_id_list" onClick="isChecked('pv_id_list','submit');">
386
                                 </td>
387
                                 <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>
388
                                 <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
3959 dpurdie 389
                                 <td nowrap class="body_rowg"><%=rowData%></td>
127 ghuddy 390
                              </tr>
3959 dpurdie 391
                           <%
392
                            rsQry.MoveNext
127 ghuddy 393
                           Loop%>
394
                           <tr>
395
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
396
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
397
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
398
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE PACKAGE NAME</td>
399
                           </tr>
400
                           <%
401
                           query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
402
                                          "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
403
                                          "  where dnr.rtag_id = "& parRtagId &_
404
                                          "    and pv.pv_id    = dnr.pv_id"&_
405
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
406
                                          "    and qv.pv_id    = dnr.root_pv_id"&_
407
                                          "    and qkg.pkg_id  = qv.pkg_id"&_
408
                                          "    and dnr.root_pv_id is not null"&_
409
                                          "  order by pkg.pkg_name"
410
                           Dim rsQry2
411
                           Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
412
                           '--- Render rows ---
413
                           Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
414
                              <tr>
415
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
416
                              </tr>
417
                              <tr>
418
                                 <td nowrap width="1%">
419
                                    <input type="checkbox" value=0 disabled=true name="notused" id="notused">
420
                                 </td>
421
                                 <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>
422
                                 <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
423
                                 <td nowrap class="body_rowg"><%=rsQry2(3)%></td>
424
                              </tr>
425
                              <%
426
                              rsQry2.MoveNext
427
                           Loop%>
428
                        </table>
429
                     </td>
430
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
121 hknight 431
                  </tr>
127 ghuddy 432
                  <%If rsQry.RecordCount > 0 Then%>
433
                     <tr>
434
                        <td background="images/bg_action_norm.gif"></td>
435
                        <td align="right" background="images/bg_action_norm.gif">
436
                           <%
437
                           Response.Write(objFormComponent.SubmitButton ( "Include", "name='submit' id='submit' class='form_btn' disabled style='color:silver' onClick='return confirmAction(""Are you sure you want to include these packages for building?"")'" ))
438
                           Response.Write(objPMod.ComposeHiddenTags())
439
                           %>
440
                        </td>
441
                        <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
442
                     </tr>
443
                  <%End If%>
121 hknight 444
                  <tr>
127 ghuddy 445
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
446
                     <td background="images/lbox_bg_blue.gif"></td>
447
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
121 hknight 448
                  </tr>
127 ghuddy 449
               </table>
450
               <!-- ACTION BUTTONS ---------------------------------------------->
451
               <input type="hidden" name="action" value="include">
452
               <!-- ACTION BUTTONS END  ------------------------------------------>
453
            </td>
454
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
455
         </tr>
456
         <%
457
         Call objFormComponent.FormEnd()
458
         rsQry.Close()
459
         Set rsQry = nothing
460
         rsQry2.Close()
461
         Set rsQry2 = nothing
462
         '-- FORM END ----------------------------------------------------------------------------------------------------------------
463
         %>
464
         <tr>
465
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
466
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
467
               <table width="10" border="0" cellspacing="0" cellpadding="0">
121 hknight 468
                  <tr>
127 ghuddy 469
                     <td width="1%"></td>
470
                     <td width="100%">
471
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
472
                           <tr>
473
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
474
                                 <p>DAEMON STATUS INFORMATION</p>
475
                              </td>
2365 dpurdie 476
                              <td align="right" valign="bottom">
477
                                <a class="txt_linked" href="build_status.asp?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
478
                              </td>
127 ghuddy 479
                           </tr>
480
                        </table>
481
                     </td>
482
                     <td width="1%"></td>
121 hknight 483
                  </tr>
484
                  <tr>
127 ghuddy 485
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
486
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
487
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
121 hknight 488
                  </tr>
489
                  <tr>
127 ghuddy 490
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
491
                     <td bgcolor="#FFFFFF" valign="top">
492
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
493
                        <!--#include file="messages/_msg_inline.asp"-->
494
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
495
                        <br>
496
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
497
                           <%
498
                           Dim indefinitelyPaused
499
                           indefinitelyPaused = FALSE
500
                           ' Insert a warning into the page if the build daemons are indefintely paused.
501
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
502
 
503
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
504
                           If rsQry.RecordCount > 0 Then
505
                              indefinitelyPaused = TRUE %>
506
                              <tr>
507
                                 <span class='err_alert'>
508
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
509
                                 </span>
510
                              </tr>
511
                           <%End If
512
 
513
                           rsQry.Close()
514
                           Set rsQry = nothing
515
                           %>
516
                           <td width="9%" valign="top"></td>
517
                           <tr>
163 brianf 518
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
127 ghuddy 519
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE Machtype</td>
520
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
521
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
522
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
147 ghuddy 523
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td>
4170 dpurdie 524
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
127 ghuddy 525
                           </tr>
526
                           <%
133 ghuddy 527
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
163 brianf 528
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
127 ghuddy 529
                                          "  where rc.rtag_id = "& parRtagId &_
530
                                          "    and gm.gbe_id = rc.gbe_id"&_
4293 dpurdie 531
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
532
                                          "  order by bm.display_name, rc.rcon_id"
133 ghuddy 533
 
127 ghuddy 534
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
133 ghuddy 535
 
127 ghuddy 536
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
537
                              rcon_id = rsQry("rcon_id")
133 ghuddy 538
 
539
                              Dim pkgName
540
                              Dim currentRunLevel
171 brianf 541
                              Dim daemonState
542
                              Dim delta
133 ghuddy 543
 
544
                              ' For this release configuration, get its entry from the run_level table. This table may not
545
                              ' have an entry so we must handle that outcome too.
147 ghuddy 546
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
547
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
548
                                             "   from run_level rl"&_
133 ghuddy 549
                                             "  where rl.rcon_id = "& rcon_id
550
 
551
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
552
 
553
                              currentRunLevel = -1
554
                              If (rsQry2.RecordCount > 0) Then
555
                                 ' Get the run level from the run_level table
556
                                 currentRunLevel = rsQry2("current_run_level")
557
                              End If
558
 
171 brianf 559
                              daemonState = NULL
560
                              If (rsQry2.RecordCount > 0) Then                                
561
                                daemonState = rsQry2("pause")
562
                              End If
563
 
564
                              delta = NULL
565
                              If (rsQry2.RecordCount > 0) Then
566
                                delta = rsQry2("delta")
567
                              End If
568
 
133 ghuddy 569
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
570
                              ' package name from the packages table
571
                              Dim rsQry3
572
                              pkgName = NULL
573
                              If (rsQry2.RecordCount > 0) AND NOT IsNull(rsQry2("current_pkg_id_being_built")) Then
574
 
575
                                 query_string = " select pkg_name from run_level rl, packages pk"&_
576
                                                "  where rl.rcon_id = "& rcon_id &_
577
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
578
 
579
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
580
                                 If (rsQry3.RecordCount > 0) Then
581
                                    pkgName = rsQry3("pkg_name")
582
                                 End If
583
                                 rsQry3.Close()
584
                                 Set rsQry3 = nothing
585
                              End If
586
 
587
                              ' --- Now render HTML for this release configuration ---
127 ghuddy 588
                              %>
589
                              <tr>
590
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
591
                              </tr>
592
                              <tr>
163 brianf 593
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
127 ghuddy 594
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
595
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
171 brianf 596
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
133 ghuddy 597
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName)%></td>
4028 dpurdie 598
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
127 ghuddy 599
                                 <td nowrap class="body_rowg">
600
                                    <%
133 ghuddy 601
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
4170 dpurdie 602
                                       If objAccessControl.UserLogedIn AND objAccessControl.IsActive("BuildControl") Then
171 brianf 603
                                          If IsNull(daemonState) Then
127 ghuddy 604
                                             Call Action_Buttons ( "Daemon Pause" )
171 brianf 605
                                          ElseIf daemonState = 1 Then
606
                                             Call Action_Buttons ( "Daemon Resume" )
607
                                          ElseIf daemonState = 2 Then
608
                                             Call Action_Buttons ( "Daemon Start" )
127 ghuddy 609
                                          Else
610
                                             Call Action_Buttons ( "Daemon Resume" )
611
                                          End If
612
                                       Else
171 brianf 613
                                          If IsNull(daemonState) Then
127 ghuddy 614
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
171 brianf 615
                                          ElseIf daemonState = 1 Then
616
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
617
                                          ElseIf daemonState = 2 Then
618
                                             Call Action_Buttons ( "Daemon Start Disabled" )
127 ghuddy 619
                                          Else
620
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
621
                                          End If
622
                                       End If
623
                                    Else
624
                                       %>Unavailable<%
625
                                    End If
626
                                    %>
627
                                 </td>
628
                              </tr>
629
                              <%
133 ghuddy 630
                              rsQry2.Close()
631
                              Set rsQry2 = nothing
127 ghuddy 632
                              rsQry.MoveNext
633
                           Loop
634
                           %>
171 brianf 635
                           <tr>
636
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
637
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
638
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
639
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
640
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
641
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
642
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
643
                             <%
644
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
4170 dpurdie 645
                                 If objAccessControl.UserLogedIn AND objAccessControl.IsActive("BuildControl") Then
171 brianf 646
                                   Call Action_Buttons ( "Daemon Control All" )
647
                                 Else 
648
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
649
                                 End If
650
                               Else
651
                                 %>&nbsp<%
652
                               End If
653
                             %>
654
                             </td>
655
                           </tr>
656
                           <%
657
                             rsQry.Close()
658
                             Set rsQry = nothing
659
                           %>
127 ghuddy 660
                        </table>
661
                     </td>
662
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
121 hknight 663
                  </tr>
664
                  <tr>
127 ghuddy 665
                     <input type="hidden" name="action" value="true">
666
                     <%=objPMod.ComposeHiddenTags()%>
667
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
668
                     <td background="images/lbox_bg_blue.gif"></td>
669
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
121 hknight 670
                  </tr>
127 ghuddy 671
               </table>
147 ghuddy 672
 
673
               <table width="10" border="0" cellspacing="0" cellpadding="0">
674
                  <tr>
675
                     <td width="1%"></td>
676
                     <td width="100%">
677
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
678
                           <tr>
679
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
680
                                 <p>DAEMON INSTRUCTIONS FOR THIS RELEASE</p>
681
                              </td>
682
                              <td align="right" valign="bottom"></td>
683
                           </tr>
684
                        </table>
685
                     </td>
686
                     <td width="1%"></td>
687
                  </tr>
688
                  <tr>
689
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
690
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
691
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
692
                  </tr>
693
                  <tr>
694
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
695
                     <td bgcolor="#FFFFFF" valign="top">
696
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
697
                           <tr>
698
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">OPERATION</td>
699
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE</td>
700
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">VERSION</td>
701
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED TIME<br>(<SPAN style=color:Red>Red</SPAN> = overdue)<br>(<SPAN style=color:Green>Green</SPAN> = ready)</td>
702
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
703
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">IN PROGRESS</td>
704
                           </tr>
705
                           <%
706
                           Dim PkgId
707
                           Dim PkgVersion
708
                           Dim UserName
709
                           Dim UserEmail
710
                           Dim bInProgress
711
                           Dim bIsOverdue
712
                           Dim bIsReady
713
 
714
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
715
                                                                  "       OP_CODE,"&_
716
                                                                  "       RTAG_ID,"&_
717
                                                                  "       PV_ID,"&_
718
                                                                  "       SCHEDULED_DATETIME,"&_
719
                                                                  "       REPEAT_SECS,"&_
720
                                                                  "       ADDED_DATETIME,"&_
721
                                                                  "       USER_ID,"&_
722
                                                                  "       IN_PROGRESS,"&_
723
                                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
724
                                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
725
                                                                  "  FROM DAEMON_INSTRUCTIONS "&_
726
                                                                  "  WHERE RTAG_ID = "& parRtagId &_
727
                                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
728
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
729
 
730
                              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
731
                                 bInProgress = False
732
                              Else
733
                                 bInProgress = True
734
                              End If
735
 
736
                              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
737
                              If rsQry("OVERDUE") AND NOT bInProgress Then
738
                                 bIsOverdue = True
739
                              Else
740
                                 bIsOverdue = False
741
                              End If
742
 
743
                              If rsQry("READY") Then
744
                                 bIsReady = True
745
                              Else
746
                                 bIsReady = False
747
                              End If
748
 
749
                              ' Get as much info about the package as we can
750
                              PkgId = 0
751
                              PkgName = "N/A"
752
                              PkgVersion = "N/A"
753
                              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
754
                                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
755
                              End If
756
 
757
                              %>
758
                              <tr>
759
 
760
                                 <td align="left" valign="top" class="body_txt">
761
                                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
762
                                 </td>
763
 
764
                                 <td align="left" valign="top" class="body_txt">
765
                                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
766
                                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
767
                                    <%Else%>
768
                                       <%=PkgName%>
769
                                    <%End If%>
770
                                 </td>
771
 
772
                                 <td align="left" valign="top" class="body_txt">
773
                                    <%=PkgVersion%>
774
                                 </td>
775
 
776
                                 <td align="left" valign="top" class="body_txt" <%If bIsOverdue Then%>style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=EuroDateTime(rsQry("SCHEDULED_DATETIME"))%></td>
777
 
778
                                 <td align="left" valign="top" class="body_txt"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
779
 
780
                                 <td align="left" valign="top" class="body_txt">
781
                                    <%If bInProgress Then%>
782
                                       YES
783
                                    <%Else%>
784
                                       NO
785
                                    <%End If%>
786
                                 </td>
787
                              </tr>
788
                              <tr>
789
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
790
                              </tr>
791
                              <%
792
                              rsQry.MoveNext()
793
                           Wend
794
                           rsQry.Close()
795
                           Set rsQry = nothing
796
                           %>
797
                        </table>
798
                     </td>
799
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
800
                  </tr>
801
                  <tr>
802
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
803
                     <td background="images/lbox_bg_blue.gif"></td>
804
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
805
                  </tr>
806
               </table>
807
 
127 ghuddy 808
            </td>
809
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
810
         </tr>
811
         <tr>
812
            <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
813
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td>
814
         </tr>
815
      </table>
816
      <!-- FOOTER -->
817
      <!--#include file="_footer.asp"-->
818
   </body>
119 ghuddy 819
</html>
820
<%
821
Call Destroy_All_Objects
822
%>