@page
@model Admin.Areas.Identity.Pages.Server.InfoModel
@{
    ViewData["Title"] = "서버 정보";
}

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

        <div class="col">
            <h4 class="pb-2">CPU</h4>
            <div class="table-responsive">
                <table class="table table-bordered">
                    <colgroup>
                        <col width="40%" />
                        <col width="60%" />
                    </colgroup>
                    <tbody>
                        @foreach (var row in Model.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>

        <div class="col">
            <h4 class="pb-2">Memory</h4>
            <div class="table-responsive">
                <table class="table table-bordered">
                    <colgroup>
                        <col width="40%" />
                        <col width="60%" />
                    </colgroup>
                    <tbody>
                        @foreach (var row in Model.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>

        <div class="col">
            <h4 class="pb-2">Disk</h4>
            <div class="table-responsive">
                <table class="table table-bordered">
                    <colgroup>
                        <col width="40%" />
                        <col width="60%" />
                    </colgroup>
                    <tbody>
                        @foreach (var row in Model.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>
</div>

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