{% extends "portal/layout.html" %}
{% block content %}

    <div class="panel panel-danger">
        <div class="panel-heading">
            <h4 class="panel-title">case:{{case.id}} {{_('event list')}}
                <a href="/portal/alarm-dash/case" class="pull-right small">{{_('back')}}</a></h4>
        </div>
        <div class="panel-body">
            <div class="alarms">
                {%for evt in case_events%}
                <div class="alarm">
                    <input type="checkbox" alarm="{{evt.id}}">
                    {%if evt.status==0%}PROBLEM{%else%}OK{%endif%} P{{case.priority}}
                    [第<span class="orange">#{{evt.step}}</span>次/最大{{case.max_step}}次]
                    <span class="orange">{{evt.timestamp|time_duration}}</span>
                    <span class="gray">[</span>
                    <a href="javascript:alarm_case_event_rm('{{evt.id}}');">delete</a>
                    <span class="gray">]</span>
                    <br/>

                    <span style="padding-left:17px;"> {{case.endpoint}} 
                        <span class="cut-line">¦</span> 
                        {{case.metric}}
                        <span class="cut-line">¦</span> 
                        {{case.func}} 
                        <span class="cut-line">¦</span> 
                        {{evt.cond}}</span>
                        <span class="cut-line">¦</span> 
                        <span class="gray">note: {{case.note}}</span>
                </div>
                <hr>
                {%endfor%}
                <a href="javascript:alarm_case_event_all_select();">{{_('select all')}}</a>/
                <a href="javascript:alarm_case_event_reverse_select();">{{_('reverse select')}}</a>
                <button class="btn btn-warning btn-sm" onclick="alarm_case_event_batch_rm();">{{_('batch delete')}}</button>
            </div>
        </div>

        {% import "portal/blocks.html" as blocks %}
        <div class="pull-left">
            {{ blocks.pager('/portal/alarm-dash/case/event?case_id='+case.id, total, limit, page) }}
        </div>

    </div>
{%endblock%}
