mirror of https://github.com/jetkvm/kvm.git
feat: add acknowledgment checkbox for version changes in advanced settings
This commit is contained in:
parent
32c66a3897
commit
e0ff6716f1
|
|
@ -32,6 +32,7 @@ export default function SettingsAdvancedRoute() {
|
||||||
const [appVersion, setAppVersion] = useState<string>("");
|
const [appVersion, setAppVersion] = useState<string>("");
|
||||||
const [systemVersion, setSystemVersion] = useState<string>("");
|
const [systemVersion, setSystemVersion] = useState<string>("");
|
||||||
const [resetConfig, setResetConfig] = useState(false);
|
const [resetConfig, setResetConfig] = useState(false);
|
||||||
|
const [versionChangeAcknowledged, setVersionChangeAcknowledged] = useState(false);
|
||||||
|
|
||||||
const settings = useSettingsStore();
|
const settings = useSettingsStore();
|
||||||
|
|
||||||
|
|
@ -357,6 +358,14 @@ export default function SettingsAdvancedRoute() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<CheckboxWithLabel
|
||||||
|
label="I understand version changes may break my device and require factory reset"
|
||||||
|
checked={versionChangeAcknowledged}
|
||||||
|
onChange={e => setVersionChangeAcknowledged(e.target.checked)}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
size="SM"
|
size="SM"
|
||||||
theme="primary"
|
theme="primary"
|
||||||
|
|
@ -364,7 +373,8 @@ export default function SettingsAdvancedRoute() {
|
||||||
disabled={
|
disabled={
|
||||||
(updateTarget === "app" && !appVersion) ||
|
(updateTarget === "app" && !appVersion) ||
|
||||||
(updateTarget === "system" && !systemVersion) ||
|
(updateTarget === "system" && !systemVersion) ||
|
||||||
(updateTarget === "both" && (!appVersion || !systemVersion))
|
(updateTarget === "both" && (!appVersion || !systemVersion)) ||
|
||||||
|
!versionChangeAcknowledged
|
||||||
}
|
}
|
||||||
onClick={handleVersionUpdate}
|
onClick={handleVersionUpdate}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue