index.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import i18n from '@/locales'
  2. import { arrayToObj } from '@/utils/utils'
  3. export const NOTIFY_TOPIC_TYPES = [
  4. { key: 'automated_process', label: i18n.t('system.notify.topic.type.automated_process') },
  5. { key: 'resource', label: i18n.t('system.notify.topic.type.resource') },
  6. { key: 'security', label: i18n.t('iam.security_info') },
  7. ]
  8. export const NOTIFY_TOPIC_TYPES_MAP = arrayToObj(NOTIFY_TOPIC_TYPES, 'key')
  9. export const NOTIFY_SUBSCRIBER_TYPES = [
  10. { key: 'receiver', label: i18n.t('system.notify.subscriber.type.receiver') },
  11. { key: 'role', label: i18n.t('system.notify.subscriber.type.role') },
  12. { key: 'robot', label: i18n.t('system.notify.subscriber.type.robot') },
  13. ]
  14. export const NOTIFY_SUBSCRIBER_TYPES_MAP = arrayToObj(NOTIFY_SUBSCRIBER_TYPES, 'key')
  15. export const NOTIFY_TOPIC_NAMES_MAP = {
  16. 'resource sync': i18n.t('system.notify.name.resource_sync'),
  17. 'snapshot policy execute': i18n.t('system.notify.name.snapshot_policy_execute'),
  18. 'scheduled task execute': i18n.t('system.notify.name.scheduled_task_execute'),
  19. 'scaling policy execute': i18n.t('system.notify.name.scaling_policy_execute'),
  20. 'resource update': i18n.t('system.notify.name.resource_update'),
  21. 'resource release due 3 day': i18n.t('system.notify.name.resource_release_due_3_day'),
  22. 'resource release due 1 day': i18n.t('system.notify.name.resource_release_due_1_day'),
  23. 'resource release due 30 day': i18n.t('system.notify.name.resource_release_due_n_day', [30]),
  24. 'resource operation failed': i18n.t('system.notify.name.resource_operation_failed'),
  25. 'resource create or delete': i18n.t('system.notify.name.resource_create_or_delete'),
  26. 'resource change config': i18n.t('system.notify.name.resource_change_config'),
  27. 'system exception event': i18n.t('iam.system_error_notify'),
  28. 'user lock': i18n.t('iam.user_lock_notify'),
  29. 'checksum test failed': i18n.t('iam.checksum_error_notify'),
  30. 'action log exceed count': i18n.t('iam.action_log_exceed_count'),
  31. 'password expire due 1 day': i18n.t('system.notify.name.password_expire_due_1_day'),
  32. 'password expire due 7 day': i18n.t('system.notify.name.password_expire_due_7_day'),
  33. 'net out of sync': i18n.t('system.notify.name.net_out_of_sync'),
  34. 'mysql out of sync': i18n.t('system.notify.name.mysql_out_of_sync'),
  35. 'cloud account sync status': i18n.t('system.notify.name.cloud_account_sync_status'),
  36. 'service abnormal': i18n.t('system.notify.name.service_abnormal'),
  37. 'server panicked': i18n.t('iam.notify.server_panicked'),
  38. 'resource release': i18n.t('iam.notify_topic.resource_release'),
  39. 'password expire': i18n.t('iam.notify_topic.password_expire'),
  40. }
  41. export const NOTIFY_ROLE_SCOPES = [
  42. { key: 'system', label: i18n.t('common_235') + i18n.t('common_723') },
  43. { key: 'domain', label: i18n.t('common_235') + i18n.t('common_437') },
  44. { key: 'project', label: i18n.t('common_235') + i18n.t('common_310') },
  45. ]
  46. export const NOTIFY_ROLE_SCOPES_MAP = arrayToObj(NOTIFY_ROLE_SCOPES, 'key')