{{@include("header", it)/}}


<div class="text-center mb-4">
    <h2>Diagnostics Report</h2>
    <small class="text-muted">{{it.message|safe}}</small>
</div>


<div class="row justify-content-md-center">
    <div class="col-lg-8 col-xl-5 mw-col6">

        <!-- Host Machine Card -->
        <div class="card card-accent-danger" style="min-height: 160px;">
            <div class="card-header font-weight-bold">Host Machine:</div>
            <div class="card-body">
                {{@if(it.host.error !== false)}}
                    {{it.host.error|safe}}
                {{#else}}
                    <strong>Node Version:</strong> {{it.host.nodeVersion}} <br>
                    <strong>OS Type:</strong> {{it.host.osType}} <br>
                    <strong>OS Release:</strong> {{it.host.osRelease}} <br>
                    <strong>Username:</strong> {{it.host.username}} <br>
                    <strong>Host CPUs:</strong> {{it.host.cpus}} {{it.host.clockWarning|safe}}<br>
                    <strong>Host Memory:</strong> {{it.host.memory}}
                {{/if}}
            </div>
        </div>

        <!-- txAdmin Config Card -->
        <div class="card card-accent-danger" style="min-height: 160px;">
            <div class="card-header font-weight-bold">txAdmin Info:</div>
            <div class="card-body">
                <h5>Stats:</h5>
                <strong>Versions:</strong> <code>v{{it.txAdminVersion}}</code> / <code>{{it.fxServerVersion}}</code> <br>
                <strong>Uptime:</strong> <code>{{it.txadmin.uptime}}</code> <br>
                <strong>Cfx.re URL:</strong> <a href="{{it.txadmin.cfxUrl}}" target="_blank" rel="noopener noreferrer">{{it.txadmin.cfxUrl}}</a> <br>
                <strong>Ban/Whitelist Checking:</strong> <code>{{it.txadmin.banlistEnabled}}</code>, <code>{{it.txadmin.whitelistEnabled}}</code> <br>
                <strong>Full/Partial Crashes:</strong> <code>{{it.txadmin.fullCrashes}}</code>, <code>{{it.txadmin.partialCrashes}}</code> <br>
                <strong>HTTP Counter:</strong> <code>{{it.txadmin.httpCounterLog}}</code> &lt; <code>{{it.txadmin.httpCounterMax}}</code> <br>
                <strong>HB Fails:</strong> <code>HTTP {{it.txadmin.hbHTTPFails}}</code> / <code>FD3 {{it.txadmin.hbFD3Fails}}</code> <br>
                <strong>Boot Seconds:</strong> <code>{{it.txadmin.hbBootSeconds}}</code> <br>
                <strong>FXServer Log Size:</strong> <code>{{it.txadmin.logFileSize}}</code> <br>
                <strong>Server Log Size:</strong> <code>{{it.txadmin.serverLogSize}}</code> <br>
                <strong>Koa Sessions:</strong> <code>{{it.txadmin.koaSessions}}</code> <br>
                <hr>
                <h5>Settings:</h5>
                <strong>Schedule:</strong> <code>{{it.txadmin.schedule}}</code> <br>
                <strong>Cooldown:</strong> <code>{{it.txadmin.cooldown}}</code> <br>
                <strong>FXServer Path:</strong> <code>{{it.txadmin.fxServerPath}}</code> <br>
                <strong>Server Data Path:</strong> <code>{{it.txadmin.serverDataPath}}</code><br>
                <strong>CFG Path:</strong> <code>{{it.txadmin.cfgPath}}</code>
            </div>
        </div>

    </div>
    <!-- /.col-->


    <div class="col-lg-8 col-xl-5 mw-col6">

        <!-- FXServer Info Card -->
        <div class="card card-accent-info" style="min-height: 160px;">
            <div class="card-header font-weight-bold">FXServer /info.json:</div>
            <div class="card-body">
                {{@if(it.fxserver.versionMismatch)}}
                    <div class="alert alert-danger text-center" role="alert">
                        <strong>This version doesn't match txAdmin's version!</strong><br>
                        If you just updated FXServer, restart txAdmin. <br>
                        Otherwise, it means FXServer was already running before txAdmin started, and nothing is going to work properly.
                    </div>
                {{/if}}
                {{@if(it.fxserver.error !== false)}}
                    {{it.fxserver.error|safe}}
                {{#else}}
                    <strong>Status: <span class="badge badge-{{it.fxserver.statusColor}}">{{it.fxserver.status}}</span></strong> <br>
                    <strong>Version:</strong> {{it.fxserver.version}} <br>
                    <strong>Resources:</strong> {{it.fxserver.resources}} {{it.fxserver.resourcesWarning|safe}} <br>
                    <strong>OneSync:</strong> {{it.fxserver.onesync}} <br>
                    <strong>Max Clients:</strong> {{it.fxserver.maxClients}} <br>
                    <strong>txAdmin Version:</strong> {{it.fxserver.txAdminVersion}} <br>
                {{/if}}
            </div>
        </div>

        <!-- Proccesses Card -->
        <div class="card card-accent-info">
            <div class="card-header font-weight-bold">Processes:</div>
            <div class="card-body">
                {{@if(!it.proccesses.length)}}
                    Failed to retrieve processed data. <br>
                    Check the terminal for more information (if verbosity is enabled)
                {{#else}}
                    {{@each(it.proccesses) => proc}}
                        <strong>Process:</strong> ({{proc.pid}}) {{proc.name}} <br>
                        <strong>Parent:</strong> {{proc.ppid}} <br>
                        <strong>Memory:</strong> {{proc.memory}} <br>
                        <strong>CPU:</strong> {{proc.cpu}} <br>
                        <br>
                    {{/each}}
                {{/if}}
            </div>
        </div>

    </div>
    <!-- /.col-->
</div>

{{@include("footer", it)/}}
