mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-01-26 08:39:09 +03:00
only show previous if in developer mode and there are something to show
This commit is contained in:
@@ -354,7 +354,9 @@ const Version = () => {
|
|||||||
const { send: sendSetPartition } = useRequest(
|
const { send: sendSetPartition } = useRequest(
|
||||||
(partition: string) => callAction({ action: 'setPartition', param: partition }),
|
(partition: string) => callAction({ action: 'setPartition', param: partition }),
|
||||||
{ immediate: false }
|
{ immediate: false }
|
||||||
);
|
).onError((error) => {
|
||||||
|
toast.error(String(error.error?.message || 'An error occurred'));
|
||||||
|
});
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data,
|
data,
|
||||||
@@ -401,7 +403,7 @@ const Version = () => {
|
|||||||
await sendUploadURL(url).catch((error: Error) => {
|
await sendUploadURL(url).catch((error: Error) => {
|
||||||
toast.error(error.message);
|
toast.error(error.message);
|
||||||
});
|
});
|
||||||
doRestart();
|
await doRestart();
|
||||||
},
|
},
|
||||||
[sendUploadURL]
|
[sendUploadURL]
|
||||||
);
|
);
|
||||||
@@ -608,28 +610,37 @@ const Version = () => {
|
|||||||
alignItems: 'baseline'
|
alignItems: 'baseline'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Grid size={{ xs: 4, md: 2 }}>
|
{data.partitions.length > 0 && data.developer_mode && (
|
||||||
<Typography color="secondary">{LL.PREVIOUS_VERSIONS()}</Typography>
|
<>
|
||||||
</Grid>
|
<Grid size={{ xs: 4, md: 2 }}>
|
||||||
<Grid size={{ xs: 8, md: 10 }}>
|
<Typography color="secondary">
|
||||||
{data.partitions.map((partition) => (
|
{LL.PREVIOUS_VERSIONS()}
|
||||||
<Typography key={partition.partition} mb={1}>
|
</Typography>
|
||||||
v{partition.version} ({partition.partition}: {partition.size}
|
</Grid>
|
||||||
{' KB'})
|
<Grid size={{ xs: 8, md: 10 }}>
|
||||||
<Button
|
{data.partitions.map((partition) => (
|
||||||
sx={{ ml: 2 }}
|
<Typography key={partition.partition} mb={1}>
|
||||||
variant="outlined"
|
v{partition.version} ({partition.partition}:{' '}
|
||||||
size="small"
|
{partition.size}
|
||||||
onClick={() =>
|
{' KB'})
|
||||||
showPreviousDialog(partition.version, partition.partition)
|
<Button
|
||||||
}
|
sx={{ ml: 2 }}
|
||||||
>
|
variant="outlined"
|
||||||
{LL.INSTALL()}
|
size="small"
|
||||||
</Button>
|
onClick={() =>
|
||||||
</Typography>
|
showPreviousDialog(
|
||||||
))}
|
partition.version,
|
||||||
</Grid>
|
partition.partition
|
||||||
|
)
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{LL.INSTALL()}
|
||||||
|
</Button>
|
||||||
|
</Typography>
|
||||||
|
))}
|
||||||
|
</Grid>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
<Grid size={{ xs: 4, md: 2 }}>
|
<Grid size={{ xs: 4, md: 2 }}>
|
||||||
<Typography color="secondary">{LL.STABLE()}</Typography>
|
<Typography color="secondary">{LL.STABLE()}</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -117,9 +117,10 @@ let system_status = {
|
|||||||
partition: 'factory',
|
partition: 'factory',
|
||||||
version: '3.7.3-dev.39',
|
version: '3.7.3-dev.39',
|
||||||
size: 4672
|
size: 4672
|
||||||
},
|
}
|
||||||
],
|
],
|
||||||
developer_mode: true,
|
// partitions: [],
|
||||||
|
developer_mode: false,
|
||||||
model: '',
|
model: '',
|
||||||
// model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)',
|
// model: 'BBQKees Electronics EMS Gateway E32 V2 (E32 V2.0 P3/2024011)',
|
||||||
// status: 0,
|
// status: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user