ip mac date pretty print
This commit is contained in:
parent
6a38cd64ea
commit
f3f26ec8d4
|
@ -17,6 +17,11 @@ export function sec2date(ms: number): string {
|
||||||
return dateTime.toLocaleString();
|
return dateTime.toLocaleString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function date2date(timestampe: Date): string {
|
||||||
|
let dateTime = new Date(timestampe);
|
||||||
|
return dateTime.toLocaleString();
|
||||||
|
}
|
||||||
|
|
||||||
function numHex(s: number): string {
|
function numHex(s: number): string {
|
||||||
let a = s.toString(16);
|
let a = s.toString(16);
|
||||||
if ((a.length % 2) > 0) { a = '0' + a; }
|
if ((a.length % 2) > 0) { a = '0' + a; }
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
import { Discovery } from '@overflow/discovery/react/components/Discovery';
|
import { Discovery } from '@overflow/discovery/react/components/Discovery';
|
||||||
|
|
||||||
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
id: string;
|
id: string;
|
||||||
probe: Probe;
|
probe: Probe;
|
||||||
|
@ -77,13 +79,13 @@ export class ProbeDetailInfo extends React.Component<Props, State> {
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Header size='small'>Created at</Header>
|
<Header size='small'>Created at</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{this.props.probe.createDate}</Table.Cell>
|
<Table.Cell>{Utils.date2date(this.props.probe.createDate)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Header size='small'>Authorized at</Header>
|
<Header size='small'>Authorized at</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{this.props.probe.authorizeDate}</Table.Cell>
|
<Table.Cell>{Utils.date2date(this.props.probe.authorizeDate)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
import InfraHost from '@overflow/infra/api/model/InfraHost';
|
import InfraHost from '@overflow/infra/api/model/InfraHost';
|
||||||
|
|
||||||
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
id: string;
|
id: string;
|
||||||
probe: Probe;
|
probe: Probe;
|
||||||
|
@ -48,13 +50,13 @@ export class ProbeHost extends React.Component<Props, State> {
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Header size='small'>IP</Header>
|
<Header size='small'>IP</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{this.props.probe.host.ip}</Table.Cell>
|
<Table.Cell>{Utils.int2ip(this.props.probe.host.ip)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
<Header size='small'>MAC</Header>
|
<Header size='small'>MAC</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{this.props.probe.host.mac}</Table.Cell>
|
<Table.Cell>{Utils.intToMac(this.props.probe.host.mac)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell collapsing>
|
<Table.Cell collapsing>
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { DetailContainer } from '@overflow/commons/react/component/DetailContain
|
||||||
import Sensor from '@overflow/sensor/api/model/Sensor';
|
import Sensor from '@overflow/sensor/api/model/Sensor';
|
||||||
import Probe from '@overflow/probe/api/model/Probe';
|
import Probe from '@overflow/probe/api/model/Probe';
|
||||||
|
|
||||||
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface SensorDetailInfoStateProps {
|
export interface SensorDetailInfoStateProps {
|
||||||
sensorId?: number;
|
sensorId?: number;
|
||||||
|
@ -106,7 +107,7 @@ export class SensorDetailInfo extends React.Component<SensorDetailInfoProps, Sen
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
<Header size='small'>Created at</Header>
|
<Header size='small'>Created at</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>{this.props.sensor.createDate}</Table.Cell>
|
<Table.Cell>{Utils.date2date(this.props.sensor.createDate)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
<Table.Row>
|
<Table.Row>
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { TargetDetailInfra } from './TargetDetailInfra';
|
||||||
import InfraDetailContainer from '@overflow/infra/react/InfraDetail';
|
import InfraDetailContainer from '@overflow/infra/react/InfraDetail';
|
||||||
import Infra from '@overflow/infra/api/model/Infra';
|
import Infra from '@overflow/infra/api/model/Infra';
|
||||||
|
|
||||||
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -106,7 +107,7 @@ export class TargetBasicInfo extends React.Component<TargetBasicInfoProps, Targe
|
||||||
<Header size='small'>Created at</Header>
|
<Header size='small'>Created at</Header>
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
<Table.Cell>
|
<Table.Cell>
|
||||||
{this.props.infra.target.createDate}
|
{Utils.date2date(this.props.infra.target.createDate)}
|
||||||
</Table.Cell>
|
</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@ import Domain from '@overflow/domain/api/model/Domain';
|
||||||
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
import { ListContainer } from '@overflow/commons/react/component/ListContainer';
|
||||||
import { Discovery } from '../../../discovery/react/components/Discovery';
|
import { Discovery } from '../../../discovery/react/components/Discovery';
|
||||||
|
|
||||||
|
import * as Utils from '@overflow/commons/util/Utils';
|
||||||
|
|
||||||
export interface StateProps {
|
export interface StateProps {
|
||||||
probeId?: string;
|
probeId?: string;
|
||||||
infraList?: Infra[];
|
infraList?: Infra[];
|
||||||
|
@ -119,7 +121,7 @@ export class TargetList extends React.Component<Props, State> {
|
||||||
<Table.Cell textAlign={'center'}>{infra.infraType.name}</Table.Cell>
|
<Table.Cell textAlign={'center'}>{infra.infraType.name}</Table.Cell>
|
||||||
<Table.Cell textAlign={'center'}>{infra.target.displayName}</Table.Cell>
|
<Table.Cell textAlign={'center'}>{infra.target.displayName}</Table.Cell>
|
||||||
<Table.Cell>TODO</Table.Cell>
|
<Table.Cell>TODO</Table.Cell>
|
||||||
<Table.Cell>{infra.target.createDate}</Table.Cell>
|
<Table.Cell>{Utils.date2date(infra.target.createDate)}</Table.Cell>
|
||||||
</Table.Row>
|
</Table.Row>
|
||||||
))}
|
))}
|
||||||
</Table.Body>
|
</Table.Body>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user