Rev 3897 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='| |'| ADMIN Build Status Information |'| |'=====================================================%><%Option explicit' Good idea to set when using redirectResponse.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="_action_buttons.asp"--><!--#include file="class/classActionButtonControl.asp"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_general.asp"--><%'------------ Variable Definition -------------Dim rsQryDim query_stringDim styleAlt1Dim styleAlt2Dim styleNowDim param_refreshPeriodDim param_refreshEnabledDim bIndefinitelyPaused'------------ Constants Declaration -----------Const Min_Refresh_Time = 10'------------ Variable Init -------------------styleAlt1="class='body_rowg1'"styleAlt2="class='body_rowg2'"styleNow = styleAlt1'----------------------------------------------%><%'--------------------------------------------------------------------------------------------------------------------------'--------------------------------------------------------------------------------------------------------------------------' Toggle row style between the two alternative stylesSub ToggleStyleNowIf styleNow = styleAlt1 ThenstyleNow = styleAlt2ElsestyleNow = styleAlt1End IfEnd Sub'--------------------------------------------------------------------------------------------------------------------------' Convert run level into a meaningful stringFunction Get_Run_Level( nLevel, indefinitePause, astate)If indefinitePause ThenGet_Run_Level = "<span class='err_alert'>Stopped</span>"ElseIf astate = 1 Then ' if build daemon pausedGet_Run_Level = "Paused"ElseIf astate = 2 Then ' if build daemon disabledGet_Run_Level = "Disabled"ElseIf astate = 0 Then ' if build daemon enabledIf nLevel = 1 ThenGet_Run_Level = "Cannot Continue"ElseIf nLevel = 2 ThenGet_Run_Level = "Paused"ElseIf nLevel = 3 ThenGet_Run_Level = "Building"ElseIf nLevel = 4 ThenGet_Run_Level = "Idle"ElseIf nLevel = 5 ThenGet_Run_Level = "Waiting"ElseIf nLevel = 6 ThenGet_Run_Level = "Publishing"ElseGet_Run_Level = "<span class='err_alert'>Unknown!</span>"End IfEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Is a build occurring for this dataset/row ?Function Is_Actively_Building( nPkgId )Is_Actively_Building = FalseIf (NOT IsNull(nPkgId)) AND (nPkgId <> "") ThenIs_Actively_Building = TrueEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Return True if the paramter values represent a possibly hung daemonFunction Daemon_Delta_Threshold_Exceeded( nDelta )Daemon_Delta_Threshold_Exceeded = FalseIf (nDelta > 600) ThenDaemon_Delta_Threshold_Exceeded = TrueEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Return True if the paramter values represent a paused daemonFunction Is_Paused( nLevel, indefinitePause )If indefinitePause ThenIs_Paused = TrueElseIf nLevel = 2 ThenIs_Paused = TrueElseIs_Paused = FalseEnd IfEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Return True if the paramter values represent a disabled or paused daemonFunction Is_Disabled( astate)If astate = 1 Then ' if build daemon pausedIs_Disabled = TrueElseIf astate = 2 Then ' if build daemon disabledIs_Disabled = TrueElseIs_Disabled = FalseEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Convert daemon mode into a meaningful stringFunction Get_Daemon_Mode( nMode )If nMode = "M" ThenGet_Daemon_Mode = "Master"ElseIf nMode = "S" ThenGet_Daemon_Mode = "Slave"ElseGet_Daemon_Mode = "?"End IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Return HTML for a seperator line between rows in the tableFunction HTML_Row_Divider( projectChanged, projectChecked, releaseChanged, last_row_displayed )Dim ss = ""If projectChanged Thens = s + "<tr>"s = s + " <td colspan='8'><img src='images/spacer.gif' width='1' height='5'></td>"s = s + "</tr>"s = s + "<tr>"s = s + " <td colspan='8' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='5'></td>"s = s + "</tr>"Elseif projectChecked = "checked" AND last_row_displayed = True Thens = s + "<tr>"If releaseChanged Thens = s + "<td></td>"s = s + "<td colspan='7' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='1'></td>"Elses = s + "<td></td>"s = s + "<td colspan='7' background='images/bg_rep_line.gif'><img src='images/spacer.gif' width='1' height='1'></td>"End Ifs = s + "</tr>"End IfEnd IfHTML_Row_Divider = sEnd Function'--------------------------------------------------------------------------------------------------------------------------' Use this function to determine the state of a specified project checkboxFunction Is_Project_Checked( nProjId )Dim hiddenProjects_arrDim hiddenProjectsDim strhiddenProjects = Request("HideProj")Is_Project_Checked = "checked"hiddenProjects_arr = Split(hiddenProjects, ",")For Each str in hiddenProjects_arrIf str = nProjId ThenIs_Project_Checked = ""Exit ForEnd IfNextEnd Function'--------------------------------------------------------------------------------------------------------------------------' Use this function to set/clear the filter on/off radio button checked state' Format of Filter Param : Filter=ON,[problemDaemonSets}[,ActiveBuilds] | OFFFunction Display_Filtered(id)Dim filterDisplay_Filtered = ""filter = Request("Filter")If NOT IsNull(filter) AND filter <> "" ThenIf InStr(filter, id) > 0 ThenDisplay_Filtered = "checked"End IfElseIf id = "OFF" ThenDisplay_Filtered = "checked"End IfEnd IfEnd FunctionFunction Display_Filter_Is_On()If Display_Filtered("ON") = "checked" ThenDisplay_Filter_Is_On = TrueElseDisplay_Filter_Is_On = FalseEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Use this function to set/clear a filter option check box with the given IDFunction Filter_Checked(id)Dim filterFilter_Checked = ""filter = Request("Filter")If NOT IsNull(filter) AND filter <> "" ThenIf InStr(filter, id) > 0 ThenFilter_Checked = "checked"End IfEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Test to see if a particular filter option is onFunction Filter_Is_On(id)If Display_Filter_Is_On() ThenIf Filter_Checked(id) = "checked" ThenFilter_Is_On = TrueElseFilter_Is_On = FalseEnd IfElseFilter_Is_On = FalseEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------' Get name of package given its ID. Return empty string if not able to do so.Function Get_Pkg_Name( nPkgId )Dim rsQry2Dim query_string2Get_Pkg_Name = ""If (NOT IsNull(nPkgId)) AND (nPkgId <> "") Thenquery_string2 = "SELECT pkg.PKG_NAME " &_" FROM PACKAGES pkg" &_" WHERE pkg.PKG_ID = " & nPkgIdSet rsQry2 = OraDatabase.DbCreateDynaset( query_string2, ORADYN_DEFAULT )If rsQry2.RecordCount > 0 ThenGet_Pkg_Name = rsQry2("pkg_name")End IfrsQry2.Close()Set rsQry2 = nothingEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------Function Indefinitely_Paused()Dim rsQry2Dim query_string2Indefinitely_Paused = Falsequery_string2 = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"Set rsQry2 = OraDatabase.DbCreateDynaset( query_string2, ORADYN_DEFAULT )If rsQry2.RecordCount > 0 ThenIndefinitely_Paused = TrueEnd IfEnd Function'--------------------------------------------------------------------------------------------------------------------------%><%'------------ RUN BEFORE PAGE RENDER ----------' Default values for Auto Refresh checkbox and edit input boxparam_refreshEnabled = Falseparam_refreshPeriod = "0"' Read the Refresh parameter which is of the form Refresh=<time-period>,ON|OFFDim param_refreshparam_refresh = Request("Refresh")If param_refresh <> "" ThenDim pr_arrpr_arr = Split(param_refresh,",")param_refreshPeriod = pr_arr(0)' Range check and end-stop the refresh period if necessaryIf CInt(param_refreshPeriod) < Min_Refresh_Time Thenparam_refreshPeriod = CStr(Min_Refresh_Time)End If' determine checkbox stateIf UBound(pr_arr) >= 1 ThenIf InStr(UCase(pr_arr(1)), "ON") > 0 Thenparam_refreshEnabled = TrueElseparam_refreshEnabled = FalseEnd IfEnd IfEnd If' Get indefinite pause statusbIndefinitelyPaused = Indefinitely_Paused()'----------------------------------------------%><script language="JavaScript" type="text/javascript"><!--//////////////////////////////////////////////////////////////////////////////////////////////////// This function rebuilds the query string so that it either adds or removes the specified project ID from// the HideProj= part of it, whilst leaving the rest of the string intact. The browser location is then// updated and the server made to re-render the page. This function must be used from the project checkboxes// to show/hide daemon status informaton for specific projects.//////////////////////////////////////////////////////////////////////////////////////////////////function toggle_project( proj_id ){var found = false;var new_url_query_string = '';var new_hp_list = '';// get the full query stringvar url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';// split it into each parametervar qs_arr = url_query_string.split('&');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 we have found the HideProj parameterif (qs_str.indexOf('HideProj') >= 0){// Split the HideProj parameter at the = symbol in order to process the comma seperated list of project IDsvar qs_hp_arr;qs_hp_arr = qs_str.split('=');if (qs_hp_arr.length > 1){// Split the comma seperated list of project IDs, and iterate through each itemvar hp_arr = qs_hp_arr[1].split(',');var i_hp_arr;for (i_hp_arr in hp_arr){var hp_str = hp_arr[i_hp_arr];// If the item matches the specified project ID and the checkbox for that project is uncheckedif (hp_str == proj_id){found = true;}else{// retain this other project ID in the listif (new_hp_list != '')new_hp_list += ',';new_hp_list += hp_str;}}}}else{// feed the existing paramter to the new query stringif (new_url_query_string == '')new_url_query_string += '?';elsenew_url_query_string += '&';new_url_query_string += qs_str}}}// If the specified project ID was not found, then that project is not currently hidden// and must now be hidden, so add its number to the list to hide it on the next server side// page render operationif (!found){if (new_hp_list != '')new_hp_list += ',';new_hp_list += proj_id}// Prepare the new query stringif (new_url_query_string == '')new_url_query_string += '\?';elsenew_url_query_string += '\&';new_url_query_string += 'HideProj=';new_url_query_string += new_hp_list;// reload the page with the new query stringvar url = location.pathname + new_url_query_string;window.location.assign(url);}//////////////////////////////////////////////////////////////////////////////////////////////////// This function rebuilds the query string to either hide all projects, or unhide all projects// fromt he display//////////////////////////////////////////////////////////////////////////////////////////////////function toggle_all_projects(bAll){var new_url_query_string = '';var list_proj_ids = '';// 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 listif (!bAll){var inputs = document.getElementsByTagName('input');var i;for (i = 0; i < inputs.length; i++){var str = inputs[i].name;if (str.indexOf("DIS_PRJ_") >= 0){str = str.replace("DIS_PRJ_","");if (list_proj_ids != '')list_proj_ids += ',' + str;elselist_proj_ids += str;}}}// get the full query stringvar url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';// split it into each parametervar qs_arr = url_query_string.split('&');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 we have found the HideProj parameterif (qs_str.indexOf('HideProj') >= 0){// do nothing}else{// feed the existing paramter to the new query stringif (new_url_query_string == '')new_url_query_string += '?';elsenew_url_query_string += '&';new_url_query_string += qs_str}}}// Prepare the new query string, only adding the HideProj parameter if the function is being// used to hide all projectsif (!bAll){if (new_url_query_string == '')new_url_query_string += '\?';elsenew_url_query_string += '\&';new_url_query_string += 'HideProj=' + list_proj_ids;}// reload the page with the new query stringvar url = location.pathname + new_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(){var new_url_query_string = '';// get the full query stringvar url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';// split it into each parametervar qs_arr = url_query_string.split('&');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 we have found the Refresh parameterif (qs_str.indexOf('Refresh') >= 0){// do nothing}else{// feed the existing paramter to the new query stringif (new_url_query_string == '')new_url_query_string += '?';elsenew_url_query_string += '&';new_url_query_string += qs_str}}}// Prepare the new query stringif (new_url_query_string == '')new_url_query_string += '\?';elsenew_url_query_string += '\&';new_url_query_string += 'Refresh=';if (document.getElementById('refreshPeriod').value < <%=Min_Refresh_Time%>){document.getElementById('refreshPeriod').value = <%=Min_Refresh_Time%>;new_url_query_string += <%=Min_Refresh_Time%>;}elsenew_url_query_string += document.getElementById('refreshPeriod').value;if (document.getElementById('autoRefresh').checked)new_url_query_string += ',ON';elsenew_url_query_string += ',OFF';// reload the page with the new query stringvar url = location.pathname + new_url_query_string;window.location.assign(url);}//////////////////////////////////////////////////////////////////////////////////////////////////// This function rebuilds the query string so that it either adds the Filter parameter// according to the value of the radio button set used to control it//////////////////////////////////////////////////////////////////////////////////////////////////function toggle_Display_Filtered(newValue){var new_url_query_string = '';// get the full query stringvar url_query_string = '<%=Request.ServerVariables("QUERY_STRING")%>';// split it into each parametervar qs_arr = url_query_string.split('&');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 we have found the Display parameterif (qs_str.indexOf('Filter') >= 0){// do nothing}else{// feed the existing paramter to the new query stringif (new_url_query_string == '')new_url_query_string += '?';elsenew_url_query_string += '&';new_url_query_string += qs_str}}}// Prepare the new query stringif (new_url_query_string == '')new_url_query_string += '\?';elsenew_url_query_string += '\&';new_url_query_string += 'Filter=';new_url_query_string += newValue;if (document.getElementById('problemDaemonSets').checked){new_url_query_string += ',problemDaemonSets';}if (document.getElementById('activeBuilds').checked){new_url_query_string += ',activeBuilds';}if (document.getElementById('disabledDaemons').checked){new_url_query_string += ',disabledDaemons';}// reload the page with the new query stringvar url = location.pathname + new_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(){if (document.getElementById('displayfiltered_off').checked)toggle_Display_Filtered("OFF");elsetoggle_Display_Filtered("ON");}//--></script><html><head><title>Release Manager</title><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" type="text/css"><link rel="stylesheet" href="images/navigation.css" type="text/css"><script language="JavaScript" src="images/common.js"></script><!-- DROPDOWN MENUS --><!--#include file="_menu_def.asp"--><script language="JavaScript1.2" src="images/popup_menu.js"></script></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" ><!-- MENU LAYERS --------------------------------------><div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div><!-- TIPS LAYERS --------------------------------------><div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10"> </div><!-----------------------------------------------------><!-- HEADER --><!--#include file="_header.asp"--><!-- BODY ----><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="1" background="images/bg_home_orange.gif" valign="top"></td><td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF"><table width="10" border="0" cellspacing="0" cellpadding="0"><tr><td width="1%"></td><td width="100%"><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap class="form_ttl"><p> </p><p>BUILD DAEMON STATUS INFORMATION</p></td><td align="right" valign="bottom"></td></tr><tr><!-- Monitoring Options Selection Box ----><td width="100%"><fieldset style="width:700px;"><legend><a href="javascript:;" class="body_scol" > Monitoring Options</a></legend><table width="100%" border="0" cellspacing="1" cellpadding="3"><tr><td valign="top" width="200px" nowrap background="images/bg_table_col.gif" class="body_col">Auto Refresh</td><td valign="top" width="100px" nowrap background="images/bg_table_col.gif" class="body_col">Filter</td><td valign="top" width="200px" nowrap background="images/bg_table_col.gif" class="body_col">Filter Options</td></tr><tr><td class="body_rowg"><input name="autoRefresh" id="autoRefresh" type="checkbox" <%If param_refreshEnabled Then%>checked<%End If%> value="1" onclick='toggle_refresh()'><input style="width:50px" name="refreshPeriod" id="refreshPeriod" type="input" maxlength="3" value=<%=param_refreshPeriod%> onchange='toggle_refresh()' >Seconds (min. 10)</td><td class="body_rowg"><input type="radio" name="displayfiltered" id="displayfiltered_off" value="OFF" <%=Display_Filtered("OFF")%> onclick="toggle_Display_Filtered('OFF')" >Off<input type="radio" name="displayfiltered" id="displayfiltered_on" value="ON" <%=Display_Filtered("ON")%> onclick="toggle_Display_Filtered('ON')" >On</td><td class="body_rowg"><input name="activeBuilds" id="activeBuilds" type="checkbox" <%=Filter_Checked("activeBuilds")%> value="activeBuilds" onclick='update_Display_Filter()'>Active Builds<input name="disabledDaemons" id="disabledDaemons" type="checkbox" <%=Filter_Checked("disabledDaemons")%> value="disabledDaemons" onclick='update_Display_Filter()'>Disabled Daemons<input name="problemDaemonSets" id="problemDaemonSets" type="checkbox" <%=Filter_Checked("problemDaemonSets")%> value="problemDaemonSets" onclick='update_Display_Filter()'>Problem Daemon Sets</td></tr><tr><td class="body_rowg"></td><td class="body_rowg"></td></tr></table></fieldset></td></tr><%If bIndefinitelyPaused Then%><tr><td><span class='err_alert'><font size='2'><b>WARNING: Indefinite Pause, Build Daemons are all stopped - please contact an administrator</b></font></span></td></tr><%End If%></table></td><td width="1%"></td></tr><tr><td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td><td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td><td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td></tr><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"><td width="9%" valign="top"></td><tr><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Project<input name="NOPRJ" id="NOPRJ" type="Button" value="All" onclick="toggle_all_projects(1)"><input name="NOPRJ" id="NOPRJ" type="Button" value="None" onclick="toggle_all_projects(0)"></td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Release<br>Mode</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Mode</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>Host</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Daemon<br>State</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Building<br>Package</td><td valign="middle" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td></tr><%query_string = "SELECT rc.RCON_ID, " &_" rc.RTAG_ID, " &_" bm.DISPLAY_NAME, " &_" rc.DAEMON_MODE, "&_" rt.RTAG_NAME, " &_" rt.OFFICIAL, " &_" p.PROJ_ID, " &_" p.PROJ_NAME, " &_" rl.CURRENT_PKG_ID_BEING_BUILT, "&_" rl.CURRENT_RUN_LEVEL, "&_" rl.PAUSE, " &_" TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_" FROM RELEASE_CONFIG rc, RELEASE_TAGS rt, PROJECTS p, RUN_LEVEL rl, BUILD_MACHINE_CONFIG bm " &_" WHERE rt.RTAG_ID = rc.RTAG_ID " &_" AND rc.DAEMON_HOSTNAME is not null" &_" AND rt.PROJ_ID = p.PROJ_ID " &_" AND rt.OFFICIAL != 'A' " &_" AND rt.OFFICIAL != 'Y' " &_" AND rl.RCON_ID = rc.RCON_ID" &_" AND rc.DAEMON_HOSTNAME = bm.MACHINE_HOSTNAME(+)" &_" ORDER BY p.PROJ_NAME, rt.RTAG_NAME, rc.DAEMON_MODE, bm.DISPLAY_NAME"Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )' String variablesDim strProject_checked ' Can be "" or "checked". Determines appearance of project enable checkbox' Boolean variablesDim bProject_changed ' signals a row change due to a different projectDim bRelease_changed ' signals a row change due to a different releaseDim bRow_displayed ' signals whether a row should be displayed or notDim bRelease_link_displayed ' indicates whether the release name has been rendered yetDim bDisplay_whole_set ' forces the whole daemon set for a release to be displayedDim bDisplayFilterIsOn ' Indicates if Filtering is on or offDim bShowProblemDaemonSets ' Indicates if problem daemons must be shown during filteringDim bShowDisabledDaemons ' Indicates if a disabled daemon must be shown during filteringDim bShowActiveBuilds ' Indicates if active builds must be shown during filtering' Integer variablesDim pkgIdDim lastProjID ' Used to detect project changes from one row to the nextDim lastRtagId ' Used to detect release changes from one row to the nextDim daemonState' Initialise variablesstrProject_checked = ""bProject_changed = TruebRelease_changed = TruebRow_displayed = TruebRelease_link_displayed = FalsebDisplay_whole_set = FalsebDisplayFilterIsOn = Display_Filter_Is_On()bShowProblemDaemonSets = Filter_Is_On("problemDaemonSets")bShowActiveBuilds = Filter_Is_On("activeBuilds")bShowDisabledDaemons = Filter_Is_On("disabledDaemons")lastProjID = 0lastRtagId = 0Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)pkgId = rsQry("current_pkg_id_being_built")' determine if user has checked the project checkboxstrProject_checked = Is_Project_Checked(rsQry("proj_id"))' Has the project changed since the last row. If so, signal it via bProject_changed variable, and' reset the bRelease_link_displayed variable to force the display of the release column value on the' render of the next unfiltered rowbProject_changed = FalseIf lastProjID <> rsQry("proj_id") ThenlastProjID = rsQry("proj_id")bProject_changed = TruebRelease_link_displayed = FalsebDisplay_whole_set = FalseEnd If' Has the release changed since the last row of displayed data. If so, signal it via the bRelease_changed variable,' and reset the bRelease_link_displayed variable to force the display of the release column value on the' render of the next unfiltered row.bRelease_changed = FalseIf lastRtagId <> rsQry("rtag_id") ThenlastRtagId = rsQry("rtag_id")bRelease_changed = TruebRelease_link_displayed = FalsebDisplay_whole_set = FalseEnd IfdaemonState = rsQry("pause")If IsNull(daemonState) ThendaemonState = 0End If' generate the table row divider - this uses the bRow_displayed value from the previous iteration in order' to prevent dividers being drawn between rows that were not actually rendered due to any filtering that' may be in effect.%><%=HTML_Row_Divider( bProject_changed, strProject_checked, bRelease_changed, bRow_displayed )%><%' If this is a Master Daemon, look ahead at all the slaves and evaluate if any daemons in the set appear to' be having a problem. If any are and the user has turned the "Show Problem Daemon Sets" filter on then' set the bDisplay_whole_set variable to True else set it to FalseIf rsQry("daemon_mode") = "M" Then' Initial default value is to not show the entire daemon setbDisplay_whole_set = False' If the filter is turned on and master daemon is NOT actively building a package and it is NOT paused...If bDisplayFilterIsOn _AND bShowProblemDaemonSets _AND (NOT Is_Actively_Building(rsQry("current_pkg_id_being_built"))) _AND (NOT Is_Paused(rsQry("current_run_level"), bIndefinitelyPaused) ) _AND (NOT Is_Disabled(daemonState) ) _Then' Display the whole set if the master daemons delta exceeds the thresholdbDisplay_whole_set = Daemon_Delta_Threshold_Exceeded(rsQry("delta"))' If nothing appears wrong with the Master Daemon, look ahead at all the slaves in the setIf NOT bDisplay_whole_set ThenDim thisRtagIdDim rtag_id_set_countDim ithisRtagId = rsQry("rtag_id")rtag_id_set_count = 1rsQry.MoveNextDo While (NOT rsQry.BOF) AND (NOT rsQry.EOF) AND rsQry("rtag_id") = thisRtagIdrtag_id_set_count = rtag_id_set_count + 1' If this slave daemon is NOT actively building a package and it is NOT paused and its Delta exceeds the threshold...If (NOT Is_Actively_Building(rsQry("current_pkg_id_being_built"))) _AND (NOT Is_Paused(rsQry("current_run_level"), bIndefinitelyPaused)) _AND (NOT Is_Disabled(daemonState) ) _AND Daemon_Delta_Threshold_Exceeded(rsQry("delta")) ThenbDisplay_whole_set = TrueEnd IfrsQry.MoveNextLoopFor i = 1 to rtag_id_set_countrsQry.MovePreviousNextEnd IfEnd IfEnd If' Now figure out if this row of data is to be displayed or notbRow_displayed = ( NOT bDisplayFilterIsOn ) _OR ( bDisplay_whole_set ) _OR ( bShowDisabledDaemons AND Is_Disabled(daemonState) ) _OR ( bShowActiveBuilds AND Is_Actively_Building(pkgId) )' If the release has changed and we are going to display this row, toggle the row style to give' it a slightly different look to the previous displayed row which was for a different releaseIf bRelease_changed AND bRow_displayed ThenCall ToggleStyleNowEnd If' Now we are ready to render the HTML content for the row, but we may still circumvent rendering if the user' has unchecked the project checkbox%><tr><%If bProject_changed Then%><td nowrap class="body_rowg"><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")%>)><a href='rtree.asp?proj_id=<%=rsQry("proj_id")%>'><%=rsQry("proj_name")%></td><%Else%><td nowrap class="body_rowg"></td><%End If%><%If strProject_checked = "checked" Then%><%If bRow_displayed Then%><%If bRelease_changed OR NOT bRelease_link_displayed Then%><%bRelease_link_displayed = True%><td nowrap <%=styleNow%>><a href='build_status.asp?rtag_id=<%=rsQry("rtag_id")%>'><%=rsQry("rtag_name")%></a></td><%Else%><td nowrap <%=styleNow%>></td><%End If%><td nowrap <%=styleNow%>><%=Get_Official(rsQry("official"))%></td><td nowrap <%=styleNow%>><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td><td nowrap <%=styleNow%>><%=rsQry("display_name")%></td><td nowrap <%=styleNow%>><%=Get_Run_Level(rsQry("current_run_level"), bIndefinitelyPaused,daemonState)%></td><td nowrap <%=styleNow%>><%=Get_Pkg_Name(pkgId)%></td><%Dim style, deltastyle = ""delta = rsQry("delta")If (delta > 600) AND (IsNull(pkgId) OR pkgId = "") Thenstyle = "style=color:Red"if( daemonState >= 2 ) AND (delta > 86400 ) ThenDim bdate, dd,mm,yybdate = DateAdd("s", - delta,Now())dd = Day(bdate)mm = MonthName(Month(bdate),1)yy = Year( bdate)delta = dd & "-" & mm & "-" & yystyle = ""ElseIf ( delta > 60*60 ) Then'Dim bdate, hh, mins, ssbdate = DateAdd("s", - delta,Now())delta = TimeValue( bdate)'delta = hh & ":" & mins & ":" & ssEnd IfEnd If%><td nowrap <%=styleNow%><%=style%>><%=delta%></td><%End If%></tr><%End If%><%rsQry.MoveNextLooprsQry.Close()Set rsQry = nothing%></table></td><td background="images/lbox_bgside_white.gif"> </td></tr><tr><input type="hidden" name="action" value="true"><%=objPMod.ComposeHiddenTags()%><td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td><td background="images/lbox_bg_blue.gif"></td><td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td></tr></table></td><td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td></tr><tr><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><td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td></tr></table><!-- FOOTER --><!--#include file="_footer.asp"--></body></html><%Call Destroy_All_Objects%>