<c8y-ui-action-bar-set>
  <li action-bar-priority="2000">
    <div class="dropdown" uib-dropdown auto-close="{{ vm.shouldClose }}" is-open="isOpen">
      <button
        class="dropdown-toggle c8y-dropdown"
        uib-dropdown-toggle
        aria-haspopup="true"
      >
        <span> <i c8y-icon="download"></i> <translate>Download</translate></span>
      </button>
      <ul class="dropdown-menu dropdown-menu-right" uib-dropdown-menu style="max-width: 350px;">
        <li class="dropdown-form" style="width: 350px;">
          <form name="logRequestForm" class="form">
            <div class="form-group c8y-datetime-picker">
              <label>{{ 'From`date`' | translate }}</label>
              <span class="d-flex">
                <c8y-date-time-picker
                  is-open="vm.datePickerFromOpen"
                  ng-model="vm.dateFrom"
                  placeholder="{{ 'From`date`' | translate }}"
                  max-date="vm.filters.dateTo"
                  show-seconds="true"
                  append-to-body="true"
                ></c8y-date-time-picker>
                <span class="m-l-4">UTC</span>
              </span>
            </div>

            <div class="form-group c8y-datetime-picker">
              <label>{{ 'To`date`' | translate }}</label>
              <span class="d-flex">
                <c8y-date-time-picker
                  is-open="vm.datePickerToOpen"
                  ng-model="vm.dateTo"
                  placeholder="{{ 'To`date`' | translate }}"
                  min-date="vm.filters.dateFrom"
                  show-seconds="true"
                  append-to-body="true"
                ></c8y-date-time-picker>
                <span class="m-l-4">UTC</span>
              </span>
            </div>

            <button
              title="{{ 'Download' | translate }}"
              class="btn btn-primary btn-block"
              ng-disabled="logRequestForm.$invalid"
              ng-click="vm.downloadLogs(); isOpen = !isOpen"
              translate
            >
              Download
            </button>
          </form>
        </li>
      </ul>
    </div>
  </li>
</c8y-ui-action-bar-set>
