<!--
  Licensed to the Apache Software
	Foundation (ASF) under one or more contributor license agreements. See the
	NOTICE file distributed with this work for additional information regarding
	copyright ownership. The ASF licenses this file to You 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.
  -->
<div class="panel my-4">
  <div class="panel-header">
    <app-pcap-filters [queryRunning]="queryRunning" [model]="pcapRequest" (search)="onSearch($event)"></app-pcap-filters>
  </div>
  <div *ngIf="queryRunning" class="pcap-progress-wrapper">
    <div class="progress pcap-progress-background">
      <div class="progress-bar progress-bar-animated pcap-progress" role="progressbar" attr.aria-valuenow="{{progressWidth}}" aria-valuemin="0" aria-valuemax="100" [ngStyle]="{'width': progressWidth + '%'}">{{progressWidth}}%</div>
    </div>
    <button
      mwlConfirmationPopover
      [popoverMessage]="cancelConfirmMessage"
      placement="left"
      (confirm)="cancelQuery()"
      cancelText="No"
      confirmText="Yes"
      confirmButtonType="danger"
      appendToBody="true"
      popoverClass="pcap-cancel-query-confirm-popover confirm-popover"

      data-qe-id="pcap-cancel-query-button"
      class="pcap-cancel-query-button btn btn-primary btn-sm"
      [disabled]="!queryId"
    >
    </button>
  </div>
  <div *ngIf="errorMsg" class="alert alert-danger" role="alert" data-qe-id="error">
    {{ errorMsg }}
  </div>
  <div class="panel-body" *ngIf="pdml">
    <app-pcap-list [packets]="pdml.packets" [pagination]="pagination" (pageUpdate)="changePage($event)"></app-pcap-list>
  </div>
  <a class="btn btn-primary" [attr.href]="getDownloadUrl()" *ngIf="pdml" data-qe-id="download-link">Download PCAP</a>
</div>
