smengcl commented on code in PR #3765:
URL: https://github.com/apache/ozone/pull/3765#discussion_r975894152
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/autoReloadPanel/autoReloadPanel.tsx:
##########
@@ -27,6 +27,10 @@ import moment from 'moment';
interface IAutoReloadPanelProps extends RouteComponentProps<object> {
onReload: () => void;
lastUpdated: number;
+ lastUpdatedOMDBDelta: number;
+ lastUpdatedOMDBFull: number;
+ lastUpdatedOMDBDeltaText: string;
+ lastUpdatedOMDBFullText: string;
Review Comment:
We can get rid of the variable here and just use hard-coded text right?
##########
hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/components/autoReloadPanel/autoReloadPanel.tsx:
##########
@@ -38,21 +42,47 @@ class AutoReloadPanel extends
React.Component<IAutoReloadPanelProps> {
};
render() {
- const {onReload, lastUpdated, isLoading} = this.props;
- const lastUpdatedText = lastUpdated === 0 ? 'NA' :
+ const {onReload, lastUpdated,
lastUpdatedOMDBDelta,lastUpdatedOMDBFull,isLoading,lastUpdatedOMDBDeltaText,lastUpdatedOMDBFullText}
= this.props;
+
+ const lastUpdatedText = lastUpdated === 0 || lastUpdated === undefined ?
'NA' :
(
<Tooltip
placement='bottom' title={moment(lastUpdated).format('ll LTS')}
>
- {moment(lastUpdated).format('LTS')}
+ {moment(lastUpdated).format('LT')}
</Tooltip>
);
+
+ const omDBDeltaFullToolTip = <span>
+ {lastUpdatedOMDBFullText}: {moment(lastUpdatedOMDBFull).fromNow()},
{moment(lastUpdatedOMDBFull).format('LT')}
+ <br/>
+ {lastUpdatedOMDBDeltaText}:
{moment(lastUpdatedOMDBDelta).fromNow()},
{moment(lastUpdatedOMDBDelta).format('LT')}
Review Comment:
Here, we could just use hard-coded text label right? e.g.
```suggestion
Full update: {moment(lastUpdatedOMDBFull).fromNow()},
{moment(lastUpdatedOMDBFull).format('LT')}
<br/>
Delta update: {lastUpdatedOMDBDeltaText}:
{moment(lastUpdatedOMDBDelta).fromNow()},
{moment(lastUpdatedOMDBDelta).format('LT')}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]