updates to scheduler web

This commit is contained in:
proddy
2024-07-28 10:56:33 +02:00
parent 4b136fb7ee
commit 0fbba50b2f
6 changed files with 29 additions and 28 deletions

View File

@@ -219,27 +219,33 @@ const Scheduler: FC = () => {
<Box>
<Typography
sx={{ fontSize: 11 }}
color={
si.flags >= ScheduleFlag.SCHEDULE_TIMER && si.flags !== flag
? 'gray'
: (si.flags & flag) === flag
? 'primary'
: 'grey'
}
color={(si.flags & flag) === flag ? 'primary' : 'grey'}
>
{flag === ScheduleFlag.SCHEDULE_TIMER
? LL.TIMER(0)
: flag === ScheduleFlag.SCHEDULE_ONCHANGE
? 'On Change'
: flag === ScheduleFlag.SCHEDULE_CONDITION
? 'Condition'
: dow[Math.log(flag) / Math.log(2)]}
{dow[Math.log(flag) / Math.log(2)]}
</Typography>
</Box>
<Divider orientation="vertical" flexItem />
</>
);
const scheduleType = (si: ScheduleItem) => (
<Box>
<Typography sx={{ fontSize: 11 }} color="primary">
{si.flags === ScheduleFlag.SCHEDULE_IMMEDIATE ? (
<>Immediate</>
) : si.flags === ScheduleFlag.SCHEDULE_TIMER ? (
<>Timer</>
) : si.flags === ScheduleFlag.SCHEDULE_CONDITION ? (
<>Condition</>
) : si.flags === ScheduleFlag.SCHEDULE_ONCHANGE ? (
<>On Change</>
) : (
<></>
)}
</Typography>
</Box>
);
useLayoutTitle(LL.SCHEDULER());
return (
@@ -283,9 +289,9 @@ const Scheduler: FC = () => {
<Cell stiff>
<Stack spacing={0.5} direction="row">
<Divider orientation="vertical" flexItem />
{si.flags === ScheduleFlag.SCHEDULE_IMMEDIATE ? (
<></>
) : si.flags < ScheduleFlag.SCHEDULE_TIMER ? (
{si.flags > 127 ? (
scheduleType(si)
) : (
<>
{dayBox(si, ScheduleFlag.SCHEDULE_MON)}
{dayBox(si, ScheduleFlag.SCHEDULE_TUE)}
@@ -295,12 +301,6 @@ const Scheduler: FC = () => {
{dayBox(si, ScheduleFlag.SCHEDULE_SAT)}
{dayBox(si, ScheduleFlag.SCHEDULE_SUN)}
</>
) : (
<>
{dayBox(si, ScheduleFlag.SCHEDULE_TIMER)}
{dayBox(si, ScheduleFlag.SCHEDULE_ONCHANGE)}
{dayBox(si, ScheduleFlag.SCHEDULE_CONDITION)}
</>
)}
</Stack>
</Cell>