update deps & lint
This commit is contained in:
@@ -5,7 +5,6 @@ import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||
import {
|
||||
GithubIcon,
|
||||
HomeIcon,
|
||||
LanguagesIcon,
|
||||
MoonIcon,
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
import { cn } from "@app/core/utils/cn.js";
|
||||
|
||||
export interface DeviceSelectorButtonProps {
|
||||
active: boolean;
|
||||
onClick: () => void;
|
||||
|
||||
@@ -26,14 +26,14 @@ export const ImportDialog = ({
|
||||
open,
|
||||
onOpenChange,
|
||||
}: ImportDialogProps): JSX.Element => {
|
||||
const [QRCodeURL, setQRCodeURL] = useState<string>("");
|
||||
const [qrCodeUrl, setQrCodeUrl] = useState<string>("");
|
||||
const [channelSet, setChannelSet] = useState<Protobuf.AppOnly.ChannelSet>();
|
||||
const [validURL, setValidURL] = useState<boolean>(false);
|
||||
const [validUrl, setValidUrl] = useState<boolean>(false);
|
||||
|
||||
const { connection } = useDevice();
|
||||
|
||||
useEffect(() => {
|
||||
const base64String = QRCodeURL.split("e/#")[1];
|
||||
const base64String = qrCodeUrl.split("e/#")[1];
|
||||
const paddedString = base64String
|
||||
?.padEnd(base64String.length + ((4 - (base64String.length % 4)) % 4), "=")
|
||||
.replace(/-/g, "+")
|
||||
@@ -42,12 +42,12 @@ export const ImportDialog = ({
|
||||
setChannelSet(
|
||||
Protobuf.AppOnly.ChannelSet.fromBinary(toByteArray(paddedString)),
|
||||
);
|
||||
setValidURL(true);
|
||||
setValidUrl(true);
|
||||
} catch (error) {
|
||||
setValidURL(false);
|
||||
setValidUrl(false);
|
||||
setChannelSet(undefined);
|
||||
}
|
||||
}, [QRCodeURL]);
|
||||
}, [qrCodeUrl]);
|
||||
|
||||
const apply = () => {
|
||||
channelSet?.settings.map((ch, index) => {
|
||||
@@ -87,19 +87,19 @@ export const ImportDialog = ({
|
||||
<div className="flex flex-col gap-3">
|
||||
<Label>Channel Set/QR Code URL</Label>
|
||||
<Input
|
||||
value={QRCodeURL}
|
||||
suffix={validURL ? "✅" : "❌"}
|
||||
value={qrCodeUrl}
|
||||
suffix={validUrl ? "✅" : "❌"}
|
||||
onChange={(e) => {
|
||||
setQRCodeURL(e.target.value);
|
||||
setQrCodeUrl(e.target.value);
|
||||
}}
|
||||
/>
|
||||
{validURL && (
|
||||
{validUrl && (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex w-full gap-2">
|
||||
<div className="w-36">
|
||||
<Label>Use Preset?</Label>
|
||||
<Switch
|
||||
disabled
|
||||
disabled={true}
|
||||
checked={channelSet?.loraConfig?.usePreset ?? true}
|
||||
/>
|
||||
</div>
|
||||
@@ -138,7 +138,7 @@ export const ImportDialog = ({
|
||||
)}
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Button onClick={apply} disabled={!validURL}>
|
||||
<Button onClick={apply} disabled={!validUrl}>
|
||||
Apply
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
|
||||
@@ -4,7 +4,6 @@ import { Serial } from "@components/PageComponents/Connect/Serial.js";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
|
||||
@@ -29,7 +29,7 @@ export const QRDialog = ({
|
||||
channels,
|
||||
}: QRDialogProps): JSX.Element => {
|
||||
const [selectedChannels, setSelectedChannels] = useState<number[]>([0]);
|
||||
const [QRCodeURL, setQRCodeURL] = useState<string>("");
|
||||
const [qrCodeUrl, setQrCodeUrl] = useState<string>("");
|
||||
|
||||
const allChannels = Array.from(channels.values());
|
||||
|
||||
@@ -49,7 +49,7 @@ export const QRDialog = ({
|
||||
.replace(/\+/g, "-")
|
||||
.replace(/\//g, "_");
|
||||
|
||||
setQRCodeURL(`https://meshtastic.org/e/#${base64}`);
|
||||
setQrCodeUrl(`https://meshtastic.org/e/#${base64}`);
|
||||
}, [channels, selectedChannels, loraConfig]);
|
||||
|
||||
return (
|
||||
@@ -92,18 +92,18 @@ export const QRDialog = ({
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<QRCode value={QRCodeURL} size={200} qrStyle="dots" />
|
||||
<QRCode value={qrCodeUrl} size={200} qrStyle="dots" />
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<Label>Sharable URL</Label>
|
||||
<Input
|
||||
value={QRCodeURL}
|
||||
disabled
|
||||
value={qrCodeUrl}
|
||||
disabled={true}
|
||||
action={{
|
||||
icon: ClipboardIcon,
|
||||
onClick() {
|
||||
void navigator.clipboard.writeText(QRCodeURL);
|
||||
void navigator.clipboard.writeText(qrCodeUrl);
|
||||
},
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -3,7 +3,6 @@ import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from "@components/UI/Dialog.js";
|
||||
|
||||
@@ -8,7 +8,6 @@ import { H4 } from "@components/UI/Typography/H4.js";
|
||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||
import {
|
||||
Control,
|
||||
DeepPartial,
|
||||
DefaultValues,
|
||||
FieldValues,
|
||||
Path,
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
} from "@components/Form/DynamicForm.js";
|
||||
import { Switch } from "@components/UI/Switch.js";
|
||||
import { ChangeEvent } from "react";
|
||||
import { Controller, FieldPathValue, FieldValues } from "react-hook-form";
|
||||
import { Controller, FieldValues } from "react-hook-form";
|
||||
|
||||
export interface ToggleFieldProps<T> extends BaseFormBuilderProps<T> {
|
||||
type: "toggle";
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useAppStore } from "@core/stores/appStore.js";
|
||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||
import { subscribeAll } from "@core/subscriptions.js";
|
||||
import { randId } from "@core/utils/randId.js";
|
||||
import { Constants, BleConnection } from "@meshtastic/js";
|
||||
import { BleConnection, Constants } from "@meshtastic/js";
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
|
||||
export const BLE = (): JSX.Element => {
|
||||
|
||||
@@ -6,7 +6,6 @@ import type { Page } from "@core/stores/deviceStore.js";
|
||||
import {
|
||||
EditIcon,
|
||||
LayersIcon,
|
||||
LayoutGrid,
|
||||
LucideIcon,
|
||||
MapIcon,
|
||||
MessageSquareIcon,
|
||||
@@ -80,7 +79,7 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
||||
<SidebarButton
|
||||
key={link.name}
|
||||
label={link.name}
|
||||
icon={link.icon}
|
||||
Icon={link.icon}
|
||||
onClick={() => {
|
||||
setActivePage(link.page);
|
||||
}}
|
||||
|
||||
+10
-14
@@ -14,20 +14,16 @@ export function Toaster() {
|
||||
|
||||
return (
|
||||
<ToastProvider>
|
||||
{toasts.map(function ({ id, title, description, action, ...props }) {
|
||||
return (
|
||||
<Toast key={id} {...props}>
|
||||
<div className="grid gap-1">
|
||||
{title && <ToastTitle>{title}</ToastTitle>}
|
||||
{description && (
|
||||
<ToastDescription>{description}</ToastDescription>
|
||||
)}
|
||||
</div>
|
||||
{action}
|
||||
<ToastClose />
|
||||
</Toast>
|
||||
);
|
||||
})}
|
||||
{toasts.map(({ id, title, description, action, ...props }) => (
|
||||
<Toast key={id} {...props}>
|
||||
<div className="grid gap-1">
|
||||
{title && <ToastTitle>{title}</ToastTitle>}
|
||||
{description && <ToastDescription>{description}</ToastDescription>}
|
||||
</div>
|
||||
{action}
|
||||
<ToastClose />
|
||||
</Toast>
|
||||
))}
|
||||
<ToastViewport />
|
||||
</ToastProvider>
|
||||
);
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { LucideIcon } from "lucide-react";
|
||||
export interface SidebarButtonProps {
|
||||
label: string;
|
||||
active?: boolean;
|
||||
icon?: LucideIcon;
|
||||
Icon?: LucideIcon;
|
||||
element?: JSX.Element;
|
||||
onClick?: () => void;
|
||||
}
|
||||
@@ -12,7 +12,7 @@ export interface SidebarButtonProps {
|
||||
export const SidebarButton = ({
|
||||
label,
|
||||
active,
|
||||
icon: Icon,
|
||||
Icon,
|
||||
element,
|
||||
onClick,
|
||||
}: SidebarButtonProps): JSX.Element => (
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useEffect, useState, ReactNode } from "react";
|
||||
import { ReactNode, useEffect, useState } from "react";
|
||||
|
||||
import type { ToastActionElement, ToastProps } from "@components/UI/Toast.js";
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
TabsList,
|
||||
TabsTrigger,
|
||||
} from "@app/components/UI/Tabs.js";
|
||||
import { cn } from "@app/core/utils/cn.js";
|
||||
import { Channel } from "@components/PageComponents/Channel.js";
|
||||
import { PageLayout } from "@components/PageLayout.js";
|
||||
import { Sidebar } from "@components/Sidebar.js";
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { NeighborInfo } from "@app/components/PageComponents/ModuleConfig/NeighborInfo.js";
|
||||
import { AmbientLighting } from "@app/components/PageComponents/ModuleConfig/AmbientLighting.js";
|
||||
import { DetectionSensor } from "@app/components/PageComponents/ModuleConfig/DetectionSensor.js";
|
||||
import { NeighborInfo } from "@app/components/PageComponents/ModuleConfig/NeighborInfo.js";
|
||||
import { Audio } from "@components/PageComponents/ModuleConfig/Audio.js";
|
||||
import { CannedMessage } from "@components/PageComponents/ModuleConfig/CannedMessage.js";
|
||||
import { ExternalNotification } from "@components/PageComponents/ModuleConfig/ExternalNotification.js";
|
||||
|
||||
@@ -24,13 +24,13 @@ export const ConfigPage = (): JSX.Element => {
|
||||
label="Radio Config"
|
||||
active={activeConfigSection === "device"}
|
||||
onClick={() => setActiveConfigSection("device")}
|
||||
icon={SettingsIcon}
|
||||
Icon={SettingsIcon}
|
||||
/>
|
||||
<SidebarButton
|
||||
label="Module Config"
|
||||
active={activeConfigSection === "module"}
|
||||
onClick={() => setActiveConfigSection("module")}
|
||||
icon={BoxesIcon}
|
||||
Icon={BoxesIcon}
|
||||
/>
|
||||
</SidebarSection>
|
||||
</Sidebar>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
@@ -6,8 +8,6 @@ import {
|
||||
IsString,
|
||||
Length,
|
||||
} from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class ChannelValidation
|
||||
implements Omit<Protobuf.Channel.Channel, keyof Message | "settings">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
export class BluetoothValidation
|
||||
implements Omit<Protobuf.Config.Config_BluetoothConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
export class DeviceValidation
|
||||
implements Omit<Protobuf.Config.Config_DeviceConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
export class DisplayValidation
|
||||
implements Omit<Protobuf.Config.Config_DisplayConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
export class LoRaValidation
|
||||
implements Omit<Protobuf.Config.Config_LoRaConfig, keyof Message>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import {
|
||||
IsBoolean,
|
||||
IsEnum,
|
||||
@@ -6,8 +8,6 @@ import {
|
||||
IsString,
|
||||
Length,
|
||||
} from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
|
||||
export class NetworkValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class PositionValidation
|
||||
implements Omit<Protobuf.Config.Config_PositionConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt, Max, Min } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
export class PowerValidation
|
||||
implements Omit<Protobuf.Config.Config_PowerConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class AmbientLightingValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
export class AudioValidation
|
||||
implements Omit<Protobuf.ModuleConfig.ModuleConfig_AudioConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt, Length } from "class-validator";
|
||||
|
||||
export class CannedMessageValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt, Length } from "class-validator";
|
||||
|
||||
export class DetectionSensorValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class ExternalNotificationValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsString, Length } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsString, Length } from "class-validator";
|
||||
|
||||
export class MqttValidation
|
||||
implements Omit<Protobuf.ModuleConfig.ModuleConfig_MQTTConfig, keyof Message>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class NeighborInfoValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class RangeTestValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
export class SerialValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class StoreForwardValidation
|
||||
implements
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import type { Message } from "@bufbuild/protobuf";
|
||||
import type { Protobuf } from "@meshtastic/js";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
export class TelemetryValidation
|
||||
implements
|
||||
|
||||
Reference in New Issue
Block a user