{{include("header")/}}


<div class="text-center mb-4">
    <h2>Diagnostics Report</h2>
</div>

<div class="row justify-content-md-center">
    <div class="col-md-4 ">
        <div class="alert alert-secondary text-center" role="alert">
            {{message|safe}}
        </div>
    </div>
</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(options.host.error !== false)}}
                    {{host.error|safe}}
                {{#else}}
                    <strong>Node Version:</strong> {{host.nodeVersion}} <br>
                    <strong>OS Type:</strong> {{host.osType}} <br>
                    <strong>OS Release:</strong> {{host.osRelease}} <br>
                    <strong>Username:</strong> {{host.username}} <br>
                    <strong>Host CPUs:</strong> {{host.cpus}} <br>
                    <strong>Host Memory:</strong> {{host.memory}} {{if(options.isLinux)}}(used + cache + buffer){{/if}}
                {{/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>Uptime:</strong> <code>{{txadmin.uptime}}</code> <br>
                <strong>Full Crashes:</strong> <code>{{txadmin.fullCrashes}}</code> <br>
                <strong>Partial Crashes:</strong> <code>{{txadmin.partialCrashes}}</code> <br>
                <hr>
                <h5>Settings:</h5>
                <strong>Schedule:</strong> <code>{{txadmin.schedule}}</code> <br>
                <strong>Timeout Limit:</strong> <code>{{txadmin.timeout}}</code> <br>
                <strong>Failures Limit:</strong> <code>{{txadmin.failures}}</code> <br>
                <strong>FXServer Path:</strong> <code>{{txadmin.fxServerPath}}</code> <br>
                <strong>Server Data Path:</strong> <code>{{txadmin.serverDataPath}}</code><br>
                <strong>CFG Path:</strong> <code>{{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(options.fxserver.error !== false)}}
                    {{fxserver.error|safe}}
                {{#else}}
                    <strong>Status: <span class="badge badge-{{fxserver.statusColor}}">{{fxserver.status}}</span></strong><br>
                    <strong>Version:</strong> {{fxserver.versionWarning|safe}} {{fxserver.version}} <br>
                    <strong>Resources:</strong> {{fxserver.resources}} {{fxserver.resourcesWarning|safe}}<br>
                    <strong>OneSync:</strong> {{fxserver.onesync}} <br>
                    <strong>Max Clients:</strong> {{fxserver.maxClients}} <br>
                    <strong>txAdmin Version:</strong> {{fxserver.txAdminVersion}} <br>
                {{/if}}
            </div>
        </div>

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

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

{{include("footer")/}}
