Subversion Repositories DevTools

Rev

Rev 7063 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|         ADMIN Build Status Information            |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0  ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="common/common_daemon.asp"-->
<% '------------ ACCESS CONTROL ------------------ %>
<!--#include file="_access_control_login_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsQry
Dim query_string
Dim styleAlt1
Dim styleAlt2
Dim styleNow
Dim param_refreshPeriod
Dim param_inactivity
Dim param_refreshEnabled
Dim buildStatus

Dim bShowProblemDaemonSets    ' Indicates if problem daemons must be shown during filtering
Dim bShowDisabledDaemons      ' Indicates if a disabled daemon must be shown during filtering
Dim bShowActiveBuilds         ' Indicates if active builds must be shown during filtering
Dim bShowIdleBuilds           ' Indicates if idle builds must be shown during filtering
Dim bShowPausedBuilds         ' Indicates if paused builds must be shown during filtering
Dim bShowAutoProject          ' Hide projects that have no active components
Dim bProjectToggle            ' State of the Project toggler

'------------ Constants Declaration -----------
Const Min_Refresh_Time = 10         ' Seconds
Const Max_DeltaBuild = 31           ' Days
'------------ Variable Init -------------------

styleAlt1="class='body_rowg1'"
styleAlt2="class='body_rowg2'"
styleNow = styleAlt1
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------
'   Populate the buildStatus dictionary
'   Get all the required data into a hash of hashes
'   It will make the following processing so much easier
'
Sub getBuildStatus
    Dim bms
    query_string = "SELECT rc.RCON_ID, " &_
                  "       rc.RTAG_ID, " &_
                  "       bm.DISPLAY_NAME, " &_
                  "       rc.DAEMON_MODE, "&_
                  "       rt.RTAG_NAME, " &_
                  "       rt.OFFICIAL, " &_
                  "       rt.BUILD_AGE, " &_
                  "       p.PROJ_ID, " &_
                  "       p.PROJ_NAME, " &_
                  "       rl.CURRENT_PKG_ID_BEING_BUILT, "&_
                  "       rl.CURRENT_RUN_LEVEL, "&_
                  "       NVL(rl.PAUSE,0) as PAUSE, " &_
                  "       TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta," &_
                  "       TO_CHAR(rl.LAST_BUILD, 'DD-MON-YYYY') as last_build," &_
                  "       TRUNC (SYSDATE - rl.LAST_BUILD) as last_build_days," &_
                  "       pkg.PKG_NAME, NVL(ACTIVE, 'U') as ACTIVE" &_
                  " FROM RELEASE_CONFIG rc, RELEASE_TAGS rt, PROJECTS p, RUN_LEVEL rl, BUILD_MACHINE_CONFIG bm, PACKAGES pkg " &_
                  " WHERE rt.RTAG_ID = rc.RTAG_ID " &_
                  "   AND rc.bmcon_id is not null" &_
                  "   AND rt.PROJ_ID = p.PROJ_ID " &_
                  "   AND rt.OFFICIAL in ( 'N', 'R', 'C')" &_
                  "   AND rl.RCON_ID(+) = rc.RCON_ID" &_
                  "   AND rc.bmcon_id = bm.bmcon_id(+)" &_
                  "   AND pkg.PKG_ID(+) = rl.CURRENT_PKG_ID_BEING_BUILT" &_
                  " ORDER BY p.PROJ_NAME, rt.RTAG_NAME, rc.DAEMON_MODE, bm.DISPLAY_NAME, rc.DAEMON_MODE"

    Set buildStatus = CreateObject("Scripting.Dictionary")
    Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
    Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
        Set bms = CreateObject("Scripting.Dictionary")

        bms.Item("RCON_ID")                     = rsQry("RCON_ID")
        bms.Item("RTAG_ID")                     = rsQry("RTAG_ID")
        bms.Item("DISPLAY_NAME")                = rsQry("DISPLAY_NAME")
        bms.Item("RTAG_NAME")                   = rsQry("RTAG_NAME")
        bms.Item("DAEMON_MODE")                 = rsQry("DAEMON_MODE")
        bms.Item("OFFICIAL")                    = rsQry("OFFICIAL")
        bms.Item("BUILD_AGE")                   = NiceInt(rsQry("BUILD_AGE"), 31)
        bms.Item("PROJ_ID")                     = rsQry("PROJ_ID")
        bms.Item("PROJ_NAME")                   = rsQry("PROJ_NAME")
        bms.Item("CURRENT_PKG_ID_BEING_BUILT")  = rsQry("CURRENT_PKG_ID_BEING_BUILT")
        bms.Item("CURRENT_RUN_LEVEL")           = rsQry("CURRENT_RUN_LEVEL")
        bms.Item("PAUSE")                       = CInt(rsQry("PAUSE"))
        bms.Item("delta")                       = rsQry("delta")
        bms.Item("last_build")                  = rsQry("last_build")
        bms.Item("last_build_days")             = NiceInt(rsQry("last_build_days"), 100)
        bms.Item("PKG_NAME")                    = rsQry("PKG_NAME")
        bms.Item("ACTIVE")                      = rsQry("ACTIVE")

        ' Calculate some values
        bms.Item("dState") = Classify_Run_Level(bms.Item("CURRENT_RUN_LEVEL"),_
                                                IndefPause,_
                                                bms.Item("PAUSE"), _
                                                bms.Item("delta") ,_
                                                bms.Item("CURRENT_PKG_ID_BEING_BUILT"),_
                                                bms.Item("ACTIVE"))

        bms.Item("dStateText") = Get_Run_Level(bms.Item("CURRENT_RUN_LEVEL"),_
                                               IndefPause,_
                                               bms.Item("PAUSE"),_
                                               bms.Item("ACTIVE"))

        ' Kill package name on disabled daemons
        If bms.Item("PAUSE") = 2 Then bms.Item("PKG_NAME") = Null


        ' Add to buildStatus
        '   This is a three level hash (Project,Release, Daemon)

        Dim ProjRef, RelRef, DRef
        ProjRef = bms.Item("PROJ_NAME")
        RelRef  = bms.Item("RTAG_NAME")
        DRef    = bms.Item("DISPLAY_NAME")

        If  Not buildStatus.Exists(ProjRef) Then
            Set buildStatus(ProjRef) = CreateObject("Scripting.Dictionary")
            Set buildStatus(ProjRef).Item("data") = CreateObject("Scripting.Dictionary")
            'buildStatus(ProjRef).Item("PROJ_ID") = bms.Item("PROJ_ID")
            'buildStatus(ProjRef).Item("PROJ_NAME") = bms.Item("PROJ_NAME")

        End If

        If  Not buildStatus(ProjRef).Item("data").Exists(RelRef) Then
            Set buildStatus(ProjRef).Item("data").Item(RelRef) = CreateObject("Scripting.Dictionary")
            Set buildStatus(ProjRef).Item("data").Item(RelRef).Item("data") = CreateObject("Scripting.Dictionary")
            'buildStatus(ProjRef).Item("data").Item(RelRef).Item("RTAG_NAME") = bms.Item("RTAG_NAME")
            'buildStatus(ProjRef).Item("data").Item(RelRef).Item("RTAG_ID") = bms.Item("RTAG_ID")
        End If

        Set buildStatus(ProjRef).Item("data").Item(RelRef).Item("data").Item(DRef) = bms

        rsQry.MoveNext
    Loop
    rsQry.Close()
    Set rsQry = nothing

    ' Iterate over each deamon set and flag some of its characteristics
    '   This could be done inline, as the data is processed from the SQL source
    Dim project,release,machine
    Dim eProject,eRelease,eMachine
    For Each project in buildStatus
        Set eProject = buildStatus.Item(project)
        For Each release in eProject.Item("data")
            Set eRelease = eProject.Item("data").Item(release)
            For Each machine in eRelease.Item("data")
                Set eMachine = eRelease.Item("data").Item(machine)

                Dim dState
                dState = eMachine.Item("dState")

                If dState = "active" Then
                    If bShowActiveBuilds Then eMachine.Item("bRow_displayed") = "ShowActive"
                ElseIf dState = "idle" Then
                    If bShowIdleBuilds Then eMachine.Item("bRow_displayed") = "ShowIdle"
                ElseIf dState = "paused" Then
                    If bShowPausedBuilds Then eMachine.Item("bRow_displayed") = "ShowPaused"
                ElseIf dState = "disabled" Then
                    If bShowDisabledDaemons Then eMachine.Item("bRow_displayed") = "ShowDisabled"
                ElseIf dState = "problem" Then
                    If bShowProblemDaemonSets Then eMachine.Item("bRow_displayed") = "ShowProblem"
                    If bShowProblemDaemonSets Then eRelease.Item("bDisplay_whole_set") = true
                Else
                    eRelease.Item("bDisplay_whole_set") = true
                    eMachine.Item("bRow_displayed") = "ShowUnknownState"
                End If

                If bShowProblemDaemonSets AND eMachine.Item("BUILD_AGE") > 0 Then
                    If (eMachine.Item("last_build_days") > eMachine.Item("BUILD_AGE")) OR (eMachine.Item("last_build_days") > param_inactivity) Then
                       If dState = "active" OR dState = "idle" Then
                          eRelease.Item("bDisplay_whole_set") = true
                          eRelease.Item("bShowAge") = true
                          eMachine.Item("bRow_displayed") = "ShowInactiveWarning"
                       End If
                    End If
                End If

                If eMachine.Exists("bRow_displayed") Then
                    eRelease.Item("bDisplay_some") = true
                    eProject.Item("bDisplay_some") = true
                End If

            Next
        Next
    Next

    ' Debug the data structure
    '   Requires common/DictDump.vbs to be included to work
    'Response.Write "<br>Pretty Dictionary Display<pre>"
    'Response.Write DICToutput(buildStatus)

End Sub

'--------------------------------------------------------------------------------------------------------------------------
' Toggle row style between the two alternative styles
Sub ToggleStyleNow
   If styleNow = styleAlt1 Then
      styleNow = styleAlt2
   Else
      styleNow = styleAlt1
   End If
End Sub
'--------------------------------------------------------------------------------------------------------------------------
' Convert run level into a meaningful filter state as a string
' Will be one of: active, idle, paused, disabled, problem, unknown
Function Classify_Run_Level( nLevel, indefinitePause, astate, nDelta, pkgId, bActive)

   If bActive = "N" AND astate <> 2 Then
      Classify_Run_Level = "problem"
   ElseIf indefinitePause Then
      Classify_Run_Level = "problem"
   ElseIf astate = 1 Then                   ' if build daemon paused
      Classify_Run_Level = "paused"
   ElseIf astate = 2 Then                   ' if build daemon disabled
      Classify_Run_Level = "disabled"
   ElseIf Int(nDelta) > Max_Delta Then
      Classify_Run_Level = "problem"
   ElseIf (IsNull(pkgId)) OR (pkgId = "") Then
      Classify_Run_Level = "idle"
   ElseIf astate = 0 Then                   ' if build daemon enabled
      If nLevel = 1 Then
         Classify_Run_Level = "problem"
      ElseIf nLevel = 2 Then
         Classify_Run_Level = "paused"
      ElseIf nLevel = 3 Then
         Classify_Run_Level = "active"
      ElseIf nLevel = 4 Then
         Classify_Run_Level = "idle"
      ElseIf nLevel = 5 Then
         Classify_Run_Level = "idle"
      ElseIf nLevel = 6 Then
         Classify_Run_Level = "active"
      Else
         Classify_Run_Level = "unknown"
      End If
   End If
End Function

'--------------------------------------------------------------------------------------------------------------------------
' Use this function to determine the state of a specified project checkbox
Function Is_Project_Checked( nProjId )
   Dim hiddenProjects_arr
   Dim hiddenProjects
   Dim str

   hiddenProjects = Request("HideProj")
   Is_Project_Checked = "checked"

   hiddenProjects_arr = Split(hiddenProjects, ",")
   For Each str in hiddenProjects_arr
      If str = nProjId Then
         Is_Project_Checked = ""
         Exit For
      End If
   Next
End Function
'--------------------------------------------------------------------------------------------------------------------------
' Use this function to set/clear the filter on/off radio button checked state
' Format of Filter Param : Filter=[problemBuilds}[,ActiveBuilds]
Function Display_Filtered(id)
   Dim filter

   Display_Filtered = ""

   filter  = Request("Filter")
   If NOT IsNull(filter) AND filter <> "" Then
      If InStr(filter, id) > 0 Then
         Display_Filtered = "checked"
      End If
   Else
      If id = "OFF" Then
         Display_Filtered = "checked"
      End If
   End If
End Function

'--------------------------------------------------------------------------------------------------------------------------
' Use this function to set/clear a filter option check box with the given ID
' If no Filter is present, then assume defaults          
Function Filter_Checked(id)
   Dim filter

   Filter_Checked = ""

   filter  = Request("Filter")
   If IsNull(filter) OR filter = "" Then
     filter="problemBuilds,activeBuilds"        ' Defaults
   End If
  If InStr(filter, id) > 0 Then
     Filter_Checked = "checked"
  End If
End Function
'--------------------------------------------------------------------------------------------------------------------------
' Test to see if a particular filter option is on
Function Filter_Is_On(id)
    If Filter_Checked(id) = "checked" Then
          Filter_Is_On = True
    Else
          Filter_Is_On = False
    End If
End Function
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

' Default values for Auto Refresh checkbox and edit input box
param_refreshEnabled = False
param_refreshPeriod  = "0"

' Read the Refresh parameter which is of the form Refresh=<time-period>,ON|OFF
Dim param_refresh
param_refresh = Request("Refresh")
If param_refresh <> "" Then
   Dim pr_arr
   pr_arr = Split(param_refresh,",")
   param_refreshPeriod = pr_arr(0)

   ' Range check and end-stop the refresh period if necessary
   If NiceInt(param_refreshPeriod, 0)  < Min_Refresh_Time Then
      param_refreshPeriod  = CStr(Min_Refresh_Time)
   End If

   ' determine checkbox state
   If UBound(pr_arr) >= 1 Then
      If InStr(UCase(pr_arr(1)), "ON") > 0 Then
         param_refreshEnabled = True
      Else
         param_refreshEnabled = False
      End If
   End If
End If

' Read the Inactivity Period
param_inactivity = NiceInt( Request("Inactivity"), Max_DeltaBuild)
If param_inactivity  = 0 Then param_inactivity = Max_DeltaBuild

' Populate display controls
bShowProblemDaemonSets = Filter_Is_On("problemBuilds")
bShowActiveBuilds      = Filter_Is_On("activeBuilds")
bShowDisabledDaemons   = Filter_Is_On("disabledDaemons")
bShowIdleBuilds        = Filter_Is_On("idleBuilds")
bShowPausedBuilds      = Filter_Is_On("pausedBuilds")
bShowAutoProject       = Filter_Is_On("autoProjects")

bProjectToggle         = RequestBool("pAll", True)

'----------------------------------------------
%>
<script language="JavaScript" type="text/javascript">
<!--
function url_append( url, str ) {
    if ( str.length <= 0 )
        return url;

    if ( url == '' )
       url += '\?';
    else
       url += '\&';
    return url + str;
}

function url_remove( url, str) {
    // split it into each parameter
    var qs_arr = url.split(/[&?]/);
    var remaining = new Array();
    var newUrl = '';
    var i_qs_arr;
    for (i_qs_arr in qs_arr)
    {
       var qs_str = qs_arr[i_qs_arr];

       if (qs_str.length > 0) {
          if (qs_str.indexOf(str) < 0) {
              remaining.push(qs_str);
          }
       }
    }
    return url_append('',remaining.join('&'));
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// This function rebuilds the query string so as to update the list of 'hidden' projects
//////////////////////////////////////////////////////////////////////////////////////////////////
function toggle_project()
{
    // Determine all non-cheked project boxes.
   var inputs = document.getElementsByTagName('input');
   var i;
   var list = new Array();
   for (i = 0; i < inputs.length; i++) {
      var str = inputs[i].name;
      if ( ! inputs[i].checked ){
          if (str.indexOf("DIS_PRJ_") >= 0) {
              list.push(str.replace("DIS_PRJ_",""));
          }
      }
   }

    // get the full query string
    var url_query_string = window.location.search.substr(1);

    // Remove bits we are going to process
    url_query_string = url_remove(url_query_string, 'HideProj');

    // Prepare the new query string, only adding the HideProj parameter if the function is being
    // used to hide all projects
     if ( list.length > 0) {
         url_query_string = url_append(url_query_string, 'HideProj=' + list.join(','));
     }

    // reload the page with the new query string
    var url = location.pathname + url_query_string;
    window.location.assign(url);
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// This function rebuilds the query string to either hide all projects, or unhide all projects
// from the display
//////////////////////////////////////////////////////////////////////////////////////////////////
function toggle_all_projects(el)
{
   var bAll = (el.checked);

   // If hiding all, then find all of the project enable/disable checkboxes, get the project ID
   // values from each one and accumulate them into a comma seperated list
   if (!bAll)
   {
      var inputs = document.getElementsByTagName('input');
      var i;
      var list = new Array();
      for (i = 0; i < inputs.length; i++) {
         var str = inputs[i].name;
         if (str.indexOf("DIS_PRJ_") >= 0) {
             list.push(str.replace("DIS_PRJ_",""));
         }
      }
   }

   // get the full query string
   var url_query_string = window.location.search.substr(1);

   // Remove bits we are going to process
   url_query_string = url_remove(url_query_string, 'HideProj');
   url_query_string = url_remove(url_query_string, 'pAll=');

   if ( !bAll) {
       url_query_string = url_append(url_query_string, 'pAll=0');
   }

   // Prepare the new query string, only adding the HideProj parameter if the function is being
   // used to hide all projects
    if (!bAll) {
        if ( list.length > 0) {
            url_query_string = url_append(url_query_string, 'HideProj=' + list.join(','));
        }
    }

   // reload the page with the new query string
   var url = location.pathname + url_query_string;
   window.location.assign(url);
}

//////////////////////////////////////////////////////////////////////////////////////////////////
// This function rebuilds the query string so that it either adds or removes the Refresh parameter
//////////////////////////////////////////////////////////////////////////////////////////////////
function toggle_refresh()
{
   // get the full query string
   var url_query_string = window.location.search.substr(1);
   url_query_string = url_remove(url_query_string, 'Refresh');

   // Prepare the new query string
   var refreshData = 'Refresh=';
   if (document.getElementById('refreshPeriod').value < <%=Min_Refresh_Time%>) {
      document.getElementById('refreshPeriod').value = <%=Min_Refresh_Time%>;
      refreshData += <%=Min_Refresh_Time%>;
   }
   else
      refreshData += document.getElementById('refreshPeriod').value;

   if (document.getElementById('autoRefresh').checked)
      refreshData += ',ON';
   else
      refreshData += ',OFF';

   url_query_string = url_append(url_query_string, refreshData);

   // reload the page with the new query string
   var url = location.pathname + url_query_string;
   window.location.assign(url);
}


//////////////////////////////////////////////////////////////////////////////////////////////////
// This function rebuilds the query string to Update the Inactivity parameter
//////////////////////////////////////////////////////////////////////////////////////////////////
function toggle_inactivity()
{
   // get the full query string
   var url_query_string = window.location.search.substr(1);
   url_query_string = url_remove(url_query_string, 'Inactivity');

   // Prepare the new query string
   var value = document.getElementById('inactivity').value;
   if  (value && (value != <%=Max_DeltaBuild%>)) {
       url_query_string = url_append(url_query_string, 'Inactivity=' + value);
    }

   // reload the page with the new query string
   var url = location.pathname + url_query_string;
   window.location.assign(url);
}


//////////////////////////////////////////////////////////////////////////////////////////////////
// Rebuild the query string and reload the page based on the current setting of the filter
// radio buttons
//////////////////////////////////////////////////////////////////////////////////////////////////
function update_Display_Filter()
{
   // get the full query string
   var url_query_string = window.location.search.substr(1);
   url_query_string = url_remove(url_query_string, 'Filter');

   // Prepare the new query string
   var active = new Array();
   var items = new Array ("activeBuilds","disabledDaemons","idleBuilds","pausedBuilds","problemBuilds","autoProjects");
   for (var item in items) {
       if (document.getElementById(items[item]).checked) {
           active.push(items[item]);
          joiner = ',';
       }
   }
   var filterSet = active.join(',') ;

   if (filterSet.length > 0) {
       url_query_string = url_append(url_query_string, 'Filter=' + filterSet);
   }
   
   // reload the page with the new query string
   var url = location.pathname + url_query_string;
   window.location.assign(url);
}

//-->
</script>
<%
'------------------------------------------------------------------------------
Sub SidePanelContent
%>
<!-- Monitoring Options Selection Box ---->
 <fieldset style="padding:3px">
    <legend class="body_scol">Display Options</legend>
     <fieldset class="body_rowg">
        <legend class="body_scol">Auto Refresh</legend>
             <div class=nowrap>
             <input name="autoRefresh" id="autoRefresh" type="checkbox" <%If param_refreshEnabled Then%>checked<%End If%> value="1" onclick='toggle_refresh()'>
                 <input class="body_txt" style="width:3em" name="refreshPeriod" id="refreshPeriod" type="input" maxlength="3" value="<%=param_refreshPeriod%>" onchange='toggle_refresh()' > Seconds
             </div>
     </fieldset>
     <fieldset class="body_rowg">
        <legend class="body_scol">Filter</legend>
            <div>
                 <input name="activeBuilds" id="activeBuilds" type="checkbox" <%=Filter_Checked("activeBuilds")%> value="activeBuilds" onclick='update_Display_Filter()'>Active
            </div>
            <div>
                 <input name="idleBuilds" id="idleBuilds" type="checkbox" <%=Filter_Checked("idleBuilds")%> value="idleBuilds" onclick='update_Display_Filter()'>Idle
            </div>
            <div>
                 <input name="pausedBuilds" id="pausedBuilds" type="checkbox" <%=Filter_Checked("pausedBuilds")%> value="paused" onclick='update_Display_Filter()'>Paused
            </div>
            <div>
                 <input name="disabledDaemons"  id="disabledDaemons"  type="checkbox" <%=Filter_Checked("disabledDaemons")%>  value="disabledDaemons"  onclick='update_Display_Filter()'>Disabled
            </div>
            <div class=nowrap>
                 <input name="problemBuilds"  id="problemBuilds"  type="checkbox" <%=Filter_Checked("problemBuilds")%>  value="problemBuilds"  onclick='update_Display_Filter()'>Problem&nbsp;Daemon&nbsp;Sets
            </div>
            <div class=nowrap>
                 <input name="autoProjects"  id="autoProjects"  type="checkbox" <%=Filter_Checked("autoProjects")%>  value="autoProjects"  onclick='update_Display_Filter()'>Auto Hide Projects
            </div>

     </fieldset>
     <fieldset class="body_rowg">
        <legend  class="body_scol">Inactivity</legend>
        <input class="body_txt" style="width:3em" name="inactivity" id="inactivity" type="input" maxlength="3" value="<%=param_inactivity%>" onchange='toggle_inactivity()' > Days
     </fieldset>
</fieldset>
<%
End Sub
'------------------------------------------------------------------------------
Sub DisplayProjectHeader(bProjectHeaderDone, eMachine, strProject_checked)
    If NOT bProjectHeaderDone Then%>
        <tr>
           <td colspan='8'><img src='images/spacer.gif' width='1' height='5'></td>
        </tr>
        <tr>
           <td colspan='8' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='5'></td>
        </tr>
        <tr>
            <td nowrap class="body_rowg">
                <input name='DIS_PRJ_<%=eMachine("PROJ_ID")%>' id='DIS_PRJ_<%=eMachine("PROJ_ID")%>' type='checkbox' value=1 <%=strProject_checked%> onclick=toggle_project()>
                <a href='rtree.asp?proj_id=<%=eMachine("PROJ_ID")%>'><%=eMachine("PROJ_NAME")%>
            </td>
        <%
    End If
End Sub
'------------------------------------------------------------------------------
Sub ShowDaemonStatus
%>
<table width="10" class="embedded_table" style="margin-bottom:10px">
  <tr>
     <td width="100%">
        <table width="100%" class="embedded_table">
           <tr>
              <td nowrap class="form_ttl">BUILD DAEMON STATUS INFORMATION</td>
           </tr>
        </table>
     </td>
  </tr>
  <tr>
    <td>
        <table class="rounded_box embedded_table" width="100%" >
          <tr>
             <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
             <td bgcolor="#FFFFFF" valign="top">
                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <!--#include file="messages/_msg_inline.asp"-->
                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <br>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                   <!-- Status Table Header -->
                   <thead>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col tleft">
                        <input type="checkbox" <%=IIF(bProjectToggle, "checked", "")%> title='Show/Hide all active releases' onclick=toggle_all_projects(this)>Project</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release<br>Mode</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Mode</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Host</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>State</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Building<br>Package</th>
                      <th valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</th>
                   </thead>

                   <!-- Status Table Body -->
                   <%
                    Dim bProject_changed          ' Signals a row change due to a different project
                    Dim strProject_checked        ' Can be "" or "checked". Determines appearance of project enable checkbox
                    Dim bRelease_changed          ' signals a row change due to a different release
                    Dim bReleaseHeaderDone        ' indicates whether the release name has been rendered yet
                    Dim bProjectHeaderDone        ' Project Header done
                    Dim bShowAge                  ' Display age warning
                    Dim bToggleStyle              ' Data shown so toggle style
                    Dim bShowReleaseSep           ' Show Release Seperator
                    Dim bShowProject              ' Show this project

                    '   Iterate over all projects, releases and machines
                    '
                    Dim project,release,machine
                    Dim eProject,eRelease,eMachine
                    For Each project in buildStatus
                        ' Start of a new Project
                        Set eProject = buildStatus.Item(project)
                        bProjectHeaderDone = false
                        bProject_changed = true
                        bShowReleaseSep = False
                        bShowProject = True
                        If bShowAutoProject AND NOT eProject.Item("bDisplay_some") Then
                            bShowProject = False
                        End If
                        If bShowProject Then
                            For Each release in eProject.Item("data")
                                '   Start of a new Release
                                Set eRelease = eProject.Item("data").Item(release)
                                bReleaseHeaderDone = False
                                bRelease_changed = true
                                bShowAge = eRelease("bShowAge")
                                If  bToggleStyle Then Call ToggleStyleNow
                                bToggleStyle = false

                                For Each machine in eRelease.Item("data")
                                    '   Start of a new Machine
                                    Set eMachine = eRelease.Item("data").Item(machine)
                                    strProject_checked = Is_Project_Checked(eMachine("PROJ_ID"))

                                    ' Consider displaying the body of this machine entry
                                    If strProject_checked = "checked" Then
                                        If eRelease.Exists("bDisplay_whole_set") OR eMachine.Exists("bRow_displayed") Then
                                            bToggleStyle = true

                                            ' Display Project and Release Header - Once, or a filler
                                            If NOT bReleaseHeaderDone Then
                                                bReleaseHeaderDone = True

                                                ' Display Project Header - ONCE. The <tr> is open
                                                Call DisplayProjectHeader(bProjectHeaderDone,eMachine, strProject_checked)
                                                bProjectHeaderDone = TRUE


                                                ' Display Release seperator, if this is not the first release in the project
                                                If bShowReleaseSep Then
                                                    %>
                                                        <tr>
                                                            <td></td>
                                                            <td colspan='7' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='1'></td>
                                                        </tr>
                                                        <tr>
                                                            <td></td>
                                                    <%
                                                End If
                                                ' Display the Release Header, with a marker to show aged releases
                                                %>
                                                <td nowrap <%=styleNow%>>
                                                    <a href='build_status.asp?rtag_id=<%=eMachine("RTAG_ID")%>' title='Last Build:<%=eMachine("last_build")%>'><%=eMachine("RTAG_NAME")%></a>
                                                <%
                                                If bShowAge Then
                                                %>
                                                    <img src='images/s_warning.gif' width='14' height='13' border='0' title='No Build in this release since <%=eMachine("last_build")%>. [<%=eMachine("last_build_days")%> Days]' style='vertical-align: bottom;'>
                                                <%
                                                End If
                                                %></td><%
                                            Else%>
                                                <td nowrap class="body_rowg"></td>
                                                <td nowrap <%=styleNow%>></td>
                                            <%
                                            End If
                                            bShowReleaseSep = true
                                            %>
                                            <td nowrap <%=styleNow%>><%=Get_Official(eMachine("OFFICIAL"))%></td>
                                            <td nowrap <%=styleNow%>><%=Get_Daemon_Mode(eMachine("DAEMON_MODE"))%></td>
                                            <td nowrap <%=styleNow%>><%=eMachine("DISPLAY_NAME")%></td>
                                            <td nowrap <%=styleNow%>><%=eMachine("dStateText")%></td>
                                            <td nowrap <%=styleNow%>><%=eMachine("PKG_NAME")%></td>
                                            <td nowrap <%=styleNow%>><%=PrettyDelta(eMachine("delta"),eMachine("PAUSE"),eMachine("PKG_NAME") )%></td>
                                            <%
                                        End If
                                        %></tr><%
                                    End If

                                    ' End of Display
                                    bRelease_changed = false
                                    bProject_changed = false
                                Next
                            Next
                            Call DisplayProjectHeader(bProjectHeaderDone,eMachine, strProject_checked)
                        End If
                        Next
                   %>
                </table>
             </td>
             <td background="images/lbox_bgside_white.gif">&nbsp;</td>
           </tr>
        </table>
      </td>
  </tr>
</table>
<%
End Sub
%>
<html>
   <head>
      <title>Release Manager</title>
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
      <meta http-equiv="Pragma" content="no-cache">
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
      <%If param_refreshEnabled AND param_RefreshPeriod <> 0 Then%>
         <META HTTP-EQUIV=REFRESH CONTENT=<%=param_RefreshPeriod%>>
      <%End If%>
      <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
      <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
      <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
      <!--#include file="_jquery_includes.asp"-->
      <!-- DROPDOWN MENUS -->
      <!--#include file="_menu_def.asp"-->
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
   </head>
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
      <!-- HEADER -->
      <!--#include file="_header.asp"-->
      <% getBuildStatus() %>
      <!-- BODY ---->
      <table class="full_table">
         <tr>
            <td width="146px" class="bg_panel" valign="top">
                <%Call SidePanelContent%>
            </td>
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
                <%Call ShowDaemonStatus%>
            </td>
         </tr>
         <tr>
            <td class="bg_panel_btm" height="350">
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>