mirror of
https://github.com/meshtastic/web.git
synced 2026-03-13 11:27:33 -04:00
WIP updates
This commit is contained in:
22
src/validation/appConfig/map.ts
Normal file
22
src/validation/appConfig/map.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { IsArray, IsBoolean, IsNumber, IsString } from "class-validator";
|
||||
|
||||
import type { RasterSource } from "@app/core/stores/appStore.js";
|
||||
|
||||
export class MapValidation {
|
||||
@IsArray()
|
||||
rasterSources: MapValidation_RasterSources[];
|
||||
}
|
||||
|
||||
export class MapValidation_RasterSources implements RasterSource {
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
@IsString()
|
||||
title: string;
|
||||
|
||||
// @IsUrl()
|
||||
tiles: string[];
|
||||
|
||||
@IsNumber()
|
||||
tileSize: number;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IsBoolean, IsEnum } from "class-validator";
|
||||
import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
@@ -11,4 +11,10 @@ export class DeviceValidation implements Protobuf.Config_DeviceConfig {
|
||||
|
||||
@IsBoolean()
|
||||
debugLogEnabled: boolean;
|
||||
|
||||
@IsInt()
|
||||
buttonGpio: number;
|
||||
|
||||
@IsInt()
|
||||
buzzerGpio: number;
|
||||
}
|
||||
|
||||
@@ -20,4 +20,7 @@ export class DisplayValidation implements Protobuf.Config_DisplayConfig {
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_DisplayUnits)
|
||||
units: Protobuf.Config_DisplayConfig_DisplayUnits;
|
||||
|
||||
@IsEnum(Protobuf.Config_DisplayConfig_OledType)
|
||||
oled: Protobuf.Config_DisplayConfig_OledType;
|
||||
}
|
||||
|
||||
@@ -6,14 +6,11 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
@IsBoolean()
|
||||
wifiEnabled: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_WiFiMode)
|
||||
wifiMode: Protobuf.Config_NetworkConfig_WiFiMode;
|
||||
|
||||
@Length(0, 33) //min 1
|
||||
@Length(1, 33)
|
||||
@IsOptional({})
|
||||
wifiSsid: string;
|
||||
|
||||
@Length(0, 64) //min 8
|
||||
@Length(8, 64)
|
||||
@IsOptional()
|
||||
wifiPsk: string;
|
||||
|
||||
@@ -26,7 +23,7 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_EthMode)
|
||||
ethMode: Protobuf.Config_NetworkConfig_EthMode;
|
||||
|
||||
ethConfig: NetworkValidation_IpV4Config;
|
||||
ipv4Config: NetworkValidation_IpV4Config;
|
||||
}
|
||||
|
||||
export class NetworkValidation_IpV4Config
|
||||
|
||||
@@ -24,6 +24,12 @@ export class PositionValidation implements Protobuf.Config_PositionConfig {
|
||||
@IsInt()
|
||||
positionFlags: number;
|
||||
|
||||
@IsInt()
|
||||
rxGpio: number;
|
||||
|
||||
@IsInt()
|
||||
txGpio: number;
|
||||
|
||||
// fixed position fields
|
||||
@IsNumber()
|
||||
fixedAlt: number;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IsInt } from "class-validator";
|
||||
import { IsBoolean, IsInt } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
@@ -13,9 +13,15 @@ export class ExternalNotificationValidation
|
||||
@IsInt()
|
||||
output: number;
|
||||
|
||||
@IsBoolean()
|
||||
active: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
alertMessage: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
alertBell: boolean;
|
||||
|
||||
@IsBoolean()
|
||||
usePwm: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user