From 32c7ba1401c9f5b325d59d827c37f38a5e868f1b Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Fri, 19 Nov 2021 17:43:31 +0000 Subject: [PATCH 1/3] Add Health (Pod/Job) and Scaling column to Workload table/s - Show a new column in workload table which indicates pod/job state and allows user to scale if possible - Pod/job state matches that shown in the workload type detail pages - Pod/job state requires we fetch these resources, in order to show the list quickly we don't block on these - Also show tooltip for columns supplied by kube schemas (this makes it easier to understand some of the workload columns) Generic changes added to support drop down - Allow columns to block selection of row - Added generic PlusMinus component (this will eventually make it on to the workload detail page) - In order to make room for the new column some columns (image + endpoint) will be removed as the screen shrinks --- assets/translations/en-us.yaml | 1 + components/SortableTable/THead.vue | 4 +- components/SortableTable/index.vue | 4 +- components/SortableTable/selection.js | 5 + components/form/PlusMinus.vue | 71 ++++++ components/formatter/WorkloadHealthScale.vue | 225 +++++++++++++++++++ config/product/explorer.js | 18 +- config/table-headers.js | 16 +- detail/workload/index.vue | 111 +-------- list/workload.vue | 22 +- models/catalog.cattle.io.clusterrepo.js | 2 +- models/workload.js | 105 ++++++++- store/type-map.js | 9 +- 13 files changed, 474 insertions(+), 119 deletions(-) create mode 100644 components/form/PlusMinus.vue create mode 100644 components/formatter/WorkloadHealthScale.vue diff --git a/assets/translations/en-us.yaml b/assets/translations/en-us.yaml index 948470f752..dd7b2cd5c4 100644 --- a/assets/translations/en-us.yaml +++ b/assets/translations/en-us.yaml @@ -4183,6 +4183,7 @@ tableHeaders: one { Host } other { Hosts } } + health: Health id: ID image: Image imageSize: Size diff --git a/components/SortableTable/THead.vue b/components/SortableTable/THead.vue index fe4a354f8f..c41a6f51da 100644 --- a/components/SortableTable/THead.vue +++ b/components/SortableTable/THead.vue @@ -135,7 +135,7 @@ export default { :class="{ sortable: col.sort, [col.breakpoint]: !!col.breakpoint}" @click.prevent="changeSort($event, col)" > - + @@ -143,7 +143,7 @@ export default { - {{ labelFor(col) }} + {{ labelFor(col) }} diff --git a/components/SortableTable/index.vue b/components/SortableTable/index.vue index d11f189dfc..cdad2cf206 100644 --- a/components/SortableTable/index.vue +++ b/components/SortableTable/index.vue @@ -397,6 +397,7 @@ export default { }, methods: { + get, dasherize, @@ -675,7 +676,7 @@ export default { :key="col.name" :data-title="labelFor(col)" :align="col.align || 'left'" - :class="{['col-'+dasherize(col.formatter||'')]: !!col.formatter, [col.breakpoint]: !!col.breakpoint}" + :class="{['col-'+dasherize(col.formatter||'')]: !!col.formatter, [col.breakpoint]: !!col.breakpoint, ['skip-select']: col.skipSelect}" :width="col.width" > @@ -686,6 +687,7 @@ export default { :row="row" :col="col" v-bind="col.formatterOpts" + :row-key="get(row,keyField)" />