<template>
  <b-container
    :style="{ display: 'flex', 'flex-direction': 'column' }"
    fluid="xxl pt-0 m-0"
  >
    <page-title :description="$t('appNavigation.deviceFirmware')" />
    <!-- BMC table -->
    <page-section class="bootstrap-table__section">
      <b-table
        responsive="md"
        sort-by="id"
        class="table-firmware"
        no-border-collapse
        sort-icon-left
        no-sort-reset
        :sort-desc="sortDesc"
        :items="items"
        :fields="fields"
      >
        <template #cell(name)="{ value }">
          <span class="regular-12px tretiatry">
            {{ value }}
          </span>
        </template>
        <template #cell(minSpeedDate)="{ value }">
          <span class="regular-12px">
            {{ value.time }}
          </span>
          <span class="regular-12px tretiatry">
            {{ value.date }}
          </span>
        </template>
        <template #cell(maxSpeedDate)="{ value }">
          <span class="regular-12px">
            {{ value.time }}
          </span>
          <span class="regular-12px tretiatry">
            {{ value.date }}
          </span>
        </template>
      </b-table>
    </page-section>
  </b-container>
</template>

<script>
import TableSortMixin from '@/components/Mixins/TableSortMixin';
import LoadingBarMixin from '@/components/Mixins/LoadingBarMixin';
import TableFilterMixin from '@/components/Mixins/TableFilterMixin';
import BVPaginationMixin from '@/components/Mixins/BVPaginationMixin';
import BVTableSelectableMixin from '@/components/Mixins/BVTableSelectableMixin';
import BVToastMixin from '@/components/Mixins/BVToastMixin';
import DataFormatterMixin from '@/components/Mixins/DataFormatterMixin';
import TableRowExpandMixin from '@/components/Mixins/TableRowExpandMixin';

import PageTitle from '@/components/Global/PageTitle';
import PageSection from '@/components/Global/PageSection';
import iconChevronUp from '@carbon/icons-vue/es/chevron--up/16';

export default {
  components: {
    PageTitle,
    PageSection,
  },
  mixins: [
    BVPaginationMixin,
    BVTableSelectableMixin,
    BVToastMixin,
    LoadingBarMixin,
    TableFilterMixin,
    DataFormatterMixin,
    TableSortMixin,
    TableRowExpandMixin,
  ],
  data() {
    return {
      text: '',
      iconChevronUp: iconChevronUp,
      sortDesc: true,
      fields: [
        {
          key: 'name',
          label: 'Устройство',
          sortable: true,
          formatter: this.dataFormatter,
          thStyle: { paddingLeft: 'calc(1.2rem + 0.65em) !important' },
        },
        {
          key: 'version',
          label: 'Версия прошивки',
          sortable: false,
          formatter: this.dataFormatter,
        },
        {
          key: 'date',
          label: 'Дата прошивки',
          sortable: true,
          formatter: this.dataFormatter,
          thStyle: { paddingLeft: '12px' },
        },
      ],
      items: [
        {
          name: 'Встроенный контроллер Порт 1|Бокс 1|Вау 1',
          version: 'HGP1',
          date: '03.11.2021',
        },
        {
          name: 'Встроенный девайс',
          version: '2.5',
          date: '03.11.2021',
        },
        {
          name: 'Встроенный ALOM',
          version: '10.52.7',
          date: '03.11.2021',
        },
        {
          name: 'Встроенный RAID',
          version: '3.00',
          date: '03.11.2021',
        },
        {
          name: 'Системная плата',
          version: '2.30 Aug 24 2020',
          date: '03.11.2021',
        },

        {
          name: 'Системная плата',
          version: '11.0.0 Build 23',
          date: '03.11.2021',
        },
        {
          name: 'Системная плата',
          version: '3.46.4',
          date: '03.11.2021',
        },
        {
          name: 'Системная плата',
          version: '1.0.7',
          date: '03.11.2021',
        },
        {
          name: 'Встроенный контроллер Порт 1|Бокс 1|Вау 1',
          version: 'HPG0.9',
          date: '02.11.2021',
        },
        {
          name: 'Встроенный девайс',
          version: '2.5',
          date: '02.11.2021',
        },
        {
          name: 'Встроенный ALOM',
          version: '10.52.7',
          date: '02.11.2021',
        },
        {
          name: 'Встроенный RAID',
          version: '3.00',
          date: '02.11.2021',
        },
        {
          name: 'Системная плата',
          version: '2.30 Aug 24 2020',
          date: '02.11.2021',
        },
        {
          name: 'Системная плата',
          version: '11.0.0 Build 23',
          date: '02.11.2021',
        },
        {
          name: 'Системная плата',
          version: '3.46.4',
          date: '02.11.2021',
        },
        {
          name: 'Системная плата',
          version: '1.0.7',
          date: '02.11.2021',
        },
        {
          name: 'Встроенный контроллер Порт 1|Бокс 1|Вау 1',
          version: 'HPG0.8',
          date: '01.11.2021',
        },
        {
          name: 'Встроенный девайс',
          version: '2.5',
          date: '01.11.2021',
        },
        {
          name: 'Встроенный ALOM',
          version: '10.52.7',
          date: '01.11.2021',
        },
        {
          name: 'Встроенный RAID',
          version: '3.00',
          date: '01.11.2021',
        },
        {
          name: 'Системная плата',
          version: '2.30 Aug 24 2020',
          date: '01.11.2021',
        },

        {
          name: 'Системная плата',
          version: '11.0.0 Build 23',
          date: '01.11.2021',
        },
        {
          name: 'Системная плата',
          version: '3.46.4',
          date: '01.11.2021',
        },
        {
          name: 'Системная плата',
          version: '1.0.7',
          date: '01.11.2021',
        },
      ],
    };
  },
};
</script>
<style lang="scss" scoped>
//nav items style
.nav-item,
.nav-link {
  padding: 0;
}

.nav-item {
  list-style-type: none;
}

.semi-bold-12px {
  display: inline-block;
  padding: 16px 0 0 2rem;
}

.bmc-configuration__bios-version {
  display: inline-block;
  color: #0c1c29;
  padding: 8px 2px 2rem 2rem;
}

a {
  color: $text-primary !important;
  &:hover {
    color: $text-primary !important;
  }
}

.fans-colors {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.row {
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
}
.medium-12px {
  color: $text-primary !important;
}
</style>
