Add the route to update a relay

This commit is contained in:
2024-08-31 20:26:16 +02:00
parent b0023a5167
commit bbe128e055
6 changed files with 88 additions and 15 deletions

View File

@ -35,6 +35,11 @@ export function DeviceRelays(p: {
setCurrRelay(undefined);
};
const updateRelay = async (r: DeviceRelay) => {
setDialogOpen(true);
setCurrRelay(r);
};
const deleteRelay = async (r: DeviceRelay) => {
if (
!(await confirm("Do you really want to delete this relay configuration?"))
@ -95,7 +100,7 @@ export function DeviceRelays(p: {
secondaryAction={
<>
<Tooltip title="Edit the relay configuration">
<IconButton>
<IconButton onClick={() => updateRelay(r)}>
<EditIcon />
</IconButton>
</Tooltip>