Skip to content

Commit 5ea2087

Browse files
committed
feat(external_notify): add WeCom supports
1 parent ad9fa64 commit 5ea2087

File tree

30 files changed

+8086
-11403
lines changed

30 files changed

+8086
-11403
lines changed

app/src/api/external_notify.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface ExternalNotify extends ModelBase {
55
type: string
66
language: string
77
config: Record<string, string>
8+
enabled: boolean
89
}
910

1011
export interface TestMessageRequest {

app/src/components/Notification/notifications.ts

Lines changed: 0 additions & 190 deletions
Original file line numberDiff line numberDiff line change
@@ -3,196 +3,6 @@
33
/* eslint-disable ts/no-explicit-any */
44

55
const notifications: Record<string, { title: () => string, content: (args: any) => string }> = {
6-
7-
// general module notifications
8-
'Reload Remote Nginx Error': {
9-
title: () => $gettext('Reload Remote Nginx Error'),
10-
content: (args: any) => $gettext('Reload Nginx on %{node} failed, response: %{resp}', args, true),
11-
},
12-
'Reload Remote Nginx Success': {
13-
title: () => $gettext('Reload Remote Nginx Success'),
14-
content: (args: any) => $gettext('Reload Nginx on %{node} successfully', args, true),
15-
},
16-
'Restart Remote Nginx Error': {
17-
title: () => $gettext('Restart Remote Nginx Error'),
18-
content: (args: any) => $gettext('Restart Nginx on %{node} failed, response: %{resp}', args, true),
19-
},
20-
'Restart Remote Nginx Success': {
21-
title: () => $gettext('Restart Remote Nginx Success'),
22-
content: (args: any) => $gettext('Restart Nginx on %{node} successfully', args, true),
23-
},
24-
'Auto Backup Configuration Error': {
25-
title: () => $gettext('Auto Backup Configuration Error'),
26-
content: (args: any) => $gettext('Storage configuration validation failed for backup task %{backup_name}, error: %{error}', args, true),
27-
},
28-
'Auto Backup Failed': {
29-
title: () => $gettext('Auto Backup Failed'),
30-
content: (args: any) => $gettext('Backup task %{backup_name} failed to execute, error: %{error}', args, true),
31-
},
32-
'Auto Backup Storage Failed': {
33-
title: () => $gettext('Auto Backup Storage Failed'),
34-
content: (args: any) => $gettext('Backup task %{backup_name} failed during storage upload, error: %{error}', args, true),
35-
},
36-
'Auto Backup Completed': {
37-
title: () => $gettext('Auto Backup Completed'),
38-
content: (args: any) => $gettext('Backup task %{backup_name} completed successfully, file: %{file_path}', args, true),
39-
},
40-
'Certificate Expired': {
41-
title: () => $gettext('Certificate Expired'),
42-
content: (args: any) => $gettext('Certificate %{name} has expired', args, true),
43-
},
44-
'Certificate Expiration Notice': {
45-
title: () => $gettext('Certificate Expiration Notice'),
46-
content: (args: any) => $gettext('Certificate %{name} will expire in %{days} days', args, true),
47-
},
48-
'Certificate Expiring Soon': {
49-
title: () => $gettext('Certificate Expiring Soon'),
50-
content: (args: any) => $gettext('Certificate %{name} will expire in %{days} days', args, true),
51-
},
52-
'Certificate Expiring Soon_1': {
53-
title: () => $gettext('Certificate Expiring Soon'),
54-
content: (args: any) => $gettext('Certificate %{name} will expire in %{days} days', args, true),
55-
},
56-
'Certificate Expiring Soon_2': {
57-
title: () => $gettext('Certificate Expiring Soon'),
58-
content: (args: any) => $gettext('Certificate %{name} will expire in 1 day', args, true),
59-
},
60-
'Sync Certificate Error': {
61-
title: () => $gettext('Sync Certificate Error'),
62-
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} failed', args, true),
63-
},
64-
'Sync Certificate Success': {
65-
title: () => $gettext('Sync Certificate Success'),
66-
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} successfully', args, true),
67-
},
68-
'Sync Config Error': {
69-
title: () => $gettext('Sync Config Error'),
70-
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} failed', args, true),
71-
},
72-
'Sync Config Success': {
73-
title: () => $gettext('Sync Config Success'),
74-
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} successfully', args, true),
75-
},
76-
'Rename Remote Config Error': {
77-
title: () => $gettext('Rename Remote Config Error'),
78-
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} failed', args, true),
79-
},
80-
'Rename Remote Config Success': {
81-
title: () => $gettext('Rename Remote Config Success'),
82-
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} successfully', args, true),
83-
},
84-
'Delete Remote Config Error': {
85-
title: () => $gettext('Delete Remote Config Error'),
86-
content: (args: any) => $gettext('Delete %{path} on %{env_name} failed', args, true),
87-
},
88-
'Delete Remote Config Success': {
89-
title: () => $gettext('Delete Remote Config Success'),
90-
content: (args: any) => $gettext('Delete %{path} on %{env_name} successfully', args, true),
91-
},
92-
'External Notification Test': {
93-
title: () => $gettext('External Notification Test'),
94-
content: (args: any) => $gettext('This is a test message sent at %{timestamp} from Nginx UI.', args, true),
95-
},
96-
'Delete Remote Site Error': {
97-
title: () => $gettext('Delete Remote Site Error'),
98-
content: (args: any) => $gettext('Delete site %{name} from %{node} failed', args, true),
99-
},
100-
'Delete Remote Site Success': {
101-
title: () => $gettext('Delete Remote Site Success'),
102-
content: (args: any) => $gettext('Delete site %{name} from %{node} successfully', args, true),
103-
},
104-
'Disable Remote Site Error': {
105-
title: () => $gettext('Disable Remote Site Error'),
106-
content: (args: any) => $gettext('Disable site %{name} from %{node} failed', args, true),
107-
},
108-
'Disable Remote Site Success': {
109-
title: () => $gettext('Disable Remote Site Success'),
110-
content: (args: any) => $gettext('Disable site %{name} from %{node} successfully', args, true),
111-
},
112-
'Enable Remote Site Error': {
113-
title: () => $gettext('Enable Remote Site Error'),
114-
content: (args: any) => $gettext('Enable site %{name} on %{node} failed', args, true),
115-
},
116-
'Enable Remote Site Success': {
117-
title: () => $gettext('Enable Remote Site Success'),
118-
content: (args: any) => $gettext('Enable site %{name} on %{node} successfully', args, true),
119-
},
120-
'Enable Remote Site Maintenance Error': {
121-
title: () => $gettext('Enable Remote Site Maintenance Error'),
122-
content: (args: any) => $gettext('Enable site %{name} maintenance on %{node} failed', args, true),
123-
},
124-
'Enable Remote Site Maintenance Success': {
125-
title: () => $gettext('Enable Remote Site Maintenance Success'),
126-
content: (args: any) => $gettext('Enable site %{name} maintenance on %{node} successfully', args, true),
127-
},
128-
'Disable Remote Site Maintenance Error': {
129-
title: () => $gettext('Disable Remote Site Maintenance Error'),
130-
content: (args: any) => $gettext('Disable site %{name} maintenance on %{node} failed', args, true),
131-
},
132-
'Disable Remote Site Maintenance Success': {
133-
title: () => $gettext('Disable Remote Site Maintenance Success'),
134-
content: (args: any) => $gettext('Disable site %{name} maintenance on %{node} successfully', args, true),
135-
},
136-
'Rename Remote Site Error': {
137-
title: () => $gettext('Rename Remote Site Error'),
138-
content: (args: any) => $gettext('Rename site %{name} to %{new_name} on %{node} failed', args, true),
139-
},
140-
'Rename Remote Site Success': {
141-
title: () => $gettext('Rename Remote Site Success'),
142-
content: (args: any) => $gettext('Rename site %{name} to %{new_name} on %{node} successfully', args, true),
143-
},
144-
'Save Remote Site Error': {
145-
title: () => $gettext('Save Remote Site Error'),
146-
content: (args: any) => $gettext('Save site %{name} to %{node} failed', args, true),
147-
},
148-
'Save Remote Site Success': {
149-
title: () => $gettext('Save Remote Site Success'),
150-
content: (args: any) => $gettext('Save site %{name} to %{node} successfully', args, true),
151-
},
152-
'Delete Remote Stream Error': {
153-
title: () => $gettext('Delete Remote Stream Error'),
154-
content: (args: any) => $gettext('Delete stream %{name} from %{node} failed', args, true),
155-
},
156-
'Delete Remote Stream Success': {
157-
title: () => $gettext('Delete Remote Stream Success'),
158-
content: (args: any) => $gettext('Delete stream %{name} from %{node} successfully', args, true),
159-
},
160-
'Disable Remote Stream Error': {
161-
title: () => $gettext('Disable Remote Stream Error'),
162-
content: (args: any) => $gettext('Disable stream %{name} from %{node} failed', args, true),
163-
},
164-
'Disable Remote Stream Success': {
165-
title: () => $gettext('Disable Remote Stream Success'),
166-
content: (args: any) => $gettext('Disable stream %{name} from %{node} successfully', args, true),
167-
},
168-
'Enable Remote Stream Error': {
169-
title: () => $gettext('Enable Remote Stream Error'),
170-
content: (args: any) => $gettext('Enable stream %{name} on %{node} failed', args, true),
171-
},
172-
'Enable Remote Stream Success': {
173-
title: () => $gettext('Enable Remote Stream Success'),
174-
content: (args: any) => $gettext('Enable stream %{name} on %{node} successfully', args, true),
175-
},
176-
'Rename Remote Stream Error': {
177-
title: () => $gettext('Rename Remote Stream Error'),
178-
content: (args: any) => $gettext('Rename stream %{name} to %{new_name} on %{node} failed', args, true),
179-
},
180-
'Rename Remote Stream Success': {
181-
title: () => $gettext('Rename Remote Stream Success'),
182-
content: (args: any) => $gettext('Rename stream %{name} to %{new_name} on %{node} successfully', args, true),
183-
},
184-
'Save Remote Stream Error': {
185-
title: () => $gettext('Save Remote Stream Error'),
186-
content: (args: any) => $gettext('Save stream %{name} to %{node} failed', args, true),
187-
},
188-
'Save Remote Stream Success': {
189-
title: () => $gettext('Save Remote Stream Success'),
190-
content: (args: any) => $gettext('Save stream %{name} to %{node} successfully', args, true),
191-
},
192-
'All Recovery Codes Have Been Used': {
193-
title: () => $gettext('All Recovery Codes Have Been Used'),
194-
content: (args: any) => $gettext('Please generate new recovery codes in the preferences immediately to prevent lockout.', args, true),
195-
},
1966
}
1977

1988
export default notifications

0 commit comments

Comments
 (0)