Subversion Repositories DevTools

Rev

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