diff --git a/src/ts/@overflow/commons/util/Utils.tsx b/src/ts/@overflow/commons/util/Utils.tsx index 42bbd76..abe1dc6 100644 --- a/src/ts/@overflow/commons/util/Utils.tsx +++ b/src/ts/@overflow/commons/util/Utils.tsx @@ -17,6 +17,11 @@ export function sec2date(ms: number): string { return dateTime.toLocaleString(); } +export function date2date(timestampe: Date): string { + let dateTime = new Date(timestampe); + return dateTime.toLocaleString(); +} + function numHex(s: number): string { let a = s.toString(16); if ((a.length % 2) > 0) { a = '0' + a; } diff --git a/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx b/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx index 1197b77..21e6d5e 100644 --- a/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx +++ b/src/ts/@overflow/probe/react/components/ProbeDetailInfo.tsx @@ -10,6 +10,8 @@ import { import Probe from '@overflow/probe/api/model/Probe'; import { Discovery } from '@overflow/discovery/react/components/Discovery'; +import * as Utils from '@overflow/commons/util/Utils'; + export interface StateProps { id: string; probe: Probe; @@ -77,13 +79,13 @@ export class ProbeDetailInfo extends React.Component {
Created at
- {this.props.probe.createDate} + {Utils.date2date(this.props.probe.createDate)}
Authorized at
- {this.props.probe.authorizeDate} + {Utils.date2date(this.props.probe.authorizeDate)}
diff --git a/src/ts/@overflow/probe/react/components/ProbeHost.tsx b/src/ts/@overflow/probe/react/components/ProbeHost.tsx index b145615..173c240 100644 --- a/src/ts/@overflow/probe/react/components/ProbeHost.tsx +++ b/src/ts/@overflow/probe/react/components/ProbeHost.tsx @@ -10,6 +10,8 @@ import { import Probe from '@overflow/probe/api/model/Probe'; import InfraHost from '@overflow/infra/api/model/InfraHost'; +import * as Utils from '@overflow/commons/util/Utils'; + export interface StateProps { id: string; probe: Probe; @@ -48,13 +50,13 @@ export class ProbeHost extends React.Component {
IP
- {this.props.probe.host.ip} + {Utils.int2ip(this.props.probe.host.ip)}
MAC
- {this.props.probe.host.mac} + {Utils.intToMac(this.props.probe.host.mac)}
diff --git a/src/ts/@overflow/sensor/react/components/SensorDetailInfo.tsx b/src/ts/@overflow/sensor/react/components/SensorDetailInfo.tsx index fa282f7..8ec70c5 100644 --- a/src/ts/@overflow/sensor/react/components/SensorDetailInfo.tsx +++ b/src/ts/@overflow/sensor/react/components/SensorDetailInfo.tsx @@ -4,6 +4,7 @@ import { DetailContainer } from '@overflow/commons/react/component/DetailContain import Sensor from '@overflow/sensor/api/model/Sensor'; import Probe from '@overflow/probe/api/model/Probe'; +import * as Utils from '@overflow/commons/util/Utils'; export interface SensorDetailInfoStateProps { sensorId?: number; @@ -106,7 +107,7 @@ export class SensorDetailInfo extends React.Component
Created at
- {this.props.sensor.createDate} + {Utils.date2date(this.props.sensor.createDate)}
diff --git a/src/ts/@overflow/target/react/components/TargetDetail.tsx b/src/ts/@overflow/target/react/components/TargetDetail.tsx index 055e4c0..ef2bfe9 100644 --- a/src/ts/@overflow/target/react/components/TargetDetail.tsx +++ b/src/ts/@overflow/target/react/components/TargetDetail.tsx @@ -5,6 +5,7 @@ import { TargetDetailInfra } from './TargetDetailInfra'; import InfraDetailContainer from '@overflow/infra/react/InfraDetail'; import Infra from '@overflow/infra/api/model/Infra'; +import * as Utils from '@overflow/commons/util/Utils'; export interface StateProps { id: string; @@ -106,7 +107,7 @@ export class TargetBasicInfo extends React.ComponentCreated at - {this.props.infra.target.createDate} + {Utils.date2date(this.props.infra.target.createDate)} diff --git a/src/ts/@overflow/target/react/components/TargetList.tsx b/src/ts/@overflow/target/react/components/TargetList.tsx index 826ed44..1b68dec 100644 --- a/src/ts/@overflow/target/react/components/TargetList.tsx +++ b/src/ts/@overflow/target/react/components/TargetList.tsx @@ -7,6 +7,8 @@ import Domain from '@overflow/domain/api/model/Domain'; import { ListContainer } from '@overflow/commons/react/component/ListContainer'; import { Discovery } from '../../../discovery/react/components/Discovery'; +import * as Utils from '@overflow/commons/util/Utils'; + export interface StateProps { probeId?: string; infraList?: Infra[]; @@ -119,7 +121,7 @@ export class TargetList extends React.Component { {infra.infraType.name} {infra.target.displayName} TODO - {infra.target.createDate} + {Utils.date2date(infra.target.createDate)} ))}