Second round of formatting
This commit is contained in:
+5
-5
@@ -1,15 +1,15 @@
|
|||||||
import { MapProvider } from "react-map-gl";
|
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
|
||||||
import { DeviceWrapper } from "@app/DeviceWrapper.js";
|
import { DeviceWrapper } from "@app/DeviceWrapper.js";
|
||||||
import { PageRouter } from "@app/PageRouter.js";
|
import { PageRouter } from "@app/PageRouter.js";
|
||||||
import { CommandPalette } from "@components/CommandPalette.js";
|
import { CommandPalette } from "@components/CommandPalette.js";
|
||||||
|
import { Dashboard } from "@components/Dashboard.js";
|
||||||
import { DeviceSelector } from "@components/DeviceSelector.js";
|
import { DeviceSelector } from "@components/DeviceSelector.js";
|
||||||
import { DialogManager } from "@components/Dialog/DialogManager.js";
|
import { DialogManager } from "@components/Dialog/DialogManager.js";
|
||||||
import { Dashboard } from "@components/Dashboard.js";
|
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
|
||||||
import { ThemeController } from "@components/generic/ThemeController.js";
|
|
||||||
import { NewDeviceDialog } from "@components/Dialog/NewDeviceDialog.js";
|
import { NewDeviceDialog } from "@components/Dialog/NewDeviceDialog.js";
|
||||||
import { Toaster } from "@components/Toaster.js";
|
import { Toaster } from "@components/Toaster.js";
|
||||||
|
import { ThemeController } from "@components/generic/ThemeController.js";
|
||||||
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
|
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||||
|
import { MapProvider } from "react-map-gl";
|
||||||
|
|
||||||
export const App = (): JSX.Element => {
|
export const App = (): JSX.Element => {
|
||||||
const { getDevice } = useDeviceStore();
|
const { getDevice } = useDeviceStore();
|
||||||
|
|||||||
@@ -360,28 +360,27 @@ export const CommandPalette = (): JSX.Element => {
|
|||||||
<CommandInput placeholder="Type a command or search..." />
|
<CommandInput placeholder="Type a command or search..." />
|
||||||
<CommandList>
|
<CommandList>
|
||||||
<CommandEmpty>No results found.</CommandEmpty>
|
<CommandEmpty>No results found.</CommandEmpty>
|
||||||
{groups.map((group, index) => (
|
{groups.map((group) => (
|
||||||
<CommandGroup key={index} heading={group.label}>
|
<CommandGroup key={group.label} heading={group.label}>
|
||||||
{group.commands.map((command, index) => (
|
{group.commands.map((command) => (
|
||||||
<div key={index}>
|
<div key={command.label}>
|
||||||
<CommandItem
|
<CommandItem
|
||||||
onSelect={() => {
|
onSelect={() => {
|
||||||
command.action && command.action();
|
command.action?.();
|
||||||
setCommandPaletteOpen(false);
|
setCommandPaletteOpen(false);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<command.icon size={16} className="mr-2" />
|
<command.icon size={16} className="mr-2" />
|
||||||
{command.label}
|
{command.label}
|
||||||
</CommandItem>
|
</CommandItem>
|
||||||
{command.subItems &&
|
{command.subItems?.map((subItem) => (
|
||||||
command.subItems.map((subItem, index) => (
|
<SubItem
|
||||||
<SubItem
|
key={subItem.label}
|
||||||
key={index}
|
label={subItem.label}
|
||||||
label={subItem.label}
|
icon={subItem.icon}
|
||||||
icon={subItem.icon}
|
action={subItem.action}
|
||||||
action={subItem.action}
|
/>
|
||||||
/>
|
))}
|
||||||
))}
|
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</CommandGroup>
|
</CommandGroup>
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import { useAppStore } from "@app/core/stores/appStore.js";
|
import { useAppStore } from "@app/core/stores/appStore.js";
|
||||||
import { Button } from "@components/UI/Button.js";
|
|
||||||
import {
|
|
||||||
PlusIcon,
|
|
||||||
ListPlusIcon,
|
|
||||||
UsersIcon,
|
|
||||||
MapPinIcon,
|
|
||||||
CalendarIcon,
|
|
||||||
BluetoothIcon,
|
|
||||||
UsbIcon,
|
|
||||||
NetworkIcon,
|
|
||||||
} from "lucide-react";
|
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
|
||||||
import { H3 } from "@components/UI/Typography/H3.js";
|
|
||||||
import { useDeviceStore } from "@app/core/stores/deviceStore.js";
|
import { useDeviceStore } from "@app/core/stores/deviceStore.js";
|
||||||
import { useMemo } from "react";
|
import { Button } from "@components/UI/Button.js";
|
||||||
import { Separator } from "@components/UI/Seperator.js";
|
import { Separator } from "@components/UI/Seperator.js";
|
||||||
|
import { H3 } from "@components/UI/Typography/H3.js";
|
||||||
|
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||||
|
import {
|
||||||
|
BluetoothIcon,
|
||||||
|
CalendarIcon,
|
||||||
|
ListPlusIcon,
|
||||||
|
MapPinIcon,
|
||||||
|
NetworkIcon,
|
||||||
|
PlusIcon,
|
||||||
|
UsbIcon,
|
||||||
|
UsersIcon,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { useMemo } from "react";
|
||||||
|
|
||||||
export const Dashboard = () => {
|
export const Dashboard = () => {
|
||||||
const { setConnectDialogOpen } = useAppStore();
|
const { setConnectDialogOpen } = useAppStore();
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
|
import { DeviceSelectorButton } from "./DeviceSelectorButton.js";
|
||||||
|
import { Separator } from "@components/UI/Seperator.js";
|
||||||
|
import { Code } from "@components/UI/Typography/Code.js";
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
import {
|
import {
|
||||||
PlusIcon,
|
GithubIcon,
|
||||||
HomeIcon,
|
HomeIcon,
|
||||||
LanguagesIcon,
|
LanguagesIcon,
|
||||||
SunIcon,
|
|
||||||
MoonIcon,
|
MoonIcon,
|
||||||
GithubIcon,
|
PlusIcon,
|
||||||
|
SunIcon,
|
||||||
TerminalIcon,
|
TerminalIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Separator } from "@components/UI/Seperator.js";
|
|
||||||
import { Code } from "@components/UI/Typography/Code.js";
|
|
||||||
import { DeviceSelectorButton } from "./DeviceSelectorButton.js";
|
|
||||||
|
|
||||||
export const DeviceSelector = (): JSX.Element => {
|
export const DeviceSelector = (): JSX.Element => {
|
||||||
const { getDevices } = useDeviceStore();
|
const { getDevices } = useDeviceStore();
|
||||||
@@ -53,6 +53,7 @@ export const DeviceSelector = (): JSX.Element => {
|
|||||||
))}
|
))}
|
||||||
<Separator />
|
<Separator />
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
onClick={() => setConnectDialogOpen(true)}
|
onClick={() => setConnectDialogOpen(true)}
|
||||||
className="transition-all duration-300 hover:text-accent"
|
className="transition-all duration-300 hover:text-accent"
|
||||||
>
|
>
|
||||||
@@ -62,18 +63,20 @@ export const DeviceSelector = (): JSX.Element => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex w-20 flex-col items-center space-y-5 bg-transparent px-5 pb-5">
|
<div className="flex w-20 flex-col items-center space-y-5 bg-transparent px-5 pb-5">
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className="transition-all hover:text-accent"
|
className="transition-all hover:text-accent"
|
||||||
onClick={() => setDarkMode(!darkMode)}
|
onClick={() => setDarkMode(!darkMode)}
|
||||||
>
|
>
|
||||||
{darkMode ? <SunIcon /> : <MoonIcon />}
|
{darkMode ? <SunIcon /> : <MoonIcon />}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className="transition-all hover:text-accent"
|
className="transition-all hover:text-accent"
|
||||||
onClick={() => setCommandPaletteOpen(true)}
|
onClick={() => setCommandPaletteOpen(true)}
|
||||||
>
|
>
|
||||||
<TerminalIcon />
|
<TerminalIcon />
|
||||||
</button>
|
</button>
|
||||||
<button className="transition-all hover:text-accent">
|
<button type="button" className="transition-all hover:text-accent">
|
||||||
<LanguagesIcon />
|
<LanguagesIcon />
|
||||||
</button>
|
</button>
|
||||||
<Separator />
|
<Separator />
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Input } from "@components/UI/Input.js";
|
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||||
|
import { Button } from "@components/UI/Button.js";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -7,11 +8,10 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.js";
|
} from "@components/UI/Dialog.js";
|
||||||
import { Button } from "@components/UI/Button.js";
|
import { Input } from "@components/UI/Input.js";
|
||||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
|
||||||
import { useForm } from "react-hook-form";
|
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
|
||||||
import { Label } from "@components/UI/Label.js";
|
import { Label } from "@components/UI/Label.js";
|
||||||
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
import { useForm } from "react-hook-form";
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
longName: string;
|
longName: string;
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { DeviceNameDialog } from "./DeviceNameDialog.js";
|
||||||
|
import { ImportDialog } from "@components/Dialog/ImportDialog.js";
|
||||||
import { QRDialog } from "@components/Dialog/QRDialog.js";
|
import { QRDialog } from "@components/Dialog/QRDialog.js";
|
||||||
import { RebootDialog } from "@components/Dialog/RebootDialog.js";
|
import { RebootDialog } from "@components/Dialog/RebootDialog.js";
|
||||||
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.js";
|
import { ShutdownDialog } from "@components/Dialog/ShutdownDialog.js";
|
||||||
import { ImportDialog } from "@components/Dialog/ImportDialog.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { DeviceNameDialog } from "./DeviceNameDialog.js";
|
|
||||||
|
|
||||||
export const DialogManager = (): JSX.Element => {
|
export const DialogManager = (): JSX.Element => {
|
||||||
const { channels, config, dialog, setDialogOpen } = useDevice();
|
const { channels, config, dialog, setDialogOpen } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { Button } from "@components/UI/Button.js";
|
||||||
import { toByteArray } from "base64-js";
|
|
||||||
import { Checkbox } from "@components/UI/Checkbox.js";
|
import { Checkbox } from "@components/UI/Checkbox.js";
|
||||||
import { Input } from "@components/UI/Input.js";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -10,11 +8,13 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.js";
|
} from "@components/UI/Dialog.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Input } from "@components/UI/Input.js";
|
||||||
import { Switch } from "@components/UI/Switch.js";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import { Label } from "@components/UI/Label.js";
|
import { Label } from "@components/UI/Label.js";
|
||||||
|
import { Switch } from "@components/UI/Switch.js";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
import { toByteArray } from "base64-js";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
export interface ImportDialogProps {
|
export interface ImportDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -120,14 +120,14 @@ export const ImportDialog = ({
|
|||||||
Channels:
|
Channels:
|
||||||
</span>
|
</span>
|
||||||
<div className="flex w-40 flex-col gap-1">
|
<div className="flex w-40 flex-col gap-1">
|
||||||
{channelSet?.settings.map((channel, index) => (
|
{channelSet?.settings.map((channel) => (
|
||||||
<div className="flex justify-between" key={index}>
|
<div className="flex justify-between" key={channel.id}>
|
||||||
<Label>
|
<Label>
|
||||||
{channel.name.length
|
{channel.name.length
|
||||||
? channel.name
|
? channel.name
|
||||||
: `Channel: ${channel.id}`}
|
: `Channel: ${channel.id}`}
|
||||||
</Label>
|
</Label>
|
||||||
<Checkbox key={index} />
|
<Checkbox key={channel.id} />
|
||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
import { BLE } from "../PageComponents/Connect/BLE.js";
|
||||||
|
import { HTTP } from "../PageComponents/Connect/HTTP.js";
|
||||||
|
import { Serial } from "../PageComponents/Connect/Serial.js";
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -11,11 +14,8 @@ import {
|
|||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.js";
|
} from "@components/UI/Tabs.js";
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
|
||||||
import { Link } from "@components/UI/Typography/Link.js";
|
import { Link } from "@components/UI/Typography/Link.js";
|
||||||
import { HTTP } from "../PageComponents/Connect/HTTP.js";
|
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||||
import { BLE } from "../PageComponents/Connect/BLE.js";
|
|
||||||
import { Serial } from "../PageComponents/Connect/Serial.js";
|
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,4 @@
|
|||||||
import { useEffect, useState } from "react";
|
|
||||||
import { fromByteArray } from "base64-js";
|
|
||||||
import { QRCode } from "react-qrcode-logo";
|
|
||||||
import { Checkbox } from "@components/UI/Checkbox.js";
|
import { Checkbox } from "@components/UI/Checkbox.js";
|
||||||
import { Input } from "@components/UI/Input.js";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -11,9 +7,13 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.js";
|
} from "@components/UI/Dialog.js";
|
||||||
import { ClipboardIcon } from "lucide-react";
|
import { Input } from "@components/UI/Input.js";
|
||||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
|
||||||
import { Label } from "@components/UI/Label.js";
|
import { Label } from "@components/UI/Label.js";
|
||||||
|
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||||
|
import { fromByteArray } from "base64-js";
|
||||||
|
import { ClipboardIcon } from "lucide-react";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
import { QRCode } from "react-qrcode-logo";
|
||||||
|
|
||||||
export interface QRDialogProps {
|
export interface QRDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { Button } from "@components/UI/Button.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -8,9 +7,10 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.js";
|
} from "@components/UI/Dialog.js";
|
||||||
import { ClockIcon, RefreshCwIcon } from "lucide-react";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
|
||||||
import { Input } from "@components/UI/Input.js";
|
import { Input } from "@components/UI/Input.js";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { ClockIcon, RefreshCwIcon } from "lucide-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export interface RebootDialogProps {
|
export interface RebootDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { useState } from "react";
|
import { Button } from "@components/UI/Button.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import {
|
import {
|
||||||
Dialog,
|
Dialog,
|
||||||
DialogContent,
|
DialogContent,
|
||||||
@@ -7,9 +6,10 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@components/UI/Dialog.js";
|
} from "@components/UI/Dialog.js";
|
||||||
import { ClockIcon, PowerIcon } from "lucide-react";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
|
||||||
import { Input } from "@components/UI/Input.js";
|
import { Input } from "@components/UI/Input.js";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { ClockIcon, PowerIcon } from "lucide-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export interface ShutdownDialogProps {
|
export interface ShutdownDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
import { Button } from "../UI/Button.js";
|
||||||
|
import { DynamicFormField, FieldProps } from "./DynamicFormField.js";
|
||||||
|
import { FieldWrapper } from "./FormWrapper.js";
|
||||||
|
import { H4 } from "@components/UI/Typography/H4.js";
|
||||||
|
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||||
import {
|
import {
|
||||||
Control,
|
Control,
|
||||||
DeepPartial,
|
DeepPartial,
|
||||||
@@ -6,11 +11,6 @@ import {
|
|||||||
SubmitHandler,
|
SubmitHandler,
|
||||||
useForm,
|
useForm,
|
||||||
} from "react-hook-form";
|
} from "react-hook-form";
|
||||||
import { H4 } from "@components/UI/Typography/H4.js";
|
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
|
||||||
import { DynamicFormField, FieldProps } from "./DynamicFormField.js";
|
|
||||||
import { FieldWrapper } from "./FormWrapper.js";
|
|
||||||
import { Button } from "../UI/Button.js";
|
|
||||||
|
|
||||||
interface DisabledBy<T> {
|
interface DisabledBy<T> {
|
||||||
fieldName: Path<T>;
|
fieldName: Path<T>;
|
||||||
@@ -79,9 +79,9 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
onChange: handleSubmit(onSubmit),
|
onChange: handleSubmit(onSubmit),
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
{fieldGroups.map((fieldGroup, index) => (
|
{fieldGroups.map((fieldGroup) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={fieldGroup.label}
|
||||||
className="space-y-8 divide-y divide-gray-200 sm:space-y-5"
|
className="space-y-8 divide-y divide-gray-200 sm:space-y-5"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
@@ -89,10 +89,10 @@ export function DynamicForm<T extends FieldValues>({
|
|||||||
<Subtle>{fieldGroup.description}</Subtle>
|
<Subtle>{fieldGroup.description}</Subtle>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{fieldGroup.fields.map((field, index) => (
|
{fieldGroup.fields.map((field) => (
|
||||||
<FieldWrapper label={field.label} description={field.description}>
|
<FieldWrapper label={field.label} description={field.description}>
|
||||||
<DynamicFormField
|
<DynamicFormField
|
||||||
key={index}
|
key={field.label}
|
||||||
field={field}
|
field={field}
|
||||||
control={control}
|
control={control}
|
||||||
disabled={isDisabled(field.disabledBy)}
|
disabled={isDisabled(field.disabledBy)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { Control, FieldValues } from "react-hook-form";
|
|
||||||
import { GenericInput, InputFieldProps } from "./FormInput.js";
|
import { GenericInput, InputFieldProps } from "./FormInput.js";
|
||||||
import { ToggleFieldProps, ToggleInput } from "./FormToggle.js";
|
|
||||||
import { SelectFieldProps, SelectInput } from "./FormSelect.js";
|
import { SelectFieldProps, SelectInput } from "./FormSelect.js";
|
||||||
|
import { ToggleFieldProps, ToggleInput } from "./FormToggle.js";
|
||||||
|
import type { Control, FieldValues } from "react-hook-form";
|
||||||
|
|
||||||
export type FieldProps<T> =
|
export type FieldProps<T> =
|
||||||
| InputFieldProps<T>
|
| InputFieldProps<T>
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import type { LucideIcon } from "lucide-react";
|
import { Input } from "../UI/Input.js";
|
||||||
import type {
|
import type {
|
||||||
BaseFormBuilderProps,
|
BaseFormBuilderProps,
|
||||||
GenericFormElementProps,
|
GenericFormElementProps,
|
||||||
} from "./DynamicForm.js";
|
} from "./DynamicForm.js";
|
||||||
import { Input } from "../UI/Input.js";
|
import type { LucideIcon } from "lucide-react";
|
||||||
import { Controller, FieldValues } from "react-hook-form";
|
import { Controller, FieldValues } from "react-hook-form";
|
||||||
|
|
||||||
export interface InputFieldProps<T> extends BaseFormBuilderProps<T> {
|
export interface InputFieldProps<T> extends BaseFormBuilderProps<T> {
|
||||||
|
|||||||
@@ -1,8 +1,3 @@
|
|||||||
import type {
|
|
||||||
BaseFormBuilderProps,
|
|
||||||
GenericFormElementProps,
|
|
||||||
} from "./DynamicForm.js";
|
|
||||||
import { Controller, FieldValues } from "react-hook-form";
|
|
||||||
import {
|
import {
|
||||||
Select,
|
Select,
|
||||||
SelectContent,
|
SelectContent,
|
||||||
@@ -10,6 +5,11 @@ import {
|
|||||||
SelectTrigger,
|
SelectTrigger,
|
||||||
SelectValue,
|
SelectValue,
|
||||||
} from "../UI/Select.js";
|
} from "../UI/Select.js";
|
||||||
|
import type {
|
||||||
|
BaseFormBuilderProps,
|
||||||
|
GenericFormElementProps,
|
||||||
|
} from "./DynamicForm.js";
|
||||||
|
import { Controller, FieldValues } from "react-hook-form";
|
||||||
|
|
||||||
export interface SelectFieldProps<T> extends BaseFormBuilderProps<T> {
|
export interface SelectFieldProps<T> extends BaseFormBuilderProps<T> {
|
||||||
type: "select" | "multiSelect";
|
type: "select" | "multiSelect";
|
||||||
@@ -50,8 +50,8 @@ export function SelectInput<T extends FieldValues>({
|
|||||||
<SelectValue />
|
<SelectValue />
|
||||||
</SelectTrigger>
|
</SelectTrigger>
|
||||||
<SelectContent>
|
<SelectContent>
|
||||||
{optionsEnumValues.map(([name, value], index) => (
|
{optionsEnumValues.map(([name, value]) => (
|
||||||
<SelectItem key={index} value={value.toString()}>
|
<SelectItem key={name} value={value.toString()}>
|
||||||
{formatEnumName
|
{formatEnumName
|
||||||
? name
|
? name
|
||||||
.replace(/_/g, " ")
|
.replace(/_/g, " ")
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import { fromByteArray, toByteArray } from "base64-js";
|
|
||||||
import type { ChannelValidation } from "@app/validation/channel.js";
|
import type { ChannelValidation } from "@app/validation/channel.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import { useToast } from "@core/hooks/useToast.js";
|
import { useToast } from "@core/hooks/useToast.js";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
|
import { fromByteArray, toByteArray } from "base64-js";
|
||||||
|
|
||||||
export interface SettingsPanelProps {
|
export interface SettingsPanelProps {
|
||||||
channel: Protobuf.Channel;
|
channel: Protobuf.Channel;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { BluetoothValidation } from "@app/validation/config/bluetooth.js";
|
import type { BluetoothValidation } from "@app/validation/config/bluetooth.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const Bluetooth = (): JSX.Element => {
|
export const Bluetooth = (): JSX.Element => {
|
||||||
const { config, setWorkingConfig } = useDevice();
|
const { config, setWorkingConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { LoRaValidation } from "@app/validation/config/lora.js";
|
import type { LoRaValidation } from "@app/validation/config/lora.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const LoRa = (): JSX.Element => {
|
export const LoRa = (): JSX.Element => {
|
||||||
const { config, setWorkingConfig } = useDevice();
|
const { config, setWorkingConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { NetworkValidation } from "@app/validation/config/network.js";
|
import type { NetworkValidation } from "@app/validation/config/network.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const Network = (): JSX.Element => {
|
export const Network = (): JSX.Element => {
|
||||||
const { config, setWorkingConfig } = useDevice();
|
const { config, setWorkingConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
|
||||||
import { Mono } from "@components/generic/Mono.js";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
import { Button } from "@components/UI/Button.js";
|
||||||
|
import { Mono } from "@components/generic/Mono.js";
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||||
import { subscribeAll } from "@core/subscriptions.js";
|
import { subscribeAll } from "@core/subscriptions.js";
|
||||||
import { randId } from "@core/utils/randId.js";
|
import { randId } from "@core/utils/randId.js";
|
||||||
import { Constants, IBLEConnection } from "@meshtastic/meshtasticjs";
|
import { Constants, IBLEConnection } from "@meshtastic/meshtasticjs";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
export const BLE = (): JSX.Element => {
|
export const BLE = (): JSX.Element => {
|
||||||
const [bleDevices, setBleDevices] = useState<BluetoothDevice[]>([]);
|
const [bleDevices, setBleDevices] = useState<BluetoothDevice[]>([]);
|
||||||
@@ -35,9 +35,9 @@ export const BLE = (): JSX.Element => {
|
|||||||
return (
|
return (
|
||||||
<div className="flex w-full flex-col gap-2 p-4">
|
<div className="flex w-full flex-col gap-2 p-4">
|
||||||
<div className="flex h-48 flex-col gap-2 overflow-y-auto">
|
<div className="flex h-48 flex-col gap-2 overflow-y-auto">
|
||||||
{bleDevices.map((device, index) => (
|
{bleDevices.map((device) => (
|
||||||
<Button
|
<Button
|
||||||
key={index}
|
key={device.id}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
void onConnect(device);
|
void onConnect(device);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Controller, useForm, useWatch } from "react-hook-form";
|
|
||||||
import { Input } from "@components/UI/Input.js";
|
|
||||||
import { Switch } from "@components/UI/Switch.js";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
import { Button } from "@components/UI/Button.js";
|
||||||
|
import { Input } from "@components/UI/Input.js";
|
||||||
|
import { Label } from "@components/UI/Label.js";
|
||||||
|
import { SelectLabel } from "@components/UI/Select.js";
|
||||||
|
import { Switch } from "@components/UI/Switch.js";
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||||
import { subscribeAll } from "@core/subscriptions.js";
|
import { subscribeAll } from "@core/subscriptions.js";
|
||||||
import { randId } from "@core/utils/randId.js";
|
import { randId } from "@core/utils/randId.js";
|
||||||
import { IHTTPConnection } from "@meshtastic/meshtasticjs";
|
import { IHTTPConnection } from "@meshtastic/meshtasticjs";
|
||||||
import { Label } from "@components/UI/Label.js";
|
import { Controller, useForm, useWatch } from "react-hook-form";
|
||||||
import { SelectLabel } from "@components/UI/Select.js";
|
|
||||||
|
|
||||||
export const HTTP = (): JSX.Element => {
|
export const HTTP = (): JSX.Element => {
|
||||||
const { addDevice } = useDeviceStore();
|
const { addDevice } = useDeviceStore();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
|
||||||
import { Mono } from "@components/generic/Mono.js";
|
|
||||||
import { Button } from "@components/UI/Button.js";
|
import { Button } from "@components/UI/Button.js";
|
||||||
|
import { Mono } from "@components/generic/Mono.js";
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
import { useDeviceStore } from "@core/stores/deviceStore.js";
|
||||||
import { subscribeAll } from "@core/subscriptions.js";
|
import { subscribeAll } from "@core/subscriptions.js";
|
||||||
import { randId } from "@core/utils/randId.js";
|
import { randId } from "@core/utils/randId.js";
|
||||||
import { ISerialConnection } from "@meshtastic/meshtasticjs";
|
import { ISerialConnection } from "@meshtastic/meshtasticjs";
|
||||||
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
|
||||||
export const Serial = (): JSX.Element => {
|
export const Serial = (): JSX.Element => {
|
||||||
const [serialPorts, setSerialPorts] = useState<SerialPort[]>([]);
|
const [serialPorts, setSerialPorts] = useState<SerialPort[]>([]);
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const ChannelChat = ({
|
|||||||
{messages ? (
|
{messages ? (
|
||||||
messages.map((message, index) => (
|
messages.map((message, index) => (
|
||||||
<Message
|
<Message
|
||||||
key={index}
|
key={message.id}
|
||||||
message={message}
|
message={message}
|
||||||
lastMsgSameUser={
|
lastMsgSameUser={
|
||||||
index === 0 ? false : messages[index - 1].from === message.from
|
index === 0 ? false : messages[index - 1].from === message.from
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
|
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import {
|
import {
|
||||||
CircleEllipsisIcon,
|
|
||||||
AlertCircleIcon,
|
AlertCircleIcon,
|
||||||
CheckCircle2Icon,
|
CheckCircle2Icon,
|
||||||
|
CircleEllipsisIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
|
||||||
import type { MessageWithState } from "@app/core/stores/deviceStore.js";
|
|
||||||
|
|
||||||
export interface MessageProps {
|
export interface MessageProps {
|
||||||
lastMsgSameUser: boolean;
|
lastMsgSameUser: boolean;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
|
import { Button } from "@components/UI/Button.js";
|
||||||
import { Input } from "@components/UI/Input.js";
|
import { Input } from "@components/UI/Input.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { SendIcon } from "lucide-react";
|
|
||||||
import type { Types } from "@meshtastic/meshtasticjs";
|
import type { Types } from "@meshtastic/meshtasticjs";
|
||||||
import { Button } from "@components/UI/Button.js";
|
import { SendIcon } from "lucide-react";
|
||||||
|
|
||||||
export interface MessageInputProps {
|
export interface MessageInputProps {
|
||||||
to: Types.Destination;
|
to: Types.Destination;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { AudioValidation } from "@app/validation/moduleConfig/audio.js";
|
import type { AudioValidation } from "@app/validation/moduleConfig/audio.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const Audio = (): JSX.Element => {
|
export const Audio = (): JSX.Element => {
|
||||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { CannedMessageValidation } from "@app/validation/moduleConfig/cannedMessage.js";
|
import type { CannedMessageValidation } from "@app/validation/moduleConfig/cannedMessage.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const CannedMessage = (): JSX.Element => {
|
export const CannedMessage = (): JSX.Element => {
|
||||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { ExternalNotificationValidation } from "@app/validation/moduleConfig/externalNotification.js";
|
import type { ExternalNotificationValidation } from "@app/validation/moduleConfig/externalNotification.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const ExternalNotification = (): JSX.Element => {
|
export const ExternalNotification = (): JSX.Element => {
|
||||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { RangeTestValidation } from "@app/validation/moduleConfig/rangeTest.js";
|
import type { RangeTestValidation } from "@app/validation/moduleConfig/rangeTest.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const RangeTest = (): JSX.Element => {
|
export const RangeTest = (): JSX.Element => {
|
||||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { StoreForwardValidation } from "@app/validation/moduleConfig/storeForward.js";
|
import type { StoreForwardValidation } from "@app/validation/moduleConfig/storeForward.js";
|
||||||
|
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { DynamicForm } from "@components/Form/DynamicForm.js";
|
|
||||||
|
|
||||||
export const StoreForward = (): JSX.Element => {
|
export const StoreForward = (): JSX.Element => {
|
||||||
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
const { moduleConfig, setWorkingModuleConfig } = useDevice();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { cn } from "@app/core/utils/cn.js";
|
import { cn } from "@app/core/utils/cn.js";
|
||||||
import { LucideIcon, AlignLeftIcon } from "lucide-react";
|
import { AlignLeftIcon, LucideIcon } from "lucide-react";
|
||||||
|
|
||||||
export interface PageLayoutProps {
|
export interface PageLayoutProps {
|
||||||
label: string;
|
label: string;
|
||||||
@@ -20,7 +20,10 @@ export const PageLayout = ({
|
|||||||
return (
|
return (
|
||||||
<div className="relative flex h-full w-full flex-col">
|
<div className="relative flex h-full w-full flex-col">
|
||||||
<div className="flex h-14 shrink-0 border-b-[0.5px] border-slate-300 dark:border-slate-700 md:h-16 md:px-4">
|
<div className="flex h-14 shrink-0 border-b-[0.5px] border-slate-300 dark:border-slate-700 md:h-16 md:px-4">
|
||||||
<button className="pl-4 transition-all hover:text-accent md:hidden">
|
<button
|
||||||
|
type="button"
|
||||||
|
className="pl-4 transition-all hover:text-accent md:hidden"
|
||||||
|
>
|
||||||
<AlignLeftIcon />
|
<AlignLeftIcon />
|
||||||
</button>
|
</button>
|
||||||
<div className="flex flex-1 items-center justify-between px-4 md:px-0">
|
<div className="flex flex-1 items-center justify-between px-4 md:px-0">
|
||||||
@@ -30,6 +33,7 @@ export const PageLayout = ({
|
|||||||
{actions?.map((action, index) => (
|
{actions?.map((action, index) => (
|
||||||
<button
|
<button
|
||||||
key={index}
|
key={index}
|
||||||
|
type="button"
|
||||||
className="transition-all hover:text-accent"
|
className="transition-all hover:text-accent"
|
||||||
onClick={action.onClick}
|
onClick={action.onClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||||
|
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||||
|
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import type { Page } from "@core/stores/deviceStore.js";
|
import type { Page } from "@core/stores/deviceStore.js";
|
||||||
import {
|
import {
|
||||||
|
EditIcon,
|
||||||
|
LayersIcon,
|
||||||
|
LayoutGrid,
|
||||||
LucideIcon,
|
LucideIcon,
|
||||||
MapIcon,
|
MapIcon,
|
||||||
MessageSquareIcon,
|
MessageSquareIcon,
|
||||||
SettingsIcon,
|
SettingsIcon,
|
||||||
LayersIcon,
|
|
||||||
UsersIcon,
|
UsersIcon,
|
||||||
EditIcon,
|
|
||||||
LayoutGrid,
|
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { Subtle } from "@components/UI/Typography/Subtle.js";
|
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
|
||||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
|
||||||
|
|
||||||
export interface SidebarProps {
|
export interface SidebarProps {
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
@@ -67,6 +67,7 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
|||||||
<Subtle>{myNode?.user?.longName ?? "UNK"}</Subtle>
|
<Subtle>{myNode?.user?.longName ?? "UNK"}</Subtle>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className="transition-all hover:text-accent"
|
className="transition-all hover:text-accent"
|
||||||
onClick={() => setDialogOpen("deviceName", true)}
|
onClick={() => setDialogOpen("deviceName", true)}
|
||||||
>
|
>
|
||||||
@@ -75,9 +76,9 @@ export const Sidebar = ({ children }: SidebarProps): JSX.Element => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SidebarSection label="Navigation">
|
<SidebarSection label="Navigation">
|
||||||
{pages.map((link, index) => (
|
{pages.map((link) => (
|
||||||
<SidebarButton
|
<SidebarButton
|
||||||
key={index}
|
key={link.name}
|
||||||
label={link.name}
|
label={link.name}
|
||||||
icon={link.icon}
|
icon={link.icon}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import { VariantProps, cva } from "class-variance-authority";
|
import { VariantProps, cva } from "class-variance-authority";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
@@ -41,6 +41,7 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|||||||
({ className, variant, size, ...props }, ref) => {
|
({ className, variant, size, ...props }, ref) => {
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className={cn(buttonVariants({ variant, size, className }))}
|
className={cn(buttonVariants({ variant, size, className }))}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
||||||
import { Check } from "lucide-react";
|
import { Check } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as React from "react";
|
|
||||||
import type { DialogProps } from "@radix-ui/react-dialog";
|
import type { DialogProps } from "@radix-ui/react-dialog";
|
||||||
import { Command as CommandPrimitive } from "cmdk";
|
import { Command as CommandPrimitive } from "cmdk";
|
||||||
import { Search } from "lucide-react";
|
import { Search } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
|
||||||
import { Dialog, DialogContent } from "@components/UI/Dialog.js";
|
import { Dialog, DialogContent } from "@components/UI/Dialog.js";
|
||||||
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
const Command = React.forwardRef<
|
const Command = React.forwardRef<
|
||||||
React.ElementRef<typeof CommandPrimitive>,
|
React.ElementRef<typeof CommandPrimitive>,
|
||||||
@@ -21,9 +21,7 @@ const Command = React.forwardRef<
|
|||||||
));
|
));
|
||||||
Command.displayName = CommandPrimitive.displayName;
|
Command.displayName = CommandPrimitive.displayName;
|
||||||
|
|
||||||
interface CommandDialogProps extends DialogProps {}
|
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
||||||
|
|
||||||
const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
|
|
||||||
return (
|
return (
|
||||||
<Dialog {...props}>
|
<Dialog {...props}>
|
||||||
<DialogContent className="overflow-hidden p-0 shadow-2xl [&_[dialog-overlay]]:bg-red-100">
|
<DialogContent className="overflow-hidden p-0 shadow-2xl [&_[dialog-overlay]]:bg-red-100">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
import * as DialogPrimitive from "@radix-ui/react-dialog";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
||||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|||||||
)}
|
)}
|
||||||
{action && (
|
{action && (
|
||||||
<button
|
<button
|
||||||
|
type="button"
|
||||||
className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-400 focus:outline-none "
|
className="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-400 focus:outline-none "
|
||||||
onClick={action.onClick}
|
onClick={action.onClick}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as LabelPrimitive from "@radix-ui/react-label";
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
import * as MenubarPrimitive from "@radix-ui/react-menubar";
|
||||||
import { Check, ChevronRight, Circle } from "lucide-react";
|
import { Check, ChevronRight, Circle } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as SelectPrimitive from "@radix-ui/react-select";
|
import * as SelectPrimitive from "@radix-ui/react-select";
|
||||||
import { Check, ChevronDown } from "lucide-react";
|
import { Check, ChevronDown } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import type { LucideIcon } from "lucide-react";
|
|
||||||
import { Button } from "../Button.js";
|
import { Button } from "../Button.js";
|
||||||
|
import type { LucideIcon } from "lucide-react";
|
||||||
|
|
||||||
export interface SidebarButtonProps {
|
export interface SidebarButtonProps {
|
||||||
label: string;
|
label: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as ToastPrimitives from "@radix-ui/react-toast";
|
import * as ToastPrimitives from "@radix-ui/react-toast";
|
||||||
import { VariantProps, cva } from "class-variance-authority";
|
import { VariantProps, cva } from "class-variance-authority";
|
||||||
import { X } from "lucide-react";
|
import { X } from "lucide-react";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import * as React from "react";
|
|
||||||
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
||||||
|
import * as React from "react";
|
||||||
|
|
||||||
import { cn } from "@core/utils/cn.js";
|
import { cn } from "@core/utils/cn.js";
|
||||||
|
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ export const Table = ({ headings, rows }: TableProps): JSX.Element => {
|
|||||||
<table className="min-w-full">
|
<table className="min-w-full">
|
||||||
<thead className="bg-backgroundPrimary text-sm font-semibold text-textPrimary">
|
<thead className="bg-backgroundPrimary text-sm font-semibold text-textPrimary">
|
||||||
<tr>
|
<tr>
|
||||||
{headings.map((heading, index) => (
|
{headings.map((heading) => (
|
||||||
<th
|
<th
|
||||||
key={index}
|
key={heading.title}
|
||||||
scope="col"
|
scope="col"
|
||||||
className={`py-2 pr-3 pl-6 text-left ${
|
className={`py-2 pr-3 pl-6 text-left ${
|
||||||
heading.sortable
|
heading.sortable
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
|
|
||||||
import type { ToastActionElement, ToastProps } from "@components/UI/Toast.js";
|
import type { ToastActionElement, ToastProps } from "@components/UI/Toast.js";
|
||||||
|
import { DialogProps } from "@radix-ui/react-dialog";
|
||||||
|
|
||||||
const TOAST_LIMIT = 1;
|
const TOAST_LIMIT = 1;
|
||||||
const TOAST_REMOVE_DELAY = 1000;
|
const TOAST_REMOVE_DELAY = 1000;
|
||||||
@@ -84,7 +85,7 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
|
||||||
case "DISMISS_TOAST":
|
case "DISMISS_TOAST": {
|
||||||
const { toastId } = action;
|
const { toastId } = action;
|
||||||
|
|
||||||
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
||||||
@@ -108,7 +109,9 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
: t,
|
: t,
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
case "REMOVE_TOAST":
|
}
|
||||||
|
|
||||||
|
case "REMOVE_TOAST": {
|
||||||
if (action.toastId === undefined) {
|
if (action.toastId === undefined) {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
@@ -119,6 +122,7 @@ export const reducer = (state: State, action: Action): State => {
|
|||||||
...state,
|
...state,
|
||||||
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
||||||
};
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -133,9 +137,7 @@ function dispatch(action: Action) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Toast extends Omit<ToasterToast, "id"> {}
|
function toast({ ...props }: DialogProps) {
|
||||||
|
|
||||||
function toast({ ...props }: Toast) {
|
|
||||||
const id = genId();
|
const id = genId();
|
||||||
|
|
||||||
const update = (props: ToasterToast) =>
|
const update = (props: ToasterToast) =>
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
import "@app/index.css";
|
import "@app/index.css";
|
||||||
|
import { enableMapSet } from "immer";
|
||||||
import "maplibre-gl/dist/maplibre-gl.css";
|
import "maplibre-gl/dist/maplibre-gl.css";
|
||||||
import { StrictMode } from "react";
|
import { StrictMode } from "react";
|
||||||
import { enableMapSet } from "immer";
|
|
||||||
import { createRoot } from "react-dom/client";
|
import { createRoot } from "react-dom/client";
|
||||||
|
|
||||||
import { App } from "@app/App.js";
|
import { App } from "@app/App.js";
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import { Sidebar } from "@components/Sidebar.js";
|
|
||||||
import { PageLayout } from "@components/PageLayout.js";
|
|
||||||
import { cn } from "@app/core/utils/cn.js";
|
|
||||||
import { Channel } from "@components/PageComponents/Channel.js";
|
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import { QrCodeIcon, ImportIcon } from "lucide-react";
|
|
||||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
|
||||||
import { useState } from "react";
|
|
||||||
import {
|
import {
|
||||||
Tabs,
|
Tabs,
|
||||||
TabsContent,
|
TabsContent,
|
||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@app/components/UI/Tabs.js";
|
} 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";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||||
|
import { ImportIcon, QrCodeIcon } from "lucide-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export const getChannelName = (channel: Protobuf.Channel) =>
|
export const getChannelName = (channel: Protobuf.Channel) =>
|
||||||
channel.settings?.name.length
|
channel.settings?.name.length
|
||||||
@@ -31,7 +31,7 @@ export const ChannelsPage = (): JSX.Element => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Sidebar></Sidebar>
|
<Sidebar />
|
||||||
<PageLayout
|
<PageLayout
|
||||||
label={`Channel: ${
|
label={`Channel: ${
|
||||||
currentChannel ? getChannelName(currentChannel) : "Loading..."
|
currentChannel ? getChannelName(currentChannel) : "Loading..."
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
import { Fragment } from "react";
|
|
||||||
import { Network } from "@components/PageComponents/Config/Network.js";
|
|
||||||
import { Bluetooth } from "@components/PageComponents/Config/Bluetooth.js";
|
import { Bluetooth } from "@components/PageComponents/Config/Bluetooth.js";
|
||||||
import { Device } from "@components/PageComponents/Config/Device.js";
|
import { Device } from "@components/PageComponents/Config/Device.js";
|
||||||
import { Display } from "@components/PageComponents/Config/Display.js";
|
import { Display } from "@components/PageComponents/Config/Display.js";
|
||||||
import { LoRa } from "@components/PageComponents/Config/LoRa.js";
|
import { LoRa } from "@components/PageComponents/Config/LoRa.js";
|
||||||
|
import { Network } from "@components/PageComponents/Config/Network.js";
|
||||||
import { Position } from "@components/PageComponents/Config/Position.js";
|
import { Position } from "@components/PageComponents/Config/Position.js";
|
||||||
import { Power } from "@components/PageComponents/Config/Power.js";
|
import { Power } from "@components/PageComponents/Config/Power.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
|
||||||
import {
|
import {
|
||||||
Tabs,
|
Tabs,
|
||||||
TabsContent,
|
TabsContent,
|
||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.js";
|
} from "@components/UI/Tabs.js";
|
||||||
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
|
import { Fragment } from "react";
|
||||||
|
|
||||||
export const DeviceConfig = (): JSX.Element => {
|
export const DeviceConfig = (): JSX.Element => {
|
||||||
const { hardware } = useDevice();
|
const { hardware } = useDevice();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Fragment } from "react";
|
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||||
import { Audio } from "@components/PageComponents/ModuleConfig/Audio.js";
|
import { Audio } from "@components/PageComponents/ModuleConfig/Audio.js";
|
||||||
import { CannedMessage } from "@components/PageComponents/ModuleConfig/CannedMessage";
|
import { CannedMessage } from "@components/PageComponents/ModuleConfig/CannedMessage";
|
||||||
import { ExternalNotification } from "@components/PageComponents/ModuleConfig/ExternalNotification.js";
|
import { ExternalNotification } from "@components/PageComponents/ModuleConfig/ExternalNotification.js";
|
||||||
@@ -7,13 +7,13 @@ import { RangeTest } from "@components/PageComponents/ModuleConfig/RangeTest.js"
|
|||||||
import { Serial } from "@components/PageComponents/ModuleConfig/Serial.js";
|
import { Serial } from "@components/PageComponents/ModuleConfig/Serial.js";
|
||||||
import { StoreForward } from "@components/PageComponents/ModuleConfig/StoreForward.js";
|
import { StoreForward } from "@components/PageComponents/ModuleConfig/StoreForward.js";
|
||||||
import { Telemetry } from "@components/PageComponents/ModuleConfig/Telemetry.js";
|
import { Telemetry } from "@components/PageComponents/ModuleConfig/Telemetry.js";
|
||||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
|
||||||
import {
|
import {
|
||||||
Tabs,
|
Tabs,
|
||||||
TabsContent,
|
TabsContent,
|
||||||
TabsList,
|
TabsList,
|
||||||
TabsTrigger,
|
TabsTrigger,
|
||||||
} from "@components/UI/Tabs.js";
|
} from "@components/UI/Tabs.js";
|
||||||
|
import { Fragment } from "react";
|
||||||
|
|
||||||
export const ModuleConfig = (): JSX.Element => {
|
export const ModuleConfig = (): JSX.Element => {
|
||||||
const { workingModuleConfig, connection } = useDevice();
|
const { workingModuleConfig, connection } = useDevice();
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import { Sidebar } from "@components/Sidebar.js";
|
|
||||||
import { SettingsIcon, BoxesIcon, SaveIcon } from "lucide-react";
|
|
||||||
import { DeviceConfig } from "@pages/Config/DeviceConfig.js";
|
|
||||||
import { ModuleConfig } from "@pages/Config/ModuleConfig.js";
|
|
||||||
import { PageLayout } from "@components/PageLayout.js";
|
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
|
||||||
import { useState } from "react";
|
|
||||||
import { useDevice } from "@app/core/stores/deviceStore.js";
|
import { useDevice } from "@app/core/stores/deviceStore.js";
|
||||||
|
import { PageLayout } from "@components/PageLayout.js";
|
||||||
|
import { Sidebar } from "@components/Sidebar.js";
|
||||||
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||||
import { useToast } from "@core/hooks/useToast.js";
|
import { useToast } from "@core/hooks/useToast.js";
|
||||||
|
import { DeviceConfig } from "@pages/Config/DeviceConfig.js";
|
||||||
|
import { ModuleConfig } from "@pages/Config/ModuleConfig.js";
|
||||||
|
import { BoxesIcon, SaveIcon, SettingsIcon } from "lucide-react";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
export const ConfigPage = (): JSX.Element => {
|
export const ConfigPage = (): JSX.Element => {
|
||||||
const { workingConfig, workingModuleConfig, connection } = useDevice();
|
const { workingConfig, workingModuleConfig, connection } = useDevice();
|
||||||
|
|||||||
+15
-15
@@ -1,22 +1,22 @@
|
|||||||
import maplibregl from "maplibre-gl";
|
import { Subtle } from "@app/components/UI/Typography/Subtle.js";
|
||||||
import { Layer, Map, Marker, Source, useMap } from "react-map-gl";
|
import { cn } from "@app/core/utils/cn.js";
|
||||||
|
import { PageLayout } from "@components/PageLayout.js";
|
||||||
|
import { Sidebar } from "@components/Sidebar.js";
|
||||||
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||||
|
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||||
import { useAppStore } from "@core/stores/appStore.js";
|
import { useAppStore } from "@core/stores/appStore.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
import { Sidebar } from "@components/Sidebar.js";
|
import { bbox, lineString } from "@turf/turf";
|
||||||
import { PageLayout } from "@components/PageLayout.js";
|
|
||||||
import {
|
import {
|
||||||
ZoomInIcon,
|
|
||||||
ZoomOutIcon,
|
|
||||||
BoxSelectIcon,
|
BoxSelectIcon,
|
||||||
MapPinIcon,
|
MapPinIcon,
|
||||||
|
ZoomInIcon,
|
||||||
|
ZoomOutIcon,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import { bbox, lineString } from "@turf/turf";
|
import maplibregl from "maplibre-gl";
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
|
||||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
|
||||||
import { Subtle } from "@app/components/UI/Typography/Subtle.js";
|
|
||||||
import { cn } from "@app/core/utils/cn.js";
|
|
||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
|
import { Layer, Map as MapGL, Marker, Source, useMap } from "react-map-gl";
|
||||||
|
|
||||||
export const MapPage = (): JSX.Element => {
|
export const MapPage = (): JSX.Element => {
|
||||||
const { nodes, waypoints } = useDevice();
|
const { nodes, waypoints } = useDevice();
|
||||||
@@ -76,8 +76,8 @@ export const MapPage = (): JSX.Element => {
|
|||||||
<>
|
<>
|
||||||
<Sidebar>
|
<Sidebar>
|
||||||
<SidebarSection label="Sources">
|
<SidebarSection label="Sources">
|
||||||
{rasterSources.map((source, index) => (
|
{rasterSources.map((source) => (
|
||||||
<SidebarButton key={index} label={source.title} />
|
<SidebarButton key={source.title} label={source.title} />
|
||||||
))}
|
))}
|
||||||
</SidebarSection>
|
</SidebarSection>
|
||||||
</Sidebar>
|
</Sidebar>
|
||||||
@@ -105,7 +105,7 @@ export const MapPage = (): JSX.Element => {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Map
|
<MapGL
|
||||||
mapStyle="https://raw.githubusercontent.com/hc-oss/maplibre-gl-styles/master/styles/osm-mapnik/v8/default.json"
|
mapStyle="https://raw.githubusercontent.com/hc-oss/maplibre-gl-styles/master/styles/osm-mapnik/v8/default.json"
|
||||||
// onClick={(e) => {
|
// onClick={(e) => {
|
||||||
// const waypoint = new Protobuf.Waypoint({
|
// const waypoint = new Protobuf.Waypoint({
|
||||||
@@ -176,7 +176,7 @@ export const MapPage = (): JSX.Element => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</Map>
|
</MapGL>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { Sidebar } from "@components/Sidebar.js";
|
import { getChannelName } from "./Channels.js";
|
||||||
import { PageLayout } from "@components/PageLayout.js";
|
|
||||||
import { ChannelChat } from "@components/PageComponents/Messages/ChannelChat.js";
|
import { ChannelChat } from "@components/PageComponents/Messages/ChannelChat.js";
|
||||||
|
import { PageLayout } from "@components/PageLayout.js";
|
||||||
|
import { Sidebar } from "@components/Sidebar.js";
|
||||||
|
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
||||||
|
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
import { HashIcon } from "lucide-react";
|
|
||||||
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
import { Protobuf, Types } from "@meshtastic/meshtasticjs";
|
||||||
import { SidebarSection } from "@components/UI/Sidebar/SidebarSection.js";
|
import { HashIcon } from "lucide-react";
|
||||||
import { useMemo, useState } from "react";
|
import { useMemo, useState } from "react";
|
||||||
import { getChannelName } from "./Channels.js";
|
|
||||||
import { SidebarButton } from "@components/UI/Sidebar/sidebarButton.js";
|
|
||||||
|
|
||||||
export const MessagesPage = (): JSX.Element => {
|
export const MessagesPage = (): JSX.Element => {
|
||||||
const { channels, nodes, hardware, messages } = useDevice();
|
const { channels, nodes, hardware, messages } = useDevice();
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
import { base16 } from "rfc4648";
|
import { Sidebar } from "@components/Sidebar.js";
|
||||||
import { Mono } from "@components/generic/Mono.js";
|
import { Mono } from "@components/generic/Mono.js";
|
||||||
import { Table } from "@components/generic/Table";
|
import { Table } from "@components/generic/Table";
|
||||||
import { TimeAgo } from "@components/generic/Table/tmp/TimeAgo.js";
|
import { TimeAgo } from "@components/generic/Table/tmp/TimeAgo.js";
|
||||||
import { useDevice } from "@core/stores/deviceStore.js";
|
import { useDevice } from "@core/stores/deviceStore.js";
|
||||||
import { Hashicon } from "@emeraldpay/hashicon-react";
|
import { Hashicon } from "@emeraldpay/hashicon-react";
|
||||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||||
import { Sidebar } from "@components/Sidebar.js";
|
import { base16 } from "rfc4648";
|
||||||
|
|
||||||
export const PeersPage = (): JSX.Element => {
|
export const PeersPage = (): JSX.Element => {
|
||||||
const { nodes, hardware } = useDevice();
|
const { nodes, hardware } = useDevice();
|
||||||
@@ -16,7 +16,7 @@ export const PeersPage = (): JSX.Element => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Sidebar></Sidebar>
|
<Sidebar />
|
||||||
<div className="w-full overflow-y-auto">
|
<div className="w-full overflow-y-auto">
|
||||||
<Table
|
<Table
|
||||||
headings={[
|
headings={[
|
||||||
|
|||||||
Reference in New Issue
Block a user