Skip to content

Commit

Permalink
Merge pull request #1093 from yaacov/explicit-host-id
Browse files Browse the repository at this point in the history
🐾 Be explicit about host id
  • Loading branch information
yaacov authored Apr 11, 2024
2 parents 3846b25 + 67c8006 commit 4b3ef05
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
"Filter by features": "Filter by features",
"Filter by flavor": "Filter by flavor",
"Filter by host": "Filter by host",
"Filter by host ID": "Filter by host ID",
"Filter by image": "Filter by image",
"Filter by name": "Filter by name",
"Filter by namespace": "Filter by namespace",
Expand All @@ -174,6 +175,7 @@
"Hooks for virtualization": "Hooks for virtualization",
"Host": "Host",
"Host cluster": "Host cluster",
"Host ID": "Host ID",
"Hosts": "Hosts",
"How to create a migration plan": "How to create a migration plan",
"I trust the authenticity of this certificate": "I trust the authenticity of this certificate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ export const hostsFieldsMetadataFactory: ResourceFieldFactory = (t) => [
},
sortable: true,
},
{
resourceFieldId: 'id',
jsonPath: '$.inventory.id',
label: t('Host ID'),
isVisible: true,
filter: {
type: 'freetext',
placeholderLabel: t('Filter by host ID'),
},
sortable: true,
},
{
resourceFieldId: 'network',
jsonPath: '$.networkAdapter.name',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { NameCellRenderer } from './components/NameCellRenderer';
import { InventoryHostPair } from './utils/helpers';
import {
HostCellProps,
IDCellRenderer,
LinkSpeedCellRenderer,
MTUCellRenderer,
NetworkCellRenderer,
Expand Down Expand Up @@ -50,6 +51,7 @@ const renderTd = ({ resourceData, resourceFieldId, resourceFields }: RenderTdPro

const cellRenderers: Record<string, React.FC<HostCellProps>> = {
name: NameCellRenderer,
id: IDCellRenderer,
network: NetworkCellRenderer,
linkSpeed: LinkSpeedCellRenderer,
mtu: MTUCellRenderer,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';
import { TableCell } from 'src/modules/Providers/utils';

import { HostCellProps } from './HostCellProps';

// Define cell renderer for 'host id'
export const IDCellRenderer: React.FC<HostCellProps> = (props) => {
return <TableCell>{props?.data?.inventory.id}</TableCell>;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// @index(['./*', /style/g], f => `export * from '${f.path}';`)
export * from './HostCellProps';
export * from './IDCellRenderer';
export * from './LinkSpeedCellRenderer';
export * from './MTUCellRenderer';
export * from './NameCellRenderer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ export const vSphereVmFieldsMetadataFactory: ResourceFieldFactory = (t) => [
{
resourceFieldId: 'host',
jsonPath: '$.vm.host',
label: t('Host'),
label: t('Host ID'),
isVisible: true,
isIdentity: false,
filter: {
type: 'freetext',
placeholderLabel: t('Filter by host'),
placeholderLabel: t('Filter by host ID'),
},
sortable: true,
},
Expand Down

0 comments on commit 4b3ef05

Please sign in to comment.