refactor: cache index

This commit is contained in:
Jacky 2025-04-04 02:00:18 +00:00
parent 5d8d96fd4f
commit 269397e114
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
20 changed files with 532 additions and 364 deletions

View file

@ -4,34 +4,6 @@
const notifications: Record<string, { title: () => string, content: (args: any) => string }> = {
// cert module notifications
'Sync Certificate Error': {
title: () => $gettext('Sync Certificate Error'),
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} failed', args),
},
'Sync Certificate Success': {
title: () => $gettext('Sync Certificate Success'),
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} successfully', args),
},
// config module notifications
'Sync Config Error': {
title: () => $gettext('Sync Config Error'),
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} failed', args),
},
'Sync Config Success': {
title: () => $gettext('Sync Config Success'),
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} successfully', args),
},
'Rename Remote Config Error': {
title: () => $gettext('Rename Remote Config Error'),
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} failed', args),
},
'Rename Remote Config Success': {
title: () => $gettext('Rename Remote Config Success'),
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} successfully', args),
},
// site module notifications
'Delete Remote Site Error': {
title: () => $gettext('Delete Remote Site Error'),
@ -121,6 +93,34 @@ const notifications: Record<string, { title: () => string, content: (args: any)
title: () => $gettext('All Recovery Codes Have Been Used'),
content: (args: any) => $gettext('Please generate new recovery codes in the preferences immediately to prevent lockout.', args),
},
// cert module notifications
'Sync Certificate Error': {
title: () => $gettext('Sync Certificate Error'),
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} failed', args),
},
'Sync Certificate Success': {
title: () => $gettext('Sync Certificate Success'),
content: (args: any) => $gettext('Sync Certificate %{cert_name} to %{env_name} successfully', args),
},
// config module notifications
'Sync Config Error': {
title: () => $gettext('Sync Config Error'),
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} failed', args),
},
'Sync Config Success': {
title: () => $gettext('Sync Config Success'),
content: (args: any) => $gettext('Sync config %{config_name} to %{env_name} successfully', args),
},
'Rename Remote Config Error': {
title: () => $gettext('Rename Remote Config Error'),
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} failed', args),
},
'Rename Remote Config Success': {
title: () => $gettext('Rename Remote Config Success'),
content: (args: any) => $gettext('Rename %{orig_path} to %{new_path} on %{env_name} successfully', args),
},
}
export default notifications