Subversion Repositories DevTools

Rev

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