ui: Fix formatting template after merging #460.

This commit is contained in:
Orne Brocaar 2024-07-30 11:18:52 +01:00
parent 6a691c62e2
commit 98978135c4
8 changed files with 14 additions and 15 deletions

View File

@ -25,7 +25,7 @@ function LogTable(props: IProps) {
const onDrawerOpen = (time: { seconds: number } | undefined, body: string) => { const onDrawerOpen = (time: { seconds: number } | undefined, body: string) => {
const ts = new Date(0); const ts = new Date(0);
ts.setUTCSeconds(time!.seconds); ts.setUTCSeconds(time!.seconds);
const drawerTitle = format(ts, "YYYY-MM-DD HH:mm:ss"); const drawerTitle = format(ts, "yyyy-MM-dd HH:mm:ss");
return () => { return () => {
setBody(body); setBody(body);
@ -106,7 +106,7 @@ function LogTable(props: IProps) {
render: (text, obj) => { render: (text, obj) => {
const ts = new Date(0); const ts = new Date(0);
ts.setUTCSeconds(obj.time!.seconds); ts.setUTCSeconds(obj.time!.seconds);
return format(ts, "YYYY-MM-DD HH:mm:ss"); return format(ts, "yyyy-MM-dd HH:mm:ss");
}, },
}, },
{ {

View File

@ -59,7 +59,7 @@ function GenerateMqttCertificate(props: IProps) {
const cert = certificate!; const cert = certificate!;
const initial = { const initial = {
expiresAt: format(cert.getExpiresAt()!.toDate()!, "YYYY-MM-DD HH:mm:ss"), expiresAt: format(cert.getExpiresAt()!.toDate()!, "yyyy-MM-dd HH:mm:ss"),
caCert: cert.getCaCert(), caCert: cert.getCaCert(),
tlsCert: cert.getTlsCert(), tlsCert: cert.getTlsCert(),
tlsKey: cert.getTlsKey(), tlsKey: cert.getTlsKey(),

View File

@ -153,7 +153,7 @@ function DeviceDashboard(props: IProps) {
let lastSeenAt = "Never"; let lastSeenAt = "Never";
if (props.lastSeenAt !== undefined) { if (props.lastSeenAt !== undefined) {
lastSeenAt = format(props.lastSeenAt, "YYYY-MM-DD HH:mm:ss"); lastSeenAt = format(props.lastSeenAt, "yyyy-MM-dd HH:mm:ss");
} }
const loading = !deviceLinkMetricsLoaded || !deviceMetrics; const loading = !deviceLinkMetricsLoaded || !deviceMetrics;

View File

@ -75,7 +75,7 @@ function ListDevices(props: IProps) {
if (record.lastSeenAt !== undefined) { if (record.lastSeenAt !== undefined) {
const ts = new Date(0); const ts = new Date(0);
ts.setUTCSeconds(record.lastSeenAt.seconds); ts.setUTCSeconds(record.lastSeenAt.seconds);
return format(ts, "YYYY-MM-DD HH:mm:ss"); return format(ts, "yyyy-MM-dd HH:mm:ss");
} }
return "Never"; return "Never";
}, },
@ -87,9 +87,8 @@ function ListDevices(props: IProps) {
width: 250, width: 250,
render: (text, record) => ( render: (text, record) => (
<Link <Link
to={`/tenants/${props.application.getTenantId()}/applications/${props.application.getId()}/devices/${ to={`/tenants/${props.application.getTenantId()}/applications/${props.application.getId()}/devices/${record.devEui
record.devEui }`}
}`}
> >
{text} {text}
</Link> </Link>
@ -180,7 +179,7 @@ function ListDevices(props: IProps) {
req.setMulticastGroupId(mgSelected); req.setMulticastGroupId(mgSelected);
req.setDevEui(devEui); req.setDevEui(devEui);
MulticastGroupStore.addDevice(req, () => {}); MulticastGroupStore.addDevice(req, () => { });
} }
setMgModalVisible(false); setMgModalVisible(false);
@ -192,7 +191,7 @@ function ListDevices(props: IProps) {
req.setRelayDevEui(relaySelected); req.setRelayDevEui(relaySelected);
req.setDeviceDevEui(devEui); req.setDeviceDevEui(devEui);
RelayStore.addDevice(req, () => {}); RelayStore.addDevice(req, () => { });
} }
setRelayModalVisible(false); setRelayModalVisible(false);

View File

@ -55,7 +55,7 @@ function GatewayCertificate(props: IProps) {
const cert = certificate!; const cert = certificate!;
const initial = { const initial = {
expiresAt: format(cert.getExpiresAt()!.toDate()!, "YYYY-MM-DD HH:mm:ss"), expiresAt: format(cert.getExpiresAt()!.toDate()!, "yyyy-MM-dd HH:mm:ss"),
caCert: cert.getCaCert(), caCert: cert.getCaCert(),
tlsCert: cert.getTlsCert(), tlsCert: cert.getTlsCert(),
tlsKey: cert.getTlsKey(), tlsKey: cert.getTlsKey(),

View File

@ -89,7 +89,7 @@ function GatewayDashboard(props: IProps) {
let lastSeenAt: string = "Never"; let lastSeenAt: string = "Never";
if (props.lastSeenAt !== undefined) { if (props.lastSeenAt !== undefined) {
lastSeenAt = format(props.lastSeenAt, "YYYY-MM-DD HH:mm:ss"); lastSeenAt = format(props.lastSeenAt, "yyyy-MM-dd HH:mm:ss");
} }
return ( return (

View File

@ -66,7 +66,7 @@ function ListGateways(props: IProps) {
if (record.lastSeenAt !== undefined) { if (record.lastSeenAt !== undefined) {
const ts = new Date(0); const ts = new Date(0);
ts.setUTCSeconds(record.lastSeenAt.seconds); ts.setUTCSeconds(record.lastSeenAt.seconds);
return format(ts, "YYYY-MM-DD HH:mm:ss"); return format(ts, "yyyy-MM-dd HH:mm:ss");
} }
}, },
}, },
@ -179,7 +179,7 @@ function ListGateways(props: IProps) {
req.setMulticastGroupId(mgSelected); req.setMulticastGroupId(mgSelected);
req.setGatewayId(gatewayId); req.setGatewayId(gatewayId);
MulticastGroupStore.addGateway(req, () => {}); MulticastGroupStore.addGateway(req, () => { });
} }
setMgModalVisible(false); setMgModalVisible(false);

View File

@ -46,7 +46,7 @@ function ListRelayGateways(props: IProps) {
if (record.lastSeenAt !== undefined) { if (record.lastSeenAt !== undefined) {
const ts = new Date(0); const ts = new Date(0);
ts.setUTCSeconds(record.lastSeenAt.seconds); ts.setUTCSeconds(record.lastSeenAt.seconds);
return format(ts, "YYYY-MM-DD HH:mm:ss"); return format(ts, "yyyy-MM-dd HH:mm:ss");
} }
}, },
}, },