Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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