<?php
require_once(dirname(__FILE__) . '/../includes/base.inc.php');
block_non_admins();

sysstat();
function sysstat() {

    $title = _('System Status');
    child_page($title, 'admin');

    echo well_top_page_header($title);

    global $dashlets;

    $fusion_subsys_status = empty($dashlets['fusion_subsys_status']) ? false : $dashlets['fusion_subsys_status'];
    $fusion_sysstat = empty($dashlets['fusion_sysstat']) ? false : $dashlets['fusion_sysstat'];
    $fused_server_stats = empty($dashlets['fused_server_stats']) ? false : $dashlets['fused_server_stats'];

    ?>
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-6 col-md-6 col-lg-4 col-xl-3">
    <?php
    if (!empty($fusion_subsys_status)) {
        echo '<h2>' . _('Subsystem Status') . '</h2>';
        echo get_inline_dashlet_html($fusion_subsys_status);
    }

    ?>
            </div>
            <div class="col-sm-6 col-md-6 col-lg-4 col-xl-4">
    <?php
    if (!empty($fusion_sysstat)) {
        echo '<h2>' . _('Server Statistics') . '</h2>';
        echo get_inline_dashlet_html($fusion_sysstat);
    }

    ?>
            </div>
            <div class="col-sm-6 col-md-6 col-lg-4 col-xl-5">
    <?php
    if (count_servers() && !empty($fused_server_stats)) {
        echo '<h2>' . _('Fused Server Status') . '</h2>';
        echo get_inline_dashlet_html($fused_server_stats);
    }
    ?>
            </div>
        </div>
    </div>
    <?php
}
