@{
    ViewData["Title"] = "서버 정보";
}

<div id="server" class="container-fluid">
    <div class="row row-cols-auto row-cols-sm-2 g-2">
        <div class="col">
            <h4 class="pb-2">@ViewData["Title"]</h4>
            <table class="table table-bordered">
                <colgroup>
                    <col width="40%" />
                    <col width="60%" />
                </colgroup>
                <tbody>
                    <tr>
                        <th>Environment Name</th>
                        <td>@ViewBag.Info.EnvironmentName</td>
                    </tr>
                    <tr>
                        <th>Content Root Path</th>
                        <td>@ViewBag.Info.ContentRootPath</td>
                    </tr>
                    <tr>
                        <th>Application Name</th>
                        <td>@ViewBag.Info.ApplicationName</td>
                    </tr>
                    <tr>
                        <th>OS Description</th>
                        <td>@ViewBag.Info.OSDescription</td>
                    </tr>
                    <tr>
                        <th>OS Architecture</th>
                        <td>@ViewBag.Info.OSArchitecture</td>
                    </tr>
                    <tr>
                        <th>.NET Framework Description</th>
                        <td>@ViewBag.Info.FrameworkDescription</td>
                    </tr>
                    <tr>
                        <th>Process Architecture</th>
                        <td>@ViewBag.Info.ProcessArchitecture</td>
                    </tr>
                    <tr>
                        <th>Machine Name</th>
                        <td>@ViewBag.Info.MachineName</td>
                    </tr>
                    <tr>
                        <th>Current Directory</th>
                        <td>@ViewBag.Info.CurrentDirectory</td>
                    </tr>
                    <tr>
                        <th>System Directory</th>
                        <td>@ViewBag.Info.SystemDirectory</td>
                    </tr>
                    <tr>
                        <th>Is 64 Bit OS</th>
                        <td>@ViewBag.Info.Is64BitOperatingSystem</td>
                    </tr>
                    <tr>
                        <th>Is 64 Bit Process</th>
                        <td>@ViewBag.Info.Is64BitProcess</td>
                    </tr>
                    <tr>
                        <th>Processor Count</th>
                        <td>@ViewBag.Info.ProcessorCount</td>
                    </tr>
                    <tr>
                        <th>TickCount (ms since startup)</th>
                        <td>@ViewBag.Info.TickCount</td>
                    </tr>
                    <tr>
                        <th>WorkingSet (Memory)</th>
                        <td>@ViewBag.Info.WorkingSet MB</td>
                    </tr>
                    <tr>
                        <th>Total Cpu Time</th>
                        <td>@ViewBag.Info.TotalCpuTime</td>
                    </tr>
                </tbody>
            </table>
        </div>

        <div class="col">
            <h4 class="pb-2">CPU</h4>
            <table class="table table-bordered">
                <colgroup>
                    <col width="40%" />
                    <col width="60%" />
                </colgroup>
                <tbody>
                    @foreach (var row in ViewBag.cpu)
                    {
                        <tr>
                            <th>Device ID</th>
                            <td>@row["DeviceID"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>SocketDesignation</th>
                            <td>@row["SocketDesignation"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Load Percentage</th>
                            <td>@row["LoadPercentage"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Cores</th>
                            <td>@row["NumberOfCores"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Current Clock Speed</th>
                            <td>@row["CurrentClockSpeed"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>AddressWidth</th>
                            <td>@row["AddressWidth"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Architecture</th>
                            <td>@row["Architecture"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Cores</th>
                            <td>@row["NumberOfCores"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Thread</th>
                            <td>@row["NumberOfLogicalProcessors"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>L2 Cache Size</th>
                            <td>@row["L2CacheSize"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>L3 Cache Size</th>
                            <td>@row["L3CacheSize"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Status</th>
                            <td>@row["Status"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Virtualization Firmware Enabled</th>
                            <td>@row["VirtualizationFirmwareEnabled"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>VMMonitor Mode Extensions</th>
                            <td>@row["VMMonitorModeExtensions"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Manufacturer</th>
                            <td>@row["Manufacturer"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Description</th>
                            <td>@row["Description"]?.ToString()</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>

        <div class="col">
            <h4 class="pb-2">Memory</h4>
            <table class="table table-bordered">
                <colgroup>
                    <col width="40%" />
                    <col width="60%" />
                </colgroup>
                <tbody>
                    @foreach (var row in ViewBag.memory)
                    {
                        foreach (var prop in row.Properties)
                        {
                            if (prop.Value is not null)
                            {
                                <tr>
                                    <th>@prop.Name</th>
                                    <td>@prop.Value</td>
                                </tr>
                            }
                        }
                    }
                </tbody>
            </table>
        </div>

        <div class="col">
            <h4 class="pb-2">Disk</h4>
            <table class="table table-bordered">
                <colgroup>
                    <col width="40%" />
                    <col width="60%" />
                </colgroup>
                <tbody>
                    @foreach (var row in ViewBag.disk)
                    {
                        <tr>
                            <th>Index</th>
                            <td>@row["Index"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Interface Type</th>
                            <td>@row["InterfaceType"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Model</th>
                            <td>@row["Model"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Size</th>
                            <td>
                                @{
                                    double microseconds = double.Parse(row["Size"]?.ToString());
                                    var ts = TimeSpan.FromMicroseconds(microseconds);
                                }
                                @ts.ToString()
                            </td>
                        </tr>
                        <tr>
                            <th>Caption</th>
                            <td>@row["Caption"]?.ToString()</td>
                        </tr>
                        <tr>
                            <th>Description</th>
                            <td>@row["Description"]?.ToString()</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>

@section Styles {
    <link rel="stylesheet" href="~/css/admin.css" asp-append-version="true" />
}