mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-01-07 10:32:49 +00:00
feat: bootloader warning
refactor: reword linux premission warning
This commit is contained in:
@@ -67,6 +67,7 @@ const de = {
|
|||||||
TITLE: "Bootmenü",
|
TITLE: "Bootmenü",
|
||||||
REBOOT: "Neustarten",
|
REBOOT: "Neustarten",
|
||||||
BOOTLOADER: "Bootloader",
|
BOOTLOADER: "Bootloader",
|
||||||
|
POWER_WARNING: "Um vom Bootloader aus neu zu starten muss das Gerät neu verbunden werden.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
browserWarning: {
|
browserWarning: {
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ const en = {
|
|||||||
TERMINAL: "Terminal",
|
TERMINAL: "Terminal",
|
||||||
APPLY_SETTINGS: "Flash changes to device",
|
APPLY_SETTINGS: "Flash changes to device",
|
||||||
NO_DEVICE: "No device connected",
|
NO_DEVICE: "No device connected",
|
||||||
LINUX_PERMISSIONS:
|
LINUX_PERMISSIONS: "Most Linux based systems need adjusted permissions in order to connect your device.",
|
||||||
"On most Linux based systems need to adjust permissions in order to connnect your device.",
|
|
||||||
bootMenu: {
|
bootMenu: {
|
||||||
TITLE: "Boot Menu",
|
TITLE: "Boot Menu",
|
||||||
REBOOT: "Reboot",
|
REBOOT: "Reboot",
|
||||||
BOOTLOADER: "Bootloader",
|
BOOTLOADER: "Bootloader",
|
||||||
|
POWER_WARNING: "To reboot from bootloader you need to physically reconnect your device.",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
browserWarning: {
|
browserWarning: {
|
||||||
|
|||||||
@@ -5,8 +5,26 @@
|
|||||||
import {preference} from "$lib/preferences"
|
import {preference} from "$lib/preferences"
|
||||||
import LL from "../i18n/i18n-svelte"
|
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 terminal = false
|
||||||
let powerDialog = false
|
let powerDialog = false
|
||||||
|
|
||||||
|
$: if ($serialPort) {
|
||||||
|
rebootInfo = false
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
@@ -26,18 +44,19 @@
|
|||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if browser}
|
{#if browser}
|
||||||
{#if navigator.userAgent.includes("Linux")}
|
{#if navigator.userAgent.includes("Linux") && !$serialPort}
|
||||||
<details class="linux-info">
|
<details class="linux-info" transition:slide>
|
||||||
<summary>{@html $LL.deviceManager.LINUX_PERMISSIONS()}</summary>
|
<summary>{@html $LL.deviceManager.LINUX_PERMISSIONS()}</summary>
|
||||||
|
In most cases you can simply follow the
|
||||||
|
<a target="_blank" href="https://docs.arduino.cc/software/ide-v1/tutorials/Linux#please-read"
|
||||||
|
>Arduino Guide</a
|
||||||
|
>
|
||||||
|
on serial port permissions.
|
||||||
|
<p>Special systems:</p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>
|
|
||||||
<a target="_blank" href="https://docs.arduino.cc/software/ide-v1/tutorials/Linux#please-read"
|
|
||||||
>Debian (Ubuntu, Mint, Pop!_OS, ...), Fedora, OpenSUSE</a
|
|
||||||
>
|
|
||||||
</li>
|
|
||||||
<li>
|
<li>
|
||||||
<a target="_blank" href="https://wiki.archlinux.org/title/Arduino#Accessing_serial"
|
<a target="_blank" href="https://wiki.archlinux.org/title/Arduino#Accessing_serial"
|
||||||
>Arch (Manjaro, EndeavourOS, ...)</a
|
>Arch and Arch-based like Manjaro or EndeavourOS</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
@@ -55,6 +74,9 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</details>
|
</details>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if rebootInfo}
|
||||||
|
<p transition:slide><b>{$LL.deviceManager.bootMenu.POWER_WARNING()}</b></p>
|
||||||
|
{/if}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
{#if $serialPort}
|
{#if $serialPort}
|
||||||
<button
|
<button
|
||||||
@@ -98,17 +120,11 @@
|
|||||||
/>
|
/>
|
||||||
<dialog open transition:slide={{duration: 250}}>
|
<dialog open transition:slide={{duration: 250}}>
|
||||||
<h3>{$LL.deviceManager.bootMenu.TITLE()}</h3>
|
<h3>{$LL.deviceManager.bootMenu.TITLE()}</h3>
|
||||||
<button
|
<button on:click={reboot}
|
||||||
on:click={() => {
|
><span class="icon">restart_alt</span>{$LL.deviceManager.bootMenu.REBOOT()}</button
|
||||||
$serialPort?.reboot()
|
|
||||||
$serialPort = undefined
|
|
||||||
}}><span class="icon">restart_alt</span>{$LL.deviceManager.bootMenu.REBOOT()}</button
|
|
||||||
>
|
>
|
||||||
<button
|
<button on:click={bootloader}
|
||||||
on:click={() => {
|
><span class="icon">rule_settings</span>{$LL.deviceManager.bootMenu.BOOTLOADER()}</button
|
||||||
$serialPort?.bootloader()
|
|
||||||
$serialPort = undefined
|
|
||||||
}}><span class="icon">rule_settings</span>{$LL.deviceManager.bootMenu.BOOTLOADER()}</button
|
|
||||||
>
|
>
|
||||||
</dialog>
|
</dialog>
|
||||||
{/if}
|
{/if}
|
||||||
@@ -126,7 +142,8 @@
|
|||||||
|
|
||||||
details a {
|
details a {
|
||||||
display: inline;
|
display: inline;
|
||||||
padding-inline-start: 0;
|
padding-inline: 0;
|
||||||
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
section {
|
section {
|
||||||
@@ -135,8 +152,7 @@
|
|||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
|
|
||||||
min-width: 260px;
|
width: 300px;
|
||||||
max-width: 400px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
summary {
|
summary {
|
||||||
|
|||||||
Reference in New Issue
Block a user