mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-17 16:50:53 +00:00
more supported events, better UI (columns) for events in connection editor
This commit is contained in:
parent
1236d3968f
commit
e030906cdd
3 changed files with 20 additions and 11 deletions
|
|
@ -13,6 +13,9 @@ SUPPORTED_EVENTS = {
|
|||
"m3u_refresh": "M3U Refreshed",
|
||||
"client_connect": "Client Connected",
|
||||
"client_disconnect": "Client Disconnected",
|
||||
"login_failed": "Login Failed",
|
||||
"epg_blocked": "EPG Blocked",
|
||||
"m3u_blocked": "M3U Blocked",
|
||||
}
|
||||
|
||||
class Integration(models.Model):
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import {
|
|||
Flex,
|
||||
TextInput,
|
||||
Box,
|
||||
Title,
|
||||
Checkbox,
|
||||
Text,
|
||||
SimpleGrid,
|
||||
} from '@mantine/core';
|
||||
import { isNotEmpty, useForm } from '@mantine/form';
|
||||
import { SUBSCRIPTION_EVENTS } from '../../constants';
|
||||
|
|
@ -72,6 +72,7 @@ const ConnectionForm = ({ connection = null, isOpen, onClose }) => {
|
|||
);
|
||||
} else {
|
||||
form.reset();
|
||||
setSelectedEvents([]);
|
||||
}
|
||||
}, [connection]);
|
||||
|
||||
|
|
@ -128,7 +129,7 @@ const ConnectionForm = ({ connection = null, isOpen, onClose }) => {
|
|||
if (!isOpen) return null;
|
||||
|
||||
return (
|
||||
<Modal opened={isOpen} onClose={handleClose} title="Connection">
|
||||
<Modal opened={isOpen} size="lg" onClose={handleClose} title="Connection">
|
||||
<form onSubmit={form.onSubmit(onSubmit)}>
|
||||
<Stack gap="md">
|
||||
<TextInput
|
||||
|
|
@ -161,17 +162,19 @@ const ConnectionForm = ({ connection = null, isOpen, onClose }) => {
|
|||
|
||||
<Box>
|
||||
<Text size="sm" weight={500} mb={5}>
|
||||
Triggers
|
||||
Event Triggers
|
||||
</Text>
|
||||
<Stack gap="xs">
|
||||
{EVENT_OPTIONS.map((opt) => (
|
||||
<Checkbox
|
||||
key={opt.value}
|
||||
label={opt.label}
|
||||
checked={selectedEvents.includes(opt.value)}
|
||||
onChange={() => toggleEvent(opt.value)}
|
||||
/>
|
||||
))}
|
||||
<SimpleGrid cols={3}>
|
||||
{EVENT_OPTIONS.map((opt) => (
|
||||
<Checkbox
|
||||
key={opt.value}
|
||||
label={opt.label}
|
||||
checked={selectedEvents.includes(opt.value)}
|
||||
onChange={() => toggleEvent(opt.value)}
|
||||
/>
|
||||
))}
|
||||
</SimpleGrid>
|
||||
</Stack>
|
||||
</Box>
|
||||
|
||||
|
|
|
|||
|
|
@ -368,4 +368,7 @@ export const SUBSCRIPTION_EVENTS = {
|
|||
m3u_refresh: 'M3U Refreshed',
|
||||
client_connect: 'Client Connected',
|
||||
client_disconnect: 'Client Disconnected',
|
||||
login_failed: 'Login Failed',
|
||||
epg_blocked: 'EPG Blocked',
|
||||
m3u_blocked: 'M3U Blocked',
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue