<%@ Page Title="" Language="C#" MasterPageFile="../BaseMaster.Master" CodeBehind="SysInfo.aspx.cs" Inherits="WAP2P.Web.PC.Admin.Sys.SysInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="header" runat="server"></asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="server">
<dl class="ui-tabs">
    <dt><a href="javascript:void(0);" class="on">系统运行信息</a></dt>     
    <dd>
        <div class="m-content">
            <table class="m-info" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <th>系统运行时</th>
                    <td>ASP.NET <%= Environment.Version %> (<span class="fcash-1"><%= Environment.OSVersion %></span>)</td>
                </tr>
                <tr>
                    <th>CPU内核数</th>
                    <td><%= Environment.ProcessorCount %></td>
                </tr>                
                <tr>
                    <th>运行模式</th>
                    <td><%= System.Web.HttpContext.Current.IsDebuggingEnabled ? "<span class=\"fcred-3\">调试模式</span> (注意在正式对外公开时，请不要使用此模式)" : "<span class=\"fcgreen-3\">正式模式</span>" %></td>
                </tr>
                <tr>
                    <th>占用内存</th>
                    <td><%= FileHelper.FormatBytes(Environment.WorkingSet) %>b</td>
                </tr>
                <tr>
                    <th>系统运行时间</th>
                    <td><%= GetSysRunTime(Environment.TickCount & Int32.MaxValue) %></td>
                </tr>
                <tr>
                    <th>短信发送队列</th>
                    <td>处理线程：<%= WAP2P.Infrastructure.Config.SMSSendRuntime.Threads %>，待发送数量：<%= WAP2P.Infrastructure.Config.SMSSendRuntime.WaitCount %></td>
                </tr>
                <tr>
                    <th>邮件发送队列</th>
                    <td>处理线程：<%= WAP2P.Infrastructure.Config.EmailSendRuntime.Threads %>，待发送数量：<%= WAP2P.Infrastructure.Config.EmailSendRuntime.WaitCount %></td>
                </tr>
            </table>
            <div class="g-fright pt10 pr5"><ruson:PermissionSpace runat="server" Module="系统设置" Function="系统运行信息" Operate="重启系统"><input type="button" class="btn-larger c-priority iconfont" id="btnRestart" value="&#xe66b; 重启系统" /></ruson:PermissionSpace></div>
        </div>
    </dd>
</dl>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="script" runat="server">
    <script>
        $("#btnRestart").click(function () {
            var me = $(this);

            $.ajax({
                url: "?action=restart",
                beforeSend: function () {
                    me.attr('disabled', 'disabled');
                },
                dataType: "json",
                success: function (res) {
                    if (res.Success)
                        $.jSuccess('重启成功。');
                    else
                        $.jError(res.Message);
                },
                complete: function () {
                    me.removeAttr('disabled');
                }
            });
        })
    </script>
</asp:Content>
