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

6
biome.json

@ -3,9 +3,9 @@
"includes": [
"**/*.ts",
"**/*.tsx",
"!npm_modules/**",
"!dist/**",
"!npm/**",
"!npm_modules",
"!dist",
"!npm",
"**/*.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]);
let processingExhausted = false;
while (byteBuffer.length !== 0 && !processingExhausted) {
const framingIndex = byteBuffer.findIndex((byte) => byte === 0x94);
const framingIndex = byteBuffer.indexOf(0x94);
const framingByte2 = byteBuffer[framingIndex + 1];
if (framingByte2 === 0xc3) {
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 malformedDetectorIndex = packet.findIndex(
(byte) => byte === 0x94,
);
const malformedDetectorIndex = packet.indexOf(0x94);
if (
malformedDetectorIndex !== -1 &&
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);
}
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/ ."
},
"dependencies": {
"@bufbuild/protobuf": "^2.6.0",
"@bufbuild/protobuf": "^2.8.0",
"@hookform/resolvers": "^5.1.1",
"@meshtastic/core": "workspace:*",
"@meshtastic/transport-http": "workspace:*",

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

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

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

@ -141,7 +141,7 @@
"title": "Рестартиране на устройството",
"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",
"enterDelay": "Enter delay",
"enterDelay": "Въведете забавяне",
"scheduled": "Насрочено е рестартиране",
"schedule": "Планиране на рестартиране",
"now": "Рестартиране сега",

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

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

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

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

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

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

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

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

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

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

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

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

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

@ -84,7 +84,7 @@ export function SelectInput<T extends FieldValues>({
if (field.selectChange) {
field.selectChange(newValue, selectedKey);
}
onChange(Number.parseInt(newValue));
onChange(Number.parseInt(newValue, 10));
};
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 count = Number.parseInt(e);
const count = Number.parseInt(e, 10);
if (!Number.isNaN(count)) {
setBytes(count);
trigger("settings.psk");

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

@ -60,7 +60,6 @@ export default function ThemeSwitcher({
<Button
variant="ghost"
onClick={toggleTheme}
id="theme-switcher"
aria-label={t("theme.changeTheme")}
className={cn(
"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", () => {
// biome-ignore lint/correctness/useUniqueElementIds: <test>
render(<Checkbox id="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">
{t("errorPage.errorMessageLabel")}
</label>
<p
id="message"
className="text-slate-400 break-words overflow-wrap"
>
<p className="text-slate-400 break-words overflow-wrap">
{error.message}
</p>
</> // TODO: Use Trans for the label and message together?
@ -83,10 +80,7 @@ export function ErrorPage({ error }: { error: Error }) {
{error?.stack && (
<>
<label htmlFor="stack">{t("errorPage.stackTraceLabel")}</label>
<p
id="stack"
className="text-slate-400 break-words overflow-wrap"
>
<p className="text-slate-400 break-words overflow-wrap">
{error.stack}
</p>
</>

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

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

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

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

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

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

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

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

9
pnpm-lock.yaml

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

Loading…
Cancel
Save