Minor fixes
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import type React from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import { FormField, SelectField, Switch, TextInputField } from "evergreen-ui";
|
||||
import { FormField, Switch, TextInputField } from "evergreen-ui";
|
||||
import { Controller, useForm } from "react-hook-form";
|
||||
|
||||
import { TelemetryValidation } from "@app/validation/moduleConfig/telemetry.js";
|
||||
import { Form } from "@components/form/Form";
|
||||
import { useDevice } from "@core/stores/deviceStore.js";
|
||||
import { renderOptions } from "@core/utils/selectEnumOptions.js";
|
||||
import { classValidatorResolver } from "@hookform/resolvers/class-validator";
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export const Telemetry = (): JSX.Element => {
|
||||
const { moduleConfig, connection } = useDevice();
|
||||
@@ -75,14 +73,6 @@ export const Telemetry = (): JSX.Element => {
|
||||
)}
|
||||
/>
|
||||
</FormField>
|
||||
<TextInputField
|
||||
label="Read Error Count Threshold"
|
||||
description="Max transmit power in dBm"
|
||||
type="number"
|
||||
{...register("environmentReadErrorCountThreshold", {
|
||||
valueAsNumber: true,
|
||||
})}
|
||||
/>
|
||||
<TextInputField
|
||||
label="Update Interval"
|
||||
description="Max transmit power in dBm"
|
||||
@@ -92,15 +82,6 @@ export const Telemetry = (): JSX.Element => {
|
||||
valueAsNumber: true,
|
||||
})}
|
||||
/>
|
||||
<TextInputField
|
||||
label="Recovery Interval"
|
||||
description="Max transmit power in dBm"
|
||||
hint="Seconds"
|
||||
type="number"
|
||||
{...register("environmentRecoveryInterval", {
|
||||
valueAsNumber: true,
|
||||
})}
|
||||
/>
|
||||
<FormField
|
||||
label="Display Farenheit"
|
||||
description="Description"
|
||||
@@ -115,21 +96,6 @@ export const Telemetry = (): JSX.Element => {
|
||||
)}
|
||||
/>
|
||||
</FormField>
|
||||
<SelectField
|
||||
label="Sensor Type"
|
||||
description="This is a description."
|
||||
{...register("environmentSensorType", { valueAsNumber: true })}
|
||||
>
|
||||
{renderOptions(Protobuf.TelemetrySensorType)}
|
||||
</SelectField>
|
||||
<TextInputField
|
||||
label="Sensor Pin"
|
||||
description="Max transmit power in dBm"
|
||||
type="number"
|
||||
{...register("environmentSensorPin", {
|
||||
valueAsNumber: true,
|
||||
})}
|
||||
/>
|
||||
</Form>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
import React, { useEffect } from "react";
|
||||
|
||||
import { majorScale, Pane, Spinner, StatusIndicator } from "evergreen-ui";
|
||||
import {
|
||||
Button,
|
||||
majorScale,
|
||||
Pane,
|
||||
ResetIcon,
|
||||
Spinner,
|
||||
StatusIndicator,
|
||||
} from "evergreen-ui";
|
||||
|
||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||
|
||||
export const Progress = (): JSX.Element => {
|
||||
const { hardware, channels, config, moduleConfig, setReady, nodes } =
|
||||
useDevice();
|
||||
const {
|
||||
hardware,
|
||||
channels,
|
||||
config,
|
||||
moduleConfig,
|
||||
setReady,
|
||||
nodes,
|
||||
connection,
|
||||
} = useDevice();
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
@@ -80,6 +94,14 @@ export const Progress = (): JSX.Element => {
|
||||
{hardware.myNodeNum !== 0 &&
|
||||
`(${channels.length} / ${hardware.maxChannels})`}
|
||||
</StatusIndicator>
|
||||
<Button
|
||||
onClick={() => {
|
||||
void connection?.configure();
|
||||
}}
|
||||
iconBefore={ResetIcon}
|
||||
>
|
||||
Retry
|
||||
</Button>
|
||||
</Pane>
|
||||
</Pane>
|
||||
</Pane>
|
||||
|
||||
@@ -119,7 +119,7 @@ export const Header = (): JSX.Element => {
|
||||
{getDevices().length !== 0 && (
|
||||
<Tooltip content="Disconnect active device">
|
||||
<Button
|
||||
iconAfter={CrossIcon}
|
||||
iconBefore={CrossIcon}
|
||||
onClick={() => {
|
||||
removeDevice(selectedDevice ?? 0);
|
||||
}}
|
||||
@@ -133,7 +133,9 @@ export const Header = (): JSX.Element => {
|
||||
target="_blank"
|
||||
href="https://github.com/meshtastic/meshtastic-web"
|
||||
>
|
||||
<IconButton icon={FiGithub} />
|
||||
<Button iconBefore={FiGithub}>
|
||||
{import.meta.env.COMMIT_HASH ?? "DEVELOPMENT"}
|
||||
</Button>
|
||||
</Link>
|
||||
</Tooltip>
|
||||
<Tooltip content="Visit Meshtastic.org">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class TelemetryValidation
|
||||
implements Protobuf.ModuleConfig_TelemetryConfig
|
||||
@@ -17,18 +17,6 @@ export class TelemetryValidation
|
||||
@IsBoolean()
|
||||
environmentScreenEnabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
environmentReadErrorCountThreshold: number;
|
||||
|
||||
@IsInt()
|
||||
environmentRecoveryInterval: number;
|
||||
|
||||
@IsBoolean()
|
||||
environmentDisplayFahrenheit: boolean;
|
||||
|
||||
@IsEnum(Protobuf.TelemetrySensorType)
|
||||
environmentSensorType: Protobuf.TelemetrySensorType;
|
||||
|
||||
@IsInt()
|
||||
environmentSensorPin: number;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user