Browse Source

Merge branch 'meshtastic:main' into new-map-snr

pull/850/head
Jeremy Gallant 9 months ago
committed by GitHub
parent
commit
fb3502c4d6
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 9
      .github/workflows/nightly.yml
  2. 6
      biome.json
  3. 6
      packages/core/src/utils/transform/fromDevice.ts
  4. 4
      packages/transport-web-bluetooth/src/transport.test.ts
  5. 2
      packages/web/package.json
  6. 16
      packages/web/public/i18n/locales/bg-BG/deviceConfig.json
  7. 2
      packages/web/public/i18n/locales/bg-BG/dialog.json
  8. 4
      packages/web/public/i18n/locales/bg-BG/moduleConfig.json
  9. 2
      packages/web/public/i18n/locales/bg-BG/ui.json
  10. 4
      packages/web/src/components/Dialog/ImportDialog.tsx
  11. 1
      packages/web/src/components/Dialog/ManagedModeDialog.tsx
  12. 2
      packages/web/src/components/Dialog/ShutdownDialog.tsx
  13. 1
      packages/web/src/components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx
  14. 2
      packages/web/src/components/Form/FormSelect.tsx
  15. 2
      packages/web/src/components/PageComponents/ChannelConfig/Channel.tsx
  16. 1
      packages/web/src/components/ThemeSwitcher.tsx
  17. 1
      packages/web/src/components/UI/Checkbox/Checkbox.test.tsx
  18. 10
      packages/web/src/components/UI/ErrorPage.tsx
  19. 1
      packages/web/src/components/generic/Filter/FilterControl.tsx
  20. 2
      packages/web/src/core/utils/ip.ts
  21. 14
      packages/web/src/pages/Config/index.tsx
  22. 2
      packages/web/src/pages/Dashboard/index.tsx
  23. 9
      pnpm-lock.yaml

9
.github/workflows/nightly.yml

@ -77,9 +77,8 @@ jobs:
fi fi
# Outputs # Outputs
echo "immutable_tag=${IMMUTABLE}" >> "$GITHUB_OUTPUT" echo "moving_tag=nightly" >> "$GITHUB_OUTPUT"
echo "moving_tag=nightly" >> "$GITHUB_OUTPUT" echo "immutable_tag=${IMMUTABLE}" >> "$GITHUB_OUTPUT"
echo "all_tags=nightly,${IMMUTABLE}" >> "$GITHUB_OUTPUT"
echo "created=${ISO_CREATED}" >> "$GITHUB_OUTPUT" echo "created=${ISO_CREATED}" >> "$GITHUB_OUTPUT"
echo "Resolved tags: nightly and ${IMMUTABLE}" echo "Resolved tags: nightly and ${IMMUTABLE}"
@ -93,7 +92,9 @@ jobs:
containerfiles: | containerfiles: |
./packages/web/infra/Containerfile ./packages/web/infra/Containerfile
image: ${{ env.REGISTRY_IMAGE }} image: ${{ env.REGISTRY_IMAGE }}
tags: ${{ steps.meta.outputs.all_tags }} tags: |
${{ steps.meta.outputs.moving_tag }}
${{ steps.meta.outputs.immutable_tag }}
oci: true oci: true
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
labels: | labels: |

6
biome.json

@ -3,9 +3,9 @@
"includes": [ "includes": [
"**/*.ts", "**/*.ts",
"**/*.tsx", "**/*.tsx",
"!npm_modules/**", "!npm_modules",
"!dist/**", "!dist",
"!npm/**", "!npm",
"**/*.json", "**/*.json",
"!**/locales/*-*/*.json" "!**/locales/*-*/*.json"
], ],

6
packages/core/src/utils/transform/fromDevice.ts

@ -14,7 +14,7 @@ export const fromDeviceStream: () => TransformStream<Uint8Array, DeviceOutput> =
byteBuffer = new Uint8Array([...byteBuffer, ...chunk]); byteBuffer = new Uint8Array([...byteBuffer, ...chunk]);
let processingExhausted = false; let processingExhausted = false;
while (byteBuffer.length !== 0 && !processingExhausted) { while (byteBuffer.length !== 0 && !processingExhausted) {
const framingIndex = byteBuffer.findIndex((byte) => byte === 0x94); const framingIndex = byteBuffer.indexOf(0x94);
const framingByte2 = byteBuffer[framingIndex + 1]; const framingByte2 = byteBuffer[framingIndex + 1];
if (framingByte2 === 0xc3) { if (framingByte2 === 0xc3) {
if (byteBuffer.subarray(0, framingIndex).length) { if (byteBuffer.subarray(0, framingIndex).length) {
@ -35,9 +35,7 @@ export const fromDeviceStream: () => TransformStream<Uint8Array, DeviceOutput> =
) { ) {
const packet = byteBuffer.subarray(4, 4 + (msb << 8) + lsb); const packet = byteBuffer.subarray(4, 4 + (msb << 8) + lsb);
const malformedDetectorIndex = packet.findIndex( const malformedDetectorIndex = packet.indexOf(0x94);
(byte) => byte === 0x94,
);
if ( if (
malformedDetectorIndex !== -1 && malformedDetectorIndex !== -1 &&
packet[malformedDetectorIndex + 1] === 0xc3 packet[malformedDetectorIndex + 1] === 0xc3

4
packages/transport-web-bluetooth/src/transport.test.ts

@ -14,7 +14,9 @@ class MiniEmitter {
this.listeners.get(type)?.delete(listener); this.listeners.get(type)?.delete(listener);
} }
dispatchEvent(event: Event) { dispatchEvent(event: Event) {
this.listeners.get(event.type)?.forEach((l) => l(event)); this.listeners.get(event.type)?.forEach((l) => {
l(event);
});
} }
} }

2
packages/web/package.json

@ -27,7 +27,7 @@
"package": "gzipper c -i html,js,css,png,ico,svg,json,webmanifest,txt dist dist/output && tar -cvf dist/build.tar -C ./dist/output/ ." "package": "gzipper c -i html,js,css,png,ico,svg,json,webmanifest,txt dist dist/output && tar -cvf dist/build.tar -C ./dist/output/ ."
}, },
"dependencies": { "dependencies": {
"@bufbuild/protobuf": "^2.6.0", "@bufbuild/protobuf": "^2.8.0",
"@hookform/resolvers": "^5.1.1", "@hookform/resolvers": "^5.1.1",
"@meshtastic/core": "workspace:*", "@meshtastic/core": "workspace:*",
"@meshtastic/transport-http": "workspace:*", "@meshtastic/transport-http": "workspace:*",

16
packages/web/public/i18n/locales/bg-BG/deviceConfig.json

@ -231,8 +231,8 @@
"label": "SSID" "label": "SSID"
}, },
"subnet": { "subnet": {
"description": "Subnet Mask", "description": "Подмрежова маска",
"label": "Subnet" "label": "Подмрежа"
}, },
"wifiEnabled": { "wifiEnabled": {
"description": "Активиране или дезактивиране на WiFi радиото", "description": "Активиране или дезактивиране на WiFi радиото",
@ -401,20 +401,20 @@
"label": "Публичен ключ" "label": "Публичен ключ"
}, },
"primaryAdminKey": { "primaryAdminKey": {
"description": "The primary public key authorized to send admin messages to this node", "description": "Основният публичен ключ, оторизиран за изпращане на администраторски съобщения до този възел",
"label": "Primary Admin Key" "label": "Основен администраторски ключ"
}, },
"secondaryAdminKey": { "secondaryAdminKey": {
"description": "The secondary public key authorized to send admin messages to this node", "description": "Вторичният публичен ключ, оторизиран за изпращане на администраторски съобщения до този възел",
"label": "Secondary Admin Key" "label": "Вторичен администраторски ключ"
}, },
"serialOutputEnabled": { "serialOutputEnabled": {
"description": "Serial Console over the Stream API", "description": "Serial Console over the Stream API",
"label": "Serial Output Enabled" "label": "Serial Output Enabled"
}, },
"tertiaryAdminKey": { "tertiaryAdminKey": {
"description": "The tertiary public key authorized to send admin messages to this node", "description": "Третичният публичен ключ, оторизиран за изпращане на администраторски съобщения до този възел",
"label": "Tertiary Admin Key" "label": "Третичен администраторски ключ"
}, },
"adminSettings": { "adminSettings": {
"description": "Настройки за Admin", "description": "Настройки за Admin",

2
packages/web/public/i18n/locales/bg-BG/dialog.json

@ -141,7 +141,7 @@
"title": "Рестартиране на устройството", "title": "Рестартиране на устройството",
"description": "Reboot now or schedule a reboot of the connected node. Optionally, you can choose to reboot into OTA (Over-the-Air) mode.", "description": "Reboot now or schedule a reboot of the connected node. Optionally, you can choose to reboot into OTA (Over-the-Air) mode.",
"ota": "Reboot into OTA mode", "ota": "Reboot into OTA mode",
"enterDelay": "Enter delay", "enterDelay": "Въведете забавяне",
"scheduled": "Насрочено е рестартиране", "scheduled": "Насрочено е рестартиране",
"schedule": "Планиране на рестартиране", "schedule": "Планиране на рестартиране",
"now": "Рестартиране сега", "now": "Рестартиране сега",

4
packages/web/public/i18n/locales/bg-BG/moduleConfig.json

@ -177,8 +177,8 @@
"description": "Output Buzzer" "description": "Output Buzzer"
}, },
"active": { "active": {
"label": "Active", "label": "Активно",
"description": "Active" "description": "Активно"
}, },
"alertMessage": { "alertMessage": {
"label": "Предупредително съобщение", "label": "Предупредително съобщение",

2
packages/web/public/i18n/locales/bg-BG/ui.json

@ -191,7 +191,7 @@
"label": "Неизвестен брой хопове" "label": "Неизвестен брой хопове"
}, },
"showUnheard": { "showUnheard": {
"label": "Never heard" "label": "Никога не е чуван"
}, },
"language": { "language": {
"label": "Език", "label": "Език",

4
packages/web/src/components/Dialog/ImportDialog.tsx

@ -84,7 +84,7 @@ export const ImportDialog = ({ open, onOpenChange }: ImportDialogProps) => {
}, [importDialogInput, t]); }, [importDialogInput, t]);
const apply = () => { const apply = () => {
channelSet?.settings.map( channelSet?.settings.forEach(
(ch: Protobuf.Channel.ChannelSettings, index: number) => { (ch: Protobuf.Channel.ChannelSettings, index: number) => {
if (importIndex[index] === -1) { if (importIndex[index] === -1) {
return; return;
@ -140,7 +140,7 @@ export const ImportDialog = ({ open, onOpenChange }: ImportDialogProps) => {
const onSelectChange = (value: string, index: number) => { const onSelectChange = (value: string, index: number) => {
const newImportIndex = [...importIndex]; const newImportIndex = [...importIndex];
newImportIndex[index] = Number.parseInt(value); newImportIndex[index] = Number.parseInt(value, 10);
setImportIndex(newImportIndex); setImportIndex(newImportIndex);
}; };

1
packages/web/src/components/Dialog/ManagedModeDialog.tsx

@ -43,7 +43,6 @@ export const ManagedModeDialog = ({
</DialogHeader> </DialogHeader>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Checkbox <Checkbox
id="managedMode"
checked={confirmState} checked={confirmState}
onChange={() => setConfirmState(!confirmState)} onChange={() => setConfirmState(!confirmState)}
name="confirmUnderstanding" name="confirmUnderstanding"

2
packages/web/src/components/Dialog/ShutdownDialog.tsx

@ -37,7 +37,7 @@ export const ShutdownDialog = ({ open, onOpenChange }: ShutdownDialogProps) => {
<Input <Input
type="number" type="number"
value={time} value={time}
onChange={(e) => setTime(Number.parseInt(e.target.value))} onChange={(e) => setTime(Number.parseInt(e.target.value, 10))}
suffix={t("unit.minute.plural")} suffix={t("unit.minute.plural")}
/> />
<Button className="w-24" onClick={handleScheduledShutdown}> <Button className="w-24" onClick={handleScheduledShutdown}>

1
packages/web/src/components/Dialog/UnsafeRolesDialog/UnsafeRolesDialog.tsx

@ -59,7 +59,6 @@ export const UnsafeRolesDialog = ({
</DialogDescription> </DialogDescription>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<Checkbox <Checkbox
id="routerRole"
checked={confirmState} checked={confirmState}
onChange={() => setConfirmState(!confirmState)} onChange={() => setConfirmState(!confirmState)}
name="confirmUnderstanding" name="confirmUnderstanding"

2
packages/web/src/components/Form/FormSelect.tsx

@ -84,7 +84,7 @@ export function SelectInput<T extends FieldValues>({
if (field.selectChange) { if (field.selectChange) {
field.selectChange(newValue, selectedKey); field.selectChange(newValue, selectedKey);
} }
onChange(Number.parseInt(newValue)); onChange(Number.parseInt(newValue, 10));
}; };
return ( return (

2
packages/web/src/components/PageComponents/ChannelConfig/Channel.tsx

@ -148,7 +148,7 @@ export const Channel = ({ onFormInit, channel }: SettingsPanelProps) => {
}; };
const selectChangeEvent = (e: string) => { const selectChangeEvent = (e: string) => {
const count = Number.parseInt(e); const count = Number.parseInt(e, 10);
if (!Number.isNaN(count)) { if (!Number.isNaN(count)) {
setBytes(count); setBytes(count);
trigger("settings.psk"); trigger("settings.psk");

1
packages/web/src/components/ThemeSwitcher.tsx

@ -60,7 +60,6 @@ export default function ThemeSwitcher({
<Button <Button
variant="ghost" variant="ghost"
onClick={toggleTheme} onClick={toggleTheme}
id="theme-switcher"
aria-label={t("theme.changeTheme")} aria-label={t("theme.changeTheme")}
className={cn( className={cn(
"group relative flex justify-start", "group relative flex justify-start",

1
packages/web/src/components/UI/Checkbox/Checkbox.test.tsx

@ -75,6 +75,7 @@ describe("Checkbox", () => {
}); });
it("uses provided id", () => { it("uses provided id", () => {
// biome-ignore lint/correctness/useUniqueElementIds: <test>
render(<Checkbox id="custom-id" />); render(<Checkbox id="custom-id" />);
expect(screen.getByRole("checkbox").id).toBe("custom-id"); expect(screen.getByRole("checkbox").id).toBe("custom-id");
}); });

10
packages/web/src/components/UI/ErrorPage.tsx

@ -72,10 +72,7 @@ export function ErrorPage({ error }: { error: Error }) {
<label htmlFor="message"> <label htmlFor="message">
{t("errorPage.errorMessageLabel")} {t("errorPage.errorMessageLabel")}
</label> </label>
<p <p className="text-slate-400 break-words overflow-wrap">
id="message"
className="text-slate-400 break-words overflow-wrap"
>
{error.message} {error.message}
</p> </p>
</> // TODO: Use Trans for the label and message together? </> // TODO: Use Trans for the label and message together?
@ -83,10 +80,7 @@ export function ErrorPage({ error }: { error: Error }) {
{error?.stack && ( {error?.stack && (
<> <>
<label htmlFor="stack">{t("errorPage.stackTraceLabel")}</label> <label htmlFor="stack">{t("errorPage.stackTraceLabel")}</label>
<p <p className="text-slate-400 break-words overflow-wrap">
id="stack"
className="text-slate-400 break-words overflow-wrap"
>
{error.stack} {error.stack}
</p> </p>
</> </>

1
packages/web/src/components/generic/Filter/FilterControl.tsx

@ -244,7 +244,6 @@ export function FilterControl({
</label> </label>
<Input <Input
type="text" type="text"
id="nodeName"
value={filterState.nodeName} value={filterState.nodeName}
onChange={handleTextChange("nodeName")} onChange={handleTextChange("nodeName")}
showClearButton showClearButton

2
packages/web/src/core/utils/ip.ts

@ -13,7 +13,7 @@ export function convertIpAddressToInt(ip: string): number | undefined {
.split(".") .split(".")
.reverse() .reverse()
.reduce((ipnum, octet) => { .reduce((ipnum, octet) => {
return (ipnum << 8) + Number.parseInt(octet); return (ipnum << 8) + Number.parseInt(octet, 10);
}, 0) >>> 0 }, 0) >>> 0
); );
} }

14
packages/web/src/pages/Config/index.tsx

@ -122,11 +122,15 @@ const ConfigPage = () => {
await connection?.commitEditSettings(); await connection?.commitEditSettings();
} }
workingChannelConfig.forEach((newChannel) => addChannel(newChannel)); workingChannelConfig.forEach((newChannel) => {
workingConfig.forEach((newConfig) => setConfig(newConfig)); addChannel(newChannel);
workingModuleConfig.forEach((newModuleConfig) => });
setModuleConfig(newModuleConfig), workingConfig.forEach((newConfig) => {
); setConfig(newConfig);
});
workingModuleConfig.forEach((newModuleConfig) => {
setModuleConfig(newModuleConfig);
});
removeWorkingChannelConfig(); removeWorkingChannelConfig();
removeWorkingConfig(); removeWorkingConfig();

2
packages/web/src/pages/Dashboard/index.tsx

@ -34,7 +34,7 @@ export const Dashboard = () => {
{devices.map((device) => { {devices.map((device) => {
const nodeDB = getNodeDB(device.id); const nodeDB = getNodeDB(device.id);
if (!nodeDB) { if (!nodeDB) {
return; return undefined;
} }
return ( return (

9
pnpm-lock.yaml

@ -91,8 +91,8 @@ importers:
packages/web: packages/web:
dependencies: dependencies:
'@bufbuild/protobuf': '@bufbuild/protobuf':
specifier: ^2.6.0 specifier: ^2.8.0
version: 2.6.3 version: 2.8.0
'@hookform/resolvers': '@hookform/resolvers':
specifier: ^5.1.1 specifier: ^5.1.1
version: 5.2.1([email protected]([email protected])) version: 5.2.1([email protected]([email protected]))
@ -983,9 +983,6 @@ packages:
cpu: [x64] cpu: [x64]
os: [win32] os: [win32]
'@bufbuild/[email protected]':
resolution: {integrity: sha512-w/gJKME9mYN7ZoUAmSMAWXk4hkVpxRKvEJCb3dV5g9wwWdxTJJ0ayOJAVcNxtdqaxDyFuC0uz4RSGVacJ030PQ==}
'@bufbuild/[email protected]': '@bufbuild/[email protected]':
resolution: {integrity: sha512-r1/0w5C9dkbcdjyxY8ZHsC5AOWg4Pnzhm2zu7LO4UHSounp2tMm6Y+oioV9zlGbLveE7YaWRDUk48WLxRDgoqg==} resolution: {integrity: sha512-r1/0w5C9dkbcdjyxY8ZHsC5AOWg4Pnzhm2zu7LO4UHSounp2tMm6Y+oioV9zlGbLveE7YaWRDUk48WLxRDgoqg==}
@ -6234,8 +6231,6 @@ snapshots:
'@biomejs/[email protected]': '@biomejs/[email protected]':
optional: true optional: true
'@bufbuild/[email protected]': {}
'@bufbuild/[email protected]': {} '@bufbuild/[email protected]': {}
'@emnapi/[email protected]': '@emnapi/[email protected]':

Loading…
Cancel
Save