mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
Merge pull request #1851 from proddy/dev
small change to make sure flags are set in Scheduler with a Timer
This commit is contained in:
@@ -169,12 +169,8 @@ const UploadDownload: FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const downloadSchedule = async () => {
|
const downloadSchedule = async () => {
|
||||||
await getSchedule()
|
await getSchedule().catch((error: Error) => {
|
||||||
.catch((error: Error) => {
|
|
||||||
toast.error(error.message);
|
toast.error(error.message);
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
toast.info(LL.DOWNLOAD_SUCCESSFUL());
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ const SchedulerDialog = ({
|
|||||||
</DialogTitle>
|
</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<Box display="flex" flexWrap="wrap" mb={1}>
|
<Box display="flex" flexWrap="wrap" mb={1}>
|
||||||
<Box flexGrow={1}>
|
<Box>
|
||||||
<ToggleButtonGroup
|
<ToggleButtonGroup
|
||||||
size="small"
|
size="small"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
@@ -191,7 +191,7 @@ const SchedulerDialog = ({
|
|||||||
</ToggleButton>
|
</ToggleButton>
|
||||||
</ToggleButtonGroup>
|
</ToggleButtonGroup>
|
||||||
</Box>
|
</Box>
|
||||||
<Box flexWrap="nowrap" whiteSpace="nowrap">
|
<Box sx={{ '& button, & a, & .MuiCard-root': { ml: 1 } }}>
|
||||||
{isTimer ? (
|
{isTimer ? (
|
||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
@@ -217,8 +217,6 @@ const SchedulerDialog = ({
|
|||||||
{showFlag(editItem, ScheduleFlag.SCHEDULE_TIMER)}
|
{showFlag(editItem, ScheduleFlag.SCHEDULE_TIMER)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
{isOnChange ? (
|
{isOnChange ? (
|
||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
@@ -247,8 +245,6 @@ const SchedulerDialog = ({
|
|||||||
{showFlag(editItem, ScheduleFlag.SCHEDULE_ONCHANGE)}
|
{showFlag(editItem, ScheduleFlag.SCHEDULE_ONCHANGE)}
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
</Box>
|
|
||||||
<Box>
|
|
||||||
{isCondition ? (
|
{isCondition ? (
|
||||||
<Button
|
<Button
|
||||||
size="large"
|
size="large"
|
||||||
@@ -279,6 +275,8 @@ const SchedulerDialog = ({
|
|||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
|
{editItem.flags !== 0 && (
|
||||||
|
<>
|
||||||
<Grid container>
|
<Grid container>
|
||||||
<BlockFormControlLabel
|
<BlockFormControlLabel
|
||||||
control={
|
control={
|
||||||
@@ -297,7 +295,9 @@ const SchedulerDialog = ({
|
|||||||
name="time"
|
name="time"
|
||||||
label={isCondition ? 'Condition' : 'On Change Value'}
|
label={isCondition ? 'Condition' : 'On Change Value'}
|
||||||
fullWidth
|
fullWidth
|
||||||
value={editItem.time == '00:00' ? (editItem.time = '') : editItem.time}
|
value={
|
||||||
|
editItem.time == '00:00' ? (editItem.time = '') : editItem.time
|
||||||
|
}
|
||||||
margin="normal"
|
margin="normal"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
@@ -315,7 +315,9 @@ const SchedulerDialog = ({
|
|||||||
/>
|
/>
|
||||||
{isTimer && (
|
{isTimer && (
|
||||||
<Box color="warning.main" ml={2} mt={4}>
|
<Box color="warning.main" ml={2} mt={4}>
|
||||||
<Typography variant="body2">{LL.SCHEDULER_HELP_2()}</Typography>
|
<Typography variant="body2">
|
||||||
|
{LL.SCHEDULER_HELP_2()}
|
||||||
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
@@ -348,6 +350,8 @@ const SchedulerDialog = ({
|
|||||||
margin="normal"
|
margin="normal"
|
||||||
onChange={updateFormValue}
|
onChange={updateFormValue}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
{!creating && (
|
{!creating && (
|
||||||
|
|||||||
Reference in New Issue
Block a user