<%!
struct server_spec_type
{
  int    max_conn;
  int    cur_conn;
  int    peak_conn;
};
struct server_spec_stack
{
  int    req_no_total_stateless;
  int    req_no_total_group;
  int    req_no_total_stateful;

  int    req_no_act_stateless[16];
  int    req_no_act_group[16];
  int    req_no_act_stateful[16];
  string req_no_timesection[16];
  string req_per_min_stateless[16];
  string req_per_min_group[16];
  string req_per_min_stateful[16];
  
  int    resp_time_last;
  int    resp_time_avg;
  int    resp_time_min;
  int    ping_time_last;

  boolean operational;
  boolean valid;
  boolean active;
  boolean responding;

  int    capacity;
  boolean capacity_is_fixed;
  int    load;
  int    load_static;
};
struct wdisp_host_info_type
{
  string name;
  string host_name;
  string http_port;
  string https_port;
  string error_text;

  boolean has_abap;
  boolean has_j2ee;

  struct server_spec_stack stack[2];

  struct server_spec_type http;
  struct server_spec_type https;
};


%>

<%
  int host_count, refresh_rate, nr, i;
  int tabsel;
  string what, browser, group, str, cap, ping_url, groupnam[];
  string iconname[3];
  struct wdisp_host_info_type wdisp_host_info[];
  string token_save_cap, token_unlock_cap;
  string token, lastControlID;
  int rc, test;
  string msg, msg_ok, msg_error, isExtern;
  string icon,systemID,systemID_show, tabsel_str;
  string alt_ping_abap_url, alt_ping_j2ee_url, tmpString;
  boolean show_stat_details;
    
  show_stat_details = __icm_get_form_field ("show_stat_details");
  
  what = anumenc(__icm_get_form_field ("what"));
  lastControlID = htmlenc(__icm_get_form_field ("lastControlID"));
  
  systemID = htmlenc(__icm_get_form_field ("systemID"));
  if (systemID != "000") {
    systemID_show = "&nbsp;(" + systemID + ")";
  }
  isExtern = __wdisp_is_extern_sid(systemID);
  
  alt_ping_abap_url = "/sap/public/icman/ping";
  tmpString = __icm_get_param ("wdisp/ping_abap_url");
  if (tmpString != "") {
    alt_ping_abap_url = tmpString;
  }
  
  alt_ping_j2ee_url = "/favicon.ico";
  tmpString = __icm_get_param ("wdisp/ping_java_url");
  if (tmpString != "") {
    alt_ping_j2ee_url = tmpString;
  }

  browser = __icm_get_browser_type();
  host_count = __wdisp_get_host_info (group, wdisp_host_info, systemID);
  
  tabsel_str = __icm_get_form_field ("tabsel");
  
  if (tabsel_str == "") {
    tabsel = 1;
    for (nr = 0; nr < host_count; nr++) {
      if (wdisp_host_info[nr].has_abap) {
        tabsel = 0;
      }
    }
  } else {
    tabsel = anumenc(__icm_get_form_field ("tabsel"));
  }
  
  if ((tabsel < 0) || (tabsel > 1))
      tabsel = 0;
  if (tabsel == 0) ping_url = alt_ping_abap_url;
  else             ping_url = alt_ping_j2ee_url;
  
  if (isExtern == "true") {
    ping_url = __icm_get_param ("wdisp/ping_extsrv_url");
  }

  if (what == "refresh") {
   refresh_rate = __icm_get_form_field ("p1");
   if (refresh_rate == 10)
    iconname[0] = "../public/icons/s_s_okay.gif";
   else
    iconname[1] = "../public/icons/s_s_okay.gif";
  }
  else
   iconname[2] = "../public/icons/s_s_okay.gif";

%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <html>
    <head>
      <link rel=stylesheet type="text/css" href="../public/css/controls_<%=browser%>.css">
	<link rel=stylesheet type="text/css" href="../public/css/sapbsp.css">
	<title>Web Dispatcher Monitor</title>
<% if (refresh_rate > 0){ %>
	<META http-equiv="refresh" content="<%=refresh_rate%>">
<% } %>
	<script type="text/javascript" src="../public/js/bspMenu.js"></script>
	<script type="text/javascript">
	  <!--
<%    
       if (what != "save_cap" && what != "unlock_cap") {
%> 
          window.onload = function() {
<%
    for (nr = 0; nr < host_count; nr++) {
%>
            initializeMenu ("HostMenu<%=nr%>", "hostObj<%=nr%>");
            initializeMenu ("HostDetailMenu<%=nr%>", "hostDetailObj<%=nr%>");
<%
    }
%>
            initializeMenu ("ResetHttpMenu", "httpPoolObj");
            initializeMenu ("ResetHttpsMenu", "httpsPoolObj");
            initializeMenu ("ResetRqCountMenu", "resetRqObj");
            initializeMenu ("CapMenu", "capObj");
            initializeMenu ("ConfMenu", "confObj");
            restoreMenuFocus('<%=lastControlID%>');
          }
	  document.onclick=bspMenuHide;
<%
    }
%>


	function callSubmitAction(form,value,wval,systemID,token)
	{
	  var Form = document[form];
	  Form.tabsel.value = value;
	  Form.what.value = wval;
	  Form.token.value = token;
	  Form.systemID.value = systemID;
	  //Form.lastControlID.value = 'CapMenu';
	  Form.submit();
	}
	
	function callUrlWithKey(ev,keycode,url) {
	  if (ev.keyCode == keycode) {
	    window.location=url;
	  }
	}
	//-->
    </script>
    </head>
    <body class="sapBdy">

<%
  group = "!ALL";
  groupnam[0] = "ABAP";
  groupnam[1] = "JAVA";
  
  if (isExtern == "true") {
    groupnam[1] = "EXTERN";
  }

  for (nr=0; nr<3;nr++){
    iconname[nr] = "../public/icons/s_s_space.gif";
  }

  if (what == "save_cap" || what == "unlock_cap")
  {
    if (what == "save_cap") {

      token = __icm_get_form_field("token");
      for (nr = 0; nr < host_count; nr++) {
	  str = "edit_cap" + wdisp_host_info[nr].name;

	  cap = anumenc(__icm_get_form_field (str));
	  if (cap != "" && wdisp_host_info[nr].stack[tabsel].capacity != cap) {
	    if (tabsel == 0)
	      rc = __wdisp_hdl (6, wdisp_host_info[nr].name, cap, wdisp_host_info[nr].stack[1].capacity, token, systemID);
	    else
	      rc = __wdisp_hdl (6, wdisp_host_info[nr].name, wdisp_host_info[nr].stack[0].capacity, cap, token, systemID);
	  }
      }

      msg_ok = "Capacities saved.";
      msg_error = "Error saving capacities";

      host_count = __wdisp_get_host_info (group, wdisp_host_info, systemID);
    } else if  (what == "unlock_cap") {
	token = __icm_get_form_field("token");
	rc = __wdisp_hdl (9, token, systemID);
        msg_ok = "Capacities unlocked.";
        msg_error = "Error unlocking capacities";
      host_count = __wdisp_get_host_info (group, wdisp_host_info, systemID);
    }

    if (rc == 0)
    {
	msg = msg_ok;
	icon = "s_m_info.gif";
    }
    else if (rc == -11) 
    {
	msg = "Session timeout. Please retry operation.";
	icon = "s_m_warn.gif";
    }
    else
    {
	msg = msg_error + ": " + __icm_get_error_text(rc) + " (" + rc + ")";
	icon = "s_m_erro.gif";
    }
%>

    <table border="0" cellspacing="0" cellpadding="0" class="sapTbvAlt" width="50%">
      <tr>
	<td class="sapTbvCellAlt" Colspan="1" align="center">
	  <img src="../public/icons/<%=icon%>" alt="">
	</td>
	<td class="sapTbvCellAlt" Colspan="2" align="center">
	  <b><i>Information</i></b>
	</td>
	<td class="sapTbvCellAlt" Colspan="1" align="center">
	  <img src="../public/icons/<%=icon%>" alt="">
	</td>
      </tr>
      <tr>
	<td class="sapTbvCellStd" Colspan="4">&nbsp;</td>
      </tr>
      <tr>
	<td class="sapTbvCellStd" Colspan="4">&nbsp;</td>
      </tr>
      <tr>
	<td class="sapTbvCellStd" Colspan="4" align="center">
	  <b><i><%=msg%></i></b>
	</td>
      </tr>
      <tr><td class="sapTbvCellStd" Colspan="4">&nbsp;</td></tr>
      <tr><td class="sapTbvCellStd" Colspan="4">&nbsp;</td></tr>

      <tr>
	<td class="sapTbvCellStd" Colspan="4" align="center">
	  <a href="./wdisp_host.icp?systemID=<%=systemID%>" class="sapBtnStd"><nobr>Back</nobr></a>
	</td>
      </tr>
    </table><p>
    <%
    } else {

    for (nr = 0; nr<host_count; nr++) {
%>
      <div id="HostMenu<%=nr%>" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'HostMenu<%=nr%>')" display:none>
<%
	if (wdisp_host_info[nr].stack[tabsel].active && wdisp_host_info[nr].stack[tabsel].operational) {
%>
      <div title="Deactivate Server" class="bspMenuItem" url="./confirm.icp?what=NodeDeactivate&amp;p1=<%=wdisp_host_info[nr].name%>:<%=tabsel+1%>&amp;systemID=<%=systemID%>">Deactivate Server (<%=groupnam[tabsel]%>)</div>

<%
	} else {
%>
      <div title="Activate Server" class="bspMenuItem" url="./confirm.icp?what=NodeActivate&amp;p1=<%=wdisp_host_info[nr].name%>:<%=tabsel+1%>&amp;systemID=<%=systemID%>">Activate Server (<%=groupnam[tabsel]%>)</div>
<%
	}

    if (isExtern != "true") 
    {
%>

      <div title="Activate Server" class="bspMenuItem" url="./confirm.icp?what=NodeActivate&amp;p1=<%=wdisp_host_info[nr].name%>&amp;systemID=<%=systemID%>">Activate Server (all stacks)</div>
      <div title="Deactivate Server" class="bspMenuItem" url="./confirm.icp?what=NodeDeactivate&amp;p1=<%=wdisp_host_info[nr].name%>&amp;systemID=<%=systemID%>">Deactivate Server (all stacks)</div>
<%
	}
%>

      <hr>
      <div title="Direct HTTP ping to server" class="bspMenuItem" url="http://<%=wdisp_host_info[nr].host_name%>:<%=wdisp_host_info[nr].http_port%><%=ping_url%>" target="newwin">Direct HTTP ping to server</div>
      <div title="Direct HTTPS ping to server" class="bspMenuItem" url="https://<%=wdisp_host_info[nr].host_name%>:<%=wdisp_host_info[nr].https_port%><%=ping_url%>" target="newwin">Direct HTTPS ping to server</div>      <hr>
      <div title="Close Menu" class="bspMenuItem">Close menu</div>
      </div>


      <div id="HostDetailMenu<%=nr%>" style="width:180;background-color:#ffffc8" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'HostDetailMenu<%=nr%>')" display:none>

      <div class="bspMenuItem">
      <table border=0 cellspacing=0 cellpadding=0 class="sapTbvAlt" width="100%">
<%
	if (!wdisp_host_info[nr].stack[tabsel].active){
	__output("<tr><td style=\"background-color:#ffffc8\" class=\"sapTbvCellAlt\">");
	  __output ("<b>Server was manually deactivated</b>");
	__output("</td></tr>");
	wdisp_host_info[nr].error_text = "Server was manually deactivated";
	}
	if (!wdisp_host_info[nr].stack[tabsel].valid && wdisp_host_info[nr].stack[tabsel].active){
	__output("<tr><td style=\"background-color:#ffffc8\" class=\"sapTbvCellAlt\">");
	  __output ("<b>Server is not reachable</b>");
	__output("</td></tr>");
	wdisp_host_info[nr].error_text = "Server is not reachable";
	}
	if (!wdisp_host_info[nr].stack[tabsel].responding && wdisp_host_info[nr].stack[tabsel].valid){
	__output("<tr><td style=\"background-color:#ffffc8\" class=\"sapTbvCellAlt\">");
	  __output ("<b>Server is not responding to ping requests</b>");
	__output("</td></tr>");
	wdisp_host_info[nr].error_text = "Server is not responding to ping requests";
	}
%>
	</table></div>
      </div>
<%
    }
%>
      <div title="Reset peak values" id="ResetHttpMenu" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'ResetHttpMenu')" display:none>
      <div class="bspMenuItem" url="./confirm.icp?what=PoolReset&amp;p1=<%=group%>&amp;systemID=<%=systemID%>">Reset peak values</div>
      <hr>
      <div title="Close Menu" class="bspMenuItem">Close Menu</div>
      </div>
      <div id="ResetHttpsMenu" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'ResetHttpsMenu')" display:none>
      <div title="Reset peak values" class="bspMenuItem" url="./confirm.icp?what=PoolReset&amp;p1=<%=group%>&amp;systemID=<%=systemID%>">Reset peak values</div>
      <hr>
      <div title="Close Menu" class="bspMenuItem">Close menu</div>
      </div>
      <div id="ResetRqCountMenu" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'ResetRqCountMenu')" display:none>
      <div title="Reset request count" class="bspMenuItem" url="./confirm.icp?what=ResetReqCount&amp;p1=<%=group%>&amp;systemID=<%=systemID%>">Reset request count</div>
      <hr>
      <div title="Close Menu" class="bspMenuItem">Close menu</div>
      </div>
      <div id="CapMenu" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event)" display:none>
<%
	if (what == "edit_cap") {
	  token_save_cap = __icm_get_token(506);
%>
      <div title="Save capacity values" class="bspMenuItem" url="javascript:callSubmitAction('FormTabStrip','<%=tabsel%>','save_cap','<%=systemID%>','<%=token_save_cap%>')">Save capacity values</div>
      <div title="Revert changes" class="bspMenuItem" url="./wdisp_host.icp?x=x&systemID=<%=systemID%>">Revert changes</div>
<%
	} else {
	  token_unlock_cap = __icm_get_token(509);
%>
      <div title="Edit capacity values" class="bspMenuItem" url="javascript:callSubmitAction('FormTabStrip','<%=tabsel%>','edit_cap','<%=systemID%>','')">Edit capacity values</div>
      
      
      <div title="Unlock capacity values" class="bspMenuItem" url="javascript:callSubmitAction('FormTabStrip','<%=tabsel%>','unlock_cap','<%=systemID%>','<%=token_unlock_cap%>')">Unlock capacity values</div>
      
<%
	}
%>
      <hr>
      <div title="Close Menu" class="bspMenuItem">Close menu</div>
      </div>
      <div id="ConfMenu" class="bspMenuBox" onMouseover="bspMenuHighlight(event)" onMouseout="bspMenuUnHighlight(event)" onClick="bspMenuSelect(event,'ConfMenu')" display:none>
      <div class="bspMenuItem" url="./wdisp_host.icp?what=refresh&amp;p1=10&systemID=<%=systemID%>"><img src=\"<%=iconname[0]%>">Auto refresh (10sec)</div>
      <div class="bspMenuItem" url="./wdisp_host.icp?what=refresh&amp;p1=30&systemID=<%=systemID%>"><img src=\"<%=iconname[1]%>">Auto refresh (30sec)</div>
      <div class="bspMenuItem" url="./wdisp_host.icp?systemID=<%=systemID%>"><img src=\"<%=iconname[2]%>">Auto refresh off</div>
      <hr>
      <div title="Close Menu" class="bspMenuItem">Close Menu</div>
      </div>

    <table border="0" cellspacing="0" cellpadding="0" class="sapTbvAlt" width="100%">
    <tr>
      <td class="sapTbvCellAlt">
	
<%
      if (isExtern == "true") {
%>
      <b><i>External System<%=systemID_show%></i></b>
<%
      } else {
%>
      <b><i>Application Server Monitor<%=systemID_show%></i></b>
<%
      } 
%>
      </td>
      <td class="sapTbvCellAlt" align="right">
	<a accesskey="r" onKeyUp="javascript:callUrlWithKey(event,82,'./confirm.icp?what=reload_wdisp_conf&amp;systemID=<%=systemID%>')"
	   href="./confirm.icp?what=reload_wdisp_conf&amp;systemID=<%=systemID%>" class="sapBtnStd" title="trigger reload of configuration">
	<nobr><u>R</u>eload Web Dispatcher configuration</nobr></a>
      </td>
      <td class="sapTbvCellAlt" align="right">
	<a href="javascript:callSubmitAction('FormTabStrip','<%=tabsel%>','','<%=systemID%>','')" class="sapBtnEmph" title="refresh page">Refresh</a>
      </td>
    </tr>
    <tr>

    <td class="sapTbvCellStd" Colspan="3">
    <form action="" method="POST" name="FormTabStrip">
      <input type="hidden" name="tabsel" value="">
      <input type="hidden" name="what" value="">
      <input type="hidden" name="token" value="<%=token%>">
      <input type="hidden" name="systemID" value="">
      <input type="hidden" name="lastControlID" value="<%=lastControlID%>">
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
	  <tr>
	    <td valign="top">
	      <br>
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
		  <tr valign="top">
		    <td>
		      <!--HEADERS-->
		      <table border="0" cellpadding="0" cellspacing="0">
			<tr>
			  <!--HEADER ITEM-->
			  <td nowrap></td>
<%
    if (isExtern == "false") {
    for (nr = 0; nr<2; nr++) {
%>
			  <td nowrap
<%
      if (nr == tabsel)
      {
%>
			    class="sapTbsTabSel">
			    <a title="List of <%=groupnam[nr]%> Hosts" class="sapLnk" OnMouseOver="window.status = '<%=groupnam[nr]%>'; return true;"
			     style="text-decoration:none">
			     <b>
				<%=groupnam[nr]%>
			      </b>

<%    } 
      else
      {
%>
			    class="sapTbsTab">
			    <a title="List of <%=groupnam[nr]%> Hosts" class="sapLnk" OnMouseOver="window.status = '<%=groupnam[nr]%>'; return true;"
			    href="javascript:callSubmitAction('FormTabStrip','<%=nr%>','','<%=systemID%>','')"
			     style="text-decoration:none">
				<%=groupnam[nr]%>
<%    }
%>
			    </a>
			  </td>
<%
   }
   }
%>
			  <!--HEADER ITEM END-->
			  <td nowrap class="sapTbsTabBlk"> </td>
			</tr>
		      </table>
		      <!--HEADER END-->
		      <!--CONTENTS-->
		      <table class="sapTbsWhl" border="0" cellspacing="0" cellpadding="0"
			width="100%">
			<tr>
			  <td align="left" valign="top">

			    <table border="0" cellspacing="0" cellpadding="0" class="sapTbvAlt" width="100%">
			      <tr>
				<td class="sapTbvCellAlt" Colspan=2>&nbsp;</td>
			      </tr>
			      <tr>
				<td class="sapTbvCellAlt" Colspan=2>
				  <table id="wdispOV" border=0 cellspacing=1 cellpadding=0 class="sapTbvAlt">
				    <tr>
<%
    if (isExtern == "false") {
%>
				      <td class="sapTbvCellAlt" Colspan=14>
					    <b><i>List of <%=groupnam[tabsel]%> Hosts</i></b>
				      </td>
<%
    } else {
%>
					  <td class="sapTbvCellAlt" Colspan=14>
					    <b><i>List of external Hosts</i></b>
				      </td>
<%    
    }
%>

				    </tr>
				    <tr>
				      <th class="sapTbvCellAlt" align="center" width=20>
					<i>Nr.</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=20>
					<i>Valid</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=100>
					<i>Name</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=100>
					<i>Hostname</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=100>
				        <a title="HTTP connections Menu" accesskey="h" href="javascript:void(0);" id="httpPoolObj" class="sapBtnStd" onKeyUp="bspMenuMainAction('ResetHttpMenu', event, this, 72);" onClick="bspMenuMainAction('ResetHttpMenu', event, this, 72);">
					<i><u>H</u>TTP connections</i>&nbsp;<img border=0 src="../public/images/cmenu/Triangle.gif" alt=""></a>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=100>
				        <a title="HTTPS connections Menu" accesskey="s" href="javascript:void(0);" id="httpsPoolObj" class="sapBtnStd" onKeyUp="bspMenuMainAction('ResetHttpsMenu', event, this, 83);" onClick="bspMenuMainAction('ResetHttpsMenu', event, this, 83);">
					<i>HTTP<u>S</u> connections</i>&nbsp;<img border=0 src="../public/images/cmenu/Triangle.gif" alt=""></a>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=50>
				        <a title="Requests Menu" accesskey="q" href="javascript:void(0);" id="resetRqObj" class="sapBtnStd" onKeyUp="bspMenuMainAction('ResetRqCountMenu', event, this, 81);" onClick="bspMenuMainAction('ResetRqCountMenu', event, this, 81);">
					<i>Re<u>q</u>uests</i>&nbsp;<img border=0 src="../public/images/cmenu/Triangle.gif" alt=""></a>
				      </th>			      
				      <th class="sapTbvCellAlt" align="center" width=50>
				        <a title="Capacity Menu" accesskey="c" href="javascript:void(0);" id="capObj" class="sapBtnStd" onKeyUp="bspMenuMainAction('CapMenu', event, this, 67);" onClick="bspMenuMainAction('CapMenu', event, this, 67);">
					<i><u>C</u>apacity</i>&nbsp;<img border=0 src="../public/images/cmenu/Triangle.gif" alt=""></a>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=50>
					<i>Load</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=50>
					<i>Response times (us)</i>
				      </th>
				      <th class="sapTbvCellAlt" align="center" width=50>
					<i>Last ping time (us)</i>
				      </th>
				    </tr>
<%
        for (nr = 0; nr < host_count; nr++)
	{
	  if (((tabsel == 0) && wdisp_host_info[nr].has_abap) || ((tabsel == 1) && wdisp_host_info[nr].has_j2ee)) {
%>
				    <tr>
				      <td class="sapTbvCellStd"><%= nr %></td>
				      <td class="sapTbvCellStd">
<%
	if (wdisp_host_info[nr].stack[tabsel].operational)
	  __output ("<img src=\"../public/icons/s_s_okay.gif\" alt=\"OK\" title=\"Server is valid\">");
	else {
	  __output ("<a id=\"hostDetailObj",nr,"\" onMouseOver=\"bspMenuShow('HostDetailMenu'+", nr, ",event)\" onMouseOut=\"bspMenuHide(event,1)\">");
	  __output ("<img src=\"../public/icons/s_m_erro.gif\" alt=\"", wdisp_host_info[nr].error_text, "\">");
	  __output ("</a>");
	}
%>
				      </td>
				      <td class="sapTbvCellStd" align="center">
	    <a title="Host Menu <%= wdisp_host_info[nr].name %>" href="javascript:void(0);" id="hostObj<%=nr%>" class="sapBtnStd" onKeyUp="bspMenuMainAction('HostMenu'+<%=nr%>, event, this);" onClick="bspMenuMainAction('HostMenu'+<%=nr%>, event, this);">
		<%= wdisp_host_info[nr].name %>&nbsp;<img border=0 src="../public/images/cmenu/Triangle.gif" alt=""></a>&nbsp;
				      </td>
				      <td class="sapTbvCellStd"><%= wdisp_host_info[nr].host_name %></td>
				      <td class="sapTbvCellStd">
				      <table border=0 cellspacing=0 cellpadding=0 class="sapTbvAlt" width="100%">
				      <tr>
				       <td class="sapTbvCellStd">Port</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].http_port%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">max</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].http.max_conn%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">current</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].http.cur_conn%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">peak</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].http.peak_conn%></td>
				      </tr>
				      </table></td>
				      <td class="sapTbvCellStd">
				      <table border=0 cellspacing=0 cellpadding=0 class="sapTbvAlt" width="100%">
				      <tr>
				       <td class="sapTbvCellStd">Port</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].https_port%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">max</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].https.max_conn%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">current</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].https.cur_conn%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">peak</td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].https.peak_conn%></td>
				      </tr>
				      </table></td>
				      <td class="sapTbvCellStd">
				      <table border=0 cellspacing=0 cellpadding=0 class="sapTbvAlt" width="100%">
				      <tr>
				       <td class="sapTbvCellStd"><nobr>Stateless</nobr></td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_total_stateless%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd"><nobr>For Group</nobr></td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_total_group%></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd"><nobr>Stateful</nobr></td>
				       <td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_total_stateful%></td>
				      </tr>
				      </table></td>				    
<%
	if (what == "edit_cap") {
%>
				      <td class="sapTbvCellStd">
					<input type="text" class="sapEdfTxtDsbl" name="edit_cap<%=wdisp_host_info[nr].name%>"
            value="<%=wdisp_host_info[nr].stack[tabsel].capacity%>" size="5" maxlength="15"></td>
<%
	} else {
%>

				      <td class="sapTbvCellStd" align="right"><%= wdisp_host_info[nr].stack[tabsel].capacity%>
<%
          if (wdisp_host_info[nr].stack[tabsel].capacity_is_fixed)
	    __output("<img src=\"../public/icons/s_s_locl.gif\" alt=\"value fixed\">");
%>
				     </td>
<%
	}
%>
				      <td class="sapTbvCellStd" align="right">
					<%= wdisp_host_info[nr].stack[tabsel].load %>
				      </td>
				      <td class="sapTbvCellStd">
				      <table border=0 cellspacing=0 cellpadding=0 class="sapTbvAlt">
				      <tr>
				       <td class="sapTbvCellStd">Last</td>
				       <td class="sapTbvCellStd" align="right"><%= wdisp_host_info[nr].stack[tabsel].resp_time_last %></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">Avg</td>
				       <td class="sapTbvCellStd" align="right"><%= wdisp_host_info[nr].stack[tabsel].resp_time_avg %></td>
				      </tr>
				      <tr>
				       <td class="sapTbvCellStd">Min</td>
				       <td class="sapTbvCellStd" align="right"><%= wdisp_host_info[nr].stack[tabsel].resp_time_min %></td>
				      </tr>
				      </table></td>
				      <td class="sapTbvCellStd" align="right"><%= wdisp_host_info[nr].stack[tabsel].ping_time_last %></td>
				    </tr>
<%
	}
	}
%>
				  </table>
				</td>
			      </tr>
			    </table>
			  </td>
			</tr>
		      </table>
		      <!--CONTENTS END-->
		    </td>
		  </tr>
		</table>
	    </td>
	  </tr>
	</table>
    </form>
    </td>
    </tr>
    </table>
<%
  }
%>

<br>
<%
    if (show_stat_details == 0) {
%>
	  <a accesskey="e" onKeyUp="javascript:callUrlWithKey(event,69,'./wdisp_host.icp?show_stat_details=1&amp;systemID=<%=systemID%>')" href="./wdisp_host.icp?show_stat_details=1&amp;systemID=<%=systemID%>" class="sapBtnEmph">
	     <nobr>Show R<u>e</u>quest History</nobr></a>
<%
    } else {
    
%>
      <a accesskey="e" onKeyUp="javascript:callUrlWithKey(event,69,'./wdisp_host.icp?show_stat_details=0&amp;systemID=<%=systemID%>')" href="./wdisp_host.icp?show_stat_details=0&amp;systemID=<%=systemID%>" class="sapBtnEmph" title="Hide Details">
         <nobr>Hide R<u>e</u>quest History</nobr></a><br><br>

<%         
    for (nr = 0; nr < host_count; nr++)
	{ 
%>
      <table border=0 cellspacing=1 cellpadding=1 class="sapTbvAlt" width="100%">
        
        <tr>
		<td class="sapTbvCellStd" colspan="2"><b><%= wdisp_host_info[nr].name %></b></td>
		<td class="sapTbvCellStd" colspan="16" align="center">Timeframes</td>
		</tr>
		
		<tr>
		<td class="sapTbvCellStd" colspan="2"><nobr><small>&nbsp;</small></nobr></td>
		
<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellAlt" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_timesection[i]%></td>
		
<%
	}
%>
		</tr>
		
		<tr>
		
		<td rowspan="2" class="sapTbvCellStd"><nobr>Stateless</nobr></td>
		<td class="sapTbvCellStd">total</td>

<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellStd" align="right"><nobr><%=wdisp_host_info[nr].stack[tabsel].req_no_act_stateless[i]%></nobr></td>

<%
	}
%>
		</tr>

		<tr>
		<td class="sapTbvCellStd">Req/min</td>

<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellStd" align="right"><nobr><%=wdisp_host_info[nr].stack[tabsel].req_per_min_stateless[i]%></nobr></td>

<%
	}
%>
		</tr>



	    <tr>
	    <td rowspan="2" class="sapTbvCellStd"><nobr>For Group</nobr></td>
		<td class="sapTbvCellStd">total</td>
<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_act_group[i]%></td>
<%
	}
%>
		</tr>
		<tr>
		<td class="sapTbvCellStd">Req/min</td>

<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellStd" align="right"><nobr><%=wdisp_host_info[nr].stack[tabsel].req_per_min_group[i]%></nobr></td>

<%
	}
%>
		</tr>

		<tr>
		<td rowspan="2" class="sapTbvCellStd"><nobr>Stateful</nobr></td>
		<td class="sapTbvCellStd">total</td>
<%
	for (i = 0; i<16; i++) {
%>
				<td class="sapTbvCellStd" align="right"><%=wdisp_host_info[nr].stack[tabsel].req_no_act_stateful[i]%></td>

<%
	}
%>
		</tr>
		<tr>
		<td class="sapTbvCellStd">Req/min</td>

<%
	for (i = 0; i<16; i++) {
%>
		<td class="sapTbvCellStd" align="right"><nobr><%=wdisp_host_info[nr].stack[tabsel].req_per_min_stateful[i]%></nobr></td>

<%
	}
%>
		</tr>

	  </table> 
	  &nbsp;
<%
    }
    } 
%>


    </body>
  </html>
