@balena/ui-shared-components 12.0.2-build-renovate-major-7-react-router-dom-591a9d391de2d33bdec9daa8f13684f5a2112f33-1 → 12.1.0-build-secure-boot-0f91aab21d2d77cbaaebddf68775aec0ba8c81ab-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DownloadImageDialog/ApplicationInstructions.d.ts +1 -0
- package/dist/components/DownloadImageDialog/ApplicationInstructions.js +25 -33
- package/dist/components/DownloadImageDialog/ImageForm.d.ts +2 -0
- package/dist/components/DownloadImageDialog/ImageForm.js +151 -82
- package/dist/components/DownloadImageDialog/VariantSelector.js +1 -1
- package/dist/components/DownloadImageDialog/index.d.ts +1 -0
- package/dist/components/DownloadImageDialog/index.js +9 -3
- package/package.json +4 -3
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import has from 'lodash/has';
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
2
|
import { interpolateMustache } from './utils';
|
|
4
3
|
import { Box, List, Tab, Tabs, Typography } from '@mui/material';
|
|
5
4
|
import { memo, useEffect, useMemo, useState } from 'react';
|
|
6
5
|
import { MUILinkWithTracking } from '../MUILinkWithTracking';
|
|
7
6
|
import { OrderedListItem } from '../OrderedListItem';
|
|
8
7
|
import { Markdown } from '../Markdown';
|
|
8
|
+
import { Chip } from '../Chip';
|
|
9
9
|
export const getUserOs = () => {
|
|
10
10
|
const platform = window.navigator.platform.toLowerCase();
|
|
11
11
|
if (platform.includes('win')) {
|
|
@@ -19,12 +19,13 @@ export const getUserOs = () => {
|
|
|
19
19
|
}
|
|
20
20
|
return 'Unknown';
|
|
21
21
|
};
|
|
22
|
+
const SECURE_BOOT_INSTRUCTION_TO_REPLACE_START = 'Press the F10 key while BIOS';
|
|
22
23
|
const dtJsonTocontractOsKeyMap = {
|
|
23
24
|
windows: 'Windows',
|
|
24
25
|
osx: 'MacOS',
|
|
25
26
|
linux: 'Linux',
|
|
26
27
|
};
|
|
27
|
-
export const ApplicationInstructions = memo(function ApplicationInstructions({ deviceType, templateData, }) {
|
|
28
|
+
export const ApplicationInstructions = memo(function ApplicationInstructions({ deviceType, templateData, secureboot, }) {
|
|
28
29
|
var _a;
|
|
29
30
|
const [currentOs, setCurrentOs] = useState(getUserOs());
|
|
30
31
|
const instructions = useMemo(() => {
|
|
@@ -64,37 +65,28 @@ export const ApplicationInstructions = memo(function ApplicationInstructions({ d
|
|
|
64
65
|
setCurrentOs(value !== null && value !== void 0 ? value : 'Unknown');
|
|
65
66
|
}, "aria-label": "os tabs", children: Object.keys(instructions).map((os) => {
|
|
66
67
|
return _jsx(Tab, { label: os, value: os }, os);
|
|
67
|
-
}) }) }) })), _jsx(InstructionsList, { instructions: finalInstructions }), _jsx(Box, { mt: 2, children: _jsxs(Typography, { children: ["For more details please refer to our", ' ', _jsx(MUILinkWithTracking, { href: `https://www.balena.io/docs/learn/getting-started/${deviceType.slug}/nodejs/`, children: "Getting Started Guide" }), "."] }) })] }));
|
|
68
|
+
}) }) }) })), _jsx(InstructionsList, { instructions: finalInstructions, secureboot: secureboot }), _jsx(Box, { mt: 2, children: _jsxs(Typography, { children: ["For more details please refer to our", ' ', _jsx(MUILinkWithTracking, { href: `https://www.balena.io/docs/learn/getting-started/${deviceType.slug}/nodejs/`, children: "Getting Started Guide" }), "."] }) })] }));
|
|
68
69
|
});
|
|
69
|
-
const InstructionsItem = ({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} }, codeProps)));
|
|
87
|
-
},
|
|
88
|
-
br: () => {
|
|
89
|
-
return _jsx("p", {});
|
|
90
|
-
},
|
|
91
|
-
p: ({ children }) => (_jsx("p", { style: { marginTop: 0, marginBottom: 0 }, children: children })),
|
|
92
|
-
}, children: text }), hasChildren && (_jsx(List, { children: node.children.map((item, i) => {
|
|
93
|
-
return _jsx(InstructionsItem, { node: item, index: i }, i);
|
|
94
|
-
}) }))] }));
|
|
70
|
+
const InstructionsItem = ({ instruction, index, secureboot, }) => {
|
|
71
|
+
return (_jsx(OrderedListItem, { index: index + 1, sx: { maxWidth: '100%' }, children: _jsx(Markdown, { components: {
|
|
72
|
+
code: (codeProps) => {
|
|
73
|
+
return (_jsx("code", Object.assign({ style: {
|
|
74
|
+
maxWidth: '100%',
|
|
75
|
+
display: 'inline-block',
|
|
76
|
+
whiteSpace: 'normal',
|
|
77
|
+
wordBreak: 'break-all',
|
|
78
|
+
wordWrap: 'break-word',
|
|
79
|
+
} }, codeProps)));
|
|
80
|
+
},
|
|
81
|
+
br: () => {
|
|
82
|
+
return _jsx("p", {});
|
|
83
|
+
},
|
|
84
|
+
p: ({ children }) => (_jsx("p", { style: { marginTop: 0, marginBottom: 0 }, children: secureboot &&
|
|
85
|
+
instruction.includes(SECURE_BOOT_INSTRUCTION_TO_REPLACE_START) ? (_jsxs(_Fragment, { children: [instruction.split(SECURE_BOOT_INSTRUCTION_TO_REPLACE_START)[0], _jsxs(Box, { mt: 2, borderLeft: 1, borderColor: "divider", pl: 2, children: [_jsx(Chip, { sx: { marginRight: 1 }, label: "Secure Boot", color: "purple" }), "The device needs to be configured in secure boot setup mode. This depends on the UEFI/BIOS implementation, but in general, this involves resetting the UEFI settings to default configuration, configuring the device to boot in UEFI mode, setting the first boot option to the USB key and disabling the restoration of factory keys. Save and Exit the UEFI/BIOS menu and the device should automatically reboot and begin the provisioning process.", ' ', _jsx(MUILinkWithTracking, { href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/generic-x86-64-gpt/#provision-the-device", children: "Read more on UEFI settings for secure boot and full disk encryption." })] })] })) : (children) })),
|
|
86
|
+
}, children: instruction }) }));
|
|
95
87
|
};
|
|
96
|
-
const InstructionsList = ({ instructions }) => {
|
|
97
|
-
return (_jsx(List, { children: instructions.map((
|
|
98
|
-
return _jsx(InstructionsItem, {
|
|
88
|
+
const InstructionsList = ({ instructions, secureboot, }) => {
|
|
89
|
+
return (_jsx(List, { children: instructions.map((instruction, i) => {
|
|
90
|
+
return (_jsx(InstructionsItem, { instruction: instruction, index: i, secureboot: secureboot }, `${instruction}_${i}`));
|
|
99
91
|
}) }));
|
|
100
92
|
};
|
|
@@ -16,5 +16,7 @@ interface ImageFormProps {
|
|
|
16
16
|
onSelectedOsTypeChange: (osType: string) => void;
|
|
17
17
|
onChange: (key: keyof DownloadImageFormModel, value: DownloadImageFormModel[keyof DownloadImageFormModel]) => void;
|
|
18
18
|
}
|
|
19
|
+
export declare const GENERIC_X86_SLUG = "generic-amd64";
|
|
20
|
+
export declare const GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION = "5.3.15";
|
|
19
21
|
export declare const ImageForm: import("react").NamedExoticComponent<ImageFormProps>;
|
|
20
22
|
export {};
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { __rest } from "tslib";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { Avatar, Box,
|
|
3
|
+
import { Avatar, Box, Checkbox, Chip, Divider, FormControl, FormControlLabel, FormLabel, InputAdornment, InputLabel, Radio, RadioGroup, TextField, Tooltip, Typography, IconButton, Autocomplete, Stack, Accordion, AccordionSummary, AccordionDetails, Switch, Dialog, DialogTitle, DialogContent, DialogActions, Button, } from '@mui/material';
|
|
4
4
|
import HelpIcon from '@mui/icons-material/Help';
|
|
5
5
|
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
|
|
6
6
|
import { getPreferredVersionOpts, transformVersions } from './version';
|
|
7
7
|
import { OsTypeSelector } from './OsTypeSelector';
|
|
8
8
|
import { VariantSelector } from './VariantSelector';
|
|
9
|
-
import AddIcon from '@mui/icons-material/Add';
|
|
10
|
-
import RemoveIcon from '@mui/icons-material/Remove';
|
|
11
9
|
import ArticleIcon from '@mui/icons-material/Article';
|
|
12
10
|
import { MUILinkWithTracking } from '../MUILinkWithTracking';
|
|
13
11
|
import { Visibility, VisibilityOff } from '@mui/icons-material';
|
|
14
12
|
import { FALLBACK_LOGO_UNKNOWN_DEVICE } from './utils';
|
|
15
13
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
16
|
-
import { faTriangleExclamation } from '@fortawesome/free-solid-svg-icons';
|
|
14
|
+
import { faChevronRight, faTriangleExclamation, } from '@fortawesome/free-solid-svg-icons';
|
|
15
|
+
import * as semver from 'balena-semver';
|
|
17
16
|
import { Callout } from '../Callout';
|
|
18
17
|
import { token } from '../../utils/token';
|
|
18
|
+
import { getFromLocalStorage, setToLocalStorage } from '../../utils/storage';
|
|
19
|
+
import { NewChip } from '../NewChip';
|
|
20
|
+
import { useAnalyticsContext } from '../../contexts/AnalyticsContext';
|
|
19
21
|
const POLL_INTERVAL_DOCS = 'https://www.balena.io/docs/reference/supervisor/bandwidth-reduction/#side-effects--warnings';
|
|
22
|
+
const SECURE_BOOT_AND_FULL_DISK_ENCRYPTION_DOCS = 'https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/';
|
|
20
23
|
const getCategorizedVersions = (deviceTypeOsVersions, deviceType, osType) => {
|
|
21
24
|
var _a;
|
|
22
25
|
const osVersions = (_a = deviceTypeOsVersions[deviceType.slug]) !== null && _a !== void 0 ? _a : [];
|
|
@@ -36,9 +39,14 @@ const lineMap = {
|
|
|
36
39
|
sunset: 'yellow',
|
|
37
40
|
outdated: 'red',
|
|
38
41
|
};
|
|
42
|
+
export const GENERIC_X86_SLUG = 'generic-amd64';
|
|
43
|
+
export const GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION = '5.3.15';
|
|
39
44
|
export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVersions, isInitialDefault, osType, osTypes, hasEsrVersions, model, formElement, downloadUrl, applicationId, authToken, onSelectedOsTypeChange, onChange, }) {
|
|
40
45
|
var _a, _b;
|
|
46
|
+
const { state } = useAnalyticsContext();
|
|
41
47
|
const [showAdvancedSettings, setShowAdvancedSettings] = useState(false);
|
|
48
|
+
const [showSecureBootConfirmationDialog, setShowSecureBootConfirmationDialog,] = useState(false);
|
|
49
|
+
const [dontShowSecureBootWarningAgain, setDontShowSecureBootWarningAgain] = useState(false);
|
|
42
50
|
const [showPassword, setShowPassword] = useState(false);
|
|
43
51
|
const [version, setVersion] = useState();
|
|
44
52
|
const [variant, setVariant] = useState('prod');
|
|
@@ -46,6 +54,15 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
|
|
|
46
54
|
const { selectionOpts, preferredSelectionOpts } = useMemo(() => getCategorizedVersions(osVersions, model.deviceType, osType), [osVersions, model.deviceType, osType]);
|
|
47
55
|
const versionSelectionOpts = useMemo(() => (showAllVersions ? selectionOpts : preferredSelectionOpts), [preferredSelectionOpts, selectionOpts, showAllVersions]);
|
|
48
56
|
const showAllVersionsToggle = useMemo(() => preferredSelectionOpts.length < selectionOpts.length, [preferredSelectionOpts.length, selectionOpts.length]);
|
|
57
|
+
const supportsSecureBoot = useMemo(() => {
|
|
58
|
+
return (model.deviceType.slug === GENERIC_X86_SLUG &&
|
|
59
|
+
semver.gte(model.version, GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION));
|
|
60
|
+
}, [model.deviceType.slug, model.version]);
|
|
61
|
+
const secureBootDontShowAgainKey = `${model.deviceType.slug}_secureboot_warning_do_not_show_again`;
|
|
62
|
+
const dismissSecureBootWarning = useCallback((accepted, dontShowAgain) => {
|
|
63
|
+
var _a;
|
|
64
|
+
(_a = state.webTracker) === null || _a === void 0 ? void 0 : _a.track('Application Add Device Modal Hide Secure Boot Warning', { accepted, dontShowAgain });
|
|
65
|
+
}, [state.webTracker]);
|
|
49
66
|
const handleVariantChange = useCallback((v) => {
|
|
50
67
|
setVariant(v);
|
|
51
68
|
onChange('developmentMode', v === 'dev');
|
|
@@ -99,86 +116,138 @@ export const ImageForm = memo(function ImageForm({ compatibleDeviceTypes, osVers
|
|
|
99
116
|
onChange('deviceType', newDeviceType);
|
|
100
117
|
}, [compatibleDeviceTypes, model.deviceType.slug, onChange]);
|
|
101
118
|
const recommendedVersion = useMemo(() => { var _a; return (_a = versionSelectionOpts.find((v) => { var _a; return !((_a = v.knownIssueList) === null || _a === void 0 ? void 0 : _a.length); })) === null || _a === void 0 ? void 0 : _a.value; }, [versionSelectionOpts]);
|
|
102
|
-
return (_jsxs(Box, { action: downloadUrl, method: "post", component: "form", noValidate: true, autoComplete: "off", p: 2, ref: formElement, children: [_jsx("input", { type: "hidden", name: "deviceType", value: model.deviceType.slug }), _jsx("input", { type: "hidden", name: "_token", value: authToken }), _jsx("input", { type: "hidden", name: "appId", value: applicationId }), _jsx("input", { type: "hidden", name: "fileType", value: ".zip" }), _jsx("input", { type: "hidden", name: "version", value: model.version }), _jsxs(Box, { py: 3, display: "flex", flexWrap: "wrap", gap: 2, children: [compatibleDeviceTypes && compatibleDeviceTypes.length > 1 && (_jsxs(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
119
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Box, { action: downloadUrl, method: "post", component: "form", noValidate: true, autoComplete: "off", p: 2, ref: formElement, children: [_jsx("input", { type: "hidden", name: "deviceType", value: model.deviceType.slug }), _jsx("input", { type: "hidden", name: "_token", value: authToken }), _jsx("input", { type: "hidden", name: "appId", value: applicationId }), _jsx("input", { type: "hidden", name: "fileType", value: ".zip" }), _jsx("input", { type: "hidden", name: "version", value: model.version }), _jsxs(Box, { py: 3, display: "flex", flexWrap: "wrap", gap: 2, children: [compatibleDeviceTypes && compatibleDeviceTypes.length > 1 && (_jsxs(Stack, { flex: "1", maxWidth: "100%", children: [_jsxs(InputLabel, { htmlFor: "device-type-select", sx: { display: 'flex', alignItems: 'center', mb: 2 }, children: ["Device type", ' ', _jsx(Tooltip, { title: "Applications can support any devices that share the same architecture as their default device type.", children: _jsx(HelpIcon, { color: "info", sx: { fontSize: '1rem', marginLeft: 1 } }) })] }), _jsx(Autocomplete, { fullWidth: true, id: "device-type-select", value: model.deviceType, options: compatibleDeviceTypes, getOptionLabel: (option) => option.name, renderOption: (props, option) => {
|
|
120
|
+
var _a;
|
|
121
|
+
return (_jsxs(Box, Object.assign({ component: "li" }, props, { children: [_jsx(Avatar, { variant: "square", src: (_a = option.logo) !== null && _a !== void 0 ? _a : FALLBACK_LOGO_UNKNOWN_DEVICE, sx: { mr: 3, width: '20px', height: '20px' } }), _jsx(Typography, { noWrap: true, children: option.name })] })));
|
|
122
|
+
}, renderInput: (_a) => {
|
|
123
|
+
var _b;
|
|
124
|
+
var { InputProps } = _a, params = __rest(_a, ["InputProps"]);
|
|
125
|
+
return (_jsx(TextField, Object.assign({}, params, { slotProps: {
|
|
126
|
+
input: Object.assign(Object.assign({}, InputProps), { startAdornment: (_jsx(Avatar, { variant: "square", src: (_b = model.deviceType.logo) !== null && _b !== void 0 ? _b : FALLBACK_LOGO_UNKNOWN_DEVICE, sx: { mr: 3, width: '20px', height: '20px' } })) }),
|
|
127
|
+
} })));
|
|
128
|
+
}, onChange: (_event, value) => {
|
|
129
|
+
if (!value) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
handleSelectedDeviceTypeChange(value);
|
|
133
|
+
}, disableClearable: true,
|
|
134
|
+
// TODO: consider whether there is a better solution than letting the width vary as you search
|
|
135
|
+
slotProps: {
|
|
136
|
+
popper: { sx: { width: 'fit-content' } },
|
|
137
|
+
} })] })), (!isInitialDefault || osType) &&
|
|
138
|
+
hasEsrVersions &&
|
|
139
|
+
model.deviceType && (_jsx(OsTypeSelector, { supportedOsTypes: osTypes, hasEsrVersions: hasEsrVersions !== null && hasEsrVersions !== void 0 ? hasEsrVersions : false, selectedOsTypeSlug: osType, onSelectedOsTypeChange: onSelectedOsTypeChange }))] }), !isInitialDefault && version && (_jsxs(Box, { display: "flex", flexWrap: "wrap", maxWidth: "100%", children: [_jsxs(Stack, { maxWidth: "100%", flex: 1, children: [_jsx(InputLabel, { sx: { mb: 2 }, htmlFor: "e2e-download-image-versions-list", children: "Select version" }), _jsx(Autocomplete, { fullWidth: true, id: "e2e-download-image-versions-list", value: version, getOptionLabel: (option) => option.value, isOptionEqualToValue: (option, value) => option.value === value.value, options: versionSelectionOpts, onChange: (_event, ver) => {
|
|
140
|
+
handleVersionChange(ver);
|
|
141
|
+
}, placeholder: "Choose a version...", renderOption: (props, option) => (_jsx(Box, Object.assign({ component: "li" }, props, { children: _jsx(VersionSelectItem, { option: option, isRecommended: option.value === recommendedVersion }) }))), renderInput: (_a) => {
|
|
142
|
+
var { InputProps } = _a, params = __rest(_a, ["InputProps"]);
|
|
143
|
+
return (_jsx(TextField, Object.assign({}, params, { slotProps: {
|
|
144
|
+
input: Object.assign(Object.assign({}, InputProps), { endAdornment: (_jsxs(_Fragment, { children: [version.value === recommendedVersion && (_jsx(Chip, { sx: { ml: 1 }, color: "green", label: "recommended" })), !!(version === null || version === void 0 ? void 0 : version.knownIssueList) && (_jsx(Tooltip, { title: version.knownIssueList, children: _jsx(FontAwesomeIcon, { icon: faTriangleExclamation, color: token('color.icon.warning') }) })), InputProps.endAdornment] })) }),
|
|
145
|
+
} })));
|
|
146
|
+
}, disableClearable: true })] }), showAllVersionsToggle && (_jsx(Box, { mx: 2, display: "flex", alignItems: "center", alignSelf: "flex-end",
|
|
147
|
+
// TODO: find a better way to center the checkbox with the input only (without label)
|
|
148
|
+
height: 54, children: _jsx(FormControlLabel, { control: _jsx(Checkbox, { id: "e2e-show-all-versions-check", checked: showAllVersions, onChange: handleShowAllVersions }), label: "Show outdated versions" }) }))] })), _jsx(Divider, { variant: "fullWidth", sx: { my: 3, borderStyle: 'dashed' } }), (!isInitialDefault || !variant) && (_jsx(Box, { sx: { mt: 3 }, children: _jsx(VariantSelector, { version: version, variant: variant, onVariantChange: (v) => {
|
|
149
|
+
handleVariantChange(v ? 'dev' : 'prod');
|
|
150
|
+
} }) })), _jsx(Divider, { variant: "fullWidth", sx: { my: 3, borderStyle: 'dashed' } }), _jsxs(Stack, { children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { id: "network-radio-buttons-group-label", children: _jsx(Typography, { variant: "titleSm", children: "Network" }) }), _jsxs(RadioGroup, { "aria-labelledby": "network-radio-buttons-group-label", value: model.network, name: "network", onChange: (event) => {
|
|
151
|
+
onChange('network', event.target.value);
|
|
152
|
+
}, children: [_jsx(FormControlLabel, { value: "ethernet", control: _jsx(Radio, {}), label: "Ethernet only" }), _jsx(FormControlLabel, { value: "wifi", control: _jsx(Radio, {}), label: "Wifi + Ethernet" })] })] }), model.network === 'wifi' && (_jsxs(_Fragment, { children: [_jsx(InputLabel, { htmlFor: "device-wifi-ssid", sx: { mb: 2 }, children: "WiFi SSID" }), _jsx(TextField, { value: model.wifiSsid, id: "device-wifi-ssid", slotProps: {
|
|
153
|
+
htmlInput: {
|
|
154
|
+
name: 'wifiSsid',
|
|
155
|
+
autoComplete: 'wifiSsid-auto-complete',
|
|
156
|
+
},
|
|
157
|
+
}, onChange: (event) => {
|
|
158
|
+
onChange('wifiSsid', event.target.value);
|
|
159
|
+
} }), _jsx(InputLabel, { htmlFor: "device-wifi-password", sx: { my: 2 }, children: "Wifi Passphrase" }), _jsx(TextField, { type: showPassword ? 'text' : 'password', id: "device-wifi-password", value: model.wifiKey, slotProps: {
|
|
160
|
+
htmlInput: {
|
|
161
|
+
name: 'wifiKey',
|
|
162
|
+
},
|
|
163
|
+
// input and htmlInput are different https://mui.com/material-ui/api/text-field/#text-field-prop-slotProps
|
|
164
|
+
input: {
|
|
165
|
+
endAdornment: (_jsx(InputAdornment, { position: "end", children: _jsx(IconButton, { onClick: () => {
|
|
166
|
+
setShowPassword((show) => !show);
|
|
167
|
+
}, onMouseDown: (event) => {
|
|
168
|
+
event.preventDefault();
|
|
169
|
+
}, edge: "end", children: showPassword ? _jsx(VisibilityOff, {}) : _jsx(Visibility, {}) }) })),
|
|
170
|
+
},
|
|
171
|
+
}, onChange: (event) => {
|
|
172
|
+
onChange('wifiKey', event.target.value);
|
|
173
|
+
} })] }))] }), supportsSecureBoot && (_jsxs(_Fragment, { children: [_jsx(Divider, { variant: "fullWidth", sx: { my: 3, borderStyle: 'dashed' } }), _jsxs(FormControl, { children: [_jsx(FormLabel, { id: "secure-boot-and-full-disk-encryption-label", children: _jsxs(Stack, { direction: "row", alignItems: "center", gap: 1, children: [_jsx(Typography, { variant: "titleSm", children: "Secure Boot and Full Disk Encryption" }), _jsx(NewChip, { expiryTimestamp: "2025-06-01" })] }) }), _jsx(FormControlLabel, { control: _jsx(Switch, { onClick: (event) => {
|
|
174
|
+
if (!model.secureboot &&
|
|
175
|
+
!getFromLocalStorage(secureBootDontShowAgainKey)) {
|
|
147
176
|
event.preventDefault();
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
177
|
+
setShowSecureBootConfirmationDialog(true);
|
|
178
|
+
if (state.webTracker) {
|
|
179
|
+
state.webTracker.track('Application Add Device Modal Show Secure Boot Warning');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, onChange: (event) => {
|
|
183
|
+
onChange('secureboot', event.target.checked);
|
|
184
|
+
}, checked: model.secureboot }), label: _jsxs(Stack, { direction: "row", children: [_jsx(Typography, { children: "Enable Secure Boot and Full Disk Encryption" }), _jsx(MUILinkWithTracking, { eventProperties: {
|
|
185
|
+
source: 'Application Add Device Modal Secure Boot Doc Icon',
|
|
186
|
+
}, href: SECURE_BOOT_AND_FULL_DISK_ENCRYPTION_DOCS, sx: {
|
|
187
|
+
display: 'flex',
|
|
188
|
+
alignItems: 'center',
|
|
189
|
+
height: '1.5rem',
|
|
190
|
+
}, children: _jsx(ArticleIcon, { sx: { ml: 1, fontSize: '1.15rem' } }) })] }) })] })] })), _jsx(Divider, { variant: "fullWidth", sx: { my: 3, borderStyle: 'dashed' } }), _jsxs(Accordion, { disableGutters: true, elevation: 0, expanded: showAdvancedSettings, onChange: () => {
|
|
191
|
+
setShowAdvancedSettings(!showAdvancedSettings);
|
|
192
|
+
}, sx: {
|
|
193
|
+
border: 'none',
|
|
194
|
+
'&::before': {
|
|
195
|
+
display: 'none',
|
|
196
|
+
},
|
|
197
|
+
}, children: [_jsx(AccordionSummary, { expandIcon: _jsx(FontAwesomeIcon, { icon: faChevronRight }), sx: { flexDirection: 'row-reverse', gap: 1 }, children: _jsx(Typography, { variant: "titleSm", children: "Advanced settings" }) }), _jsx(AccordionDetails, { children: _jsxs(Stack, { children: [_jsxs(FormControl, { children: [_jsxs(FormLabel, { htmlFor: "poll-interval-label", sx: { display: 'flex', alignItems: 'center' }, children: ["Check for updates every X minutes", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
|
|
198
|
+
source: 'Application Add Device Modal Poll Interval Doc Icon',
|
|
199
|
+
}, href: POLL_INTERVAL_DOCS, sx: {
|
|
200
|
+
display: 'flex',
|
|
201
|
+
alignItems: 'center',
|
|
202
|
+
height: '1.5rem',
|
|
203
|
+
}, children: _jsx(ArticleIcon, { sx: { ml: 1, fontSize: '1.15rem' } }) })] }), _jsx(TextField, { id: "poll-interval-label", "aria-labelledby": "poll-interval-label", value: model.appUpdatePollInterval, slotProps: {
|
|
204
|
+
htmlInput: {
|
|
205
|
+
name: 'appUpdatePollInterval',
|
|
206
|
+
autoComplete: 'appUpdatePollInterval-auto-complete',
|
|
207
|
+
},
|
|
208
|
+
}, onChange: (event) => {
|
|
209
|
+
onChange('appUpdatePollInterval', event.target.value);
|
|
210
|
+
} })] }), _jsx(InputLabel, { htmlFor: "provision-key-name", sx: { my: 2 }, children: "Provisioning Key name" }), _jsx(TextField, { name: "provisioningKeyName", id: "provision-key-name", value: (_a = model.provisioningKeyName) !== null && _a !== void 0 ? _a : '', slotProps: {
|
|
211
|
+
htmlInput: {
|
|
212
|
+
name: 'provisioningKeyName',
|
|
213
|
+
autoComplete: 'provisioningKeyName-auto-complete',
|
|
214
|
+
},
|
|
215
|
+
}, onChange: (event) => {
|
|
216
|
+
onChange('provisioningKeyName', event.target.value);
|
|
217
|
+
} }), _jsx(InputLabel, { htmlFor: "provision-key-expiring", sx: { my: 2 }, children: "Provisioning Key expiring on" }), _jsx(TextField, { type: "date", id: "provision-key-expiring", value: (_b = model.provisioningKeyExpiryDate) !== null && _b !== void 0 ? _b : '', slotProps: {
|
|
218
|
+
htmlInput: {
|
|
219
|
+
name: 'provisioningKeyExpiryDate',
|
|
220
|
+
autoComplete: 'provisioningKeyExpiryDate-auto-complete',
|
|
221
|
+
},
|
|
222
|
+
}, onChange: (event) => {
|
|
223
|
+
onChange('provisioningKeyExpiryDate', event.target.value);
|
|
224
|
+
} })] }) })] })] }), _jsxs(Dialog, { open: showSecureBootConfirmationDialog, onClose: () => {
|
|
225
|
+
setShowSecureBootConfirmationDialog(false);
|
|
226
|
+
dismissSecureBootWarning(false, dontShowSecureBootWarningAgain);
|
|
227
|
+
setDontShowSecureBootWarningAgain(false);
|
|
228
|
+
}, children: [_jsx(DialogTitle, { children: "Enabling Secure Boot and Full Disk Encryption" }), _jsx(DialogContent, { children: _jsxs(Stack, { children: ["Enabling Secure Boot and Full Disk Encryption has important implications:", _jsxs("ul", { children: [_jsxs("li", { children: ["The image you are about to download is", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
|
|
229
|
+
source: "Application Add Device Modal Secure Boot Warning signed with balena's main platform key Link",
|
|
230
|
+
}, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/#keys-and-certificates-in-secure-boot", children: "signed with balena's main platform key" })] }), _jsx("li", { children: "Full Disk Encryption (FDE): All data on the disk will be encrypted with a unique key per device, ensuring that data extraction or retrieval from a powered-off device is impossible." }), _jsxs("li", { children: ["Secure Boot: Ensures only OS images signed by balena can unlock the disks and access data stored on the device. Hardened Mode Limitations:", _jsxs("ul", { children: [_jsx("li", { children: "Unsigned kernel modules cannot be loaded." }), _jsx("li", { children: "Boot parameters cannot be modified." }), _jsx("li", { children: "Debugging early boot processes is practically impossible." })] })] })] }), _jsxs(Typography, { children: ["If you need to load out-of-tree kernel drivers or require a unique signing key,", ' ', _jsx(MUILinkWithTracking, { eventProperties: {
|
|
231
|
+
source: 'Application Add Device Modal Secure Boot Warning Contact Us Link',
|
|
232
|
+
}, href: "mailto:sales@balena.io", target: "_self", children: "contact us" }), ' ', "to discuss your specific requirements."] }), _jsx(MUILinkWithTracking, { eventProperties: {
|
|
233
|
+
source: 'Application Add Device Modal Secure Boot Warning Learn More Link',
|
|
234
|
+
}, href: "https://docs.balena.io/reference/OS/secure-boot-and-full-disk-encryption/overview/", children: "Learn more about Secure Boot and Full Disk Encryption." }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { onChange: (event) => {
|
|
235
|
+
setDontShowSecureBootWarningAgain(event.target.checked);
|
|
236
|
+
} }), label: "Don't show me this warning again for this device type", sx: { mt: 2 } })] }) }), _jsxs(DialogActions, { children: [_jsx(Button, { "aria-label": "Go back and do not acknowledge Secure Boot and Full Disk Encryption warning", onClick: () => {
|
|
237
|
+
setShowSecureBootConfirmationDialog(false);
|
|
238
|
+
dismissSecureBootWarning(false, dontShowSecureBootWarningAgain);
|
|
239
|
+
setDontShowSecureBootWarningAgain(false);
|
|
240
|
+
}, variant: "outlined", color: "secondary", children: "Cancel" }), _jsx(Button, { "aria-label": "Acknowledge Secure Boot and Full Disk Encryption warning", onClick: () => {
|
|
241
|
+
onChange('secureboot', true);
|
|
242
|
+
setShowSecureBootConfirmationDialog(false);
|
|
243
|
+
if (dontShowSecureBootWarningAgain) {
|
|
244
|
+
setToLocalStorage(secureBootDontShowAgainKey, 'true');
|
|
245
|
+
}
|
|
246
|
+
dismissSecureBootWarning(true, dontShowSecureBootWarningAgain);
|
|
247
|
+
setDontShowSecureBootWarningAgain(false);
|
|
248
|
+
}, children: "I understand and acknowledge" })] })] })] }));
|
|
180
249
|
});
|
|
181
250
|
// TODO: We need a better way than just copying the styling. Consider creating a component to export
|
|
182
251
|
const VersionSelectItem = ({ option, isRecommended, }) => {
|
|
183
|
-
return (_jsxs(Stack, {
|
|
252
|
+
return (_jsxs(Stack, { flexWrap: "wrap", maxWidth: "100%", rowGap: 1, children: [_jsxs(Typography, { noWrap: true, maxWidth: "100%", variant: "titleSm", children: [option.title, !!option.line && (_jsx(Chip, { sx: { ml: 1 }, label: option.line, color: lineMap[option.line] })), isRecommended && (_jsx(Chip, { sx: { ml: 1 }, color: "green", label: "recommended" }))] }), !!option.knownIssueList && (_jsx(Callout, { severity: "warning", size: "sm", children: option.knownIssueList }))] }));
|
|
184
253
|
};
|
|
@@ -16,7 +16,7 @@ const variantInfo = {
|
|
|
16
16
|
};
|
|
17
17
|
const BuildVariants = ['dev', 'prod'];
|
|
18
18
|
export const VariantSelector = ({ version, variant, onVariantChange, }) => {
|
|
19
|
-
return (_jsxs(FormControl, { children: [_jsx(FormLabel, { children: "Select edition" }), _jsx(RadioGroup, { "aria-labelledby": "variant-radio-buttons-group", name: "developmentMode", value: variant === 'dev', onChange: (event) => {
|
|
19
|
+
return (_jsxs(FormControl, { children: [_jsx(FormLabel, { children: _jsx(Typography, { variant: "titleSm", children: "Select edition" }) }), _jsx(RadioGroup, { "aria-labelledby": "variant-radio-buttons-group", name: "developmentMode", value: variant === 'dev', onChange: (event) => {
|
|
20
20
|
onVariantChange(event.target.value === 'true');
|
|
21
21
|
}, children: BuildVariants.map((buildVariant, index) => {
|
|
22
22
|
const isDev = buildVariant === 'dev';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { Avatar, Box, DialogActions, DialogContent, Divider, Grid2 as Grid, Typography, } from '@mui/material';
|
|
3
3
|
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { FALLBACK_LOGO_UNKNOWN_DEVICE, isUrlAccessible, stripVersionBuild, } from './utils';
|
|
5
|
-
import { ImageForm } from './ImageForm';
|
|
5
|
+
import { GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION, GENERIC_X86_SLUG, ImageForm, } from './ImageForm';
|
|
6
6
|
import { ApplicationInstructions } from './ApplicationInstructions';
|
|
7
7
|
import { DropDownButton } from '../DropDownButton';
|
|
8
8
|
import DownloadIcon from '@mui/icons-material/Download';
|
|
@@ -15,6 +15,7 @@ import { enqueueSnackbar } from 'notistack';
|
|
|
15
15
|
import { DialogWithCloseButton } from '../DialogWithCloseButton';
|
|
16
16
|
import { Callout } from '../Callout';
|
|
17
17
|
import { Spinner } from '../Spinner';
|
|
18
|
+
import * as semver from 'balena-semver';
|
|
18
19
|
const etcherLogoBase64 = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjYwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KIDxnPgogIDx0aXRsZT5FdGNoZXI8L3RpdGxlPgogIDxnIGlkPSJzdmdfMSIgc3Ryb2tlPSJudWxsIj4KICAgPHBhdGggaWQ9InN2Z18yIiBjbGFzcz0ic3QxIiBkPSJtNDEyLjkwMzgzLDM1OC4wNjcxM2wwLDE3MS40OTU4M2M3LjQ5MjU0LC0xLjY2NTAxIDE0LjE1MjU3LC0zLjMzMDAyIDIwLjgxMjYsLTcuNDkyNTRsMTQyLjM1ODE5LC04MS41ODUzOWMyMC44MTI2LC0xMS42NTUwNiAzMy4zMDAxNiwtMzQuMTMyNjYgMzMuMzAwMTYsLTU4LjI3NTI4bDAsLTE2Mi4zMzgyOGMwLC02LjY2MDAzIC0wLjgzMjUsLTEzLjMyMDA2IC0zLjMzMDAyLC0xOS4xNDc1OWwtMTU0LjAxMzI0LDg5LjA3NzkzYy0zMi40Njc2NiwyMi40Nzc2MSAtMzkuMTI3NjksNDMuMjkwMjEgLTM5LjEyNzY5LDY4LjI2NTMzbDAsLTAuMDAwMDF6IiBmaWxsPSIjQTVERTM3IiBzdHJva2U9Im51bGwiLz4KICAgPHBhdGggaWQ9InN2Z18zIiBjbGFzcz0ic3QyIiBkPSJtNjYyLjY1NTAzLDE2Ny40MjM3MWwtNTYuNjEwMjcsMzIuNDY3NjZjMS42NjUwMSw1LjgyNzUzIDMuMzMwMDIsMTIuNDg3NTYgMy4zMzAwMiwxOS4xNDc1OWwwLDE2My4xNzA3OWMwLDI0LjE0MjYyIC0xMy4zMjAwNiw0Ni42MjAyMiAtMzMuMzAwMTYsNTguMjc1MjhsLTE0Mi4zNTgxOSw4MS41ODUzOWMtNi42NjAwMywzLjMzMDAyIC0xMy4zMjAwNiw1LjgyNzUzIC0yMC44MTI2LDcuNDkyNTRsMCw2NC45MzUzMWM5Ljk5MDA1LC0xLjY2NTAxIDE5Ljk4MDEsLTQuOTk1MDIgMjguMzA1MTQsLTkuOTkwMDVsMTg0LjgxNTg5LC0xMDUuNzI4MDFjMjUuODA3NjIsLTE0Ljk4NTA3IDQxLjYyNTIsLTQyLjQ1NzcgNDEuNjI1MiwtNzIuNDI3ODVsMCwtMjExLjQ1NjAyYzAsLTkuMTU3NTQgLTEuNjY1MDEsLTE4LjMxNTA5IC00Ljk5NTAyLC0yNy40NzI2M2wtMC4wMDAwMSwweiIgZmlsbD0iI0M4RjE3OCIgc3Ryb2tlPSJudWxsIi8+CiAgIDxwYXRoIGlkPSJzdmdfNCIgY2xhc3M9InN0MSIgZD0ibTM5OS41ODM3NiwzMDMuOTU0MzZjOC4zMjUwNCwtMTMuMzIwMDYgMjAuODEyNiwtMjUuODA3NjIgMzkuMTI3NjksLTM2LjYzMDE4bDE1NS42NzgyNSwtODkuOTEwNDNjLTQuOTk1MDIsLTYuNjYwMDMgLTExLjY1NTA2LC0xMi40ODc1NiAtMTguMzE1MDksLTE2LjY1MDA4bC0xNDIuMzU4MTksLTgxLjU4NTM5Yy0yMC44MTI2LC0xMS42NTUwNiAtNDYuNjIwMjIsLTExLjY1NTA2IC02Ny40MzI4MiwwbC0xNDEuNTI1NjgsODEuNTg1MzljLTcuNDkyNTQsNC4xNjI1MiAtMTMuMzIwMDYsOS45OTAwNSAtMTkuMTQ3NTksMTYuNjUwMDhsMTU0Ljg0NTc1LDg5LjkxMDQzYzE4LjMxNTA5LDExLjY1NTA2IDMwLjgwMjY1LDIzLjMxMDExIDM5LjEyNzY5LDM2LjYzMDE4bC0wLjAwMDAxLDB6IiBmaWxsPSIjQTVERTM3IiBzdHJva2U9Im51bGwiLz4KICAgPHBhdGggaWQ9InN2Z181IiBjbGFzcz0ic3QyIiBkPSJtMjI0Ljc1NzkyLDE2MS41OTYxOGwxNDEuNTI1NjgsLTgxLjU4NTM5YzIwLjgxMjYsLTExLjY1NTA2IDQ2LjYyMDIyLC0xMS42NTUwNiA2Ny40MzI4MiwwbDE0Mi4zNTgxOSw4MS41ODUzOWM3LjQ5MjU0LDQuMTYyNTIgMTMuMzIwMDYsOS45OTAwNSAxOC4zMTUwOSwxNi42NTAwOGw1Ni42MTAyNywtMzIuNDY3NjZjLTYuNjYwMDMsLTkuMTU3NTQgLTE0Ljk4NTA3LC0xNi42NTAwOCAtMjQuOTc1MTIsLTIxLjY0NTFsLTE4NC44MTU4OSwtMTA3LjM5MzAyYy0yNS44MDc2MiwtMTQuOTg1MDcgLTU3LjQ0Mjc4LC0xNC45ODUwNyAtODMuMjUwNCwwbC0xODMuMTUwODgsMTA2LjU2MDUxYy05Ljk5MDA1LDUuODI3NTMgLTE4LjMxNTA5LDEzLjMyMDA2IC0yNC45NzUxMiwyMi40Nzc2MWw1Ni42MTAyNywzMi40Njc2NmM0LjE2MjUyLC02LjY2MDAzIDEwLjgyMjU1LC0xMi40ODc1NiAxOC4zMTUwOSwtMTYuNjUwMDh6IiBmaWxsPSIjQzhGMTc4IiBzdHJva2U9Im51bGwiLz4KICAgPHBhdGggaWQ9InN2Z182IiBjbGFzcz0ic3QyIiBkPSJtMzY2LjI4MzYsNTIyLjA3MDQxbC0xNDEuNTI1NjgsLTgxLjU4NTM5Yy0yMC44MTI2LC0xMS42NTUwNiAtMzMuMzAwMTYsLTM0LjEzMjY2IC0zMy4zMDAxNiwtNTguMjc1MjhsMCwtMTYzLjE3MDc5YzAsLTYuNjYwMDMgMC44MzI1LC0xMi40ODc1NiAyLjQ5NzUxLC0xOC4zMTUwOWwtNTYuNjEwMjcsLTMyLjQ2NzY2Yy0zLjMzMDAyLDkuMTU3NTQgLTQuOTk1MDIsMTcuNDgyNTggLTQuOTk1MDIsMjYuNjQwMTNsMCwyMTIuMjg4NTJjMCwyOS45NzAxNCAxNS44MTc1OCw1Ny40NDI3OCA0MS42MjUyLDcxLjU5NTM0bDE4My45ODMzOSwxMDUuNzI4MDFjOC4zMjUwNCw0Ljk5NTAyIDE4LjMxNTA5LDguMzI1MDQgMjguMzA1MTQsOS45OTAwNWwwLC02NC45MzUzMWMtNi42NjAwMywtMC44MzI1IC0xMy4zMjAwNiwtMy4zMzAwMiAtMTkuOTgwMSwtNy40OTI1NGwtMC4wMDAwMSwwLjAwMDAxeiIgZmlsbD0iI0M4RjE3OCIgc3Ryb2tlPSJudWxsIi8+CiAgIDxwYXRoIGlkPSJzdmdfNyIgY2xhc3M9InN0MSIgZD0ibTM0Ny4xMzYwMSwyODguOTY5MjlsLTE1My4xODA3NCwtODguMjQ1NDJjLTEuNjY1MDEsNS44Mjc1MyAtMi40OTc1MSwxMi40ODc1NiAtMi40OTc1MSwxOC4zMTUwOWwwLDE2My4xNzA3OWMwLDI0LjE0MjYyIDEyLjQ4NzU2LDQ2LjYyMDIyIDMzLjMwMDE2LDU4LjI3NTI4bDE0MS41MjU2OCw4MS41ODUzOWM2LjY2MDAzLDMuMzMwMDIgMTMuMzIwMDYsNS44Mjc1MyAyMC44MTI2LDcuNDkyNTRsMCwtMTcxLjQ5NTgzYy0wLjgzMjUsLTI0Ljk3NTEyIC03LjQ5MjU0LC00NS43ODc3MiAtMzkuOTYwMTksLTY5LjA5NzgzbDAsLTAuMDAwMDF6IiBmaWxsPSIjQTVERTM3IiBzdHJva2U9Im51bGwiLz4KICA8L2c+CiA8L2c+Cgo8L3N2Zz4=';
|
|
19
20
|
const ETCHER_OPEN_IMAGE_URL = 'https://www.balena.io/etcher/open-image-url';
|
|
20
21
|
export var ActionType;
|
|
@@ -64,6 +65,7 @@ const getInitialState = (deviceType, applicationId, releaseId) => ({
|
|
|
64
65
|
deviceType,
|
|
65
66
|
version: '',
|
|
66
67
|
network: 'ethernet',
|
|
68
|
+
secureboot: false,
|
|
67
69
|
developmentMode: false,
|
|
68
70
|
appUpdatePollInterval: 10,
|
|
69
71
|
wifiSsid: undefined,
|
|
@@ -249,7 +251,11 @@ export const DownloadImageDialog = ({ open, applicationId, releaseId, compatible
|
|
|
249
251
|
newFormModelState = getInitialState(value, applicationId, releaseId);
|
|
250
252
|
}
|
|
251
253
|
else {
|
|
252
|
-
newFormModelState = Object.assign(Object.assign({}, formModel), {
|
|
254
|
+
newFormModelState = Object.assign(Object.assign({}, formModel), { secureboot: key === 'version' &&
|
|
255
|
+
formModel.deviceType.slug === GENERIC_X86_SLUG &&
|
|
256
|
+
semver.lt(value, GENERIC_X86_MINIMUM_SUPPORTED_SECUREBOOT_VERSION)
|
|
257
|
+
? false
|
|
258
|
+
: formModel.secureboot, [key]: value });
|
|
253
259
|
onFieldChange === null || onFieldChange === void 0 ? void 0 : onFieldChange(newFormModelState);
|
|
254
260
|
}
|
|
255
261
|
setFormModel(newFormModelState);
|
|
@@ -276,7 +282,7 @@ export const DownloadImageDialog = ({ open, applicationId, releaseId, compatible
|
|
|
276
282
|
dockerImage: formModel.version
|
|
277
283
|
? getDockerArtifact(formModel.deviceType.slug, stripVersionBuild(formModel.version))
|
|
278
284
|
: '',
|
|
279
|
-
} })] }), ((_d = formModel.deviceType.imageDownloadAlerts) !== null && _d !== void 0 ? _d : []).map((alert) => {
|
|
285
|
+
}, secureboot: formModel.secureboot })] }), ((_d = formModel.deviceType.imageDownloadAlerts) !== null && _d !== void 0 ? _d : []).map((alert) => {
|
|
280
286
|
return (_jsx(Grid, { pt: 0, size: 12, children: _jsx(Callout, { severity: alert.type, children: alert.message }, alert.message) }, alert.message));
|
|
281
287
|
})] }) }) }), _jsx(DialogActions, { sx: {
|
|
282
288
|
display: 'flex',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@balena/ui-shared-components",
|
|
3
|
-
"version": "12.0
|
|
3
|
+
"version": "12.1.0-build-secure-boot-0f91aab21d2d77cbaaebddf68775aec0ba8c81ab-1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"files": [
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"ajv-formats": "^3.0.1",
|
|
34
34
|
"ajv-keywords": "^5.1.0",
|
|
35
35
|
"analytics-client": "^2.0.1",
|
|
36
|
+
"balena-semver": "^3.0.5",
|
|
36
37
|
"color": "^5.0.0",
|
|
37
38
|
"color-hash": "^2.0.2",
|
|
38
39
|
"date-fns": "^4.1.0",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"react-dropzone": "^14.2.3",
|
|
45
46
|
"react-helmet": "^6.1.0",
|
|
46
47
|
"react-markdown": "^10.0.0",
|
|
47
|
-
"react-router-dom": "^
|
|
48
|
+
"react-router-dom": "^6.28.0",
|
|
48
49
|
"remark-breaks": "^4.0.0",
|
|
49
50
|
"remark-gfm": "^4.0.0",
|
|
50
51
|
"rimraf": "^6.0.0",
|
|
@@ -138,6 +139,6 @@
|
|
|
138
139
|
},
|
|
139
140
|
"homepage": "https://github.com/balena-io/ui-shared-components#readme",
|
|
140
141
|
"versionist": {
|
|
141
|
-
"publishedAt": "2025-04-
|
|
142
|
+
"publishedAt": "2025-04-08T11:39:17.057Z"
|
|
142
143
|
}
|
|
143
144
|
}
|