aboutsummaryrefslogtreecommitdiff
path: root/modern
diff options
context:
space:
mode:
Diffstat (limited to 'modern')
-rw-r--r--modern/src/resources/l10n/en.json1
-rw-r--r--modern/src/settings/NotificationPage.js11
2 files changed, 11 insertions, 1 deletions
diff --git a/modern/src/resources/l10n/en.json b/modern/src/resources/l10n/en.json
index 308d92d8..2400ecf9 100644
--- a/modern/src/resources/l10n/en.json
+++ b/modern/src/resources/l10n/en.json
@@ -485,6 +485,7 @@
"notificationType": "Type of Notification",
"notificationAlways": "All Devices",
"notificationNotificators": "Channels",
+ "notificatorCommand": "Command",
"notificatorWeb": "Web",
"notificatorMail": "Mail",
"notificatorSms": "SMS",
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"