<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<%If session("admau")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(Request("id"))  Then
	ef=True
	ec="ID应该是数字！"
elseIf session("cansetserver")="" Then
	ef=True
	ec="您没有此操作的权限。"
end if
if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
Sql="Select * from FreeHost.FreeHost_Serverlist where id='"&Request("id")&"'"
		ds.Open Sql,conn,1,1
If ds.Eof Then
	ef=True
	ec="不存在的服务器ID。"
else
if ds("ostype")="linux" then
'Response.Redirect dsserver("site")
%>
<form name="form1" method="post" action="<%=ds("site")%>/CMD_LOGIN" ID="Form1">
<input type=hidden name=referer value="/">
<input name="username" type="hidden" value="admin">
<input name="password" type="hidden" value="<%=ds("FreeHostsharekey")%>">
<input type="submit" name="Submit" value="正在自动登陆DA后台...........">
</form>
<script language="JavaScript">
document.Form1.submit();
</script>
<%response.end
End if
end if

if not ef then
URL=ds("site")
FreeHostsharekey=ds("FreeHostsharekey")
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html8")%>
<%=htmlwrite("html9")%>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0 background="img/midtop4.gif">
  <TBODY>
    <TR>
      <TD width=53 align="left" background="img/midtop1.gif"><strong> 　 </strong><font color="#FFFFFF">─<strong>&gt;</strong></font> </TD>
      <TD align="left"><table height="59"  border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="7" background="img/midtop.gif">&nbsp;</td>
            <td width="80" align="center" valign="middle" background="img/r3.jpg" id="tableTop1" style="Cursor:hand"><a href="serverlist.asp"><font color="#FFFFFF">服务器管理</font></a></td>
            <td width="5" background="img/midtop2.gif">&nbsp;</td>
          </tr>
      </table></TD>
      <TD width=23 align="right"><IMG height=59 
                  src="img/rtop4.jpg" 
                  width=19></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width="100%" border=0 cellPadding=0 cellSpacing=0>
  <TBODY>
    <TR>
      <TD width=19 background="img/midlef.gif" id=rightid>&nbsp;</TD>
      <TD height="300" align="center" vAlign=top bgcolor="#FFFFFF">
	  <DIV class="tableborder">
<table width="100%"  border="0" cellspacing="1">
  <tr >
    <td width="11%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">编号</font></td>
    <td width="57%" align="center" background="img/tablebg.gif"><font color="#FFFFFF">服务器名称</font></td>
    <td height="24" colspan="2" align="center" background="img/tablebg.gif"><font color="#FFFFFF">操作</font></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td rowspan="7" align="center"><%=ds("id")%></td>
    <td rowspan="7" align="left">　<%=ds("servername")%>(<%=ds("site")%>) IP:<%=ds("ip")%>
      <%if ds("agent1")<>"n" then%>
      　 代理名：<a href="searchagent.asp?username=<%=ds("agent1")%>"><font color="#0000FF"><%=ds("agent1")%></font></a>
      <%end if%>
      <br>
      <br>      　昨天流量：<%=round(CDbl(ds("Bytes"))/1048576,2)%>M<br>
      　分析日志时间: <%=ds("lastanatime")%> 更新流量表时间: <%=ds("lastlogtime")%><br>
      <br>　      
      <a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=clearlog"><font color=black>将这台服务器所有虚拟主机月流量清零>>></font></a><br>
      　
      </td>
    <td width="16%" height="23" align="center">
      <a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=iisrestart"><font color=black>重启IIS</font></a>
      <a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=iisstop"><font color=black>停止IIS</font></a> </td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=reboot"><font color=black>重启服务器</font></a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=stopmssql"><font color=black>停止MSSQL</font></a></td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=startmssql"><font color=black>启动MSSQL</font></a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=stopmysql"><font color=black>停止MYSQL</font></a></td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=startmysql"><font color=black>启动MYSQL</font></a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=stopwinwebmail"><font color=black>停止WinWebMail</font></a></td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=startwinwebmail"><font color=black>启动WinWebMail</font></a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=stopimail"><font color=black>停止Imail</font></a></td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=startimail"><font color=black>启动Imail</font></a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=analog"><font color=black>重新分析昨天流量</font></a></td>
    <td width="16%" height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=uplog"><font color=black>更新流量表<br>
      (必须先点“重新分析昨天流量”后过半小时才能点击更新流量表)
    </font></a><a href="http://sys.7i24.com/system/support/show.asp?id=109261105282" target="_blank"><br>
    <br>
    本功能的说明参考&gt;&gt;&gt;</a></td>
  </tr>
  <tr bgcolor="#E4EAF2">
    <td height="23" align="center"><a href="serverop.asp?id=<%=ds("id")%>&type=<%=request("type")%>&op=siteback"><font color=black>重新备份昨天文件</font></a></td>
    <td width="16%" height="23" align="center"><a href="batchupftppass.asp?serverlistid=<%=ds("id")%>&type=<%=request("type")%>&op=siteback" target="_blank"><font color=black>随机化设置所有FTP密码</font></a></td>
  </tr>
</table>
	  <br>
	  <br>
	  <table width="100%"  border="0" cellspacing="1">
        <tr >
          <td width="11%" height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">内容</font></td>
          <td width="57%" align="center" background="img/tablebg.gif"><font color="#FFFFFF">服务器信息</font></td>
          <td height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">总空间(GB)</font></td>
          <td height="24" align="center" background="img/tablebg.gif"><font color="#FFFFFF">空闲</font></td>
        </tr>
<%
outcon=replace(ShowAllDrive(URL,FreeHostsharekey,"IWEBMSG"),"调用出错！","")

if Not instr(outcon,"全部磁盘容量")>1 then 
Response.Write "这台受控服务器自检没有通过，请在站点管理，虚拟主机中自检来分析原因。"
Response.End 
end if 

arryA=split(outcon,"	　　")
for i=0 to ubound(arryA)
arryB=split(arryA(i),":")
if ubound(arryB)>0 then
arryC=split(replace(arryB(1),"\",""),"	")
arryC(0)=replace(replace(arryC(0),"全部磁盘容量是 ",""),"GB","")
arryC(1)=replace(replace(arryC(1),"空余磁盘容量是 ",""),"GB","")
spaceused=CDbl(arryC(0))-CDbl(arryC(1))
spacelimit=CDbl(arryC(0))
%>

        <tr bgcolor="#E4EAF2">
          <td height="50" align="center"><%=arryB(0)%>: 盘</td>
          <td align="left"><table width="<%=int(Clng(spaceused)*100/spacelimit)%>%" height="20"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000"><%=int(Clng(spaceused)*100/spacelimit)%>%
</table>
</td>
          <td width="16%" align="center"><%=FormatNumber(arryC(0),3,-1)%> GB</td>
          <td width="16%" align="center"><%=FormatNumber(arryC(1),3,-1)%> GB</td>
        </tr>
<%
end if
next%>

<%
outcon=ShowAllDrive(URL,FreeHostsharekey,"RAM")
if Not instr(outcon,"物理内存")>1 then 
Response.Write "这台受控服务器受控没升级，请先升级。"
Response.End 
end if 

arryRam=split(outcon,";")
arryRamT=split(arryRam(0),"：")
'Response.write "<br>总物理内存："&arryRamT(1)&"<br><br>"
arryRamA=split(arryRam(1),"：")
'Response.write "<br>可用物理内存："&arryRamA(1)&"<br><br>"
arryRamP=split(arryRam(2),"：")
'Response.write "<br>已用物理内存比例："&arryRamP(1)&"<br><br>"
'Response.write "<br>内存使用情况："&outcon&"<br><br>"
%>

<tr bgcolor="#E4EAF2">
          <td height="50" align="center">内存</td>
          <td align="left"><table width="<%=arryRamP(1)%>" height="20"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FF0000"><%=arryRamP(1)%> <a href="serveradmlist.asp">列出所有服务器的使用情况</a>
</table>
</td>
          <td width="16%" align="center"><%=arryRamT(1)%></td>
          <td width="16%" align="center"><%=arryRamA(1)%></td>
        </tr>


      </table>
	  </div>
</TD>
      <TD width=18 background="img/midri.gif">&nbsp;</TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TBODY>
    <TR>
      <TD width=30><IMG height=19 
                  src="img/rb1.jpg" 
                  width=30></TD>
      <TD 
                background=img/rb2.jpg>&nbsp;</TD>
      <TD width=30><IMG height=19 
                  src="img/rb3.jpg" 
                  width=30></TD>
    </TR>
  </TBODY>
</TABLE>
<%end if%>

<%=htmlwrite("html10")%>
<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>
