home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_03.cab / iiperf.asp < prev    next >
Text File  |  1997-11-14  |  9KB  |  339 lines

  1. <%@ LANGUAGE=VBScript %>
  2. <% Option Explicit %>
  3. <% Response.Expires = 0 %>
  4.  
  5. <% if Session("FONTSIZE") = "" then %>
  6.     <!--#include file="iito.inc"-->
  7. <% else %>
  8.  
  9. <% 
  10. '    strings for localization
  11. Const L_PERFORMANCE_TEXT = "Performance"
  12. Const L_ACCESSDENIED_TEXT="Access Denied" 
  13. Const L_ENTERINT_ERRORMESSAGE="Please enter an integer."
  14. Const L_UNSAVEDCHANGES_ERRORMESSAGE="You have unsaved changes. Save now?"
  15. Const L_CONNECTIONCONFIG_TEXT="Connection Configuration"
  16. Const L_KEEPALIVES_TEXT="HTTP Keep Alives enabled"
  17. Const L_TUNING_TEXT="Tuning"
  18. Const L_TUNESERVER_TEXT="Tune your server performance based on the number of hits expected per day."
  19. Const L_FEWER_TEXT="Fewer than"
  20. Const L_MORE_TEXT="More than"
  21. Const L_10000_TEXT="10,000"
  22. Const L_100000_TEXT="100,000"
  23. Const L_ENABLEBANDWIDTH_TEXT="Enable Bandwidth Throttling"
  24. Const L_LIMITNET_TEXT="Limit network bandwidth available to this Web site. This number cannot be more than the global setting on machine properties."
  25. Const L_KBS_TEXT="KB/S"
  26. Const L_MAXNETUSAGE_TEXT="Maximum network use:"
  27. Const L_SAVING_TEXT="Saving..."
  28.  
  29. On Error Resume Next 
  30.  
  31. Dim path, currentobj, mbw, maxtext
  32.  
  33. path=Session("spath")
  34. Session("path")=path
  35. Session("SpecObj")=""
  36. Session("SpecProps")=""
  37. Set currentobj=GetObject(path)
  38. %>
  39.  
  40. <!--#include file="iiset.inc"-->
  41.  
  42. <%
  43. function writeSlider(prop, stops, width, selnum)
  44.     dim slidestr, i
  45.     slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  46.     for i=0 to stops-2
  47.         slidestr=slidestr & drawStop(i,prop, selnum) 
  48.         slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
  49.     Next
  50.     slidestr=slidestr & drawStop(i, prop, selnum)
  51.     slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  52.     writeSlider=slidestr
  53. end function 
  54.  
  55. function drawStop(curr,prop, selnum)
  56.     dim thisname, slidestr,formname
  57.     thisname=quote & prop & curr & quote 
  58.     if Session("IsIE") then 
  59.         formname = "parent.document.userform."
  60.     else
  61.         formname = "document.userform."
  62.     end if 
  63.     slidestr="<A HREF='javascript:moveSlider(" &  formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
  64.     if curr=selnum then
  65.         drawStop=slidestr & "<IMG NAME=" & thisname &  " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  66.     else
  67.         drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  68.     end if
  69. end function 
  70.  
  71.  
  72.  %>
  73.  
  74.  
  75.  
  76. <HTML>
  77.  
  78. <HEAD>
  79. <TITLE></TITLE>
  80. <SCRIPT LANGUAGE="JavaScript">
  81.  
  82.     top.title.Global.helpFileName="iipy_30";
  83.     top.title.Global.siteProperties = true;
  84.  
  85.  
  86. <% if not Session("IsIE") then %>
  87.     slideron=new Image(11,26);
  88.     slideron.src="images/slideron.gif";    
  89.     slideroff=new Image(11,26);
  90.     slideroff.src="images/slideroff.gif";
  91.     lastslide="ServerSize<%= currentobj.ServerSize %>";
  92. <% end if %>
  93.  
  94.     function isNum(txtcntrl,min,max) {
  95.         str=txtcntrl.value;
  96.         for (var i=0; i < str.length; i++) {
  97.               num = parseInt(str);
  98.             if (isNaN(num)){
  99.                    alert("Please enter an integer.");
  100.                 return false;
  101.               }
  102.             else{
  103.                 txtcntrl.value = parseInt(str);
  104.  
  105.                 if (num < min) {
  106.                     alert("Please enter an integer greater than " + (min-1) + ".");
  107.                     return false;
  108.                 }
  109.                 if (num > max) {
  110.                     alert("Please enter an integer less than " + (max + 1) + ".");
  111.                     return false;
  112.                 }            
  113.             }
  114.          }
  115.         return true;
  116.     }
  117.  
  118.     function SetMaxBW(isChecked){
  119.         if (isChecked){
  120.             if (document.userform.hdnhdnMaxBandwidth.value == "")
  121.             {
  122.                 document.userform.hdnhdnMaxBandwidth.value = 1024;
  123.             }
  124.             document.userform.hdnMaxBandwidth.value=document.userform.hdnhdnMaxBandwidth.value;
  125.             document.userform.MaxBandwidth.value = document.userform.hdnhdnMaxBandwidth.value * 1024;
  126.         }
  127.         else{
  128.             document.userform.hdnhdnMaxBandwidth.value=document.userform.hdnMaxBandwidth.value;
  129.             document.userform.hdnMaxBandwidth.value="";
  130.             document.userform.MaxBandwidth.value = -1;
  131.         }
  132.     }
  133.     
  134.     function calcBW(thiscntrl){
  135.         if (thiscntrl.value == ""){
  136.             document.userform.hdnchkMaxBandwith.checked = false;
  137.             SetMaxBW(false);
  138.         }
  139.         else{
  140.             str = stripChar(thiscntrl.value,",");
  141.             num = parseInt(str);
  142.             if (!isNaN(num)){
  143.             document.userform.MaxBandwidth.value = num * 1024;
  144.             }
  145.         }
  146.     }
  147.  
  148.     function stripChar(str,chr){
  149.         while (str.indexOf(chr) != -1){
  150.             str = str.substring(0,str.indexOf(chr)) + str.substring(str.indexOf(chr)+1,str.length);
  151.         }
  152.         return str;
  153.     }
  154.  
  155.     function moveSlider(control, prop,num){
  156.         top.title.Global.updated=true;
  157.         <% if Session("IsIE") then %>
  158.             slideurl="iislider.asp?selnum="+num+"&stops=3&width=180&prop="+prop;
  159.             control.value=num;
  160.             document.Slider.location.href=slideurl;            
  161.         <% else %>
  162.             turnSlideOff(lastslide);
  163.             lastslide=prop+num;
  164.             thisprop=prop+num;
  165.             document [thisprop].src=slideron.src;
  166.             control.value=num;
  167.         <% end if %>
  168.     }
  169.  
  170.     function turnSlideOff(prop){
  171.                 document [prop].src=slideroff.src;
  172.     }
  173.     
  174.  
  175. </SCRIPT>
  176. </HEAD>
  177.  
  178. <BODY BGCOLOR="#CCCCCC" TOPMARGIN=5 TEXT="#000000" LINK="#000000" STYLE="font-face: Helv,Arial; font-size:10pt;">
  179. <FONT SIZE=1 FACE="Helv,Arial">
  180. <B><%= L_PERFORMANCE_TEXT %></B>
  181. <P>
  182. <%= L_TUNING_TEXT %>
  183. <BLOCKQUOTE>
  184. <TABLE>
  185. <TR>
  186.     <TD><FONT SIZE=1 FACE="Helv,Arial">
  187. <%= L_TUNESERVER_TEXT %><P>
  188.     <TABLE BORDER=0>
  189.         <TR>                    
  190.                 <TD COLSPAN=5><FONT SIZE=1 FACE="Helv,Arial">
  191.                 <% if Session("IsIE") then %>
  192.                 <IFRAME NAME="Slider" HEIGHT=30 FRAMEBORDER=0 WIDTH=415 SRC="iislider.asp?stops=3&width=180&prop=ServerSize&selnum=<%= currentobj.ServerSize %>">
  193.                 </IFRAME>
  194.                 <% else %>
  195.                     <%= writeSlider("ServerSize", 3, 180, currentobj.ServerSize) %>                     
  196.                 <% end if %>
  197.                 
  198.                 <FONT FACE="Helv,Arial" SIZE=1>                    
  199.                 </FONT>
  200.                 </TD>
  201.             </TR>
  202.  
  203.             <TR>
  204.                 <TD WIDTH= 130 ALIGN="left">                    
  205.                     <FONT FACE="Helv,Arial" SIZE=1>    
  206.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',0)">                                
  207.                         <%= L_FEWER_TEXT %><BR>
  208.                         <%= L_10000_TEXT %>
  209.                         </A>
  210.                     </FONT>
  211.                 </TD>                
  212.                 <TD WIDTH= 130 ALIGN="center">                                        
  213.                     <FONT FACE="Helv,Arial" SIZE=1>    
  214.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',1)">                                    
  215.                         <%= L_FEWER_TEXT %><BR>
  216.                         <%= L_100000_TEXT %>
  217.                         </A>
  218.                     </FONT>
  219.                 </TD>
  220.                 <TD WIDTH= 130 ALIGN="right">                                        
  221.                     <FONT FACE="Helv,Arial" SIZE=1>                                    
  222.                         <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',2)">    
  223.                         <%= L_MORE_TEXT %><BR>
  224.                         <%= L_100000_TEXT %>
  225.                         </A>
  226.                     </FONT>
  227.                 </TD>
  228.             </TR>
  229.         </TABLE>
  230.         </FONT>
  231.     </TD>
  232. </TR>
  233. </TABLE>
  234.  
  235. </BLOCKQUOTE>
  236. <HR>
  237.  
  238. <FORM NAME="userform">
  239.     <FONT SIZE=1 FACE="Helv,Arial">
  240. <INPUT TYPE="hidden" NAME="ServerSize" VALUE="<%= currentobj.ServerSize %>">
  241.  
  242. <% if Session("vtype") <> "svc" then %>
  243.     <%= checkboxVal(0, currentobj.MaxBandwidth > 0 , "hdnchkMaxBandwith", "SetMaxBW(this.checked);", True) %>    
  244.      <%= L_ENABLEBANDWIDTH_TEXT %></B>
  245.     
  246.     <BLOCKQUOTE>
  247.     <TABLE>
  248.     <TR>
  249.         <TD COLSPAN=2>
  250.             <FONT SIZE=1 FACE="Helv,Arial">
  251.             <%
  252.             if currentobj.MaxBandwidth < 0 then
  253.                 mbw = ""
  254.             else
  255.                 mbw = currentobj.MaxBandwidth/1024
  256.             end if
  257.             %>
  258.             <%= L_LIMITNET_TEXT %><P>
  259.             <%= L_MAXNETUSAGE_TEXT %> <%= inputbox(0,"text","hdnMaxBandwidth",mbw,10,"","","isNum(this,1,32767);calcBW(this);",True,True, not Session("IsAdmin") ) %> <%= L_KBS_TEXT %>
  260.             <INPUT TYPE="hidden" NAME="MaxBandwidth" VALUE="<%= currentobj.MaxBandwidth%>">
  261.             </FONT>
  262.         </TD>
  263.     </TR>
  264.     </TABLE>
  265.     </BLOCKQUOTE>
  266. <% else %>
  267.     <FONT SIZE=1 FACE="Helv,Arial" COLOR="Gray">
  268.     <IMG SRC="images/checkoff.gif" WIDTH=13 HEIGHT=13 BORDER=0>
  269.      <%= L_ENABLEBANDWIDTH_TEXT %>
  270.     </B>
  271.     <BLOCKQUOTE>
  272.     <TABLE BORDER = 0 WIDTH = 500>
  273.     <TR>
  274.         <TD COLSPAN=4>
  275.             <FONT SIZE=1 FACE="Helv,Arial" COLOR="Gray">
  276.             <%= L_LIMITNET_TEXT %><P>            
  277.             </FONT>
  278.         </TD>        
  279.     </TR>
  280.     <TR>
  281.         <TD WIDTH = 125>
  282.             <FONT SIZE=1 FACE="Helv,Arial" COLOR="Gray">
  283.                 <%= L_MAXNETUSAGE_TEXT %>
  284.             </FONT>
  285.         </TD>
  286.         <TD WIDTH =75>
  287.             <FONT SIZE=1 FACE="Helv,Arial" COLOR="Gray">
  288.             <%
  289.             maxtext = disableintstart & "     " & disabletextend
  290.             %>            
  291.             <%= maxtext %>
  292.             </FONT>            
  293.         </TD>
  294.         <TD WIDTH =25>
  295.             <FONT SIZE=1 FACE="Helv,Arial" COLOR="Gray">
  296.                 <%= L_KBS_TEXT %>
  297.             </FONT>
  298.         </TD>
  299.         <TD WIDTH =275> 
  300.         </TD>
  301.         
  302.     </TR>
  303.     </TABLE>
  304.     </BLOCKQUOTE>
  305.     </FONT>
  306. <% end if %>
  307.  
  308.  
  309. <HR>
  310. <%= L_CONNECTIONCONFIG_TEXT %>
  311. <BLOCKQUOTE>
  312. <TABLE>
  313. <TR>
  314.     <TD COLSPAN=2>
  315.         <FONT SIZE=1 FACE="Helv,Arial">
  316.             <%= checkbox("AllowKeepAlive","",True) %> <%= L_KEEPALIVES_TEXT %>
  317.         </FONT>
  318.     </TD>
  319. </TR>
  320. </TABLE>
  321. </BLOCKQUOTE>
  322. </FORM>
  323. <% if Session("vtype") <> "svc" then %>
  324. <SCRIPT LANGUAGE="JavaScript">
  325.     if (document.userform.MaxBandwidth.value==-1){
  326.         document.userform.MaxBandwidth.value=""
  327.     }
  328.         
  329. </SCRIPT>
  330. <% end if %>
  331.  
  332.  
  333. </FONT>
  334. </BODY>
  335.  
  336.  
  337. </HTML>
  338.  
  339. <% end if %>