Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

315 lines
8.6 KiB

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3. <!-- #include file="directives.inc" -->
  4. <% if Session("FONTSIZE") = "" then %>
  5. <!--#include file="iito.inc"-->
  6. <% else %>
  7. <!--#include file="iiperf.str"-->
  8. <%
  9. On Error Resume Next
  10. Dim path, currentobj, mbw, maxtext, logonly
  11. path=Session("spath")
  12. Session("path")=path
  13. Session("SpecObj")=""
  14. Session("SpecProps")=""
  15. Set currentobj=GetObject(path)
  16. %>
  17. <!--#include file="iiset.inc"-->
  18. <!--#include file="iisetfnt.inc"-->
  19. <%
  20. function writeSlider(prop, stops, width, selnum)
  21. dim slidestr, i
  22. slidestr="<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  23. for i=0 to stops-2
  24. slidestr=slidestr & drawStop(i,prop, selnum)
  25. slidestr=slidestr & "<IMG SRC='images/slidersp.gif' WIDTH=" & width & " HEIGHT=26 BORDER=0>"
  26. Next
  27. slidestr=slidestr & drawStop(i, prop, selnum)
  28. slidestr=slidestr & "<IMG SRC='images/sliderend.gif' WIDTH=1 HEIGHT=26 BORDER=0>"
  29. writeSlider=slidestr
  30. end function
  31. function drawStop(curr,prop, selnum)
  32. dim thisname, slidestr,formname
  33. thisname=quote & prop & curr & quote
  34. if Session("IsIE") then
  35. formname = "parent.document.userform."
  36. else
  37. formname = "document.userform."
  38. end if
  39. slidestr="<A HREF='javascript:moveSlider(" & formname & prop & ", " & quote & prop & quote & "," & curr & ")'>"
  40. if curr=selnum then
  41. drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideron.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  42. else
  43. drawStop=slidestr & "<IMG NAME=" & thisname & " SRC='images/slideroff.gif' WIDTH=11 HEIGHT=26 BORDER=0></A>"
  44. end if
  45. end function
  46. %>
  47. <HTML>
  48. <HEAD>
  49. <TITLE></TITLE>
  50. <SCRIPT LANGUAGE="JavaScript">
  51. <!--#include file="iijsfuncs.inc"-->
  52. <% if Session("vtype") = "svc" then %>
  53. top.title.Global.helpFileName="iipy_47";
  54. top.title.Global.siteProperties = false;
  55. <% else %>
  56. top.title.Global.helpFileName="iipy_30";
  57. top.title.Global.siteProperties = true;
  58. <% end if %>
  59. <% if not Session("IsIE") then %>
  60. slideron=new Image(11,26);
  61. slideron.src="images/slideron.gif";
  62. slideroff=new Image(11,26);
  63. slideroff.src="images/slideroff.gif";
  64. lastslide="ServerSize<%= currentobj.ServerSize %>";
  65. <% end if %>
  66. function SetMaxBW(isChecked){
  67. if (isChecked){
  68. if (document.userform.hdnhdnMaxBandwidth.value == "")
  69. {
  70. document.userform.hdnhdnMaxBandwidth.value = 1024;
  71. }
  72. document.userform.hdnMaxBandwidth.value=document.userform.hdnhdnMaxBandwidth.value;
  73. document.userform.MaxBandwidth.value = document.userform.hdnhdnMaxBandwidth.value * 1024;
  74. }
  75. else{
  76. document.userform.hdnhdnMaxBandwidth.value=document.userform.hdnMaxBandwidth.value;
  77. document.userform.hdnMaxBandwidth.value="";
  78. document.userform.MaxBandwidth.value = -1;
  79. }
  80. }
  81. function calcBW(thiscntrl){
  82. if (thiscntrl.value == ""){
  83. document.userform.hdnchkMaxBandwith.checked = false;
  84. SetMaxBW(false);
  85. }
  86. else{
  87. str = stripChar(thiscntrl.value,",");
  88. num = parseInt(str);
  89. if (!isNaN(num)){
  90. document.userform.MaxBandwidth.value = num * 1024;
  91. }
  92. }
  93. }
  94. function stripChar(str,chr){
  95. while (str.indexOf(chr) != -1){
  96. str = str.substring(0,str.indexOf(chr)) + str.substring(str.indexOf(chr)+1,str.length);
  97. }
  98. return str;
  99. }
  100. function moveSlider(control, prop,num){
  101. top.title.Global.updated=true;
  102. <% if Session("IsIE") then %>
  103. slideurl="iislider.asp?selnum="+num+"&stops=3&width=180&prop="+prop;
  104. control.value=num;
  105. document.Slider.location.href=slideurl;
  106. <% else %>
  107. turnSlideOff(lastslide);
  108. lastslide=prop+num;
  109. thisprop=prop+num;
  110. document [thisprop].src=slideron.src;
  111. control.value=num;
  112. <% end if %>
  113. }
  114. function turnSlideOff(prop){
  115. document [prop].src=slideroff.src;
  116. }
  117. //sets CPU Throttling properties not exposed in the UI
  118. //these are all stored as 1000 of a percent.
  119. //This gets called if a change is made to CPU Max amount, or if the user checks LogOnly
  120. function setCPUThrottle()
  121. {
  122. //shortcut our formname
  123. uform = document.userform;
  124. //if LogOnly is checked, we need to set the unexposed properties to 0;
  125. if (uform.hdnEnforceLimits.checked)
  126. {
  127. uform.CPULimitLogEvent.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 1000),100000);
  128. uform.CPULimitPriority.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 1.50 * 1000),100000);
  129. uform.CPULimitProcStop.value = setToMax((uform.hdnPctCPULimitLogEvent.value * 2.00 * 1000),100000);
  130. uform.CPULimitPause.value = 0;
  131. }
  132. else
  133. {
  134. uform.CPULimitLogEvent.value = uform.hdnPctCPULimitLogEvent.value * 1000;
  135. uform.CPULimitPriority.value = 0;
  136. uform.CPULimitProcStop.value = 0;
  137. uform.CPULimitPause.value = 0;
  138. }
  139. }
  140. //limit a value to either the value or the maxvalue, whichever is less.
  141. function setToMax(val, maxval)
  142. {
  143. if (val > maxval)
  144. {
  145. return maxval;
  146. }
  147. return val;
  148. }
  149. </SCRIPT>
  150. </HEAD>
  151. <BODY BGCOLOR="<%= Session("BGCOLOR") %>" TOPMARGIN=5 TEXT="#000000" LINK="#000000" >
  152. <TABLE WIDTH = 500 BORDER = 0>
  153. <TR>
  154. <TD>
  155. <%= sFont("","","",True) %>
  156. <B><%= L_PERFORMANCE_TEXT %></B>
  157. <P>
  158. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  159. <%= L_TUNING_TEXT %>
  160. <IMG SRC="images/hr.gif" WIDTH=<%= L_TUNING_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">
  161. <TABLE>
  162. <TR>
  163. <TD><%= sFont("","","",True) %>
  164. <%= L_TUNESERVER_TEXT %><P>
  165. <TABLE BORDER=0>
  166. <TR>
  167. <TD COLSPAN=5><%= sFont("","","",True) %>
  168. <% if Session("IsIE") then %>
  169. <IFRAME NAME="Slider" HEIGHT=<%= L_SLIDERFRM_H %> FRAMEBORDER=0 WIDTH=<%= L_SLIDERFRM_W %> SRC="iislider.asp?stops=3&width=180&prop=ServerSize&selnum=<%= currentobj.ServerSize %>">
  170. </IFRAME>
  171. <% else %>
  172. <%= writeSlider("ServerSize", 3, L_SLIDERSTEPSIZE_NUM, currentobj.ServerSize) %>
  173. <% end if %>
  174. </TD>
  175. </TR>
  176. <TR>
  177. <TD WIDTH= 130 ALIGN="left">
  178. <%= sFont("","","",True) %>
  179. <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',0)">
  180. <%= L_MINHITS_TEXT %>
  181. </A>
  182. </FONT>
  183. </TD>
  184. <TD WIDTH= 130 ALIGN="center">
  185. <%= sFont("","","",True) %>
  186. <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',1)">
  187. <%= L_MIDHITS_TEXT %>
  188. </A>
  189. </FONT>
  190. </TD>
  191. <TD WIDTH= 130 ALIGN="right">
  192. <%= sFont("","","",True) %>
  193. <A HREF="javascript:moveSlider(document.userform.ServerSize,'ServerSize',2)">
  194. <%= L_MAXHITS_TEXT %>
  195. </A>
  196. </FONT>
  197. </TD>
  198. </TR>
  199. </TABLE>
  200. </FONT>
  201. </TD>
  202. </TR>
  203. </TABLE>
  204. </BLOCKQUOTE>
  205. <FORM NAME="userform">
  206. <%= sFont("","","",True) %>
  207. <INPUT TYPE="hidden" NAME="ServerSize" VALUE="<%= currentobj.ServerSize %>">
  208. <% if Session("vtype") <> "svc" then %>
  209. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  210. <%= checkboxVal(0, currentobj.MaxBandwidth > 0 , "hdnchkMaxBandwith", "SetMaxBW(this.checked);", True) %>
  211. &nbsp;<%= L_ENABLEBANDWIDTH_TEXT %></B>
  212. <IMG SRC="images/hr.gif" WIDTH=<%= L_ENABLEBANDWIDTH_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">
  213. <TABLE WIDTH = 400>
  214. <TR>
  215. <TD COLSPAN=2>
  216. <%= sFont("","","",True) %>
  217. <%
  218. if currentobj.MaxBandwidth < 0 then
  219. mbw = ""
  220. else
  221. mbw = currentobj.MaxBandwidth/1024
  222. end if
  223. %>
  224. <%= L_LIMITNET_TEXT %><P>
  225. <%= L_MAXNETUSAGE_TEXT %>&nbsp;<%= inputbox(0,"text","hdnMaxBandwidth",mbw,L_MAXNETUSAGE_NUM,"","","isNum(this,1,32767);calcBW(this);",True,True, not Session("IsAdmin") ) %>&nbsp;<%= L_KBS_TEXT %>
  226. <INPUT TYPE="hidden" NAME="MaxBandwidth" VALUE="<%= currentobj.MaxBandwidth%>">
  227. </FONT>
  228. </TD>
  229. </TR>
  230. </TABLE>
  231. </BLOCKQUOTE>
  232. <% end if %>
  233. <IMG SRC="images/hr.gif" WIDTH=5 HEIGHT=2 BORDER=0 ALIGN="middle">
  234. <%= checkbox("CPULimitsEnabled", "", True) %>&nbsp;
  235. <%= L_ENABLECPUACCT_TEXT %></B>
  236. <IMG SRC="images/hr.gif" WIDTH=<%= L_ENABLECPUACCT_HR_W %> HEIGHT=2 BORDER=0 ALIGN="middle">
  237. <BR>
  238. <TABLE WIDTH = 400>
  239. <TR>
  240. <TD COLSPAN=2>
  241. <%= sFont("","","",True) %>
  242. <%= L_MAXCPUUSAGE_TEXT %>&nbsp;
  243. <%= inputbox(0,"text","hdnPctCPULimitLogEvent",(currentobj.CPULimitLogEvent/1000),L_MAXCPUUSAGE_NUM,"","","isNum(this,0,32767);setCPUThrottle();",False,True, not Session("IsAdmin") ) %>
  244. &nbsp;<%= L_PRCNT_TEXT %>
  245. <%= writehidden("CPULimitLogEvent") %>
  246. <%= writehidden("CPULimitPriority") %>
  247. <%= writehidden("CPULimitProcStop") %>
  248. <%= writehidden("CPULimitPause") %>
  249. <P>
  250. <%
  251. logonly = (currentobj.CPULimitLogEvent <> 0) and (currentobj.CPULimitPriority = 0 and currentobj.CPULimitProcStop = 0 and currentobj.CPULimitPause = 0)
  252. %>
  253. <%= checkboxVal(0, not logonly, "hdnEnforceLimits", "setCPUThrottle();", True)%>&nbsp;<%= L_LOGEVENT_TEXT %>&nbsp;
  254. </FONT>
  255. </TD>
  256. </TR>
  257. </TABLE>
  258. </FONT>
  259. </FORM>
  260. </TD>
  261. </TR>
  262. </TABLE>
  263. <% if Session("vtype") <> "svc" then %>
  264. <SCRIPT LANGUAGE="JavaScript">
  265. if (document.userform.MaxBandwidth.value==-1){
  266. document.userform.MaxBandwidth.value=""
  267. }
  268. </SCRIPT>
  269. <% end if %>
  270. </BODY>
  271. </HTML>
  272. <% end if %>