Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
147 ghuddy 1
 
2
<%@LANGUAGE="VBSCRIPT"%>
3
<%
4
'=====================================================
5
'|                                                   |
6
'|         ADMIN Build Status Information            |
7
'|                                                   |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
13
Response.Expires = 0  ' always load the page, dont store
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="common/_form_window_common.asp"-->
21
<!--#include file="_action_buttons.asp"-->
22
<!--#include file="class/classActionButtonControl.asp"-->
23
<%
24
' Set rfile parameter. This is a return page after Login
25
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
26
%>
27
<%
28
'------------ ACCESS CONTROL ------------------
29
%>
30
<!--#include file="_access_control_general.asp"-->
31
<%
32
'------------ Variable Definition -------------
33
Dim rsQry
34
Dim query_string
35
Dim styleAlt1
36
Dim styleAlt2
37
Dim styleNow
38
Dim param_refreshPeriod
39
Dim param_refreshEnabled
40
Dim bIndefinitelyPaused
41
'------------ Constants Declaration -----------
42
Const Min_Refresh_Time = 10
43
'------------ Variable Init -------------------
44
 
45
styleAlt1="class='body_rowg1'"
46
styleAlt2="class='body_rowg2'"
47
styleNow = styleAlt1
48
 
49
 
50
'----------------------------------------------
51
%>
52
<%
53
'--------------------------------------------------------------------------------------------------------------------------
54
 
55
'--------------------------------------------------------------------------------------------------------------------------
56
' Toggle row style between the two alternative styles
57
Sub ToggleStyleNow
58
   If styleNow = styleAlt1 Then
59
      styleNow = styleAlt2
60
   Else
61
      styleNow = styleAlt1
62
   End If
63
End Sub
64
'--------------------------------------------------------------------------------------------------------------------------
65
' Convert run level into a meaningful string
173 brianf 66
Function Get_Run_Level( nLevel, indefinitePause, astate)
147 ghuddy 67
 
68
   If indefinitePause Then
69
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
173 brianf 70
   ElseIf astate = 1 Then      ' if build daemon paused
71
      Get_Run_Level = "Paused"
72
   ElseIf astate = 2 Then      ' if build daemon disabled
73
      Get_Run_Level = "Disabled"
74
   ElseIf IsNull(astate) Then  ' if build daemon enabled
147 ghuddy 75
      If nLevel = 1 Then
76
         Get_Run_Level = "Cannot Continue"
77
      ElseIf nLevel = 2 Then
78
         Get_Run_Level = "Paused"
79
      ElseIf nLevel = 3 Then
80
         Get_Run_Level = "Actively engaged in a build"
81
      ElseIf nLevel = 4 Then
82
         Get_Run_Level = "Idle"
83
      ElseIf nLevel = 5 Then
84
         Get_Run_Level = "Waiting"
85
      ElseIf nLevel = 6 Then
86
         Get_Run_Level = "Publishing"
87
      Else
88
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
89
      End If
90
   End If
91
End Function
92
'--------------------------------------------------------------------------------------------------------------------------
93
' Is a build occurring for this dataset/row ?
94
Function Is_Actively_Building( nPkgId )
95
   Is_Actively_Building = False
96
   If (NOT IsNull(nPkgId)) AND (nPkgId <> "") Then
97
      Is_Actively_Building = True
98
   End If
99
End Function
100
'--------------------------------------------------------------------------------------------------------------------------
101
' Return True if the paramter values represent a possibly hung daemon
102
Function Daemon_Delta_Threshold_Exceeded( nDelta )
103
   Daemon_Delta_Threshold_Exceeded = False
104
   If (nDelta > 600) Then
105
      Daemon_Delta_Threshold_Exceeded = True
106
   End If
107
End Function
108
 
109
'--------------------------------------------------------------------------------------------------------------------------
110
' Return True if the paramter values represent a paused daemon
111
Function Is_Paused( nLevel, indefinitePause )
112
   If indefinitePause Then
113
      Is_Paused = True
114
   Else
115
      If nLevel = 2 Then
116
         Is_Paused = True
117
      Else
118
         Is_Paused = False
119
      End If
120
   End If
121
End Function
122
'--------------------------------------------------------------------------------------------------------------------------
123
' Convert daemon mode into a meaningful string
124
Function Get_Daemon_Mode( nMode )
125
   If nMode = "M" Then
126
      Get_Daemon_Mode = "Master"
127
   ElseIf nMode = "S" Then
128
      Get_Daemon_Mode = "Slave"
129
   Else
130
      Get_Daemon_Mode = "?"
131
   End If
132
End Function
133
 
134
'--------------------------------------------------------------------------------------------------------------------------
135
' Return HTML for a seperator line between rows in the table
136
Function HTML_Row_Divider( projectChanged, projectChecked, releaseChanged, last_row_displayed )
137
   Dim s
138
   s = ""
139
   If projectChanged Then
140
      s = s + "<tr>"
141
      s = s + "   <td colspan='8'><img src='images/spacer.gif' width='1' height='5'></td>"
142
      s = s + "</tr>"
143
      s = s + "<tr>"
144
      s = s + "   <td colspan='8' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='5'></td>"
145
      s = s + "</tr>"
146
   Else
147
      if projectChecked = "checked" AND last_row_displayed = True Then
148
         s = s + "<tr>"
149
         If releaseChanged Then
150
            s = s + "<td></td>"
151
            s = s + "<td colspan='7' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='1'></td>"
152
         Else
153
            s = s + "<td></td>"
154
            s = s + "<td colspan='7' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='1'></td>"
155
         End If
156
         s = s + "</tr>"
157
      End If
158
   End If
159
   HTML_Row_Divider = s
160
End Function
161
'--------------------------------------------------------------------------------------------------------------------------
162
' Use this function to determine the state of a specified project checkbox
163
Function Is_Project_Checked( nProjId )
164
   Dim hiddenProjects_arr
165
   Dim hiddenProjects
166
   Dim str
167
 
168
   hiddenProjects = Request("HideProj")
169
   Is_Project_Checked = "checked"
170
 
171
   hiddenProjects_arr = Split(hiddenProjects, ",")
172
   For Each str in hiddenProjects_arr
173
      If str = nProjId Then
174
         Is_Project_Checked = ""
175
         Exit For
176
      End If
177
   Next
178
End Function
179
'--------------------------------------------------------------------------------------------------------------------------
180
' Use this function to set/clear the filter on/off radio button checked state
181
' Format of Filter Param : Filter=ON,[problemDaemonSets}[,ActiveBuilds] | OFF
182
Function Display_Filtered(id)
183
   Dim filter
184
 
185
   Display_Filtered = ""
186
 
187
   filter  = Request("Filter")
188
   If NOT IsNull(filter) AND filter <> "" Then
189
      If InStr(filter, id) > 0 Then
190
         Display_Filtered = "checked"
191
      End If
192
   Else
193
      If id = "OFF" Then
194
         Display_Filtered = "checked"
195
      End If
196
   End If
197
End Function
198
 
199
Function Display_Filter_Is_On()
200
   If Display_Filtered("ON") = "checked" Then
201
      Display_Filter_Is_On = True
202
   Else
203
      Display_Filter_Is_On = False
204
   End If
205
End Function
206
'--------------------------------------------------------------------------------------------------------------------------
207
' Use this function to set/clear a filter option check box with the given ID
208
Function Filter_Checked(id)
209
   Dim filter
210
 
211
   Filter_Checked = ""
212
 
213
   filter  = Request("Filter")
214
   If NOT IsNull(filter) AND filter <> "" Then
215
      If InStr(filter, id) > 0 Then
216
         Filter_Checked = "checked"
217
      End If
218
   End If
219
End Function
220
'--------------------------------------------------------------------------------------------------------------------------
221
' Test to see if a particular filter option is on
222
Function Filter_Is_On(id)
223
   If Display_Filter_Is_On() Then
224
      If Filter_Checked(id) = "checked" Then
225
         Filter_Is_On = True
226
      Else
227
         Filter_Is_On = False
228
      End If
229
   Else
230
      Filter_Is_On = False
231
   End If
232
End Function
233
'--------------------------------------------------------------------------------------------------------------------------
234
' Get name of package given its ID. Return empty string if not able to do so.
235
Function Get_Pkg_Name( nPkgId )
236
   Dim rsQry2
237
   Dim query_string2
238
 
239
   Get_Pkg_Name = ""
240
   If (NOT IsNull(nPkgId)) AND (nPkgId <> "") Then
241
 
242
      query_string2 = "SELECT pkg.PKG_NAME " &_
243
                     "  FROM PACKAGES pkg" &_
244
                     " WHERE pkg.PKG_ID = " & nPkgId
245
 
246
      Set rsQry2 = OraDatabase.DbCreateDynaset( query_string2, ORADYN_DEFAULT )
247
      If rsQry2.RecordCount > 0 Then
248
         Get_Pkg_Name = rsQry2("pkg_name")
249
      End If
250
      rsQry2.Close()
251
      Set rsQry2 = nothing
252
   End If
253
End Function
254
'--------------------------------------------------------------------------------------------------------------------------
255
Function Indefinitely_Paused()
256
   Dim rsQry2
257
   Dim query_string2
258
 
259
   Indefinitely_Paused = False
260
 
261
   query_string2 = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
262
 
263
   Set rsQry2 = OraDatabase.DbCreateDynaset( query_string2, ORADYN_DEFAULT )
264
   If rsQry2.RecordCount > 0 Then
265
      Indefinitely_Paused = True
266
   End If
267
End Function
268
'--------------------------------------------------------------------------------------------------------------------------
269
 
270
%>
271
<%
272
'------------ RUN BEFORE PAGE RENDER ----------
273
 
274
' Default values for Auto Refresh checkbox and edit input box
275
param_refreshEnabled = False
276
param_refreshPeriod  = "0"
277
 
278
' Read the Refresh parameter which is of the form Refresh=<time-period>,ON|OFF
279
Dim param_refresh
280
param_refresh = Request("Refresh")
281
If param_refresh <> "" Then
282
   Dim pr_arr
283
   pr_arr = Split(param_refresh,",")
284
   param_refreshPeriod = pr_arr(0)
285
 
286
   ' Range check and end-stop the refresh period if necessary
287
   If CInt(param_refreshPeriod)  < Min_Refresh_Time Then
288
      param_refreshPeriod  = CStr(Min_Refresh_Time)
289
   End If
290
 
291
   ' determine checkbox state
292
   If UBound(pr_arr) >= 1 Then
293
      If InStr(UCase(pr_arr(1)), "ON") > 0 Then
294
         param_refreshEnabled = True
295
      Else
296
         param_refreshEnabled = False
297
      End If
298
   End If
299
End If
300
 
301
' Get indefinite pause status
302
bIndefinitelyPaused = Indefinitely_Paused()
303
 
304
'----------------------------------------------
305
%>
306
<script language="JavaScript" type="text/javascript">
307
<!--
308
 
309
//////////////////////////////////////////////////////////////////////////////////////////////////
310
// This function rebuilds the query string so that it either adds or removes the specified project ID from
311
// the HideProj= part of it, whilst leaving the rest of the string intact. The browser location is then
312
// updated and the server made to re-render the page. This function must be used from the project checkboxes
313
// to show/hide daemon status informaton for specific projects.
314
//////////////////////////////////////////////////////////////////////////////////////////////////
315
function toggle_project( proj_id )
316
{
317
   var found = false;
318
   var new_url_query_string = '';
319
   var new_hp_list = '';
320
 
321
   // get the full query string
322
   var url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';
323
 
324
   // split it into each parameter
325
   var qs_arr = url_query_string.split('&');
326
   var i_qs_arr;
327
   for (i_qs_arr in qs_arr)
328
   {
329
      var qs_str = qs_arr[i_qs_arr];
330
 
331
      if (qs_str.length > 0)
332
      {
333
         // if we have found the HideProj parameter
334
         if (qs_str.indexOf('HideProj') >= 0)
335
         {
336
            // Split the HideProj parameter at the = symbol in order to process the comma seperated list of project IDs
337
            var qs_hp_arr;
338
            qs_hp_arr = qs_str.split('=');
339
            if (qs_hp_arr.length > 1)
340
            {
341
               // Split the comma seperated list of project IDs, and iterate through each item
342
               var hp_arr = qs_hp_arr[1].split(',');
343
               var i_hp_arr;
344
               for (i_hp_arr in hp_arr)
345
               {
346
                  var hp_str = hp_arr[i_hp_arr];
347
 
348
                  // If the item matches the specified project ID and the checkbox for that project is unchecked
349
                  if (hp_str == proj_id)
350
                  {
351
                     found = true;
352
                  }
353
                  else
354
                  {
355
                     // retain this other project ID in the list
356
                     if (new_hp_list != '')
357
                        new_hp_list += ',';
358
                     new_hp_list += hp_str;
359
                  }
360
               }
361
            }
362
         }
363
         else
364
         {
365
            // feed the existing paramter to the new query string
366
            if (new_url_query_string == '')
367
               new_url_query_string += '?';
368
            else
369
               new_url_query_string += '&';
370
            new_url_query_string += qs_str
371
         }
372
      }
373
   }
374
 
375
   // If the specified project ID was not found, then that project is not currently hidden
376
   // and must now be hidden, so add its number to the list to hide it on the next server side
377
   // page render operation
378
   if (!found)
379
   {
380
      if (new_hp_list != '')
381
         new_hp_list += ',';
382
      new_hp_list += proj_id
383
   }
384
 
385
   // Prepare the new query string
386
   if (new_url_query_string == '')
387
      new_url_query_string += '\?';
388
   else
389
      new_url_query_string += '\&';
390
 
391
   new_url_query_string += 'HideProj=';
392
   new_url_query_string += new_hp_list;
393
 
394
   // reload the page with the new query string
395
   var url = location.pathname + new_url_query_string;
396
   window.location.assign(url);
397
}
398
 
399
//////////////////////////////////////////////////////////////////////////////////////////////////
400
// This function rebuilds the query string to either hide all projects, or unhide all projects
401
// fromt he display
402
//////////////////////////////////////////////////////////////////////////////////////////////////
403
function toggle_all_projects(bAll)
404
{
405
   var new_url_query_string = '';
406
   var list_proj_ids = '';
407
 
408
   // If hiding all, then find all of the project enable/disable checkboxes, get the project ID
409
   // values from each one and accumulate them into a comma seperated list
410
   if (!bAll)
411
   {
412
      var inputs = document.getElementsByTagName('input');
413
      var i;
414
      for (i = 0; i < inputs.length; i++)
415
      {
416
         var str = inputs[i].name;
417
         if (str.indexOf("DIS_PRJ_") >= 0)
418
         {
419
            str = str.replace("DIS_PRJ_","");
420
            if (list_proj_ids != '')
421
               list_proj_ids += ',' + str;
422
            else
423
               list_proj_ids += str;
424
         }
425
      }
426
   }
427
 
428
   // get the full query string
429
   var url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';
430
 
431
   // split it into each parameter
432
   var qs_arr = url_query_string.split('&');
433
   var i_qs_arr;
434
   for (i_qs_arr in qs_arr)
435
   {
436
      var qs_str = qs_arr[i_qs_arr];
437
 
438
      if (qs_str.length > 0)
439
      {
440
         // if we have found the HideProj parameter
441
         if (qs_str.indexOf('HideProj') >= 0)
442
         {
443
            // do nothing
444
         }
445
         else
446
         {
447
            // feed the existing paramter to the new query string
448
            if (new_url_query_string == '')
449
               new_url_query_string += '?';
450
            else
451
               new_url_query_string += '&';
452
            new_url_query_string += qs_str
453
         }
454
      }
455
   }
456
 
457
   // Prepare the new query string, only adding the HideProj parameter if the function is being
458
   // used to hide all projects
459
   if (!bAll)
460
   {
461
      if (new_url_query_string == '')
462
         new_url_query_string += '\?';
463
      else
464
         new_url_query_string += '\&';
465
 
466
      new_url_query_string += 'HideProj=' + list_proj_ids;
467
   }
468
   // reload the page with the new query string
469
   var url = location.pathname + new_url_query_string;
470
   window.location.assign(url);
471
}
472
 
473
//////////////////////////////////////////////////////////////////////////////////////////////////
474
// This function rebuilds the query string so that it either adds or removes the Refresh parameter
475
//////////////////////////////////////////////////////////////////////////////////////////////////
476
function toggle_refresh()
477
{
478
   var new_url_query_string = '';
479
 
480
   // get the full query string
481
   var url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';
482
 
483
   // split it into each parameter
484
   var qs_arr = url_query_string.split('&');
485
   var i_qs_arr;
486
   for (i_qs_arr in qs_arr)
487
   {
488
      var qs_str = qs_arr[i_qs_arr];
489
 
490
      if (qs_str.length > 0)
491
      {
492
         // if we have found the Refresh parameter
493
         if (qs_str.indexOf('Refresh') >= 0)
494
         {
495
            // do nothing
496
         }
497
         else
498
         {
499
            // feed the existing paramter to the new query string
500
            if (new_url_query_string == '')
501
               new_url_query_string += '?';
502
            else
503
               new_url_query_string += '&';
504
            new_url_query_string += qs_str
505
         }
506
      }
507
   }
508
 
509
   // Prepare the new query string
510
 
511
   if (new_url_query_string == '')
512
      new_url_query_string += '\?';
513
   else
514
      new_url_query_string += '\&';
515
 
516
   new_url_query_string += 'Refresh=';
517
   if (document.getElementById('refreshPeriod').value < <%=Min_Refresh_Time%>)
518
   {
519
      document.getElementById('refreshPeriod').value = <%=Min_Refresh_Time%>;
520
      new_url_query_string += <%=Min_Refresh_Time%>;
521
   }
522
   else
523
      new_url_query_string += document.getElementById('refreshPeriod').value;
524
 
525
   if (document.getElementById('autoRefresh').checked)
526
      new_url_query_string += ',ON';
527
   else
528
      new_url_query_string += ',OFF';
529
 
530
 
531
   // reload the page with the new query string
532
   var url = location.pathname + new_url_query_string;
533
   window.location.assign(url);
534
}
535
 
536
//////////////////////////////////////////////////////////////////////////////////////////////////
537
// This function rebuilds the query string so that it either adds the Filter parameter
538
// according to the value of the radio button set used to control it
539
//////////////////////////////////////////////////////////////////////////////////////////////////
540
function toggle_Display_Filtered(newValue)
541
{
542
   var new_url_query_string = '';
543
 
544
   // get the full query string
545
   var url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';
546
 
547
   // split it into each parameter
548
   var qs_arr = url_query_string.split('&');
549
   var i_qs_arr;
550
   for (i_qs_arr in qs_arr)
551
   {
552
      var qs_str = qs_arr[i_qs_arr];
553
 
554
      if (qs_str.length > 0)
555
      {
556
         // if we have found the Display parameter
557
         if (qs_str.indexOf('Filter') >= 0)
558
         {
559
            // do nothing
560
         }
561
         else
562
         {
563
            // feed the existing paramter to the new query string
564
            if (new_url_query_string == '')
565
               new_url_query_string += '?';
566
            else
567
               new_url_query_string += '&';
568
            new_url_query_string += qs_str
569
         }
570
      }
571
   }
572
 
573
   // Prepare the new query string
574
   if (new_url_query_string == '')
575
      new_url_query_string += '\?';
576
   else
577
      new_url_query_string += '\&';
578
 
579
   new_url_query_string += 'Filter=';
580
   new_url_query_string += newValue;
581
 
582
   if (document.getElementById('problemDaemonSets').checked)
583
   {
584
      new_url_query_string += ',problemDaemonSets';
585
   }
586
 
587
   if (document.getElementById('activeBuilds').checked)
588
   {
589
      new_url_query_string += ',activeBuilds';
590
   }
591
 
592
   // reload the page with the new query string
593
   var url = location.pathname + new_url_query_string;
594
   window.location.assign(url);
595
}
596
 
597
//////////////////////////////////////////////////////////////////////////////////////////////////
598
// Rebuild the query string and reload the page based on the current setting of the filter
599
// radio buttons
600
//////////////////////////////////////////////////////////////////////////////////////////////////
601
function update_Display_Filter()
602
{
603
   if (document.getElementById('displayfiltered_off').checked)
604
      toggle_Display_Filtered("OFF");
605
   else
606
      toggle_Display_Filtered("ON");
607
}
608
 
609
//-->
610
</script>
611
 
612
<html>
613
   <head>
614
      <title>Release Manager</title>
615
      <meta http-equiv="Pragma" content="no-cache">
616
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
617
      <%If param_refreshEnabled AND param_RefreshPeriod <> 0 Then%>
618
         <META HTTP-EQUIV=REFRESH CONTENT=<%=param_RefreshPeriod%>>
619
      <%End If%>
620
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
621
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
622
      <script language="JavaScript" src="images/common.js"></script>
623
      <!-- DROPDOWN MENUS -->
624
      <!--#include file="_menu_def.asp"-->
625
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
626
   </head>
627
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
628
      <!-- MENU LAYERS -------------------------------------->
629
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
630
      <!-- TIPS LAYERS -------------------------------------->
631
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
632
      <!----------------------------------------------------->
633
      <!-- HEADER -->
634
      <!--#include file="_header.asp"-->
635
      <!-- BODY ---->
636
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
637
         <tr>
638
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
639
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
640
 
641
               <table width="10" border="0" cellspacing="0" cellpadding="0">
642
                  <tr>
643
                     <td width="1%"></td>
644
                     <td width="100%">
645
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
646
                           <tr>
647
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
648
                                 <p>BUILD DAEMON STATUS INFORMATION</p>
649
                              </td>
650
                              <td align="right" valign="bottom"></td>
651
                           </tr>
652
 
653
                           <tr>
654
                              <td width="100%">
655
                                 <fieldset style="width:700px;">
656
                                    <legend><a href="javascript:;" class="body_scol" >&nbsp;Monitoring&nbsp;Options</a></legend>
657
                                    <table width="100%" border="0" cellspacing="1" cellpadding="3">
658
                                       <tr>
659
                                          <td valign="top" width="200px" nowrap background="images/bg_table_col.gif" class="body_col">Auto Refresh</td>
660
                                          <td valign="top" width="100px" nowrap background="images/bg_table_col.gif" class="body_col">Filter</td>
661
                                          <td valign="top" width="200px" nowrap background="images/bg_table_col.gif" class="body_col">Filter Options</td>
662
                                       </tr>
663
 
664
                                       <tr>
665
                                          <td class="body_rowg">
666
                                             <input name="autoRefresh" id="autoRefresh" type="checkbox" <%If param_refreshEnabled Then%>checked<%End If%> value="1" onclick='toggle_refresh()'>
667
                                             <input style="width:50px" name="refreshPeriod" id="refreshPeriod" type="input" maxlength="3" value=<%=param_refreshPeriod%> onchange='toggle_refresh()' >Seconds (min. 10)
668
                                          </td>
669
                                          <td class="body_rowg">
670
                                             <input type="radio" name="displayfiltered" id="displayfiltered_off" value="OFF" <%=Display_Filtered("OFF")%> onclick="toggle_Display_Filtered('OFF')" >Off
671
                                             <input type="radio" name="displayfiltered" id="displayfiltered_on"  value="ON"  <%=Display_Filtered("ON")%>  onclick="toggle_Display_Filtered('ON')"  >On
672
                                          </td>
673
                                          <td class="body_rowg">
674
                                             <input name="activeBuilds" id="activeBuilds" type="checkbox" <%=Filter_Checked("activeBuilds")%> value="activeBuilds" onclick='update_Display_Filter()'>Active Builds
675
                                             <input name="problemDaemonSets"  id="problemDaemonSets"  type="checkbox" <%=Filter_Checked("problemDaemonSets")%>  value="problemDaemonSets"  onclick='update_Display_Filter()'>Problem Daemon Sets
676
                                          </td>
677
                                       </tr>
678
                                       <tr>
679
                                          <td class="body_rowg">
680
                                          </td>
681
                                          <td class="body_rowg">
682
                                          </td>
683
                                       </tr>
684
                                    </table>
685
                                 </fieldset>
686
                              </td>
687
                           </tr>
688
                           <%If bIndefinitelyPaused Then%>
689
                              <tr>
690
                                 <td>
691
                                    <span class='err_alert'>
692
                                       <font size='2'><b>WARNING: Indefinite Pause, Build Daemons are all stopped - please contact an administrator</b></font>
693
                                    </span>
694
                                 </td>
695
                              </tr>
696
                           <%End If%>
697
                        </table>
698
                     </td>
699
                     <td width="1%"></td>
700
                  </tr>
701
                  <tr>
702
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
703
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
704
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
705
                  </tr>
706
                  <tr>
707
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
708
                     <td bgcolor="#FFFFFF" valign="top">
709
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
710
                        <!--#include file="messages/_msg_inline.asp"-->
711
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
712
                        <br>
713
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
714
                           <td width="9%" valign="top"></td>
715
                           <tr>
716
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Project
717
                                 <input name="NOPRJ" id="NOPRJ" type="Button" value="All" onclick="toggle_all_projects(1)">
718
                                 <input name="NOPRJ" id="NOPRJ" type="Button" value="None" onclick="toggle_all_projects(0)">
719
                              </td>
720
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release</td>
721
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release<br>Mode</td>
722
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Mode</td>
163 brianf 723
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Host</td>
147 ghuddy 724
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>State</td>
725
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Building<br>Package</td>
726
                              <td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td>
727
                           </tr>
728
                           <%
729
 
730
                           query_string = "SELECT rc.RCON_ID, " &_
731
                                          "       rc.RTAG_ID, " &_
163 brianf 732
                                          "       bm.DISPLAY_NAME, " &_
147 ghuddy 733
                                          "       rc.DAEMON_MODE, "&_
734
                                          "       rt.RTAG_NAME, " &_
735
                                          "       rt.OFFICIAL, " &_
736
                                          "       p.PROJ_ID, " &_
737
                                          "       p.PROJ_NAME, " &_
738
                                          "       rl.CURRENT_PKG_ID_BEING_BUILT, "&_
739
                                          "       rl.CURRENT_RUN_LEVEL, "&_
740
                                          "       rl.PAUSE, " &_
741
                                          "       TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
163 brianf 742
                                          " FROM RELEASE_CONFIG rc, RELEASE_TAGS rt, PROJECTS p, RUN_LEVEL rl, BUILD_MACHINE_CONFIG bm " &_
147 ghuddy 743
                                          " WHERE rt.RTAG_ID = rc.RTAG_ID " &_
744
                                          "   AND rc.DAEMON_HOSTNAME is not null" &_
745
                                          "   AND rt.PROJ_ID = p.PROJ_ID " &_
746
                                          "   AND rt.OFFICIAL != 'A' " &_
747
                                          "   AND rt.OFFICIAL != 'Y' " &_
748
                                          "   AND rl.RCON_ID = rc.RCON_ID" &_
163 brianf 749
                                          "   AND rc.DAEMON_HOSTNAME = bm.MACHINE_HOSTNAME(+)" &_
750
                                          " ORDER BY p.PROJ_NAME, rt.RTAG_NAME, rc.DAEMON_MODE, bm.DISPLAY_NAME"
147 ghuddy 751
 
752
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
753
 
754
                           ' String variables
755
                           Dim strProject_checked        ' Can be "" or "checked". Determines appearance of project enable checkbox
756
 
757
                           ' Boolean variables
758
                           Dim bProject_changed          ' signals a row change due to a different project
759
                           Dim bRelease_changed          ' signals a row change due to a different release
760
                           Dim bRow_displayed            ' signals whether a row should be displayed or not
761
                           Dim bRelease_link_displayed   ' indicates whether the release name has been rendered yet
762
                           Dim bDisplay_whole_set        ' forces the whole daemon set for a release to be displayed
763
                           Dim bDisplayFilterIsOn        ' Indicates if Filtering is on or off
764
                           Dim bShowProblemDaemonSets    ' Indicates if problem daemons must be shown during filtering
765
                           Dim bShowActiveBuilds         ' Indicates if active builds must be shown during filtering
766
 
767
                           ' Integer variables
768
                           Dim pkgId
769
                           Dim lastProjID                ' Used to detect project changes from one row to the next
770
                           Dim lastRtagId                ' Used to detect release changes from one row to the next
173 brianf 771
                           Dim daemonState
147 ghuddy 772
 
773
                           ' Initialise variables
774
                           strProject_checked = ""
775
 
776
                           bProject_changed = True
777
                           bRelease_changed = True
778
                           bRow_displayed   = True
779
                           bRelease_link_displayed = False
780
                           bDisplay_whole_set  = False
781
                           bDisplayFilterIsOn  = Display_Filter_Is_On()
782
                           bShowProblemDaemonSets = Filter_Is_On("problemDaemonSets")
783
                           bShowActiveBuilds   = Filter_Is_On("activeBuilds")
784
 
785
                           lastProjID = 0
786
                           lastRtagId = 0
787
 
788
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
789
                              pkgId = rsQry("current_pkg_id_being_built")
790
 
791
                              ' determine if user has checked the project checkbox
792
                              strProject_checked = Is_Project_Checked(rsQry("proj_id"))
793
 
794
 
795
                              ' Has the project changed since the last row. If so, signal it via bProject_changed variable, and
796
                              ' reset the bRelease_link_displayed variable to force the display of the release column value on the
797
                              ' render of the next unfiltered row
798
                              bProject_changed = False
799
                              If lastProjID <> rsQry("proj_id") Then
800
                                 lastProjID =  rsQry("proj_id")
801
                                 bProject_changed = True
802
                                 bRelease_link_displayed = False
803
                                 bDisplay_whole_set = False
804
                              End If
805
 
806
                              ' Has the release changed since the last row of displayed data. If so, signal it via the bRelease_changed variable,
807
                              ' and reset the bRelease_link_displayed variable to force the display of the release column value on the
808
                              ' render of the next unfiltered row.
809
                              bRelease_changed = False
810
                              If lastRtagId <> rsQry("rtag_id") Then
811
                                 lastRtagId =  rsQry("rtag_id")
812
                                 bRelease_changed = True
813
                                 bRelease_link_displayed = False
814
                                 bDisplay_whole_set = False
815
                              End If
816
 
173 brianf 817
                              daemonState = rsQry("pause")
818
 
147 ghuddy 819
                              ' generate the table row divider - this uses the bRow_displayed value from the previous iteration in order
820
                              ' to prevent dividers being drawn between rows that were not actually rendered due to any filtering that
821
                              ' may be in effect.
822
                              %>
823
                              <%=HTML_Row_Divider( bProject_changed, strProject_checked, bRelease_changed, bRow_displayed )%>
824
                              <%
825
 
826
                              ' If this is a Master Daemon, look ahead at all the slaves and evaluate if any daemons in the set appear to
827
                              ' be having a problem. If any are and the user has turned the "Show Problem Daemon Sets" filter on then
828
                              ' set the bDisplay_whole_set variable to True else set it to False
829
                              If rsQry("daemon_mode") = "M" Then
830
 
831
                                 ' Initial default value is to not show the entire daemon set
832
                                 bDisplay_whole_set = False
833
 
834
                                 ' If the filter is turned on and master daemon is NOT actively building a package and it is NOT paused...
835
                                 If bDisplayFilterIsOn _
836
                                    AND bShowProblemDaemonSets _
837
                                    AND (NOT Is_Actively_Building(rsQry("current_pkg_id_being_built"))) _
838
                                    AND (NOT Is_Paused(rsQry("current_run_level"), bIndefinitelyPaused) ) Then
839
 
840
                                    ' Display the whole set if the master daemons delta exceeds the threshold
841
                                    bDisplay_whole_set = Daemon_Delta_Threshold_Exceeded(rsQry("delta"))
842
 
843
                                    ' If nothing appears wrong with the Master Daemon, look ahead at all the slaves in the set
844
                                    If NOT bDisplay_whole_set Then
845
                                       Dim thisRtagId
846
                                       Dim rtag_id_set_count
847
                                       Dim i
848
 
849
                                       thisRtagId = rsQry("rtag_id")
850
                                       rtag_id_set_count = 1
851
 
852
                                       rsQry.MoveNext
853
                                       Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF) AND rsQry("rtag_id") = thisRtagId
854
                                          rtag_id_set_count = rtag_id_set_count + 1
855
 
856
                                          ' If this slave daemon is NOT actively building a package and it is NOT paused and its Delta exceeds the threshold...
857
                                          If (NOT Is_Actively_Building(rsQry("current_pkg_id_being_built"))) _
858
                                             AND (NOT Is_Paused(rsQry("current_run_level"), bIndefinitelyPaused)) _
859
                                             AND Daemon_Delta_Threshold_Exceeded(rsQry("delta")) Then
860
 
861
                                             bDisplay_whole_set = True
862
                                          End If
863
                                          rsQry.MoveNext
864
                                       Loop
865
                                       For i = 1 to rtag_id_set_count
866
                                          rsQry.MovePrevious
867
                                       Next
868
                                    End If
869
                                 End If
870
                              End If
871
 
872
 
873
                              ' Now figure out if this row of data is to be displayed or not
874
                              bRow_displayed  =   ( NOT bDisplayFilterIsOn ) _
875
                                               OR ( bDisplay_whole_set ) _
876
                                               OR ( bShowActiveBuilds AND Is_Actively_Building(pkgId) )
877
 
878
 
879
                              ' If the release has changed and we are going to display this row, toggle the row style to give
880
                              ' it a slightly different look to the previous displayed row which was for a different release
881
                              If bRelease_changed AND bRow_displayed Then
882
                                 Call ToggleStyleNow
883
                              End If
884
 
885
                              ' Now we are ready to render the HTML content for the row, but we may still circumvent rendering if the user
886
                              ' has unchecked the project checkbox
887
                              %>
888
                              <tr>
889
                                 <%If bProject_changed Then%>
890
                                    <td nowrap class="body_rowg">
891
                                       <input name='DIS_PRJ_<%=rsQry("proj_id")%>' id='DIS_PRJ_<%=rsQry("proj_id")%>' type='checkbox' value=1 <%=strProject_checked%> onclick=toggle_project(<%=rsQry("proj_id")%>)>
892
                                       <a href='rtree.asp?proj_id=<%=rsQry("proj_id")%>'><%=rsQry("proj_name")%>
893
                                    </td>
894
                                 <%Else%>
895
                                    <td nowrap class="body_rowg"></td>
896
                                 <%End If%>
897
 
898
                                 <%If strProject_checked = "checked" Then%>
899
 
900
                                    <%If bRow_displayed Then%>
901
 
902
                                       <%If bRelease_changed OR NOT bRelease_link_displayed Then%>
903
                                          <%bRelease_link_displayed = True%>
904
                                          <td nowrap <%=styleNow%>><a href='build_status.asp?rtag_id=<%=rsQry("rtag_id")%>'><%=rsQry("rtag_name")%></a></td>
905
                                       <%Else%>
906
                                          <td nowrap <%=styleNow%>></td>
907
                                       <%End If%>
908
 
909
 
910
                                       <td nowrap <%=styleNow%>><%=Get_Official(rsQry("official"))%></td>
911
                                       <td nowrap <%=styleNow%>><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
163 brianf 912
                                       <td nowrap <%=styleNow%>><%=rsQry("display_name")%></td>
173 brianf 913
                                       <td nowrap <%=styleNow%>><%=Get_Run_Level(rsQry("current_run_level"), bIndefinitelyPaused,daemonState)%></td>
147 ghuddy 914
                                       <td nowrap <%=styleNow%>><%=Get_Pkg_Name(pkgId)%></td>
915
 
916
                                       <%If (rsQry("delta") > 600) AND (IsNull(pkgId) OR pkgId = "") Then%>
917
                                          <td nowrap <%=styleNow%> style=color:Red><%=rsQry("delta")%></td>
918
                                       <%Else%>
919
                                          <td nowrap <%=styleNow%>><%=rsQry("delta")%></td>
920
                                       <%End If%>
921
                                    <%End If%>
922
 
923
                                 </tr>
924
                                 <%End If%>
925
                              <%
926
                              rsQry.MoveNext
927
                           Loop
928
                           rsQry.Close()
929
                           Set rsQry = nothing
930
 
931
                           %>
932
                        </table>
933
                     </td>
934
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
935
                  </tr>
936
                  <tr>
937
                     <input type="hidden" name="action" value="true">
938
                     <%=objPMod.ComposeHiddenTags()%>
939
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
940
                     <td background="images/lbox_bg_blue.gif"></td>
941
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
942
                  </tr>
943
               </table>
944
            </td>
945
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
946
         </tr>
947
         <tr>
948
            <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>
949
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td>
950
         </tr>
951
      </table>
952
      <!-- FOOTER -->
953
      <!--#include file="_footer.asp"-->
954
   </body>
955
</html>
956
<%
957
Call Destroy_All_Objects
958
%>