Define Virtualization Management table headers; They will be used in prod build

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2024-11-12 13:12:47 +01:00
parent 86461e1dbd
commit 6f9c92f16a
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
3 changed files with 44 additions and 11 deletions

View File

@ -1,6 +1,7 @@
import { HCI, MANAGEMENT, CAPI } from '@shell/config/types';
import { HARVESTER, MULTI_CLUSTER } from '@shell/store/features';
import { STATE, NAME as NAME_COL, AGE, VERSION } from '@shell/config/table-headers';
import { MACHINE_POOLS } from '../config/table-headers';
import { allHash } from '@shell/utils/promise';
import { BLANK_CLUSTER } from '@shell/store/store-types.js';
@ -8,16 +9,6 @@ export const PRODUCT_NAME = 'harvester-manager';
export const NAME = 'harvesterManager';
const MACHINE_POOLS = {
name: 'summary',
labelKey: 'tableHeaders.machines',
sort: false,
search: false,
value: 'nodes.length',
align: 'center',
width: 100,
};
const harvesterClustersLocation = {
name: 'c-cluster-product-resource',
params: {
@ -56,7 +47,7 @@ export function init($plugin, store) {
name: 'harvesterVersion',
sort: 'harvesterVersion',
labelKey: 'harvesterManager.tableHeaders.harvesterVersion',
value: 'HarvesterVersion',
value: 'harvesterVersion',
getValue: (row) => row.harvesterVersion
},
{

View File

@ -77,3 +77,14 @@ export const VM_SCHEDULE_TYPE = {
sort: 'spec.vmbackup.type',
align: 'center',
};
// The MACHINE_POOLS column in Virtualization Management list page
export const MACHINE_POOLS = {
name: 'summary',
labelKey: 'tableHeaders.machines',
sort: false,
search: false,
value: 'nodes.length',
align: 'center',
width: 100,
};

View File

@ -8,6 +8,8 @@ import { HARVESTER_NAME as VIRTUAL } from '@shell/config/features';
import { CAPI, HCI, MANAGEMENT } from '@shell/config/types';
import { isHarvesterCluster } from '@shell/utils/cluster';
import { allHash } from '@shell/utils/promise';
import { STATE, NAME as NAME_COL, AGE, VERSION } from '@shell/config/table-headers';
import { MACHINE_POOLS } from '../config/table-headers';
export default {
components: {
@ -56,6 +58,34 @@ export default {
},
computed: {
headers() {
return [
STATE,
NAME_COL,
{
name: 'harvesterVersion',
sort: 'harvesterVersion',
labelKey: 'harvesterManager.tableHeaders.harvesterVersion',
value: 'harvesterVersion',
getValue: (row) => row.harvesterVersion
},
{
...VERSION,
labelKey: 'harvesterManager.tableHeaders.kubernetesVersion',
value: 'kubernetesVersion',
getValue: (row) => row.kubernetesVersion
},
MACHINE_POOLS,
AGE,
{
name: 'harvester',
label: ' ',
align: 'right',
width: 65,
},
];
},
importLocation() {
return {
name: 'c-cluster-product-resource-create',
@ -144,6 +174,7 @@ export default {
<ResourceTable
v-if="rows && rows.length"
:schema="schema"
:headers="headers"
:rows="rows"
:is-creatable="true"
:namespaced="false"