mirror of
https://github.com/luc-github/ESP3D-WEBUI.git
synced 2026-02-20 01:11:21 +01:00
Fix Settings for Direct SD connection show wrong data
Add depend feature to field group
This commit is contained in:
@@ -18,8 +18,23 @@
|
||||
*/
|
||||
|
||||
import { h } from "preact"
|
||||
import {
|
||||
useUiContext,
|
||||
useUiContextFn,
|
||||
useSettingsContext,
|
||||
} from "../../contexts"
|
||||
import {
|
||||
generateDependIds,
|
||||
connectionDepend,
|
||||
settingsDepend,
|
||||
} from "../Helpers"
|
||||
|
||||
const FieldGroup = ({ className, children, label, id }) => {
|
||||
const FieldGroup = ({ className, children, label, id, depend }) => {
|
||||
const { connectionSettings } = useSettingsContext()
|
||||
const canshow = connectionDepend(depend, connectionSettings.current)
|
||||
if (!canshow) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<fieldset
|
||||
class={
|
||||
|
||||
@@ -400,6 +400,9 @@ const InterfaceTab = () => {
|
||||
label={T(
|
||||
fieldData.label
|
||||
)}
|
||||
depend={
|
||||
fieldData.depend
|
||||
}
|
||||
>
|
||||
{Object.keys(
|
||||
fieldData.value
|
||||
|
||||
@@ -105,6 +105,10 @@
|
||||
"id": "sd",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"connection_id": "SDConnection",
|
||||
"value": "!='direct'"
|
||||
},
|
||||
{
|
||||
"id": "showfilespanel",
|
||||
"value": true
|
||||
@@ -122,6 +126,10 @@
|
||||
"id": "sd",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"connection_id": "SDConnection",
|
||||
"value": "!='direct'"
|
||||
},
|
||||
{
|
||||
"id": "showfilespanel",
|
||||
"value": true
|
||||
@@ -257,6 +265,10 @@
|
||||
{
|
||||
"id": "sd",
|
||||
"value": true
|
||||
},
|
||||
{
|
||||
"connection_id": "SDConnection",
|
||||
"value": "!='direct'"
|
||||
}
|
||||
],
|
||||
"value": [
|
||||
|
||||
Reference in New Issue
Block a user