Compare commits

...

2 Commits

Author SHA1 Message Date
5418218aa1 ui: Run make format to format ui code. 2024-08-28 14:42:16 +01:00
29b5c3de1c ui: Fix tooltip date formatting.
With the migration from moment to date-fns (#460) some of the formatting
strings were not updated accordingly.

Fixes #503.
2024-08-28 14:41:43 +01:00
3 changed files with 10 additions and 11 deletions

View File

@ -15,16 +15,16 @@ interface IProps {
function MetricChart(props: IProps) {
let unit: TimeUnit = "hour";
let tooltipFormat = "LT";
let tooltipFormat = "p";
if (props.aggregation === Aggregation.DAY) {
unit = "day";
tooltipFormat = "MMM Do";
tooltipFormat = "MMM d";
} else if (props.aggregation === Aggregation.MONTH) {
unit = "month";
tooltipFormat = "MMM YYYY";
tooltipFormat = "MMM yyyy";
} else if (props.aggregation === Aggregation.MINUTE) {
unit = "minute";
tooltipFormat = "LT";
tooltipFormat = "p";
}
const animation = false as const;
@ -59,8 +59,6 @@ function MetricChart(props: IProps) {
.sort((a, b) => a.getLabel().localeCompare(b.getLabel()))
.map((v, i) => {
const colors = palette("cb-Paired", props.metric.getDatasetsList().length).map((hex: string) => "#" + hex);
console.log(v.getLabel());
console.log(colors[i]);
return {
label: v.getLabel(),

View File

@ -87,8 +87,9 @@ function ListDevices(props: IProps) {
width: 250,
render: (text, record) => (
<Link
to={`/tenants/${props.application.getTenantId()}/applications/${props.application.getId()}/devices/${record.devEui
}`}
to={`/tenants/${props.application.getTenantId()}/applications/${props.application.getId()}/devices/${
record.devEui
}`}
>
{text}
</Link>
@ -179,7 +180,7 @@ function ListDevices(props: IProps) {
req.setMulticastGroupId(mgSelected);
req.setDevEui(devEui);
MulticastGroupStore.addDevice(req, () => { });
MulticastGroupStore.addDevice(req, () => {});
}
setMgModalVisible(false);
@ -191,7 +192,7 @@ function ListDevices(props: IProps) {
req.setRelayDevEui(relaySelected);
req.setDeviceDevEui(devEui);
RelayStore.addDevice(req, () => { });
RelayStore.addDevice(req, () => {});
}
setRelayModalVisible(false);

View File

@ -179,7 +179,7 @@ function ListGateways(props: IProps) {
req.setMulticastGroupId(mgSelected);
req.setGatewayId(gatewayId);
MulticastGroupStore.addGateway(req, () => { });
MulticastGroupStore.addGateway(req, () => {});
}
setMgModalVisible(false);