{{define "theme-hotaru/service"}}
{{template "common/header" .}}
{{if ts .CustomCode}}
{{.CustomCode|safe}}
{{end}}
{{template "common/menu" .}}
<div class="nb-container">
    <div class="ui container">
        <div class="service-status">

            <table class="ui celled table">
                <thead>
                    <tr>
                        <th class="ui center aligned">{{tr "Name"}}</th>
                        <th class="ui center aligned">{{tr "30DaysOnline"}}</th>
                        <th class="ui center aligned">{{tr "Details"}}</th>
                        <th class="ui center aligned">{{tr "Status"}}</th>
                    </tr>
                </thead>
                <tbody>
                    {{range $service := .Services}}
                    <tr>
                        <td class="ui center aligned">{{$service.Monitor.Name}}</td>
                        <td class="ui center aligned">
                            {{$service.TotalUptime|float32f}}%
                        </td>
                        <td class="ui center aligned">{{range $i,$d := $service.Delay}}
                            <div class="ui icon button {{className (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}"
                                data-tooltip="{{dayBefore $i}}, {{tr "AverageLatency"}}:{{float32f $d}}ms">
                            </div> {{end}}
                        </td>
                        <td class="ui center aligned delay-today">
                            <i class="delay-today {{className (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}"></i>
                            {{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}
                        </td>
                    </tr> {{end}}
                </tbody>
            </table>
        </div>
    </div>
</div>
{{template "common/footer" .}}
{{end}}