<!--
  ~ Isomer Application Framework
  ~ ============================
  ~ Copyright (C) 2011 - 2018 riot <riot@c-base.org> and others.
  ~
  ~ This program is free software: you can redistribute it and/or modify
  ~ it under the terms of the GNU Affero General Public License as published by
  ~ the Free Software Foundation, either version 3 of the License, or
  ~ (at your option) any later version.
  ~
  ~ This program 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 Affero General Public License for more details.
  ~
  ~ You should have received a copy of the GNU Affero General Public License
  ~ along with this program.  If not, see <http://www.gnu.org/licenses/>.
  -->

<div class="well">
    <h1>System Log</h1>

    <table ng-table="$ctrl.tableParams"
           show-filter="$ctrl.show_filter"
           class="table table-condensed table-bordered table-striped">
        <tr ng-repeat="message in $data"
            ng-class="{danger: 40 < message.severity && message.severity <= 100,
                       warning: 20 < message.severity && message.severity <= 40,
                       info: 10 < message.severity && message.severity <= 20,
                       muted: 0 < message.severity && message.severity <= 10}">
            <td class="text-nowrap" title="'Timestamp'" sortable="'timestamp'">
                {{message.timestamp * 1000| date:'mediumTime'}}
            </td>
            <td class="text-nowrap"
                title="'Emitter'"
                filter="{ emitter: 'select'}"
                filter-data="$ctrl.emitters"
                sortable="'emitter'">
                {{message.emitter}}
            </td>
            <td title="'Message'" filter="{ content: 'text'}" sortable="'content'">
                {{message.content}}
            </td>
        </tr>
    </table>
</div>
