Skip to content

Commit 25c659b

Browse files
committed
Revert "Progress"
This reverts commit e38a4b4.
1 parent e38a4b4 commit 25c659b

File tree

16 files changed

+1246
-836
lines changed

16 files changed

+1246
-836
lines changed

gui/.env

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# VITE_FIRMWARE_TOOL_URL=https://fw-tool-api.slimevr.io
2-
# VITE_FIRMWARE_TOOL_S3_URL=https://fw-tool-bucket.slimevr.io
3-
# FIRMWARE_TOOL_SCHEMA_URL=https://fw-tool-api.slimevr.io/api-json
1+
VITE_FIRMWARE_TOOL_URL=https://fw-tool-api.slimevr.io
2+
VITE_FIRMWARE_TOOL_S3_URL=https://fw-tool-bucket.slimevr.io
3+
FIRMWARE_TOOL_SCHEMA_URL=https://fw-tool-api.slimevr.io/api-json
44

55

6-
VITE_FIRMWARE_TOOL_URL=http://localhost:3000
7-
VITE_FIRMWARE_TOOL_S3_URL=http://localhost:9099
8-
FIRMWARE_TOOL_SCHEMA_URL=http://localhost:3000/api-json
6+
# VITE_FIRMWARE_TOOL_URL=http://localhost:3000
7+
# VITE_FIRMWARE_TOOL_S3_URL=http://localhost:9000
8+
# FIRMWARE_TOOL_SCHEMA_URL=http://localhost:3000/api-json

gui/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"@tauri-apps/plugin-store": "^2.0.0",
2626
"@tweenjs/tween.js": "^25.0.0",
2727
"@twemoji/svg": "^15.0.0",
28-
"ajv": "^8.17.1",
2928
"browser-fs-access": "^0.35.0",
3029
"classnames": "^2.5.1",
3130
"flatbuffers": "22.10.26",

gui/public/i18n/en/translation.ftl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ board_type-WEMOSD1MINI = Wemos D1 Mini
8989
board_type-TTGO_TBASE = TTGO T-Base
9090
board_type-ESP01 = ESP-01
9191
board_type-SLIMEVR = SlimeVR
92-
board_type-SLIMEVR_V1_2 = SlimeVR v1.2
9392
board_type-LOLIN_C3_MINI = Lolin C3 Mini
9493
board_type-BEETLE32C3 = Beetle ESP32-C3
9594
board_type-ESP32C3DEVKITM1 = Espressif ESP32-C3 DevKitM-1
@@ -384,8 +383,7 @@ tracker-settings-name_section-label = Tracker name
384383
tracker-settings-forget = Forget tracker
385384
tracker-settings-forget-description = Removes the tracker from the SlimeVR Server and prevents it from connecting until the server is restarted. The configuration of the tracker won't be lost.
386385
tracker-settings-forget-label = Forget tracker
387-
tracker-settings-update-unavailable-v2 = No releases found
388-
tracker-settings-update-incompatible = Cannot update. Incompatible board
386+
tracker-settings-update-unavailable = Cannot be updated (DIY)
389387
tracker-settings-update-low-battery = Cannot update. Battery lower than 50%
390388
tracker-settings-update-up_to_date = Up to date
391389
tracker-settings-update-blocked = Update not available. No other releases available

gui/src/components/firmware-tool/FirmwareTool.tsx

Lines changed: 44 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Typography } from '@/components/commons/Typography';
33
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
44
import {
55
FirmwareToolContextC,
6-
provideFirmwareTool,
6+
useFirmwareToolContext,
77
} from '@/hooks/firmware-tool';
88
import { AddImusStep } from './AddImusStep';
99
import { SelectBoardStep } from './SelectBoardStep';
@@ -15,87 +15,63 @@ import { SelectFirmwareStep } from './SelectFirmwareStep';
1515
import { BuildStep } from './BuildStep';
1616
import { FlashingMethodStep } from './FlashingMethodStep';
1717
import { FlashingStep } from './FlashingStep';
18+
import { FlashBtnStep } from './FlashBtnStep';
19+
import { FirmwareUpdateMethod } from 'solarxr-protocol';
1820
import { useMemo } from 'react';
19-
import {
20-
useGetHealth,
21-
useGetIsCompatibleVersion,
22-
} from '@/firmware-tool-api/firmwareToolComponents';
23-
import { SelectSourceSetep } from './steps/SelectSourceStep';
24-
import { BoardDefaultsStep } from './steps/BoardDefaultsStep';
2521

2622
function FirmwareToolContent() {
2723
const { l10n } = useLocalization();
28-
const context = provideFirmwareTool();
29-
const { isError, isLoading: isInitialLoading, refetch } = useGetHealth({});
30-
const compatibilityCheckEnabled = !!__VERSION_TAG__;
31-
const { isLoading: isCompatibilityLoading, data: compatibilityData } =
32-
useGetIsCompatibleVersion(
33-
{ pathParams: { version: __VERSION_TAG__ } },
34-
{ enabled: compatibilityCheckEnabled }
35-
);
36-
37-
const isLoading = isInitialLoading || isCompatibilityLoading;
38-
const isCompatible =
39-
!compatibilityCheckEnabled || (compatibilityData?.success ?? false);
24+
const context = useFirmwareToolContext();
25+
const { isError, isGlobalLoading: isLoading, retry, isCompatible } = context;
4026

4127
const steps = useMemo(() => {
4228
const steps = [
4329
{
44-
id: 'SelectSource',
45-
component: SelectSourceSetep,
46-
title: l10n.getString('firmware_tool-step-select_source'),
30+
id: 'SelectBoard',
31+
component: SelectBoardStep,
32+
title: l10n.getString('firmware_tool-board_step'),
33+
},
34+
{
35+
component: BoardPinsStep,
36+
title: l10n.getString('firmware_tool-board_pins_step'),
4737
},
4838
{
49-
component: BoardDefaultsStep,
50-
title: l10n.getString('firmware_tool-step-board_defaults'),
39+
component: AddImusStep,
40+
title: l10n.getString('firmware_tool-add_imus_step'),
41+
},
42+
{
43+
id: 'SelectFirmware',
44+
component: SelectFirmwareStep,
45+
title: l10n.getString('firmware_tool-select_firmware_step'),
46+
},
47+
{
48+
component: FlashingMethodStep,
49+
id: 'FlashingMethod',
50+
title: l10n.getString('firmware_tool-flash_method_step'),
51+
},
52+
{
53+
component: BuildStep,
54+
title: l10n.getString('firmware_tool-build_step'),
55+
},
56+
{
57+
component: FlashingStep,
58+
title: l10n.getString('firmware_tool-flashing_step'),
5159
},
52-
// {
53-
// component: BoardPinsStep,
54-
// title: l10n.getString('firmware_tool-board_pins_step'),
55-
// },
56-
// {
57-
// component: AddImusStep,
58-
// title: l10n.getString('firmware_tool-add_imus_step'),
59-
// },
60-
// {
61-
// id: 'SelectFirmware',
62-
// component: SelectFirmwareStep,
63-
// title: l10n.getString('firmware_tool-select_firmware_step'),
64-
// },
65-
// {
66-
// component: FlashingMethodStep,
67-
// id: 'FlashingMethod',
68-
// title: l10n.getString('firmware_tool-flash_method_step'),
69-
// },
70-
// {
71-
// component: BuildStep,
72-
// title: l10n.getString('firmware_tool-build_step'),
73-
// },
74-
// {
75-
// component: FlashingStep,
76-
// title: l10n.getString('firmware_tool-flashing_step'),
77-
// },
7860
];
7961

80-
// if (
81-
// context.defaultConfig?.needBootPress &&
82-
// context.selectedDevices?.find(
83-
// ({ type }) => type === FirmwareUpdateMethod.SerialFirmwareUpdate
84-
// )
85-
// ) {
86-
// steps.splice(5, 0, {
87-
// component: FlashBtnStep,
88-
// title: l10n.getString('firmware_tool-flashbtn_step'),
89-
// });
90-
// }
62+
if (
63+
context.defaultConfig?.needBootPress &&
64+
context.selectedDevices?.find(
65+
({ type }) => type === FirmwareUpdateMethod.SerialFirmwareUpdate
66+
)
67+
) {
68+
steps.splice(5, 0, {
69+
component: FlashBtnStep,
70+
title: l10n.getString('firmware_tool-flashbtn_step'),
71+
});
72+
}
9173
return steps;
92-
}, [
93-
/* context.defaultConfig?.needBootPress, context.selectedDevices */ l10n,
94-
]);
95-
96-
const retry = async () => {
97-
await refetch();
98-
};
74+
}, [context.defaultConfig?.needBootPress, context.selectedDevices, l10n]);
9975

10076
return (
10177
<FirmwareToolContextC.Provider value={context}>

gui/src/components/firmware-tool/FlashBtnStep.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ export function FlashBtnStep({
2626
{l10n.getString('firmware_tool-flashbtn_step-description')}
2727
</Typography>
2828
{defaultConfig?.boardConfig.type ===
29-
boardTypeToFirmwareToolBoardType[BoardType.SLIMEVR] ||
30-
defaultConfig?.boardConfig.type ===
31-
boardTypeToFirmwareToolBoardType[BoardType.SLIMEVR_V1_2] ? (
29+
boardTypeToFirmwareToolBoardType[BoardType.SLIMEVR] ? (
3230
<>
3331
<Typography variant="standard" whitespace="whitespace-pre">
3432
{l10n.getString('firmware_tool-flashbtn_step-board_SLIMEVR')}

gui/src/components/firmware-tool/steps/BoardDefaultsStep.tsx

Lines changed: 0 additions & 173 deletions
This file was deleted.

0 commit comments

Comments
 (0)