Small UI fixes (#1641)

This commit is contained in:
lucas lelievre authored and GitHub committed 2025-12-05 18:17:51 +01:00
1 parent 45f0e14582
commit 742a3fcafe
3 files changed
+87 -75

No files matched your search

+7 -5
View File
@@ -402,9 +402,11 @@ tracker-settings-update-incompatible = Cannot update. Incompatible board
tracker-settings-update-low-battery = Cannot update. Battery lower than 50%
tracker-settings-update-up_to_date = Up to date
tracker-settings-update-blocked = Update not available. No other releases available
tracker-settings-update-available = { $versionName } is now available
tracker-settings-update = Update now
tracker-settings-update-title = Firmware version
tracker-settings-current-version = Current
tracker-settings-latest-version = Latest
## Tracker part card info
tracker-part_card-no_name = No name
@@ -1412,13 +1414,13 @@ firmware_tool-flash_method_step-serial-v2 =
.description = Use a USB cable to update your tracker.
firmware_tool-flashbtn_step = Press the boot btn
firmware_tool-flashbtn_step = Press the boot button
firmware_tool-flashbtn_step-description = Before going to the next step, there are a few things you need to do
firmware_tool-flashbtn_step-board_SLIMEVR = Turn off the tracker, remove the case (if any), connect the USB cable to your computer, then follow the appropriate steps for your SlimeVR board revision:
firmware_tool-flashbtn_step-board_SLIMEVR-r11 = Turn on the tracker while shorting the second rectangular FLASH pad from the edge on the top side of the board to the metal shield of the microcontroller.
firmware_tool-flashbtn_step-board_SLIMEVR-r12 = Turn on the tracker while shorting the circular FLASH pad on the top side of the board to the metal shield of the microcontroller.
firmware_tool-flashbtn_step-board_SLIMEVR-r14 = Turn on the tracker while pushing in the FLASH button on the top side of the board.
firmware_tool-flashbtn_step-board_SLIMEVR-r11-v2 = Turn on the tracker while shorting the second rectangular FLASH pad from the edge on the top side of the board to the metal shield of the microcontroller. The tracker LED should do a short blink.
firmware_tool-flashbtn_step-board_SLIMEVR-r12-v2 = Turn on the tracker while shorting the circular FLASH pad on the top side of the board to the metal shield of the microcontroller. The tracker LED should do a short blink.
firmware_tool-flashbtn_step-board_SLIMEVR-r14-v2 = Turn on the tracker while pushing in the FLASH button on the top side of the board. The tracker LED should do a short blink.
firmware_tool-flashbtn_step-board_OTHER = Before flashing, you will probably need to put the tracker into bootloader mode.
Most of the time, this means pressing the boot button on the board before the flashing process starts.
@@ -21,7 +21,7 @@ export function FlashBtnStep({
{selectedSource?.source.board === 'BOARD_SLIMEVR' ||
selectedSource?.source.board === 'BOARD_SLIMEVR_V1_2' ? (
<>
<Typography variant="standard" whitespace="whitespace-pre">
<Typography variant="standard" whitespace="whitespace-pre-wrap">
{l10n.getString('firmware_tool-flashbtn_step-board_SLIMEVR')}
</Typography>
<div className="gap-2 grid lg:grid-cols-3 md:grid-cols-2 mobile:grid-cols-1">
@@ -29,7 +29,7 @@ export function FlashBtnStep({
<Typography variant="main-title">R11</Typography>
<Typography variant="standard">
{l10n.getString(
'firmware_tool-flashbtn_step-board_SLIMEVR-r11'
'firmware_tool-flashbtn_step-board_SLIMEVR-r11-v2'
)}
</Typography>
<img src="/images/R11_board_reset.webp" />
@@ -38,7 +38,7 @@ export function FlashBtnStep({
<Typography variant="main-title">R12</Typography>
<Typography variant="standard">
{l10n.getString(
'firmware_tool-flashbtn_step-board_SLIMEVR-r12'
'firmware_tool-flashbtn_step-board_SLIMEVR-r12-v2'
)}
</Typography>
<img src="/images/R12_board_reset.webp" />
@@ -48,7 +48,7 @@ export function FlashBtnStep({
<Typography variant="main-title">R14</Typography>
<Typography variant="standard">
{l10n.getString(
'firmware_tool-flashbtn_step-board_SLIMEVR-r14'
'firmware_tool-flashbtn_step-board_SLIMEVR-r14-v2'
)}
</Typography>
<img src="/images/R14_board_reset_sw.webp" />
+76 -66
View File
@@ -1,4 +1,4 @@
import { Localized, useLocalization } from '@fluent/react';
import { useLocalization } from '@fluent/react';
import classNames from 'classnames';
import { IPv4 } from 'ip-num';
import { useEffect, useMemo, useState } from 'react';
@@ -39,6 +39,7 @@ import { MagnetometerToggleSetting } from '@/components/settings/pages/Magnetome
import { useSetAtom } from 'jotai';
import { ignoredTrackersAtom } from '@/store/app-store';
import { checkForUpdate } from '@/hooks/firmware-update';
import { Tooltip } from '@/components/commons/Tooltip';
const rotationsLabels: [Quaternion, string][] = [
[rotationToQuatMap.BACK, 'tracker-rotation-back'],
@@ -200,75 +201,84 @@ export function TrackerSettingsPage() {
)}
{
<div className="flex flex-col bg-background-70 p-3 rounded-lg gap-2">
<Localized id="tracker-settings-update-title">
<Typography variant="section-title">
Firmware version
</Typography>
</Localized>
<div className="flex gap-2">
<Typography>
v{tracker?.device?.hardwareInfo?.firmwareVersion}
</Typography>
<Typography>-</Typography>
{updateUnavailable && (
<Localized id="tracker-settings-update-unavailable-v2">
<Typography>No releases found</Typography>
</Localized>
)}
{!updateUnavailable && (
<>
{needUpdate === 'unavailable' && (
<Localized id="tracker-settings-update-incompatible">
<Typography>
Cannot be updated, Incompatible board
<Typography
variant="section-title"
id="tracker-settings-update-title"
>
Firmware version
</Typography>
<div className="flex gap-2 flex-col">
<div className="flex justify-between gap-2">
<Typography id="tracker-settings-current-version" />
<Typography
whitespace="whitespace-pre-wrap"
textAlign="text-end"
>
v{tracker?.device?.hardwareInfo?.firmwareVersion}
</Typography>
</div>
<div className="flex justify-between gap-2">
<Typography id="tracker-settings-latest-version" />
{!updateUnavailable && (
<>
{currentFirmwareRelease && (
<Typography
color={
needUpdate === 'updated'
? undefined
: 'text-accent-background-10'
}
textAlign="text-end"
whitespace="whitespace-pre-wrap"
>
{currentFirmwareRelease.name}
</Typography>
</Localized>
)}
{needUpdate === 'blocked' && (
// This happens only if no update is available and or the user is not in the current stagged
<Localized id="tracker-settings-update-blocked">
<Typography>
Update not available. No other releases available
</Typography>
</Localized>
)}
{needUpdate === 'updated' && (
<Localized id="tracker-settings-update-up_to_date">
<Typography>Up to date</Typography>
</Localized>
)}
{needUpdate === 'can-update' && currentFirmwareRelease && (
<Localized
id="tracker-settings-update-available"
vars={{ versionName: currentFirmwareRelease.name }}
>
<Typography color="text-accent-background-10">
New version available
</Typography>
</Localized>
)}
{needUpdate === 'low-battery' && currentFirmwareRelease && (
<Localized
id="tracker-settings-update-low-battery"
vars={{ versionName: currentFirmwareRelease.name }}
>
<Typography color="text-status-critical" />
</Localized>
)}
</>
)}
)}
</>
)}
{updateUnavailable && (
<Typography id="tracker-settings-update-unavailable-v2">
No releases found
</Typography>
)}
</div>
</div>
<Localized id="tracker-settings-update">
<Button
variant={
needUpdate === 'can-update' ? 'primary' : 'secondary'
{!updateUnavailable && (
<Tooltip
preferedDirection="top"
disabled={
needUpdate === 'can-update' || needUpdate === 'updated'
}
content={
<>
{needUpdate === 'unavailable' && (
<Typography id="tracker-settings-update-unavailable-v2" />
)}
{needUpdate === 'blocked' && (
// This happens only if no update is available and or the user is not in the current stagged
<Typography id="tracker-settings-update-blocked" />
)}
{needUpdate === 'low-battery' &&
currentFirmwareRelease && (
<Typography id="tracker-settings-update-low-battery" />
)}
</>
}
disabled={needUpdate !== 'can-update'}
to="/firmware-update"
>
Update now
</Button>
</Localized>
<Button
variant={
needUpdate === 'can-update' ? 'primary' : 'secondary'
}
disabled={needUpdate !== 'can-update'}
to="/firmware-update"
id={
needUpdate === 'updated'
? 'tracker-settings-update-up_to_date'
: 'tracker-settings-update'
}
/>
</Tooltip>
)}
</div>
}