mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-27 20:36:31 -08:00
Add 'Latest' flair/tag to sorted first version in DIY firmware tool
This commit is contained in:
2 files changed
+18
-3
No files matched your search
@@ -1415,6 +1415,7 @@ firmware_tool-select_source-firmware = Firmware Source
|
||||
firmware_tool-select_source-version = Firmware Version
|
||||
firmware_tool-select_source-official = Official
|
||||
firmware_tool-select_source-dev = Dev
|
||||
firmware_tool-select_source-latest = Latest
|
||||
firmware_tool-select_source-not_selected = No source selected
|
||||
firmware_tool-select_source-no_boards = No available boards for this source
|
||||
firmware_tool-select_source-no_versions = No available versions for this source
|
||||
|
||||
@@ -22,7 +22,7 @@ function Selector({
|
||||
text: string;
|
||||
active: boolean;
|
||||
official?: boolean;
|
||||
tag?: 'official' | 'dev';
|
||||
tag?: 'official' | 'dev' | 'latest';
|
||||
disabled?: boolean;
|
||||
onClick: () => void;
|
||||
}) {
|
||||
@@ -64,6 +64,18 @@ function Selector({
|
||||
</Localized>
|
||||
</div>
|
||||
)}
|
||||
{tag === 'latest' && (
|
||||
<div
|
||||
className={classNames(
|
||||
'absolute px-2 py-0.5 rounded-md bg-accent-background-20 -top-2 -right-2',
|
||||
{ 'brightness-20': disabled, 'brightness-50': !active }
|
||||
)}
|
||||
>
|
||||
<Localized id="firmware_tool-select_source-latest">
|
||||
<Typography />
|
||||
</Localized>
|
||||
</div>
|
||||
)}
|
||||
{text}
|
||||
</div>
|
||||
);
|
||||
@@ -269,7 +281,7 @@ export function SelectSourceSetep({
|
||||
<Typography variant="section-title" />
|
||||
</Localized>
|
||||
<div className="flex flex-col gap-4 md:max-h-[305px] overflow-y-auto bg-background-80 rounded-lg p-4">
|
||||
{possibleVersions?.map(({ name, disabled }) => (
|
||||
{possibleVersions?.map(({ name, disabled }, i) => (
|
||||
<Selector
|
||||
active={partialBoard?.version === name}
|
||||
disabled={disabled}
|
||||
@@ -278,7 +290,9 @@ export function SelectSourceSetep({
|
||||
partialBoard?.source?.startsWith('SlimeVR/') &&
|
||||
name === 'llelievr/board-defaults'
|
||||
? 'dev'
|
||||
: undefined
|
||||
: i == 0
|
||||
? 'latest'
|
||||
: undefined
|
||||
}
|
||||
onClick={() => {
|
||||
setPartialBoard((curr) => ({
|
||||
|
||||
Reference in new issue
Block a user