diff options
author | Sukanya Pandey <sukapan1@in.ibm.com> | 2020-07-27 19:14:47 +0300 |
---|---|---|
committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2020-09-22 16:32:25 +0300 |
commit | 9901096a45c9bda51438dcc91d5feb8a590df0c3 (patch) | |
tree | 7cba8a8a5c39415d6d46a9e64b4e70e73ec3e840 /src/components/Global | |
parent | ce33f216a7ed893936fc3f187421c2a736b8c9ff (diff) | |
download | webui-vue-9901096a45c9bda51438dcc91d5feb8a590df0c3.tar.xz |
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
Diffstat (limited to 'src/components/Global')
-rw-r--r-- | src/components/Global/TableCellCount.vue | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/components/Global/TableCellCount.vue b/src/components/Global/TableCellCount.vue new file mode 100644 index 00000000..4f44ec29 --- /dev/null +++ b/src/components/Global/TableCellCount.vue @@ -0,0 +1,35 @@ +<template> + <div class="mt-2 d-flex flex-column justify-content-end"> + <p v-if="!filterActive"> + {{ $t('global.table.items', { count: totalNumberOfCells }) }} + </p> + <p v-else> + {{ + $t('global.table.selectedItems', { + count: totalNumberOfCells, + filterCount: filteredItemsCount + }) + }} + </p> + </div> +</template> + +<script> +export default { + props: { + filteredItemsCount: { + type: Number, + required: true + }, + totalNumberOfCells: { + type: Number, + required: true + } + }, + computed: { + filterActive() { + return this.filteredItemsCount !== this.totalNumberOfCells; + } + } +}; +</script> |