mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-02 11:50:31 +03:00
Add configurable notification TTL (#24829)
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / AMD64 Smoke Test (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
* add configurable ttl for active alert notifications Notifications sent while an alert was active always used a TTL of 0, so the push service dropped them if the device wasn't reachable at that moment and users only received the notification sent when the alert ended. A new `ttl` notifications option, settable globally or per camera, lets the push service retry these notifications for that many seconds. It defaults to 0, and the settings UI warns that a non-zero value can deliver stale notifications. * make notification ttl a global advanced setting - Read `ttl` from the global notifications config and hide it on the camera form - Show it under Advanced Settings on the Notifications page - Remove extra padding that misaligned the Notifications cards with the rest of the form - Shorten the ttl warning * tweaks * use enum instead of raw seconds value
This commit is contained in:
@@ -7,7 +7,7 @@ const notifications: SectionConfigOverrides = {
|
||||
fieldOrder: ["enabled", "email"],
|
||||
fieldGroups: {},
|
||||
hiddenFields: ["enabled_in_config"],
|
||||
advancedFields: [],
|
||||
advancedFields: ["ttl"],
|
||||
fieldMessages: [
|
||||
{
|
||||
key: "profile-base-notifications-disabled",
|
||||
@@ -24,6 +24,14 @@ const notifications: SectionConfigOverrides = {
|
||||
camera.notifications.enabled_in_config,
|
||||
),
|
||||
},
|
||||
{
|
||||
key: "notifications-ttl-delay",
|
||||
field: "ttl",
|
||||
messageKey: "configMessages.notifications.ttlDelay",
|
||||
severity: "warning",
|
||||
position: "after",
|
||||
condition: (ctx) => ctx.formData?.ttl === "reliable",
|
||||
},
|
||||
],
|
||||
},
|
||||
global: {
|
||||
@@ -31,12 +39,13 @@ const notifications: SectionConfigOverrides = {
|
||||
"ui:before": { render: "NotificationsSettingsExtras" },
|
||||
enabled: { "ui:widget": "hidden" },
|
||||
email: { "ui:widget": "hidden" },
|
||||
ttl: { "ui:options": { enumI18nPrefix: "notificationTtl" } },
|
||||
cooldown: { "ui:widget": "hidden" },
|
||||
enabled_in_config: { "ui:widget": "hidden" },
|
||||
},
|
||||
},
|
||||
camera: {
|
||||
hiddenFields: ["enabled_in_config", "email"],
|
||||
hiddenFields: ["enabled_in_config", "email", "ttl"],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -340,7 +340,7 @@ export default function NotificationsSettingsExtras({
|
||||
set(nextNotifications, "enabled", desiredEnabled);
|
||||
const sanitizedNotifications = sanitizeSectionData(
|
||||
nextNotifications as ConfigSectionData,
|
||||
["enabled_in_config", "email"],
|
||||
["enabled_in_config", "email", "ttl"],
|
||||
);
|
||||
onPendingDataChange("notifications", camera.name, sanitizedNotifications);
|
||||
pendingCameraOverridesRef.current.add(camera.name);
|
||||
@@ -490,7 +490,7 @@ export default function NotificationsSettingsExtras({
|
||||
|
||||
return (
|
||||
<div className="flex size-full flex-col md:flex-row">
|
||||
<div className="scrollbar-container order-last mb-2 mt-2 flex h-full w-full flex-col overflow-y-auto px-2 md:order-none">
|
||||
<div className="scrollbar-container order-last mb-2 mt-2 flex h-full w-full flex-col overflow-y-auto md:order-none">
|
||||
<div className={cn("w-full max-w-5xl space-y-6")}>
|
||||
{isAdmin && (
|
||||
<SettingsGroupCard
|
||||
|
||||
Reference in New Issue
Block a user