Skip to content

Commit

Permalink
feat(ui): Added timing info to container state UI (#20920)
Browse files Browse the repository at this point in the history
Signed-off-by: Surajyadav <harrypotter1108@gmail.com>
  • Loading branch information
surajyadav1108 authored Nov 24, 2024
1 parent a849d41 commit 1120a08
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {ApplicationResourcesDiff} from '../application-resources-diff/applicatio
import {ComparisonStatusIcon, formatCreationTimestamp, getPodReadinessGatesState, getPodStateReason, HealthStatusIcon} from '../utils';
import './application-node-info.scss';
import {ReadinessGatesNotPassedWarning} from './readiness-gates-not-passed-warning';
import Moment from 'react-moment';

const RenderContainerState = (props: {container: any}) => {
const state = (props.container.state?.waiting && 'waiting') || (props.container.state?.terminated && 'terminated') || (props.container.state?.running && 'running');
Expand Down Expand Up @@ -69,7 +70,13 @@ const RenderContainerState = (props: {container: any}) => {
{lastState && (
<>
<>
The container last terminated with <span className='application-node-info__container--highlight'>exit code {lastState?.exitCode}</span>
The container last terminated{' '}
<span className='application-node-info__container--highlight'>
<Moment fromNow={true} ago={true}>
{lastState.finishedAt}
</Moment>{' '}
ago with exit code {lastState?.exitCode}
</span>
</>
{lastState?.reason && ' because of '}
<span title={props.container.lastState?.message || ''}>
Expand Down

0 comments on commit 1120a08

Please sign in to comment.