diff --git a/ui/src/components/NestedSettingsGroup.tsx b/ui/src/components/NestedSettingsGroup.tsx new file mode 100644 index 00000000..3ee57b0f --- /dev/null +++ b/ui/src/components/NestedSettingsGroup.tsx @@ -0,0 +1,22 @@ +import { cx } from "@/cva.config"; + +interface NestedSettingsGroupProps { + readonly children: React.ReactNode; + readonly className?: string; +} + +export function NestedSettingsGroup(props: NestedSettingsGroupProps) { + const { children, className } = props; + + return ( +
+ {children} +
+ ); +} + diff --git a/ui/src/routes/devices.$id.settings.access._index.tsx b/ui/src/routes/devices.$id.settings.access._index.tsx index ae2ae3c3..0cb49c81 100644 --- a/ui/src/routes/devices.$id.settings.access._index.tsx +++ b/ui/src/routes/devices.$id.settings.access._index.tsx @@ -11,6 +11,7 @@ import { SelectMenuBasic } from "@components/SelectMenuBasic"; import { SettingsItem } from "@components/SettingsItem"; import { SettingsPageHeader } from "@components/SettingsPageheader"; import { SettingsSectionHeader } from "@components/SettingsSectionHeader"; +import { NestedSettingsGroup } from "@components/NestedSettingsGroup"; import { TextAreaWithLabel } from "@components/TextArea"; import api from "@/api"; import notifications from "@/notifications"; @@ -237,39 +238,30 @@ export default function SettingsAccessIndexRoute() { {tlsMode === "custom" && ( -
-
- -
- handleTlsCertChange(e.target.value)} - /> -
- -
-
- handleTlsKeyChange(e.target.value)} - /> -
-
-
+ + + handleTlsCertChange(e.target.value)} + /> + handleTlsKeyChange(e.target.value)} + />
-
+ )} {selectedProvider === "custom" && ( -
+
-
+ )} )} diff --git a/ui/src/routes/devices.$id.settings.advanced.tsx b/ui/src/routes/devices.$id.settings.advanced.tsx index ea2ca76c..31d623c8 100644 --- a/ui/src/routes/devices.$id.settings.advanced.tsx +++ b/ui/src/routes/devices.$id.settings.advanced.tsx @@ -8,6 +8,7 @@ import { ConfirmDialog } from "@components/ConfirmDialog"; import { GridCard } from "@components/Card"; import { SettingsItem } from "@components/SettingsItem"; import { SettingsPageHeader } from "@components/SettingsPageheader"; +import { NestedSettingsGroup } from "@components/NestedSettingsGroup"; import { TextAreaWithLabel } from "@components/TextArea"; import { isOnDevice } from "@/main"; import notifications from "@/notifications"; @@ -200,41 +201,69 @@ export default function SettingsAdvancedRoute() { onChange={e => handleDevModeChange(e.target.checked)} />
- - {settings.developerMode && ( - -
- - - -
-
-

- {m.advanced_developer_mode_enabled_title()} -

-
-
    -
  • {m.advanced_developer_mode_warning_security()}
  • -
  • {m.advanced_developer_mode_warning_risks()}
  • -
+ {settings.developerMode ? ( + + +
+ + + +
+
+

+ {m.advanced_developer_mode_enabled_title()} +

+
+
    +
  • {m.advanced_developer_mode_warning_security()}
  • +
  • {m.advanced_developer_mode_warning_risks()}
  • +
+
+
+
+ {m.advanced_developer_mode_warning_advanced()}
-
- {m.advanced_developer_mode_warning_advanced()} +
+ + + {isOnDevice && ( +
+ + setSSHKey(e.target.value)} + placeholder={m.advanced_ssh_public_key_placeholder()} + /> +

+ {m.advanced_ssh_default_user()}root. +

+
+
-
-
- )} + )} +
+ ) : null} - {isOnDevice && settings.developerMode && ( -
- -
- setSSHKey(e.target.value)} - placeholder={m.advanced_ssh_public_key_placeholder()} - /> -

- {m.advanced_ssh_default_user()}root. -

-
-
-
-
- )} + {settings.debugMode && ( - <> + - + )}
diff --git a/ui/src/routes/devices.$id.settings.general._index.tsx b/ui/src/routes/devices.$id.settings.general._index.tsx index 7f70f2aa..55b92c00 100644 --- a/ui/src/routes/devices.$id.settings.general._index.tsx +++ b/ui/src/routes/devices.$id.settings.general._index.tsx @@ -12,13 +12,11 @@ import notifications from "@/notifications"; import { getLocale, setLocale, locales, baseLocale } from '@localizations/runtime.js'; import { m } from "@localizations/messages.js"; import { deleteCookie, map_locale_code_to_name } from "@/utils"; -import { useVersion } from "@hooks/useVersion"; export default function SettingsGeneralRoute() { const { send } = useJsonRpc(); const { navigateTo } = useDeviceUiNavigation(); const [autoUpdate, setAutoUpdate] = useState(true); - const { isOnDevVersion } = useVersion(); const currentVersions = useDeviceStore(state => { const { appVersion, systemVersion } = state; if (!appVersion || !systemVersion) return null; @@ -75,10 +73,6 @@ export default function SettingsGeneralRoute() { notifications.success(m.locale_change_success({ locale: validLocale || m.locale_auto() })); }; - const downgradeAvailable = useMemo(() => { - return isOnDevVersion; - }, [isOnDevVersion]); - return (
- {downgradeAvailable &&
+