From d98653995b82e970967960fe58b4c9b3ef365944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Tue, 12 Dec 2023 18:30:20 +0100 Subject: [PATCH] feat: bootloader warning refactor: reword linux premission warning --- src/i18n/de/index.ts | 1 + src/i18n/en/index.ts | 4 +-- src/routes/ConnectionPopup.svelte | 58 ++++++++++++++++++++----------- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/src/i18n/de/index.ts b/src/i18n/de/index.ts index ed7d78dc..5e50d123 100644 --- a/src/i18n/de/index.ts +++ b/src/i18n/de/index.ts @@ -67,6 +67,7 @@ const de = { TITLE: "Bootmenü", REBOOT: "Neustarten", BOOTLOADER: "Bootloader", + POWER_WARNING: "Um vom Bootloader aus neu zu starten muss das Gerät neu verbunden werden.", }, }, browserWarning: { diff --git a/src/i18n/en/index.ts b/src/i18n/en/index.ts index 82d3347e..6baf3c87 100644 --- a/src/i18n/en/index.ts +++ b/src/i18n/en/index.ts @@ -60,12 +60,12 @@ const en = { TERMINAL: "Terminal", APPLY_SETTINGS: "Flash changes to device", NO_DEVICE: "No device connected", - LINUX_PERMISSIONS: - "On most Linux based systems need to adjust permissions in order to connnect your device.", + LINUX_PERMISSIONS: "Most Linux based systems need adjusted permissions in order to connect your device.", bootMenu: { TITLE: "Boot Menu", REBOOT: "Reboot", BOOTLOADER: "Bootloader", + POWER_WARNING: "To reboot from bootloader you need to physically reconnect your device.", }, }, browserWarning: { diff --git a/src/routes/ConnectionPopup.svelte b/src/routes/ConnectionPopup.svelte index 46272019..969bd38f 100644 --- a/src/routes/ConnectionPopup.svelte +++ b/src/routes/ConnectionPopup.svelte @@ -5,8 +5,26 @@ import {preference} from "$lib/preferences" import LL from "../i18n/i18n-svelte" + function reboot() { + $serialPort?.reboot() + $serialPort = undefined + powerDialog = false + } + + function bootloader() { + $serialPort?.bootloader() + $serialPort = undefined + rebootInfo = true + powerDialog = false + } + + let rebootInfo = false let terminal = false let powerDialog = false + + $: if ($serialPort) { + rebootInfo = false + }
@@ -26,18 +44,19 @@ {/if} {#if browser} - {#if navigator.userAgent.includes("Linux")} -
+ {#if navigator.userAgent.includes("Linux") && !$serialPort} +
{@html $LL.deviceManager.LINUX_PERMISSIONS()} + In most cases you can simply follow the + Arduino Guide + on serial port permissions. +

Special systems:

{/if} + {#if rebootInfo} +

{$LL.deviceManager.bootMenu.POWER_WARNING()}

+ {/if}
{#if $serialPort} restart_alt{$LL.deviceManager.bootMenu.REBOOT()} - rule_settings{$LL.deviceManager.bootMenu.BOOTLOADER()} {/if} @@ -126,7 +142,8 @@ details a { display: inline; - padding-inline-start: 0; + padding-inline: 0; + text-decoration: underline; } section { @@ -135,8 +152,7 @@ align-items: flex-start; justify-content: flex-start; - min-width: 260px; - max-width: 400px; + width: 300px; } summary {