Browse Source

Fix prod url & more settings

pull/2/head
Sacha Weatherstone 5 years ago
parent
commit
d87782d33a
  1. 4
      package.json
  2. 8
      pnpm-lock.yaml
  3. 2
      src/App.tsx
  4. 3
      src/components/templates/PageLayout.tsx
  5. 2
      src/pages/Plugins/Files.tsx
  6. 2
      src/pages/settings/Connection.tsx
  7. 41
      src/pages/settings/Radio.tsx

4
package.json

@ -4,7 +4,7 @@
"description": "Meshtastic web client",
"license": "GPL-3.0-only",
"scripts": {
"dev": "NODE_ENV=development vite",
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"package": "gzipper c -i html,js,css,png,ico,svg,webmanifest,txt dist dist/output && tar -cvf dist/build.tar -C ./dist/output/ $(ls ./dist/output/)",
@ -13,7 +13,7 @@
},
"dependencies": {
"@headlessui/react": "^1.4.2",
"@meshtastic/meshtasticjs": "^0.6.26",
"@meshtastic/meshtasticjs": "^0.6.27",
"@reduxjs/toolkit": "^1.6.2",
"boring-avatars": "^1.5.8",
"i18next": "^21.4.2",

8
pnpm-lock.yaml

@ -2,7 +2,7 @@ lockfileVersion: 5.3
specifiers:
'@headlessui/react': ^1.4.2
'@meshtastic/meshtasticjs': ^0.6.26
'@meshtastic/meshtasticjs': ^0.6.27
'@reduxjs/toolkit': ^1.6.2
'@types/react': ^17.0.34
'@types/react-dom': ^17.0.11
@ -52,7 +52,7 @@ specifiers:
dependencies:
'@headlessui/react': 1.4[email protected][email protected]
'@meshtastic/meshtasticjs': 0.6.26
'@meshtastic/meshtasticjs': 0.6.27
'@reduxjs/toolkit': 1.6[email protected][email protected]
boring-avatars: 1.5.8
i18next: 21.4.2
@ -1359,8 +1359,8 @@ packages:
resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==}
dev: true
/@meshtastic/meshtasticjs/0.6.26:
resolution: {integrity: sha512-1itDg63rfyMzEbDQrFycmG19mLus3mCffpm3T0PC+egj7e4q9aWBO3o3WC8/eoakeaS/cmBUW+FIO+h/Cktkzw==}
/@meshtastic/meshtasticjs/0.6.27:
resolution: {integrity: sha512-WiM9v/3+YWtt6/wLJOyyhAQdtsIGcEs3geofRZA6y/TCQkbjo/mdvY8Y+ZMZERSFXIZXiovvZgJG0vSYq7JC9A==}
dependencies:
'@protobuf-ts/runtime': 2.0.7
sub-events: 1.8.9

2
src/App.tsx

@ -49,7 +49,7 @@ const App = (): JSX.Element => {
const connectionURL = hostOverrideEnabled
? hostOverride
: import.meta.env.NODE_ENV === 'production'
: import.meta.env.PROD
? window.location.hostname
: (import.meta.env.VITE_PUBLIC_DEVICE_IP as string) ??
'http://meshtastic.local';

3
src/components/templates/PageLayout.tsx

@ -5,7 +5,8 @@ import { FiXCircle } from 'react-icons/fi';
import { useBreakpoint } from '@app/hooks/breakpoint';
import { Drawer } from '@components/generic/Drawer';
import { IconButton } from '@components/generic/IconButton';
import { SidebarItem, SidebarItemProps } from '@components/generic/SidebarItem';
import type { SidebarItemProps } from '@components/generic/SidebarItem';
import { SidebarItem } from '@components/generic/SidebarItem';
import { Tab } from '@headlessui/react';
export interface PageLayoutProps {

2
src/pages/Plugins/Files.tsx

@ -40,7 +40,7 @@ export const Files = ({ navOpen, setNavOpen }: RangeTestProps): JSX.Element => {
const connectionURL = hostOverrideEnabled
? hostOverride
: import.meta.env.NODE_ENV === 'production'
: import.meta.env.PROD
? window.location.hostname
: (import.meta.env.VITE_PUBLIC_DEVICE_IP as string) ??
'http://meshtastic.local';

2
src/pages/settings/Connection.tsx

@ -109,7 +109,7 @@ export const Connection = ({
const connectionURL: string = hostOverrideEnabled
? hostOverride
: import.meta.env.NODE_ENV === 'production'
: import.meta.env.PROD
? window.location.hostname
: (import.meta.env.VITE_PUBLIC_DEVICE_IP as string) ??
'http://meshtastic.local';

41
src/pages/settings/Radio.tsx

@ -88,6 +88,16 @@ export const Radio = ({ navOpen, setNavOpen }: RadioProps): JSX.Element => {
<Cover enabled={debug} content={<JSONPretty data={radioConfig} />} />
<div className="w-full max-w-3xl p-10 md:max-w-xl">
<form className="space-y-2" onSubmit={onSubmit}>
<div>Power</div>
<hr />
<Input
label={'Charge current'}
disabled
{...register('chargeCurrent', { valueAsNumber: true })}
/>
<Checkbox label="Always powered" {...register('isAlwaysPowered')} />
<Checkbox label="Low Power" {...register('isLowPower')} />
<hr />
<div>WiFi</div>
<Input label={t('strings.wifi_ssid')} {...register('wifiSsid')} />
<Input
@ -95,14 +105,11 @@ export const Radio = ({ navOpen, setNavOpen }: RadioProps): JSX.Element => {
label={t('strings.wifi_psk')}
{...register('wifiPassword')}
/>
<Input
label={'Charge current'}
disabled
{...register('chargeCurrent', { valueAsNumber: true })}
/>
<hr />
<div>Position</div>
<Input
label={'Broadcast Interval (seconds)'}
type="number"
{...register('positionBroadcastSecs', { valueAsNumber: true })}
/>
<Select
@ -124,13 +131,31 @@ export const Radio = ({ navOpen, setNavOpen }: RadioProps): JSX.Element => {
optionsEnum={Protobuf.GpsOperation}
{...register('gpsOperation', { valueAsNumber: true })}
/>
<div>Other</div>
<Select
label="Display Format"
optionsEnum={Protobuf.GpsCoordinateFormat}
{...register('gpsFormat', { valueAsNumber: true })}
/>
<Checkbox label="Accept 2D Fix" {...register('gpsAccept2D')} />
<Input
label={'Last GPS Attempt'}
label="Max DOP"
type="number"
{...register('gpsMaxDop', { valueAsNumber: true })}
/>
<Input
label="Last GPS Attempt"
disabled
{...register('gpsAttemptTime', { valueAsNumber: true })}
/>
<hr />
<div>Other</div>
<Select
label="Region"
optionsEnum={Protobuf.RegionCode}
{...register('region', { valueAsNumber: true })}
/>
<Checkbox label="Debug Log" {...register('debugLogEnabled')} />
<Checkbox label="Serial Disabled" {...register('serialDisabled')} />
</form>
</div>
</Card>

Loading…
Cancel
Save