mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
improved webUI display on narrow screens
- unified vertical spacing (settings page) - auto switching from 3 to 2 boxes displayed in row on narrow screens - displaying (at least a part off) names of entities names on dashboard - fixes MQTT discovery field too small
This commit is contained in:
@@ -214,12 +214,13 @@ const MqttSettingsForm: FC = () => {
|
|||||||
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
|
sx={{ pb: 2 }}
|
||||||
control={<Checkbox name="ha_enabled" checked={data.ha_enabled} onChange={updateFormValue} />}
|
control={<Checkbox name="ha_enabled" checked={data.ha_enabled} onChange={updateFormValue} />}
|
||||||
label={LL.MQTT_PUBLISH_TEXT_3()}
|
label={LL.MQTT_PUBLISH_TEXT_3()}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
{data.ha_enabled && (
|
{data.ha_enabled && (
|
||||||
<Grid item xs={2}>
|
<Grid item sx={{ pb: 3 }}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="discovery_prefix"
|
name="discovery_prefix"
|
||||||
label={LL.MQTT_PUBLISH_TEXT_4()}
|
label={LL.MQTT_PUBLISH_TEXT_4()}
|
||||||
@@ -233,11 +234,11 @@ const MqttSettingsForm: FC = () => {
|
|||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
)}
|
)}
|
||||||
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
|
<Typography variant="h6" color="primary">
|
||||||
{LL.MQTT_PUBLISH_INTERVALS()} (0=auto)
|
{LL.MQTT_PUBLISH_INTERVALS()} (0=auto)
|
||||||
</Typography>
|
</Typography>
|
||||||
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_boiler"
|
name="publish_time_boiler"
|
||||||
@@ -253,7 +254,7 @@ const MqttSettingsForm: FC = () => {
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_thermostat"
|
name="publish_time_thermostat"
|
||||||
@@ -269,7 +270,7 @@ const MqttSettingsForm: FC = () => {
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_solar"
|
name="publish_time_solar"
|
||||||
@@ -285,7 +286,7 @@ const MqttSettingsForm: FC = () => {
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_mixer"
|
name="publish_time_mixer"
|
||||||
@@ -301,7 +302,7 @@ const MqttSettingsForm: FC = () => {
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_sensor"
|
name="publish_time_sensor"
|
||||||
@@ -317,7 +318,7 @@ const MqttSettingsForm: FC = () => {
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="publish_time_other"
|
name="publish_time_other"
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ const DashboardData: FC = () => {
|
|||||||
common_theme,
|
common_theme,
|
||||||
{
|
{
|
||||||
Table: `
|
Table: `
|
||||||
--data-table-library_grid-template-columns: repeat(1, minmax(0, 1fr)) minmax(140px, max-content) 40px;
|
--data-table-library_grid-template-columns: minmax(0, 1fr) 35% 40px;
|
||||||
`,
|
`,
|
||||||
BaseRow: `
|
BaseRow: `
|
||||||
.td {
|
.td {
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ const SettingsApplication: FC = () => {
|
|||||||
</ValidatedTextField>
|
</ValidatedTextField>
|
||||||
{data.board_profile === 'CUSTOM' && (
|
{data.board_profile === 'CUSTOM' && (
|
||||||
<>
|
<>
|
||||||
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
<Grid container spacing={1} sx={{ pt: 1 }} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="rx_gpio"
|
name="rx_gpio"
|
||||||
@@ -156,7 +156,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="tx_gpio"
|
name="tx_gpio"
|
||||||
@@ -170,7 +170,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="pbutton_gpio"
|
name="pbutton_gpio"
|
||||||
@@ -184,7 +184,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="dallas_gpio"
|
name="dallas_gpio"
|
||||||
@@ -198,7 +198,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="led_gpio"
|
name="led_gpio"
|
||||||
@@ -212,7 +212,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="phy_type"
|
name="phy_type"
|
||||||
label={LL.PHY_TYPE()}
|
label={LL.PHY_TYPE()}
|
||||||
@@ -231,8 +231,8 @@ const SettingsApplication: FC = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
{data.phy_type !== 0 && (
|
{data.phy_type !== 0 && (
|
||||||
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
<Grid container spacing={1} sx={{ pt: 1 }} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="eth_power"
|
name="eth_power"
|
||||||
label={LL.GPIO_OF('PHY Power') + ' (-1=' + LL.DISABLED(1) + ')'}
|
label={LL.GPIO_OF('PHY Power') + ' (-1=' + LL.DISABLED(1) + ')'}
|
||||||
@@ -245,7 +245,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="eth_phy_addr"
|
name="eth_phy_addr"
|
||||||
label={LL.ADDRESS_OF('PHY I²C')}
|
label={LL.ADDRESS_OF('PHY I²C')}
|
||||||
@@ -258,7 +258,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="eth_clock_mode"
|
name="eth_clock_mode"
|
||||||
label="PHY Clk"
|
label="PHY Clk"
|
||||||
@@ -399,13 +399,14 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={saving}
|
disabled={saving}
|
||||||
/>
|
/>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
|
sx={{ pb: 2 }}
|
||||||
control={<Checkbox checked={data.shower_alert} onChange={updateFormValue} name="shower_alert" />}
|
control={<Checkbox checked={data.shower_alert} onChange={updateFormValue} name="shower_alert" />}
|
||||||
label={LL.ENABLE_SHOWER_ALERT()}
|
label={LL.ENABLE_SHOWER_ALERT()}
|
||||||
disabled={!data.shower_timer}
|
disabled={!data.shower_timer}
|
||||||
/>
|
/>
|
||||||
{data.shower_alert && (
|
{data.shower_alert && (
|
||||||
<>
|
<>
|
||||||
<Grid>
|
<Grid item sx={{ pr: 1, pb: 2 }}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="shower_alert_trigger"
|
name="shower_alert_trigger"
|
||||||
@@ -421,8 +422,7 @@ const SettingsApplication: FC = () => {
|
|||||||
disabled={!data.shower_timer}
|
disabled={!data.shower_timer}
|
||||||
/>
|
/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<Grid item sx={{ pb: 3 }}>
|
||||||
<Grid item xs={4}>
|
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
fieldErrors={fieldErrors}
|
fieldErrors={fieldErrors}
|
||||||
name="shower_alert_coldshot"
|
name="shower_alert_coldshot"
|
||||||
@@ -441,11 +441,11 @@ const SettingsApplication: FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</Grid>
|
</Grid>
|
||||||
<Typography sx={{ pt: 2 }} variant="h6" color="primary">
|
<Typography variant="h6" color="primary">
|
||||||
{LL.FORMATTING_OPTIONS()}
|
{LL.FORMATTING_OPTIONS()}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
<Grid container spacing={1} direction="row" justifyContent="flex-start" alignItems="flex-start">
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="bool_dashboard"
|
name="bool_dashboard"
|
||||||
label={LL.BOOLEAN_FORMAT_DASHBOARD()}
|
label={LL.BOOLEAN_FORMAT_DASHBOARD()}
|
||||||
@@ -462,7 +462,7 @@ const SettingsApplication: FC = () => {
|
|||||||
<MenuItem value={5}>1/0</MenuItem>
|
<MenuItem value={5}>1/0</MenuItem>
|
||||||
</ValidatedTextField>
|
</ValidatedTextField>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="bool_format"
|
name="bool_format"
|
||||||
label={LL.BOOLEAN_FORMAT_API()}
|
label={LL.BOOLEAN_FORMAT_API()}
|
||||||
@@ -481,7 +481,7 @@ const SettingsApplication: FC = () => {
|
|||||||
<MenuItem value={6}>1/0</MenuItem>
|
<MenuItem value={6}>1/0</MenuItem>
|
||||||
</ValidatedTextField>
|
</ValidatedTextField>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={4}>
|
<Grid item xs={6} sm={4}>
|
||||||
<ValidatedTextField
|
<ValidatedTextField
|
||||||
name="enum_format"
|
name="enum_format"
|
||||||
label={LL.ENUM_FORMAT()}
|
label={LL.ENUM_FORMAT()}
|
||||||
|
|||||||
Reference in New Issue
Block a user