Subversion Repositories DevTools

Rev

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