{{!
    This file is part of Moodle - http://moodle.org/

    Moodle is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Moodle is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
}}
{{!
    @template block_edwiser_site_monitor/last_24_hours_usage

    This template renders last 24 hourse usage tab

    Example context (json):
    {
        "hasdate" : true, // Had data for multiple dates
        "dates"   : [{
            "stamp"    : 12345678, // Unix timestamp
            "selected" : true,
            "date"     : "01-06-1989" // User understandable date
        }]
    }
}}
<div class="server_last_24_hours_usage has-loader">
    {{#error}}
        <div class="text-center">{{{error}}}</div>
    {{/error}}
    <div class="server_usage_chart">
        {{#hasdates}}
        <select class='form-control' id='esm_usage_date_selector'>
            {{#dates}}
                <option value="{{stamp}}" {{selected}}>{{date}}</option>
            {{/dates}}
        </select>
        {{/hasdates}}
        <canvas class="esm_usage_chart" id="esm_usage_chart"></canvas>
    </div>
    <div class="cannot_display_server_usage">
        <label>{{#str}} cannotshowonsidebar, block_edwiser_site_monitor {{/str}}</label>
    </div>
    <div class="edwiser-server-monitor-loader">
        <div class="edwiser-server-monitor-loading-icon">
            <i class="fa fa-circle-o-notch fa-spin fa-fw" aria-hidden="true"></i>
        </div>
    </div>
</div>
