move eth_10mbit to Network Settings

This commit is contained in:
proddy
2026-09-03 12:22:52 +02:00
parent c711d1c6de
commit 13c6ed9e06
15 changed files with 83 additions and 74 deletions
-1
View File
@@ -39,7 +39,6 @@ export interface Settings {
eth_power: number;
eth_phy_addr: number;
eth_clock_mode: number;
eth_10mbit: boolean;
platform: string;
modbus_enabled: boolean;
modbus_port: number;
@@ -820,18 +820,6 @@ const ApplicationSettings = () => {
</Grid>
</Grid>
)}
{data.phy_type !== 0 && (
<BlockFormControlLabel
control={
<Checkbox
checked={data.eth_10mbit}
onChange={updateFormValue}
name="eth_10mbit"
/>
}
label="Force 10Mbit half-duplex"
/>
)}
</>
)}
<Grid container spacing={2} rowSpacing={0}>
@@ -22,6 +22,7 @@ import {
import * as NetworkApi from 'api/network';
import { API } from 'api/app';
import { readSystemStatus } from 'api/system';
import { updateState, useRequest } from 'alova/client';
import type { APIcall } from 'app/main/types';
@@ -50,6 +51,8 @@ import { isNetworkOpen, networkSecurityMode } from './WiFiNetworkSelector';
const NetworkSettings = () => {
const { LL } = useI18nContext();
const { data: hardwareData } = useRequest(readSystemStatus);
const { selectedNetwork, deselectNetwork } = useContext(WiFiConnectionContext);
const [initialized, setInitialized] = useState(false);
@@ -92,7 +95,8 @@ const NetworkSettings = () => {
nosleep: true,
enableMDNS: true,
enableCORS: false,
CORSOrigin: '*'
CORSOrigin: '*',
eth_10mbit: current_data ? current_data.eth_10mbit : false
})
);
}
@@ -136,7 +140,7 @@ const NetworkSettings = () => {
};
const content = () => {
if (!data) {
if (!data || !hardwareData) {
return <FormLoader onRetry={loadData} errorMessage={errorMessage || ''} />;
}
@@ -246,6 +250,23 @@ const NetworkSettings = () => {
}
label={LL.NETWORK_LOW_BAND()}
/>
{hardwareData.esp_platform === 'ESP32' && (
<>
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
Ethernet
</Typography>
<BlockFormControlLabel
control={
<Checkbox
name="eth_10mbit"
checked={data.eth_10mbit}
onChange={updateFormValue}
/>
}
label="Force 10Mbit half-duplex"
/>
</>
)}
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
{LL.GENERAL_OPTIONS()}
</Typography>
+1
View File
@@ -54,6 +54,7 @@ export interface NetworkSettingsType {
enableMDNS: boolean;
enableCORS: boolean;
CORSOrigin: string;
eth_10mbit: boolean;
[key: string]: unknown;
}