mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-12 15:51:00 +00:00
Minor tweaks to time displays
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import { State as AppState } from '../state';
|
||||
import { formatNumber } from '../utils';
|
||||
import { formatNumber, secondsWithPrecision } from '../utils';
|
||||
import { Tile, Icon, Node, Ago } from './';
|
||||
|
||||
import nodeIcon from '../icons/server.svg';
|
||||
@@ -54,7 +54,7 @@ export class Chain extends React.Component<Chain.Props, Chain.State> {
|
||||
<div className="Chain">
|
||||
<div className="Chain-header">
|
||||
<Tile icon={blockIcon} title="Best Block">#{formatNumber(best)}</Tile>
|
||||
<Tile icon={blockTimeIcon} title="Avgerage Time">{ blockAverage == null ? '-' : (blockAverage / 1000).toFixed(3) + 's' }</Tile>
|
||||
<Tile icon={blockTimeIcon} title="Avgerage Time">{ blockAverage == null ? '-' : secondsWithPrecision(blockAverage / 1000) }</Tile>
|
||||
<Tile icon={lastTimeIcon} title="Last Block"><Ago when={blockTimestamp} /></Tile>
|
||||
</div>
|
||||
<div className="Chain-content-container">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import { formatNumber, trimHash } from '../utils';
|
||||
import { formatNumber, trimHash, milliOrSecond, secondsWithPrecision } from '../utils';
|
||||
import { Ago } from './Ago';
|
||||
import { Types, Maybe } from '@dotstats/common';
|
||||
|
||||
@@ -26,8 +26,8 @@ export function Node(props: Node.Props) {
|
||||
<td style={{ width: 26 }}>{txcount}</td>
|
||||
<td style={{ width: 88 }}>#{formatNumber(height)}</td>
|
||||
<td style={{ width: 154 }}><span title={hash}>{trimHash(hash, 16)}</span></td>
|
||||
<td style={{ width: 80 }}>{(blockTime / 1000).toFixed(3)}s</td>
|
||||
<td style={{ width: 58 }}>{propagationTime === null ? '∞' : `${propagationTime}ms`}</td>
|
||||
<td style={{ width: 80 }}>{secondsWithPrecision(blockTime/1000)}</td>
|
||||
<td style={{ width: 58 }}>{propagationTime === null ? '∞' : milliOrSecond(propagationTime as number)}</td>
|
||||
<td style={{ width: 82 }}><Ago when={blockTimestamp} /></td>
|
||||
</tr>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user