-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Cluster Operator upgrade activity
- Loading branch information
Showing
10 changed files
with
96 additions
and
40 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...nd/packages/console-app/src/components/dashboards-page/ClusterOperatorUpgradeActivity.tsx
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,35 @@ | ||
import * as React from 'react'; | ||
import { | ||
ClusterOperator, | ||
getStatusAndMessage, | ||
referenceForModel, | ||
} from '@console/internal/module/k8s'; | ||
import ActivityItem from '@console/shared/src/components/dashboard/activity-card/ActivityItem'; | ||
import { ResourceLink } from '@console/internal/components/utils/resource-link'; | ||
import { ClusterOperatorModel } from '@console/internal/models'; | ||
|
||
const ClusterOperatorUpgradeActivity: React.FC<ClusterOperatorUpgradeActivityProps> = ({ | ||
resource, | ||
}) => { | ||
const { message } = getStatusAndMessage(resource); | ||
return ( | ||
<> | ||
<ActivityItem> | ||
Upgrading operator{' '} | ||
<ResourceLink | ||
kind={referenceForModel(ClusterOperatorModel)} | ||
name={resource.metadata.name} | ||
inline | ||
hideIcon | ||
/> | ||
</ActivityItem> | ||
{message} | ||
</> | ||
); | ||
}; | ||
|
||
export default ClusterOperatorUpgradeActivity; | ||
|
||
type ClusterOperatorUpgradeActivityProps = { | ||
resource: ClusterOperator; | ||
}; |
14 changes: 2 additions & 12 deletions
14
frontend/packages/console-app/src/components/dashboards-page/ClusterUpdateActivity.tsx
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
17 changes: 17 additions & 0 deletions
17
frontend/packages/console-app/src/components/dashboards-page/activity.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,17 @@ | ||
import { | ||
ClusterVersionKind, | ||
ClusterUpdateStatus, | ||
getClusterUpdateStatus, | ||
getClusterOperatorStatus, | ||
OperatorStatus, | ||
ClusterOperator, | ||
} from '@console/internal/module/k8s'; | ||
|
||
export const isClusterUpdateActivity = (cv: ClusterVersionKind) => | ||
getClusterUpdateStatus(cv) === ClusterUpdateStatus.Updating; | ||
|
||
export const getClusterUpdateTimestamp = (cv: ClusterVersionKind) => | ||
cv && cv.status.history[0] ? new Date(cv.status.history[0].startedTime) : null; | ||
|
||
export const isClusterOperatorUpgradeActivity = (resource: ClusterOperator) => | ||
getClusterOperatorStatus(resource) === OperatorStatus.Updating; |
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
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
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
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