<!--<template>
  <b-container fluid="xl">
    <page-title :description="$t('appPageTitle.dynamicInformation')" />
    <collapse id="collapse_1">
      <chart :data="filteredSensors"></chart>
      <page-section small-section-title="Заголовок таблицы">
        <b-table
          responsive="md"
          show-empty
          table-variant="accessory"
          hover
          :items="items"
          :fields="fields"
          :empty-text="$t('global.table.emptyMessage')"
        >
          <template #cell(name)="{ value, index }">
            <div
              class="item-color"
              :style="`background-color: ${colors[index]}`"
            ></div>
            {{ value }}
          </template>
        </b-table>
      </page-section>
    </collapse>
  </b-container>
</template>-->

<template>
  <b-container fluid="xl">
    <page-title :description="$t('appPageTitle.dynamicInformation')" />

    <chart :data="filteredSensors"></chart>
  </b-container>
</template>

<script>
import PageTitle from '@/components/_sila/Global/PageTitle';
import Chart from '@/components/_sila/Global/Chart';
// import PageSection from '@/components/Global/PageSection';

import DataFormatterMixin from '@/components/_sila/Mixins/DataFormatterMixin';
import LoadingBarMixin from '@/components/_sila/Mixins/LoadingBarMixin';
import TableFilterMixin from '@/components/_sila/Mixins/TableFilterMixin';
// import Collapse from '@/components/_sila/Global/Collapse';

export default {
  components: { PageTitle, /*Collapse, PageSection,*/ Chart },
  mixins: [DataFormatterMixin, LoadingBarMixin, TableFilterMixin],
  data() {
    return {
      activeFilters: [],
    };
  },

  computed: {
    allSensors() {
      let sensors = this.$store.getters['processors/processors'];
      return sensors;
    },

    filteredSensors() {
      return this.getFilteredTableData(this.allSensors, this.activeFilters);
    },
  },

  created() {
    this.startLoader();
    this.$store.dispatch('processors/getProcessorsDynamic').finally(() => {
      this.endLoader();
    });
  },
};
</script>
