-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for HCI Phase 2<RHSTOR-4885>
Adds list page for Clients Adds Modal for generating onboarding token for clients Updates ODF dashboard to add Client Status Adds flags for Provider Mode Disables StorageClass and BlockPool creation in Provider mode Signed-off-by: Bipul Adhikari <[email protected]>
- Loading branch information
Showing
19 changed files
with
736 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ard/status-card/storage-system-popup.scss → ...oard/status-card/status-card-popover.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
.odf-storageSystemPopup__item--margin { | ||
.odf-status-card__popup--margin { | ||
// Overriding PF default margin for FlexItem | ||
margin-bottom: 0 !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
packages/odf/components/odf-dashboard/status-card/utils.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import { StorageConsumerKind, StorageConsumerState } from '@odf/shared'; | ||
import { getTimeDifferenceInSeconds } from '@odf/shared/details-page/datetime'; | ||
import { HealthState } from '@openshift-console/dynamic-plugin-sdk'; | ||
import { TFunction } from 'i18next'; | ||
|
||
const getHealthAndTotalClientCounts = (clients: StorageConsumerKind[]) => { | ||
const connectedClients = clients.filter( | ||
(client) => client.status.state === StorageConsumerState.Ready | ||
); | ||
|
||
const healthyClients = connectedClients.filter( | ||
(client) => getTimeDifferenceInSeconds(client.status.lastHeartbeat) < 120 | ||
); | ||
const healthyClientsCount = healthyClients.length; | ||
const totalClientsCount = clients.length; | ||
|
||
return [healthyClientsCount, totalClientsCount]; | ||
}; | ||
|
||
export const getAggregateClientHealthState = ( | ||
clients: StorageConsumerKind[] = [] | ||
) => { | ||
const [healthyClientsCount, totalClientsCount] = | ||
getHealthAndTotalClientCounts(clients); | ||
if (totalClientsCount === healthyClientsCount && totalClientsCount > 0) { | ||
return HealthState.OK; | ||
} | ||
if (totalClientsCount > healthyClientsCount) { | ||
return HealthState.ERROR; | ||
} | ||
if (totalClientsCount === 0) { | ||
return HealthState.NOT_AVAILABLE; | ||
} | ||
return HealthState.UNKNOWN; | ||
}; | ||
|
||
export const getClientText = (clients: StorageConsumerKind[], t: TFunction) => { | ||
const [healthyClientsCount, totalClientsCount] = | ||
getHealthAndTotalClientCounts(clients); | ||
if (totalClientsCount === 0) { | ||
return t('0 connected'); | ||
} else { | ||
return t('{{connected}} / {{total}} connected', { | ||
connected: healthyClientsCount, | ||
total: totalClientsCount, | ||
}); | ||
} | ||
}; |
Oops, something went wrong.