<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
If session("VPSAUID")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(session("VPSAUID"))  Then
	ef=True
	ec="osid应该是数字！"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set dsph = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_Product_VPS where id='"&session("VPSAUID")&"'"
	dsph.Open Sql,conn,1,3
if dsph.Eof then
	ef=True
	ec="不存在的数据库产品ID！"
end if
end if

if not ef then
	Set dsVPSpdlist = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_VPSProductlist where VPStype='"&dsph("VPStype")&"'"
	if Instr(1,sql, ";", 1)>0 or Instr(1,sql, "--", 1)>0 then
Response.Write "非法字符！"
Response.End
end if
	dsVPSpdlist.Open Sql,conn,1,1
if dsVPSpdlist.Eof then
	ef=True
	ec="产品不存在！"
end if
end if

if not ef then
	Set dsserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerVPSlist where id='"&dsph ("ServerlistID")&"'"
	dsserver.Open Sql,conn,1,1
if dsserver.Eof then
	ef=True
	ec="服务器不存在！"
else
isONEip=dsserver("isONEip")	
end if
end If

if not ef then
if isONEip=true then
	Set dsCDNserver = Server.CreateObject("ADODB.Recordset")	
	Sql="Select * from FreeHost.FreeHost_ServerCDNlist where id='"&dsserver ("usecdn1")&"'"
	dsCDNserver.Open Sql,conn,1,1
if dsCDNserver.Eof then
	ef=True
	ec="CDN服务器不存在！"
end if
end if
end if


if not ef Then

 txml=dateadd("y",-1,now)
 cputotal=dsserver("CPUMHZ")	
'Response.write FormatNumber((dsph("LastdayCpu")/cputotal/(hour(now)+1)/(dsph("MaxCPU")/100)),1,-1)
'Response.write hour(now)

%>
<!--#include virtual="/inc-freehost-function/template-vpsadm-top.asp"-->
　云服务器自助管理

<br>
<br>

  <TABLE width="100%" border=1 align=center cellPadding=0 cellSpacing=0 borderColorLight=#cccccc borderColorDark=#fbfbfb>
    <TBODY>
      <TR align="center">
        <TD height="35" vAlign=middle bgColor=#494949>&nbsp; <font color="#FFFFFF">
          <input name="id" type="hidden" value="<%=Request("id")%>">
          每小时CPU使用分析：</font></TD>
      </TR>
      <TR>

        <TD height="50" align="center" vAlign=middle bgColor=#FFFFFF>昨天的全天平均使用CPU为 <%=FormatNumber((dsph("LastdayCpu")/cputotal/(hour(now)+1)/(dsph("MaxCPU")/100)),1,-1)%> %　今天已用的CPU为 <%=FormatNumber((dsph("TodayCpu")/cputotal/(hour(now)+1)/(dsph("MaxCPU")/100)),1,-1)%> % </TD>
      </TR>
      <TR>
        <TD height="200" align="center" vAlign=middle bgColor=#FFFFFF>
		
		
		


<table width="430" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="right" valign="top" id="endMaxid" style="line-height: 12px; margin-right: 2;text-align: right;padding:0px"> </td>
            <td><table width="412" border="1" cellpadding="0" cellspacing="0" background="img/deepback.gif">
              <tr>
                <td><table width="18"  border="0" cellspacing="1" cellpadding="1">
                    <tr>
                      <%
nowtime=hour(now)
runcountMax=0
'runcountMaxAGN=0
Y=1
For i=0 To 23
'Response.write "HourMB"&i 
runcount=FormatNumber((dsph("HourCPU"&i)/(dsph("MaxCPU")/100)/cputotal)*100,1,-1)

If runcount>runcountMax Then runcountMax=runcount

%>
                      <td width="14" height="100" valign="bottom" title="<%=runcount%>" id="TDid<%=Y%>"><table width="14"  border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td valign="bottom" bgcolor="#006600"  id="TDidX<%=Y%>" title="<%If hour(now)<i Then%>昨天<%End if%><%If i=0 Then%>昨天23<%else%><%=i-1%><%End if%>:00-<%=i%>:00 平均使用: <%=runcount%> %">
							<table width="14" height="0" border="0" cellpadding="0" cellspacing="0">
							</table>
</td>
                          </tr>
                      </table></td>
                      <%
Y=Y+1
next%>
                    </tr>
                    <tr>
                      <%
'nowtime=date
For i=0 To 23
%>
                      <td width="14" title="<%If hour(now)<i Then%>昨天<%End if%><%If i=0 Then%>昨天23<%else%><%=i-1%><%End if%>:00-<%=i%>:00"><a href="#">
                        <%If i=1 or i=12 then%>
                        <font color=red><%=i%></font>
                        <%else%>
                        <%=i%>
                        <%End if%>
                      </a></td>
                      <%next%>
                    </tr>
                </table></td>
              </tr>
            </table></td>
          </tr>
        </table>
<div style="width:520px;margin:12px 0px 12px 18px;color:#999">单位为%，上图为每小时CPU使用报表</div>


<%if runcountMax=0 then runcountMax=0.001%>
<script>
<%For Y=1 To 24
if Y>hour(now) or Y<2 then%>
document.getElementById("TDidX<%=Y%>").style.backgroundColor = "#CCCCCC"
<%end if%>
document.getElementById("TDidX<%=Y%>").style.height = document.getElementById("TDid<%=Y%>").title*100/<%=runcountMax%>;
<%next%>
document.getElementById("endMaxid").innerHTML="<%=FormatNumber(runcountMax,0,-1)%><br><br><%=FormatNumber(runcountMax*3/4,0,-1)%><br><br><%=FormatNumber(runcountMax*2/4,0,-1)%><br><br><%=FormatNumber(runcountMax*1/4,0,-1)%>";
<%For Y=1 To 24%>
document.getElementById("TDidX<%=Y%>").style.height = document.getElementById("TDid<%=Y%>").title*100/<%=runcountMax%>;
<%next%>
</script>

		
		
		
		
		</TD>
      </TR>
    </TBODY>
  </TABLE>


  <br>
<br>


　<a href="selfVPSmodify.asp?id=<%=Request("id")%>"><font color="#000000">[返回上一页]</font></a>
<!--#include virtual="/inc-freehost-function/template-vpsadm-end.asp"-->
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
