Show total and filtered number of items in a table
-The total number of items and the filtered items will be shown in the
EventLogs, Sensors and HardwareStatus table.
Signed-off-by: Sukanya Pandey <sukapan1@in.ibm.com>
Change-Id: I0ee6410bf675038a350a71a02ec076f9e8baf004
diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableDimmSlot.vue b/src/views/Health/HardwareStatus/HardwareStatusTableDimmSlot.vue
index 4fd077b..97116ca 100644
--- a/src/views/Health/HardwareStatus/HardwareStatusTableDimmSlot.vue
+++ b/src/views/Health/HardwareStatus/HardwareStatusTableDimmSlot.vue
@@ -4,6 +4,12 @@
<b-col sm="6" md="5" xl="4">
<search @changeSearch="onChangeSearchInput" />
</b-col>
+ <b-col sm="6" md="3" xl="2">
+ <table-cell-count
+ :filtered-items-count="filteredRows"
+ :total-number-of-cells="dimms.length"
+ ></table-cell-count>
+ </b-col>
</b-row>
<b-table
sort-icon-left
@@ -18,6 +24,7 @@
:filter="searchFilter"
:empty-text="$t('global.table.emptyMessage')"
:empty-filtered-text="$t('global.table.emptySearchMessage')"
+ @filtered="onFiltered"
>
<!-- Expand chevron icon -->
<template v-slot:cell(expandRow)="row">
@@ -58,12 +65,14 @@
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import StatusIcon from '@/components/Global/StatusIcon';
+import TableCellCount from '@/components/Global/TableCellCount';
+
import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
import TableSortMixin from '@/components/Mixins/TableSortMixin';
import Search from '@/components/Global/Search';
export default {
- components: { IconChevron, PageSection, StatusIcon, Search },
+ components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount },
mixins: [TableDataFormatterMixin, TableSortMixin],
data() {
return {
@@ -99,10 +108,16 @@
sortable: true
}
],
- searchFilter: null
+ searchFilter: null,
+ searchTotalFilteredRows: 0
};
},
computed: {
+ filteredRows() {
+ return this.searchFilter
+ ? this.searchTotalFilteredRows
+ : this.dimms.length;
+ },
dimms() {
return this.$store.getters['memory/dimms'];
}
@@ -121,6 +136,9 @@
},
onChangeSearchInput(searchValue) {
this.searchFilter = searchValue;
+ },
+ onFiltered(filteredItems) {
+ this.searchTotalFilteredRows = filteredItems.length;
}
}
};
diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableFans.vue b/src/views/Health/HardwareStatus/HardwareStatusTableFans.vue
index c2fd7bf..0b6e1a3 100644
--- a/src/views/Health/HardwareStatus/HardwareStatusTableFans.vue
+++ b/src/views/Health/HardwareStatus/HardwareStatusTableFans.vue
@@ -4,6 +4,12 @@
<b-col sm="6" md="5" xl="4">
<search @changeSearch="onChangeSearchInput" />
</b-col>
+ <b-col sm="6" md="3" xl="2">
+ <table-cell-count
+ :filtered-items-count="filteredRows"
+ :total-number-of-cells="fans.length"
+ ></table-cell-count>
+ </b-col>
</b-row>
<b-table
sort-icon-left
@@ -18,6 +24,7 @@
:filter="searchFilter"
:empty-text="$t('global.table.emptyMessage')"
:empty-filtered-text="$t('global.table.emptySearchMessage')"
+ @filtered="onFiltered"
>
<!-- Expand chevron icon -->
<template v-slot:cell(expandRow)="row">
@@ -56,6 +63,7 @@
<script>
import PageSection from '@/components/Global/PageSection';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
+import TableCellCount from '@/components/Global/TableCellCount';
import StatusIcon from '@/components/Global/StatusIcon';
import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
@@ -63,7 +71,7 @@
import Search from '@/components/Global/Search';
export default {
- components: { IconChevron, PageSection, StatusIcon, Search },
+ components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount },
mixins: [TableDataFormatterMixin, TableSortMixin],
data() {
return {
@@ -99,10 +107,16 @@
sortable: true
}
],
- searchFilter: null
+ searchFilter: null,
+ searchTotalFilteredRows: 0
};
},
computed: {
+ filteredRows() {
+ return this.searchFilter
+ ? this.searchTotalFilteredRows
+ : this.fans.length;
+ },
fans() {
return this.$store.getters['fan/fans'];
}
@@ -121,6 +135,9 @@
},
onChangeSearchInput(searchValue) {
this.searchFilter = searchValue;
+ },
+ onFiltered(filteredItems) {
+ this.searchTotalFilteredRows = filteredItems.length;
}
}
};
diff --git a/src/views/Health/HardwareStatus/HardwareStatusTablePowerSupplies.vue b/src/views/Health/HardwareStatus/HardwareStatusTablePowerSupplies.vue
index 2ad4a28..77a1e3c 100644
--- a/src/views/Health/HardwareStatus/HardwareStatusTablePowerSupplies.vue
+++ b/src/views/Health/HardwareStatus/HardwareStatusTablePowerSupplies.vue
@@ -4,6 +4,12 @@
<b-col sm="6" md="5" xl="4">
<search @changeSearch="onChangeSearchInput" />
</b-col>
+ <b-col sm="6" md="3" xl="2">
+ <table-cell-count
+ :filtered-items-count="filteredRows"
+ :total-number-of-cells="powerSupplies.length"
+ ></table-cell-count>
+ </b-col>
</b-row>
<b-table
sort-icon-left
@@ -18,6 +24,7 @@
:filter="searchFilter"
:empty-text="$t('global.table.emptyMessage')"
:empty-filtered-text="$t('global.table.emptySearchMessage')"
+ @filtered="onFiltered"
>
<!-- Expand chevron icon -->
<template v-slot:cell(expandRow)="row">
@@ -81,12 +88,13 @@
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import StatusIcon from '@/components/Global/StatusIcon';
+import TableCellCount from '@/components/Global/TableCellCount';
import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
import TableSortMixin from '@/components/Mixins/TableSortMixin';
import Search from '@/components/Global/Search';
export default {
- components: { IconChevron, PageSection, StatusIcon, Search },
+ components: { IconChevron, PageSection, StatusIcon, Search, TableCellCount },
mixins: [TableDataFormatterMixin, TableSortMixin],
data() {
return {
@@ -122,10 +130,16 @@
sortable: true
}
],
- searchFilter: null
+ searchFilter: null,
+ searchTotalFilteredRows: 0
};
},
computed: {
+ filteredRows() {
+ return this.searchFilter
+ ? this.searchTotalFilteredRows
+ : this.powerSupplies.length;
+ },
powerSupplies() {
return this.$store.getters['powerSupply/powerSupplies'];
}
@@ -144,6 +158,9 @@
},
onChangeSearchInput(searchValue) {
this.searchFilter = searchValue;
+ },
+ onFiltered(filteredItems) {
+ this.searchTotalFilteredRows = filteredItems.length;
}
}
};
diff --git a/src/views/Health/HardwareStatus/HardwareStatusTableProcessors.vue b/src/views/Health/HardwareStatus/HardwareStatusTableProcessors.vue
index fc6c17f..6ab1343 100644
--- a/src/views/Health/HardwareStatus/HardwareStatusTableProcessors.vue
+++ b/src/views/Health/HardwareStatus/HardwareStatusTableProcessors.vue
@@ -5,6 +5,12 @@
<b-col sm="6" md="5" xl="4">
<search @changeSearch="onChangeSearchInput" />
</b-col>
+ <b-col sm="6" md="3" xl="2">
+ <table-cell-count
+ :filtered-items-count="filteredRows"
+ :total-number-of-cells="processors.length"
+ ></table-cell-count>
+ </b-col>
</b-row>
<b-table
sort-icon-left
@@ -17,6 +23,7 @@
:filter="searchFilter"
:empty-text="$t('global.table.emptyMessage')"
:empty-filtered-text="$t('global.table.emptySearchMessage')"
+ @filtered="onFiltered"
>
<!-- Expand button -->
<template v-slot:cell(expandRow)="row">
@@ -87,13 +94,14 @@
import PageSection from '@/components/Global/PageSection';
import IconChevron from '@carbon/icons-vue/es/chevron--down/20';
import StatusIcon from '@/components/Global/StatusIcon';
+import TableCellCount from '@/components/Global/TableCellCount';
import TableSortMixin from '@/components/Mixins/TableSortMixin';
import TableDataFormatterMixin from '@/components/Mixins/TableDataFormatterMixin';
import Search from '@/components/Global/Search';
export default {
- components: { PageSection, IconChevron, StatusIcon, Search },
+ components: { PageSection, IconChevron, TableCellCount, StatusIcon, Search },
mixins: [TableDataFormatterMixin, TableSortMixin],
data() {
return {
@@ -129,10 +137,16 @@
sortable: true
}
],
- searchFilter: null
+ searchFilter: null,
+ searchTotalFilteredRows: 0
};
},
computed: {
+ filteredRows() {
+ return this.searchFilter
+ ? this.searchTotalFilteredRows
+ : this.processors.length;
+ },
processors() {
return this.$store.getters['processors/processors'];
}
@@ -146,6 +160,9 @@
methods: {
onChangeSearchInput(searchValue) {
this.searchFilter = searchValue;
+ },
+ onFiltered(filteredItems) {
+ this.searchTotalFilteredRows = filteredItems.length;
}
}
};