<%@ Page Language="c#" Inherits="TopWinCMS.WebUI.Admin.Admin_Index_Main" CodeBehind="Index_Main.aspx.cs" %>

<%@ Register Src="UC_AjaxLoading.ascx" TagName="UC_AjaxLoading" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>起始页 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Pragma" content="No-cach" />
    <script language="javascript" type="text/javascript" src="../JS/Ajax/Ajax.js"></script>
    <script language="javascript" type="text/javascript" src="TopWin.js"></script>
    <script language="javascript" type="text/javascript">

        window.onload = function ()
        {
            window.setTimeout("GetRunningInfo()", 3000);
            GetRequest();
        }
        function GetRequest()
        {
            var Ajax = new AjaxClass();
            Ajax.RequestUrl = "../AjaxPostBack.ashx?Action=UpDataNews";
            Ajax.Method = "get";
            Ajax.StateChangeEvent = function ()
            {
                if (Ajax.XmlHttp.readyState == 4)
                {
                    $("updata").innerText = Ajax.XmlHttp.responseText;
                }
                else
                {
                    $("updata").innerText = "数据正在加载。。。";
                }
            };
            Ajax.SendRequest();
        }


        function HideAndDisplay(TabIndex, o)
        {
            $("current").id = "";
            for (i = 0; i < 4; i++)
            {
                if (i == TabIndex)
                {
                    o.id = "current";
                    $("Tab" + i).style.display = "block";
                }
                else
                {
                    $("Tab" + i).style.display = "none";
                }
            }

            return false;
        }
        function GetRunningInfo()
        {
            var Ajax = new AjaxClass();
            Ajax.RequestUrl = "Index_Main.aspx?Action=GetRunningInfo";
            Ajax.Method = "get";
            Ajax.StateChangeEvent = function ()
            {
                if (Ajax.XmlHttp.readyState == 4 && Ajax.XmlHttp.status == 200)
                {
                    var info = eval('(' + Ajax.XmlHttp.responseText + ')');

                    $("LB_aspnetn").innerText = info.LB_aspnetn;
                    $("LB_aspnetcpu").innerText = info.LB_aspnetcpu;
                    $("LB_serverstart").innerText = info.LB_serverstart;
                    $("LB_prstart").innerText = info.LB_prstart;
                    $("LB_CpuUsage").innerText = info.LB_CpuUsage;
                    $("LB_GetMaxThreads").innerText = info.LB_GetMaxThreads;
                    $("LB_ProcessThread").innerText = info.LB_ProcessThread;
                    $("LB_dwMemoryLoad").innerText = info.LB_dwMemoryLoad;
                    $("LB_dwAvailPhys").innerText = info.LB_dwAvailPhys;
                    $("LB_dwAvailPageFile").innerText = info.LB_dwAvailPageFile;
                    $("LB_servers").innerText = info.LB_servers;
                    $("LB_servera").innerText = info.LB_servera;
                    $("LB_Cache").innerText = info.LB_Cache;
                    $("LB_CacheMax").innerText = info.LB_CacheMax;

                    window.setTimeout("GetRunningInfo()", 3000);
                }
            };
            Ajax.SendRequest();
        } 
    </script>
    <style type="text/css">
        .AA
        {
            width: 180px;
        }
        #LB_Cache
        {
            cursor: pointer;
        }
        #Tab0
        {
            display: block;
        }
    </style>
    <link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="Form1" runat="server">
    <div id="tabs">
        <ul>
            <li id="current" onclick="return HideAndDisplay(0,this);"><a href="#"><span>服务器状态</span></a></li>
            <li onclick="return HideAndDisplay(1,this);"><a href="#"><span>全站信息</span></a></li>
            <li onclick="return HideAndDisplay(2,this);"><a href="#"><span>程序开发</span></a></li>
            <li onclick="return HideAndDisplay(3,this);"><a href="#"><span>官方信息</span></a></li>
        </ul>
    </div>
     <div id="tabs_main">
    <table width="700" id="Tab0" class="TabelStyle" cellpadding="6">
        <tr>
            <td class="RowTitle">
                AspNet内存占用：
            </td>
            <td class="AA">
                <asp:Label ID="LB_aspnetn" runat="server"></asp:Label>
            </td>
            <td class="RowTitle">
                AspNet CPU时间：
            </td>
            <td class="AA">
                <asp:Label ID="LB_aspnetcpu" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                正在使用内存：
            </td>
            <td>
                <asp:Label ID="LB_dwMemoryLoad" runat="server"></asp:Label>
            </td>
            <td class="RowTitle">
                开机运行时长：
            </td>
            <td>
                <asp:Label ID="LB_serverstart" runat="server"></asp:Label>
                小时
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                &nbsp;系统占用CPU：
            </td>
            <td>
                <asp:Label ID="LB_CpuUsage" runat="server"></asp:Label>
                %
            </td>
            <td class="RowTitle">
                剩余物理内存：
            </td>
            <td>
                <asp:Label ID="LB_dwAvailPhys" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                AspNet线程池线程数上限：
            </td>
            <td>
                <asp:Label ID="LB_GetMaxThreads" runat="server"></asp:Label>
            </td>
            <td class="RowTitle">
                剩余交换文件：
            </td>
            <td>
                <asp:Label ID="LB_dwAvailPageFile" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                当前AspNet运行线程数：
            </td>
            <td>
                <asp:Label ID="LB_ProcessThread" runat="server"></asp:Label>
            </td>
            <td class="RowTitle">
                进程开始时间：
            </td>
            <td>
                <asp:Label ID="LB_prstart" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                网站Session总数：
            </td>
            <td>
                <asp:Label ID="LB_servers" runat="server"></asp:Label>
            </td>
            <td class="RowTitle">
                Application总数：
            </td>
            <td>
                <asp:Label ID="LB_servera" runat="server"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                网站Cache总数：
            </td>
            <td>
                <asp:Label ID="LB_Cache" runat="server" onclick="NewTabPage('所有缓存','所有缓存','ControlPanel/CacheExplorer.aspx');"></asp:Label>
            </td>
            <td class="RowTitle">
                可用缓存容量：
            </td>
            <td>
                <asp:Label ID="LB_CacheMax" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
    <table width="748" id="Tab1" class="TabelStyle" cellpadding="6" style="display: none">
        <tr>
            <td align="right" valign="top">
                <strong>授权类型：</strong>
            </td>
            <td colspan="5" style="line-height: 200%;">
                产 品：
                <asp:Label ID="LB_Version" runat="server"></asp:Label>
                <%= TopWinCMS.Licenses.License.CurrentEdition %><br />
                数 据 库：
                <asp:Label ID="LB_DataType" runat="server"></asp:Label>
                <br />
                序 列 号：
                <%= TopWinCMS.Licenses.License.SN %><br />
                
            </td>
        </tr>
    </table>
    <table id="Tab2" width="748" class="TabelStyle" style="display: none">
        <tr>
            <td class="RowTitle">
                程序制作：
            </td>
            <td>
                拓文网络
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                E_mail：
            </td>
            <td>
                winner2050@126.com
            </td>
        </tr>
   
        <tr>
            <td class="RowTitle">
                程序主页：
            </td>
            <td>
                <a href="http://www.TopWinCMS.com" target="_blank">www.TopWinCMS.com</a>
            </td>
        </tr>
    </table>
    <table id="Tab3" width="748" border="0" cellpadding="0" cellspacing="0" style="display: none">
        <tr>
            <td id="updata">
            </td>
        </tr>
    </table></div>
    </form>
</body>
</html>
