<!--

    Copyright © 2016-2018 The Thingsboard Authors

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<md-content flex class="md-padding tb-absolute-fill" layout="column">
    <section layout="row">
        <md-input-container class="md-block" style="width: 200px;">
            <label translate>alarm.alarm-status</label>
            <md-select ng-model="alarmSearchStatus" ng-disabled="$root.loading">
                <md-option ng-repeat="searchStatus in types.alarmSearchStatus" ng-value="searchStatus">
                    {{ ('alarm.search-status.' + searchStatus) | translate }}
                </md-option>
            </md-select>
        </md-input-container>
        <tb-timewindow flex ng-model="timewindow" history-only as-button="true"></tb-timewindow>
    </section>
    <div flex layout="column" class="tb-alarm-container md-whiteframe-z1">
        <md-list flex layout="column" class="tb-alarm-table">
            <md-list class="tb-row tb-header" layout="row" layout-align="start center" tb-alarm-header>
            </md-list>
            <md-progress-linear style="max-height: 0px;" md-mode="indeterminate" ng-disabled="!$root.loading"
                                ng-show="$root.loading"></md-progress-linear>
            <md-divider></md-divider>
            <span translate layout-align="center center"
                  style="margin-top: 25px;"
                  class="tb-prompt" ng-show="noData()">alarm.no-alarms-prompt</span>
            <md-virtual-repeat-container ng-show="hasData()" flex md-top-index="topIndex" tb-scope-element="repeatContainer">
                <md-list-item md-virtual-repeat="alarm in theAlarms" md-on-demand flex ng-style="hasScroll() ? {'margin-right':'-15px'} : {}">
                    <md-list class="tb-row" flex layout="row" layout-align="start center" tb-alarm-row alarm="{{alarm}}">
                    </md-list>
                    <md-divider flex></md-divider>
                </md-list-item>
            </md-virtual-repeat-container>
        </md-list>
    </div>
</md-content>
