<%@ Page Language="c#" Inherits="WebApp.Admin.watchOperateState" CodeBehind="watchOperateState.aspx.cs" %>

<!DOCTYPE html>
<!--[if lt IE 9]><html class="lte-ie8"><![endif]-->
<!--[if gt IE 8]><!-->
<html>
<!--<![endif]-->
<head>
    <title>watchOperateState</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
    .table1 {
	        width:100%;
	        background:#FFFFFF;
	        font-size:12px;
        }
        .table1 th,
        .table1 tr.title,
        .table1 td.title {
	        background:#E9EBF3;
	        text-align:right;
	        font-weight:normal;
        }
        .table1 td {
            height:24px;
        }
        .table1 .required {
	        font-style:normal;
	        font-weight:normal;
	        color:#FF0000;
	        margin-right:0.5em;
        }
        .table1-l,.table1-r,
        .table1-l tr,.table1-r tr,
        .table1-l td,.table1-r td{
            border:1px solid #ddd !important;
            outline: none !important;
        }
        
    </style>
    <script language="javascript" type="text/javascript">

function ReceiveServerData(result)
{
    if (result != "")
    {
        var rows = result.split("$$");
        var html = [];
        var html1 = [];
        var j=0;
        for (var i = 0; i < rows.length; i ++)
        {
            var row = rows[i].split("$");
            if(row[3]!="0" && row[3] != "1")
            {
			    html[html.length] = "<tr bgcolor=#FFFFFF>"+"<td align=center>" + row[11] + "</td>"+"<td align=center>" + operate(row[2]) + "</td>"+"<td align=center>" +row[7] + "</td>"+"<td align=center>" + row[9] + "</td>"+"<td align=center>" + row[10] + "</td>"+"</tr>";
			}
            document.getElementById("watchFinishQueue").innerHTML = "<table class=table1-l width=100% style=BORDER-COLLAPSE: collapse; HEIGHT: 214px borderColor=#ddd cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0><tr class=tdbg><td align=center>网站</td><td align=center>请求操作</td><td align=center>状态</td><td align=center>响应时间</td><td align=center>完成时间</td></tr>" + html.join("") + "</table>";
        }
        for (var i = rows.length-1; i >=0 ; i--)
        {
            var row = rows[i].split("$");
            if (row[3] == "0" || row[3] == "1")
            {
                j++;
                html1[html1.length] = "<tr bgcolor=#FFFFFF>"+"<td>" +j+ "</td>"+"<td>" + row[11] + "</td>"+"<td>" + operate(row[2]) + "</td>"+"<td>" + row[7] + "</td>"+"<td>" + (row[6] == "null" ? "":row[6]) + "</td>"+"<td>" + row[8] + "</td>"+"<td>" + (row[9] == "null" ? "":row[9]) + "</td>"+"</tr>";
            }
            document.getElementById("watchWaitQueue").innerHTML = "<table class=table1-r width=100% style=BORDER-COLLAPSE: collapse; HEIGHT: 214px borderColor=#ddd  cellSpacing=0 cellPadding=0 bgColor=#ffffff border=0><tr class=tdbg><td align=center width=30>编号</td><td align=center>网站</td><td align=center width=60>请求操作</td><td align=center>状态</td><td align=center width=60>执行操作</td><td align=center width=60>请求时间</td><td align=center width=60>响应时间</td></tr>" + html1.join("") + "</table>";
        }
    }
}

function operate(i)
{
  var op;
  switch(i)
  {
    case "0":
     op="建站";
     break;
    case "1":
     op="运行网站";
     break;
    case "2":
     op="停止网站";
     break;
    case "3":
     op="删除网站";
     break;
    case "4":
     op="统计磁盘空间";
     break;
    case "5":
     op="备份数据";
     break;
    case "6":
     op="恢复数据";
     break;
      case "7":
     op="清除数据";
     break;
      case "8":
     op="撤消删除";
     break;
     case "9":
     op="编辑站点信息";
     break;
     case "10":
     op="WEB服务迁移";
     break;
     case "11":
     op="数据库迁移";
     break;
     case "12":
     op="WEB服务空间统计";
     break;
     case "13":
     op="删除子站备份包";
     break;
     case "14":
     op="删除源站点";
     break;
     case "15":
     op="删除源数据库";
     break;
    }
    return op;
      
  }


function operateList()
{
    arg = 1;
   
    <% =callback%>
}
    </script>

</head>
<body>
    <form id="Form1" method="post" runat="server">
    <div>
    <table class="table1">
        <tr>
            <td align="center" bgcolor="#E9EBF3">
                请求队列
            </td>
            <td align="center" bgcolor="#B7B2A0">
                完成队列
            </td>
        </tr>
        <tr>
            <td valign="top">
                <asp:Label ID="watchWaitQueue" runat="server">监视等待队列</asp:Label>
            </td>
            <td valign="top">
                <asp:Label ID="watchFinishQueue" runat="server">监视完成队列</asp:Label>
            </td>
        </tr>
    </table>
    </div>
    </form>

    <script language="javascript">

timename=setInterval("operateList();",500); 
	
    </script>

</body>
</html>
