Skip to content

Commit

Permalink
Merge pull request #2143 from proddy/dev
Browse files Browse the repository at this point in the history
minor UI changes
  • Loading branch information
proddy authored Oct 27, 2024
2 parents d440e6d + 4a4ea0e commit 3cd6774
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 55 deletions.
40 changes: 21 additions & 19 deletions interface/src/app/main/Customizations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -464,14 +464,7 @@ const Customizations = () => {
)}
{selectedDevice !== -1 &&
(rename ? (
<ButtonRow>
<Button
startIcon={<SaveIcon />}
variant="contained"
onClick={() => renameDevice()}
>
{LL.UPDATE()}
</Button>
<>
<Button
startIcon={<CancelIcon />}
variant="outlined"
Expand All @@ -480,7 +473,14 @@ const Customizations = () => {
>
{LL.CANCEL()}
</Button>
</ButtonRow>
<Button
startIcon={<SaveIcon />}
variant="outlined"
onClick={() => renameDevice()}
>
{LL.RENAME()}
</Button>
</>
) : (
<Button
startIcon={<EditIcon />}
Expand Down Expand Up @@ -716,16 +716,18 @@ const Customizations = () => {
</ButtonRow>
)}
</Box>
<ButtonRow mt={1}>
<Button
startIcon={<SettingsBackupRestoreIcon />}
variant="outlined"
color="error"
onClick={() => setConfirmReset(true)}
>
{LL.RESET(0)}
</Button>
</ButtonRow>
{!rename && (
<ButtonRow mt={1}>
<Button
startIcon={<SettingsBackupRestoreIcon />}
variant="outlined"
color="error"
onClick={() => setConfirmReset(true)}
>
{LL.RESET(0)}
</Button>
</ButtonRow>
)}
</Box>
)}
{renderResetDialog()}
Expand Down
81 changes: 48 additions & 33 deletions interface/src/app/settings/Version.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import {
DialogActions,
DialogContent,
DialogTitle,
Divider,
Link,
Typography
} from '@mui/material';
import Grid from '@mui/material/Grid2';

import * as SystemApi from 'api/system';
import { callAction } from 'api/app';
Expand Down Expand Up @@ -182,43 +184,55 @@ const Version = () => {

return (
<>
<Typography variant="h6" color="primary">
Firmware Version Check
</Typography>

<Box p={2} mt={2} border="1px solid grey" borderRadius={2}>
<Typography>
<b>{LL.VERSION() + ':'}</b>&nbsp;{data.emsesp_version}
{data.build_flags && (
<Typography variant="caption">
&nbsp; &#40;{data.build_flags}&#41;
<Box p={2} border="1px solid grey" borderRadius={2}>
<Grid container spacing={3}>
<Grid mb={1}>
<Typography mb={1} fontWeight={'fontWeightBold'}>
{LL.VERSION()}
</Typography>
)}
</Typography>
<Typography>
<b>Platform:</b>&nbsp;{getPlatform()}
</Typography>
<Typography mb={1} fontWeight={'fontWeightBold'}>
Platform
</Typography>
<Typography mb={1} fontWeight={'fontWeightBold'}>
Release
</Typography>
</Grid>
<Grid>
<Typography mb={1}>
{data.emsesp_version}
{data.build_flags && (
<Typography variant="caption">
&nbsp; &#40;{data.build_flags}&#41;
</Typography>
)}
</Typography>
<Typography mb={1}>{getPlatform()}</Typography>
<Typography>
{isDev ? LL.DEVELOPMENT() : LL.STABLE()}&nbsp;
<Link
target="_blank"
href={useDev ? DEV_RELNOTES_URL : STABLE_RELNOTES_URL}
color="primary"
>
(changelog)
</Link>
</Typography>
</Grid>
</Grid>

<Typography>
<b>Release:</b>&nbsp;
<Link
target="_blank"
href={useDev ? DEV_RELNOTES_URL : STABLE_RELNOTES_URL}
<Divider />

{!isDev && (
<Button
sx={{ mt: 2 }}
variant="outlined"
color="primary"
size="small"
onClick={() => showFirmwareDialog(true)}
>
{isDev ? LL.DEVELOPMENT() : LL.STABLE()}
</Link>
{!isDev && (
<Button
sx={{ ml: 2 }}
variant="outlined"
color="primary"
onClick={() => showFirmwareDialog(true)}
>
{LL.SWITCH_DEV()}
</Button>
)}
</Typography>
{LL.SWITCH_DEV()}
</Button>
)}

<Typography mt={2} color="warning">
<InfoOutlinedIcon color="warning" sx={{ verticalAlign: 'middle' }} />
Expand All @@ -231,6 +245,7 @@ const Version = () => {
sx={{ ml: 2, textTransform: 'none' }}
variant="outlined"
color="primary"
size="small"
onClick={() => showFirmwareDialog(false)}
>
{isDev
Expand Down
2 changes: 1 addition & 1 deletion interface/src/i18n/en/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const en: Translation = {
CUSTOMIZATIONS_RESTART: 'All customizations have been removed. Restarting...',
CUSTOMIZATIONS_FULL: 'Selected entities exceeded limit. Please save in batches',
CUSTOMIZATIONS_SAVED: 'Customizations saved',
CUSTOMIZATIONS_HELP_1: 'Select a device and customize the entities options or click to rename',
CUSTOMIZATIONS_HELP_1: 'Select a device and customize the entities options',
CUSTOMIZATIONS_HELP_2: 'mark as favorite',
CUSTOMIZATIONS_HELP_3: 'disable write action',
CUSTOMIZATIONS_HELP_4: 'exclude from MQTT and API',
Expand Down
4 changes: 2 additions & 2 deletions mock-api/rest_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ function check_upgrade(version: string) {
console.log('check upgrade from version', version);
data = {
emsesp_version: VERSION,
upgradeable: true
// upgradeable: false,
// upgradeable: true
upgradeable: false
};
} else {
console.log('requesting ems-esp version');
Expand Down

0 comments on commit 3cd6774

Please sign in to comment.