aboutsummaryrefslogtreecommitdiff
path: root/modern/src/settings/NotificationPage.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-02-20 14:33:36 -0800
committerAnton Tananaev <anton@traccar.org>2023-02-20 14:33:36 -0800
commitef5058c6960157652ea660423625fd6841fb5a3a (patch)
tree06ca4ec6d43ecfe380f5fea3e316d79dd7de38de /modern/src/settings/NotificationPage.js
parente043691a1f4e61509b9192ad9d169ea65f6933ea (diff)
downloadtrackermap-web-ef5058c6960157652ea660423625fd6841fb5a3a.tar.gz
trackermap-web-ef5058c6960157652ea660423625fd6841fb5a3a.tar.bz2
trackermap-web-ef5058c6960157652ea660423625fd6841fb5a3a.zip
Implement command notificator
Diffstat (limited to 'modern/src/settings/NotificationPage.js')
-rw-r--r--modern/src/settings/NotificationPage.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/modern/src/settings/NotificationPage.js b/modern/src/settings/NotificationPage.js
index a5a9d8d2..fdefedaf 100644
--- a/modern/src/settings/NotificationPage.js
+++ b/modern/src/settings/NotificationPage.js
@@ -52,7 +52,7 @@ const NotificationPage = () => {
}));
});
- const validate = () => item && item.type && item.notificators;
+ const validate = () => item && item.type && item.notificators && (!item.notificators?.includes('command') || item.commandId);
return (
<EditItemView
@@ -100,6 +100,15 @@ const NotificationPage = () => {
titleGetter={(it) => t(prefixString('notificator', it.type))}
label={t('notificationNotificators')}
/>
+ {item.notificators?.includes('command') && (
+ <SelectField
+ value={item.commandId || 0}
+ onChange={(event) => setItem({ ...item, commandId: Number(event.target.value) })}
+ endpoint="/api/commands"
+ titleGetter={(it) => it.description}
+ label={t('sharedSavedCommand')}
+ />
+ )}
<Button
variant="outlined"
color="primary"