Skip to content

Commit

Permalink
Merge pull request #1670 from bipuladh/client-alert
Browse files Browse the repository at this point in the history
Adds column for quota utilization in client list page
  • Loading branch information
openshift-merge-bot[bot] authored Nov 12, 2024
2 parents cafce2d + 415fe91 commit d61b5ce
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions locales/en/plugin__odf-console.json
Original file line number Diff line number Diff line change
Expand Up @@ -1222,6 +1222,7 @@
"To connect a storage client to the Data Foundation provider cluster, click <2>Generate client onboarding token</2> and use the token to deploy the client cluster.": "To connect a storage client to the Data Foundation provider cluster, click <2>Generate client onboarding token</2> and use the token to deploy the client cluster.",
"Cluster name (ID)": "Cluster name (ID)",
"Storage quota": "Storage quota",
"Storage quota utilization ratio": "Storage quota utilization ratio",
"Openshift version": "Openshift version",
"Data Foundation version": "Data Foundation version",
"Last heartbeat": "Last heartbeat",
Expand Down
15 changes: 15 additions & 0 deletions packages/odf/components/storage-consumers/client-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ const tableColumns = [
className: '',
id: 'storageQuota',
},
{
className: '',
id: 'storageQuotaUtilRatio',
},
{
className: '',
id: 'openshiftVersion',
Expand Down Expand Up @@ -171,6 +175,11 @@ const ClientsList: React.FC<ClientListProps> = (props) => {
column.sort = 'status.storageQuotaInGiB';
column.props.info = { popover: <StorageQuotaPopoverContent /> };
break;
case 'storageQuotaUtilRation':
column.title = t('Storage quota utilization ratio');
column.sort = 'status.client.storageQuotaUtilization';
column.props.info = { popover: <StorageQuotaPopoverContent /> };
break;
case 'openshiftVersion':
column.title = t('Openshift version');
column.sort = 'status.client.platformVersion';
Expand Down Expand Up @@ -216,6 +225,9 @@ const ClientsList: React.FC<ClientListProps> = (props) => {
const getOpenshiftVersion = (obj: StorageConsumerKind) =>
obj?.status?.client?.platformVersion;

const getStorageQuotaUtilizationRatio = (obj: StorageConsumerKind) =>
`${obj?.status?.client?.storageQuotaUtilizationRatio}`;

const getDataFoundationVersion = (obj: StorageConsumerKind) =>
obj?.status?.client?.operatorVersion;

Expand Down Expand Up @@ -340,6 +352,9 @@ const StorageClientRow: React.FC<
case 'storageQuota':
data = humanizedStorageQuota;
break;
case 'storageQuotaUtilizationRatio':
data = getStorageQuotaUtilizationRatio(obj) || '-';
break;
case 'openshiftVersion':
data = getOpenshiftVersion(obj) || '-';
break;
Expand Down
1 change: 1 addition & 0 deletions packages/shared/src/types/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ type ClientStatus = {
clusterId: string;
clusterName: string;
name: string;
storageQuotaUtilizationRatio: number;
};

export type StorageConsumerKind = K8sResourceCommon & {
Expand Down

0 comments on commit d61b5ce

Please sign in to comment.