template.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package notify
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. type TemplateCreateInput struct {
  17. apis.StandaloneAnonResourceCreateInput
  18. // description: Contact type, specifically, setting it to all means all contact type
  19. // require: true
  20. // example: email
  21. ContactType string `json:"contact_type"`
  22. // description: Template type
  23. // enum: ["title","content","remote"]
  24. // example: title
  25. TemplateType string `json:"template_type"`
  26. // description: Template topic
  27. // required: true
  28. // example: IMAGE_ACTIVE
  29. Topic string `json:"topic"`
  30. // description: Template content
  31. // required: true
  32. // example: 镜像 {{.name}} 上传完成
  33. Content string `json:"content"`
  34. // description: Example for using this template
  35. // required: true
  36. // example: {"name": "centos7.6"}
  37. Example string `json:"example"`
  38. // description: Language
  39. // enum: ["cn","en"]
  40. Lang string `json:"lang"`
  41. }
  42. type TemplateManagerSaveInput struct {
  43. ContactType string `json:"contact_type"`
  44. Templates []TemplateCreateInput `json:"templates"`
  45. Force bool `json:"force"`
  46. }
  47. type TemplateListInput struct {
  48. apis.StandaloneAnonResourceListInput
  49. // description: Contact type, specifically, setting it to all means all contact type
  50. // require: true
  51. // example: email
  52. ContactType string `json:"contact_type"`
  53. // description: Template type
  54. // enum: ["title","content","remote"]
  55. // example: title
  56. TemplateType string `json:"template_type"`
  57. // description: template topic
  58. // required: true
  59. // example: IMAGE_ACTIVE
  60. Topic string `json:"topic"`
  61. // description: Language
  62. // enum: ["cn","en"]
  63. Lang string `json:"lang"`
  64. }
  65. type TemplateUpdateInput struct {
  66. apis.StandaloneAnonResourceBaseUpdateInput
  67. // description: template content
  68. // required: true
  69. // example: 镜像 {{.name}} 上传完成
  70. Content string `json:"content"`
  71. // description: all example for using this template
  72. // required: true
  73. // example: {"name": "centos7.6"}
  74. Example string `json:"example"`
  75. }
  76. type TemplateDetails struct {
  77. apis.StandaloneResourceDetails
  78. STemplate
  79. }
  80. // 密码即将失效通知
  81. const (
  82. PWD_EXPIRE_SOON_TITLE_CN = `{{- $d := .resource_details -}}
  83. {{ $d.account }}:您的密码有效期将过`
  84. PWD_EXPIRE_SOON_TITLE_EN = `{{- $d := .resource_details -}}
  85. {{ $d.account }}:Your password is valid and will expire soon`
  86. PWD_EXPIRE_SOON_CONTENT_CN = `{{- $d := .resource_details -}}
  87. {{ $d.account }}:您的密码将在{{ .advance_days }} 天后失效,请及时登录平台更新密码。`
  88. PWD_EXPIRE_SOON_CONTENT_EN = `{{- $d := .resource_details -}}
  89. {{ $d.account }}:Your password will expire in {{ .advance_days }} days. Please log in to the platform in time to update your password.`
  90. )
  91. // 资源即将到期通知
  92. const (
  93. EXPIRED_RELEASE_TITLE_CN = `{{- $d := .resource_details -}}
  94. {{ $d.project }}项目的
  95. {{ .resource_type_display }}{{ $d.name }}即将到期`
  96. EXPIRED_RELEASE_TITLE_EN = `{{- $d := .resource_details -}}
  97. {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} expiration`
  98. EXPIRED_RELEASE_CONTENT_CN = `{{- $d := .resource_details -}}
  99. 您在{{ $d.project }}项目的
  100. {{- if $d.brand -}}
  101. {{ $d.brand }}平台
  102. {{- end -}}
  103. {{- if $d.private_dns -}}
  104. ,内网地址为{{ $d.private_dns }}:{{ $d.private_connect_port }}
  105. {{- end -}}
  106. {{- if $d.public_dns -}}
  107. ,外网地址为{{ $d.public_dns }}:{{ $d.public_connect_port }}的
  108. {{- end -}}
  109. {{ .resource_type_display }}{{ $d.name }}将在{{ .advance_days }}天后到期释放,{{ if $d.auto_renew }}到期已开启自动续费,{{ end }}如有其它变更,请尽快前往控制台处理`
  110. EXPIRED_RELEASE_CONTENT_EN = `{{- $d := .resource_details -}}
  111. Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.public_dns -}} with external address {{ $d.public_dns }}:{{ $d.public_connect_port }} {{ end -}} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} will expire and be released in {{ .advance_days }} days. {{ if $d.auto_renew }}It has turned on automatic renewal. {{ end }}If there are other changes, please go to the console as soon as possible.`
  112. )
  113. // 服务崩溃通知
  114. const (
  115. PANIC_TITLE_CN = `{{- $d := .resource_details -}}
  116. {{ .resource_type }} {{ $d.task_name }} 崩溃了`
  117. PANIC_TITLE_EN = `{{- $d := .resource_details -}}
  118. {{ .resource_type }} {{ $d.task_name }} PANIC`
  119. PANIC_CONTENT_CN = `{{- $d := .resource_details -}}
  120. {{ .resource_type }} {{ $d.task_name }} PANIC {{- if $d.error -}} 错误: {{ $d.error }} {{- end -}}
  121. 堆栈信息:
  122. {{ $d.stack }}`
  123. PANIC_CONTENT_EN = `{{- $d := .resource_details -}}
  124. {{ .resource_type }} {{ $d.task_name }} PANIC {{- if $d.error -}} Error: {{ $d.error }} {{- end -}}
  125. Stack Info:
  126. {{ $d.stack }}`
  127. )
  128. // 日志容量超限通知
  129. const (
  130. ACTION_LOG_EXCEED_COUNT_TITLE_CN = `{{- $d := .resource_details -}}
  131. 操作日志超出设置数量{{ $d.exceed_count }}条,当前{{ $d.current_count }}条`
  132. ACTION_LOG_EXCEED_COUNT_TITLE_EN = `{{- $d := .resource_details -}}
  133. Action logs excced expected count {{ $d.exceed_count }}, current count is {{ $d.current_count }}`
  134. ACTION_LOG_EXCEED_COUNT_CONTENT_CN = `{{- $d := .resource_details.action -}}
  135. 当前日志 ID: {{ $d.id }}`
  136. ACTION_LOG_EXCEED_COUNT_CONTENT_EN = `{{- $d := .resource_details.action -}}
  137. Current log ID: {{ $d.id }}`
  138. )
  139. // 完整性校验失败通知
  140. const (
  141. CHECKSUM_TEST_FAILED_TITLE_CN = `{{- $d := .resource_details -}}
  142. {{- if eq .resource_type "cloudpods_component" }}
  143. {{ $d.title }}
  144. {{- else -}}
  145. {{ .resource_type_display }}完整性校验失败
  146. {{- end -}}`
  147. CHECKSUM_TEST_FAILED_TITLE_EN = `{{- $d := .resource_details -}}
  148. {{- if eq .resource_type "cloudpods_component" }}
  149. {{ $d.title }}
  150. {{- else -}}
  151. The checksum of {{ .resource_type_display }} test failed
  152. {{- end -}}`
  153. CHECKSUM_TEST_FAILED_CONTENT_CN = `{{- $d := .resource_details -}}
  154. {{- if eq .resource_type "db_table_record" }}
  155. 表{{ $d.table_name }}记录{{ $d.name }}被修改,完整性校验失败。期望校验和({{ $d.expected_checksum }}) != 计算校验和({{ $d.calculated_checksum }})。
  156. {{- end -}}
  157. {{- if eq .resource_type "cloudpods_component" }}
  158. {{ $d.details }}
  159. {{- end -}}
  160. {{- if eq .resource_type "snapshot" }}
  161. 快照{{ $d.name }}的内存快照完整性校验失败
  162. {{- end -}}
  163. {{- if eq .resource_type "image" }}
  164. 镜像{{ $d.name }}完整性校验失败
  165. {{- end -}}
  166. {{- if eq .resource_type "vm_integrity" }}
  167. 主机{{ $d.name }}完整性校验失败
  168. {{- end -}}`
  169. CHECKSUM_TEST_FAILED_CONTENT_EN = `{{- $d := .resource_details -}}
  170. {{- if eq .resource_type "db_table_record" }}
  171. The record {{ $d.name }} in table {{ $d.table_name }} of the database {{ $d.db_name }} has been modified because the checksum test failed. Expected_checksum({{ $d.expected_checksum }}) != Calculated_checksum({{ $d.calculated_checksum }}).
  172. {{- end -}}
  173. {{- if eq .resource_type "cloudpods_component" }}
  174. {{ $d.details }}
  175. {{- end -}}
  176. {{- if eq .resource_type "snapshot" }}
  177. The checksum of the memory snapshot of the snapshot {{ $d.name }} test failed.
  178. {{- end -}}
  179. {{- if eq .resource_type "image" }}
  180. The checksum of the image {{ $d.name }} test failed.
  181. {{- end -}}`
  182. )
  183. // 通用通知
  184. const (
  185. COMMON_TITLE_CN = `{{- $d := .resource_details -}}
  186. {{- if $d.project -}}
  187. {{ $d.project }}项目的
  188. {{- end -}}
  189. {{ .resource_type_display }}{{ $d.name }}{{ .action_display }}{{ .result_display }}`
  190. COMMON_TITLE_EN = `{{- $d := .resource_details -}}
  191. The {{ .resource_type_display }} {{ .Name }} {{ if $d.project }} in poject {{ $d.project }} {{ end -}} {{ .action_display }} {{ .result_display }}`
  192. COMMON_CONTENT_CN = `{{- $d := .resource_details -}}
  193. {{- if $d.project -}}
  194. 在{{ $d.project }}项目
  195. {{- end -}}
  196. {{- if $d.brand -}}
  197. {{ $d.brand }}平台
  198. {{- end -}}
  199. 的{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}{{.result_display}}
  200. {{- if eq .result "failed" -}}
  201. ,请尽快前往控制台进行处理
  202. {{- end -}}`
  203. COMMON_CONTENT_EN = `{{- $d := .resource_details -}}
  204. Your {{- if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been {{ .action_display }} {{ .result_display }}
  205. {{- if eq .result "failed" -}}
  206. . And please go to the console as soon as possible to process.
  207. {{- end -}}`
  208. )
  209. // 服务组件异常通知
  210. const (
  211. EXCEPTION_TITLE_CN = `{{- $d := .resource_details -}}
  212. {{ .resource_type }} {{ $d.name }} 发生异常: {{ $d.message }}`
  213. EXCEPTION_TITLE_EN = `{{- $d := .resource_details -}}
  214. {{ .resource_type }} {{ $d.name }} exception occurs: {{ $d.message }}`
  215. EXCEPTION_CONTENT_CN = `{{- $d := .resource_details -}}
  216. {{ .resource_type }} {{ $d.name }} 发生异常: {{ $d.message }}`
  217. EXCEPTION_CONTENT_EN = `{{- $d := .resource_details -}}
  218. {{ .resource_type }} {{ $d.name }} exception occurs: {{ $d.message }}`
  219. )
  220. // 数据库主从同步不一致通知
  221. const (
  222. MYSQL_OUT_OF_SYNC_TITLE_CN = `{{- $d := .resource_details -}}
  223. 数据库 {{$d.ip}} 的主从同步不一致,请及时检查。`
  224. MYSQL_OUT_OF_SYNC_TITLE_EN = `{{- $d := .resource_details -}}
  225. The primary and secondary synchronization of the database ({{ $d.ip }}) is inconsistent, please check in time.`
  226. MYSQL_OUT_OF_SYNC_CONTENT_CN = `{{- $d := .resource_details -}}
  227. 数据库 {{$d.ip}} 的主从同步不一致,请及时检查。
  228. {{ range $status := $d.status }}
  229. 数据库 {{$status.ip}} 状态:
  230. {{- if not $status.operator_error }}
  231. - Slave_IO_Running: {{$status.slave_io_running}}
  232. - Slave_SQL_Running: {{$status.slave_sql_running}}
  233. {{- if $status.last_error }}
  234. - Last_Error: {{$status.last_error}}
  235. {{- end -}}
  236. {{- if $status.last_io_error }}
  237. - Last_IO_Error: {{$status.last_io_error}}
  238. {{- end }}
  239. {{else}}
  240. - Operator_Error: {{$status.operator_error}}
  241. {{- end}}
  242. {{end}}`
  243. MYSQL_OUT_OF_SYNC_CONTENT_EN = `{{- $d := .resource_details -}}
  244. The primary and secondary synchronization of the database ({{ $d.ip }}) is inconsistent, please check in time.
  245. {{ range $status := $d.status }}
  246. Database {{$status.ip}} status:
  247. {{- if not $status.operator_error }}
  248. - Slave_IO_Running: {{$status.slave_io_running}}
  249. - Slave_SQL_Running: {{$status.slave_sql_running}}
  250. {{- if $status.last_error }}
  251. - Last_Error: {{$status.last_error}}
  252. {{- end -}}
  253. {{- if $status.last_io_error }}
  254. - Last_IO_Error: {{$status.last_io_error}}
  255. {{- end }}
  256. {{else}}
  257. - Operator_Error: {{$status.operator_error}}
  258. {{- end}}
  259. {{end}}`
  260. )
  261. // 网络拓扑不一致通知
  262. const (
  263. NET_OUT_OF_SYNC_TITLE_CN = `{{- $d := .resource_details -}}
  264. {{ $d.service_name }}服务的网络拓扑信息同步不一致,请及时检查。 `
  265. NET_OUT_OF_SYNC_TITLE_EN = `{{- $d := .resource_details -}}
  266. {{ $d.service_name }}: The network topology information of the service is inconsistent, please check in time.`
  267. NET_OUT_OF_SYNC_CONTENT_CN = `{{- $d := .resource_details -}}
  268. {{ $d.service_name }}服务的网络拓扑信息同步不一致,请及时检查。 `
  269. NET_OUT_OF_SYNC_CONTENT_EN = `{{- $d := .resource_details -}}
  270. {{ $d.service_name }}: The network topology information of the service is inconsistent, please check in time.`
  271. )
  272. // 离线通知
  273. const (
  274. OFFLINE_TITLE_CN = `{{- $d := .resource_details -}}
  275. {{ .resource_type }} {{ $d.name }} 离线`
  276. OFFLINE_TITLE_EN = `{{- $d := .resource_details -}}
  277. The {{ .resource_type }} {{ $d.name }} Offline `
  278. OFFLINE_CONTENT_CN = `{{- $d := .resource_details -}}
  279. {{ .resource_type }} {{ $d.name }} 离线 {{- if $d.reason -}} 原因: {{ $d.reason }} {{- end -}}`
  280. OFFLINE_CONTENT_EN = `{{- $d := .resource_details -}}
  281. The {{ .resource_type }} {{ $d.name }} Offline {{- if $d.reason -}} Reason: {{ $d.reason }}的 {{- end -}}`
  282. )
  283. // 资源加入回收站通知
  284. const (
  285. PENDING_DELETE_TITLE_CN = `{{- $d := .resource_details -}}
  286. {{- if $d.project -}}
  287. {{ $d.project }}项目的
  288. {{- end -}}
  289. {{ .resource_type_display }}{{ $d.name }}成功加入回收站`
  290. PENDING_DELETE_TITLE_EN = `{{- $d := .resource_details -}}
  291. The {{ .resource_type_display }} {{ .Name }} {{ if $d.project }} in poject {{ $d.project }} {{ end -}} has been added to recycle bin successfully`
  292. PENDING_DELETE_CONTENT_CN = `{{- $d := .resource_details -}}
  293. 您在{{ $d.project }}项目的
  294. {{- if $d.ips -}}
  295. IP地址为{{ $d.ips }}的
  296. {{- end -}}
  297. {{- if $d.ip_addr -}}
  298. IP地址为{{ $d.ip_addr }}的
  299. {{- end -}}
  300. {{- if $d.brand -}}
  301. {{ $d.brand }}平台
  302. {{- end -}}
  303. {{ .resource_type_display }}{{ $d.name }}成功加入回收站`
  304. PENDING_DELETE_CONTENT_EN = `{{- $d := .resource_details -}}
  305. Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type_display }} {{ $d.name }}
  306. {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been added to recycle bin successfully
  307. {{- if $d.private_dns -}}
  308. , the intranet address is {{ $d.private_dns }}:{{ $d.private_connect_port }}
  309. {{- end -}}
  310. {{- if $d.public_dns -}}
  311. , the external address is {{ $d.public_dns }}:{{ $d.public_connect_port }}
  312. {{- end -}}
  313. {{- if and $d.address_type $d.address -}}
  314. , the service address is {{ $d.address_type }}{{ $d.address }}
  315. {{- end -}}
  316. {{- if $d.ips -}}
  317. , the IP address is {{ $d.ips }}
  318. {{- end -}}
  319. {{- if $d.ip_addr -}}
  320. , the IP address is {{ $d.ip_addr }}
  321. {{- end -}}`
  322. )
  323. // 虚拟机崩溃通知
  324. const (
  325. SERVER_PANICKED_TITLE_CN = `{{- $d := .resource_details -}}
  326. 您在{{ $d.project }}项目的虚拟机{{ $d.name }}崩溃了`
  327. SERVER_PANICKED_TITLE_EN = `{{- $d := .resource_details -}}
  328. {{ .resource_type }} {{ $d.task_name }} PANIC`
  329. SERVER_PANICKED_CONTENT_CN = `{{- $d := .resource_details -}}
  330. 您在{{ $d.project }}项目的虚拟机{{ $d.name }}崩溃了`
  331. SERVER_PANICKED_CONTENT_EN = `{{- $d := .resource_details -}}
  332. The server {{ $d.name }} in project {{ $d.project }} panicked.`
  333. )
  334. // 资源定时调度任务通知
  335. const (
  336. SCHEDULEDTASK_EXECUTE_TITLE_CN = `{{- $d := .resource_details -}}
  337. 您在{{ $d.project }}项目的定时任务执行成功`
  338. SCHEDULEDTASK_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
  339. The scheduled task in {{ $d.project }} execute successfully`
  340. SCHEDULEDTASK_EXECUTE_CONTENT_CN = `{{- $d := .resource_details -}}
  341. 您在{{ $d.project }}项目的定时任务执行成功`
  342. SCHEDULEDTASK_EXECUTE_CONTENT_EN = `{{- $d := .resource_details -}}
  343. The scheduled task in {{ $d.project }} successfully {{ $d.operation_display }} the {{ $d.resource_type_display }} {{ $d.resource_name }}`
  344. )
  345. // 服务异常通知
  346. const (
  347. SERVICE_ABNORMAL_TITLE_CN = `{{- $d := .resource_details -}}
  348. 服务{{ $d.service_name }}异常`
  349. SERVICE_ABNORMAL_TITLE_EN = `{{- $d := .resource_details -}}
  350. Server {{ $d.service_name }} abnormal`
  351. SERVICE_ABNORMAL_CONTENT_CN = `{{- $d := .resource_details -}}
  352. 服务: {{ $d.service_name }} 异常。
  353. 方法: {{ $d.method }}
  354. 路径: {{ $d.path }}
  355. {{- if $d.body }}
  356. 请求: {{ $d.body -}}
  357. {{ end }}
  358. 错误: {{ $d.error }}`
  359. SERVICE_ABNORMAL_CONTENT_EN = `{{- $d := .resource_details -}}
  360. Service: {{ $d.service_name }} abnormal
  361. Method: {{ $d.method }}
  362. Path: {{ $d.path }}
  363. {{- if $d.body }}
  364. Body: {{ $d.body -}}
  365. {{ end }}
  366. Error: {{ $d.error }}`
  367. )
  368. // 弹性伸缩组策略生效通知
  369. const (
  370. SCALINGPOLICY_EXECUTE_TITLE_CN = `{{- $d := .resource_details -}}
  371. {{ $d.project }}项目的弹性伸缩组{{ $d.scaling_group }}中的伸缩策略{{ $d.name }}满足触发条件`
  372. SCALINGPOLICY_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
  373. The scaling policy {{ $d.name }} in the scaling group {{ $d.scaling_group }} triggered`
  374. SCALINGPOLICY_EXECUTE_CONTENT_CN = `{{- $d := .resource_details -}}
  375. 您在{{ $d.project }}项目的弹性伸缩组{{ $d.scaling_group }}中的{{ $d.trigger_type_display }}类型伸缩策略{{ $d.name }}满足触发条件,成功{{ $d.action_display }}{{ $d.number }}{{ $d.unit_display }}实例`
  376. SCALINGPOLICY_EXECUTE_CONTENT_EN = `{{- $d := .resource_details -}}
  377. The {{ $d.trigger_type_display }} type scaling policy {{ $d.name }} in the scaling group {{ $d.scaling_group }} of the {{ $d.project }} project satisfies the trigger conditions, and {{ $d.action_display }} {{ $d.number }}{{ $d.unit_display }} instances successfully`
  378. )
  379. // 自动快照策略生效通知
  380. const (
  381. SNAPSHOTPOLICY_EXECUTE_TITLE_CN = `{{- $d := .resource_details -}}
  382. {{ $d.project }}项目的自动快照策略{{ $d.name }}生效`
  383. SNAPSHOTPOLICY_EXECUTE_TITLE_EN = `{{- $d := .resource_details -}}
  384. The snapshot policy {{ $d.name }} in the {{ $d.project }} project executed`
  385. SNAPSHOTPOLICY_EXECUTE_CONTENT_CN = `{{- $d := .resource_details -}}
  386. 您在{{ $d.project }}项目的自动快照策略{{ $d.name }}为硬盘{{ $d.disk }}创建快照成功`
  387. SNAPSHOTPOLICY_EXECUTE_CONTENT_EN = `{{- $d := .resource_details -}}
  388. The snapshot policy {{ $d.name }} in the {{ $d.project }} project successfully creates a snapshot for the disk {{ $d.disk }}`
  389. )
  390. // 资源变更通知
  391. const (
  392. UPDATE_TITLE_CN = `{{- $d := .resource_details -}}
  393. {{- if $d.project -}}
  394. {{ $d.project }}项目的
  395. {{- end -}}
  396. {{ .resource_type_display }}{{ $d.name }}{{ .action_display }}成功`
  397. UPDATE_TITLE_EN = `{{- $d := .resource_details -}}
  398. The {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} {{ .action_display }} successfully`
  399. UPDATE_CONTENT_CN = `{{- $d := .resource_details -}}
  400. {{- if $d.project -}}
  401. 在{{ $d.project }}项目
  402. {{- end -}}
  403. {{- if $d.brand -}}
  404. {{ $d.brand }}平台
  405. {{- end -}}
  406. 的{{ .resource_type_display }}{{ $d.name }}{{ .action_display }}成功
  407. {{- if $d.account -}}
  408. ,帐号为{{ $d.account }}
  409. {{- end -}}
  410. {{- if $d.password -}}
  411. ,密码为{{ $d.password }}
  412. {{- end -}}
  413. ,更多信息请前往控制台进行查看`
  414. UPDATE_CONTENT_EN = `{{- $d := .resource_details -}}
  415. Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} has been {{ .action_display }} successfully
  416. {{- if $d.account -}}
  417. , the acount is {{ $d.account }}
  418. {{- end -}}
  419. {{- if $d.password -}}
  420. , the password is {{ $d.password }}
  421. {{- end -}}
  422. , and please go to the console to view more information`
  423. )
  424. // 用户锁定通知
  425. const (
  426. USER_LOCK_TITLE_CN = `{{- $d := .resource_details -}}
  427. 账号{{ $d.name }}已被锁定`
  428. USER_LOCK_TITLE_EN = `{{- $d := .resource_details -}}
  429. Account {{ $d.name }} has been locked`
  430. USER_LOCK_CONTENT_CN = `{{- $d := .resource_details -}}
  431. 账号{{ $d.name }}由于异常登录已被锁定,请核实情况,如果需要为用户解锁,请到用户列表启用该用户。`
  432. USER_LOCK_CONTENT_EN = `{{- $d := .resource_details -}}
  433. The account {{ $d.name }} has been locked due to abnormal login. Please verify the situation. If you need to unlock the user, please go to the user list to enable the user.`
  434. )
  435. // 云账号状态异常通知
  436. const (
  437. SYNC_ACCOUNT_STATUS_TITLE_CN = `{{- $d := .resource_details -}}
  438. 云账号{{ $d.name}}状态异常`
  439. SYNC_ACCOUNT_STATUS_TITLE_EN = `{{- $d := .resource_details -}}
  440. The account {{ $d.name }} status is abnormal`
  441. SYNC_ACCOUNT_STATUS_CONTENT_CN = `{{- $d := .resource_details -}}
  442. 云账号{{ $d.name }}状态异常,请及时检查。`
  443. SYNC_ACCOUNT_STATUS_CONTENT_EN = `{{- $d := .resource_details -}}
  444. The account {{ $d.name }} status is abnormal. Please check in time.`
  445. )
  446. // work阻塞通知
  447. const (
  448. WORK_BLOCK_TITLE_CN = `{{- $d := .resource_details -}}
  449. 服务{{ d.service_name}} worker阻塞半小时,请及时检查。`
  450. WORK_BLOCK_TITLE_EN = `{{- $d := .resource_details -}}
  451. The service: {{ d.service_name}} worker has been block 30 minutes.Please verify the service in time.`
  452. WORK_BLOCK_CONTENT_CN = `{{- $d := .resource_details -}}
  453. 服务{{ d.service_name}} worker阻塞半小时,请及时检查。`
  454. WORK_BLOCK_CONTENT_EN = `{{- $d := .resource_details -}}
  455. The service: {{ d.service_name}} worker has been block 30 minutes.Please verify the service in time.`
  456. )
  457. // TODO
  458. // 资源挂载\卸载通知
  459. const (
  460. // ACTION_ATTACH_TITLE_CN = `{{- $d := .resource_details -}}
  461. // 操作日志超出设置数量{{ $d.exceed_count }}条,当前{{ $d.current_count }}条`
  462. // ACTION_ATTACH_TITLE_EN = `{{- $d := .resource_details -}}
  463. // Action logs excced expected count {{ $d.exceed_count }}, current count is {{ $d.current_count }}`
  464. // ACTION_ATTACH_CONTENT_CN = `{{- $d := .resource_details.action -}}
  465. // 当前日志 ID: {{ $d.id }}`
  466. // ACTION_ATTACH_CONTENT_EN = `{{- $d := .resource_details.action -}}
  467. // Current log ID: {{ $d.id }}`
  468. )
  469. const (
  470. STATUS_CHANGED_TITLE_CN = `{{- $d := .resource_details -}}
  471. {{ $d.project }}项目的
  472. {{ .resource_type_display }}{{ $d.name }}状态发生变更`
  473. STATUS_CHANGED_TITLE_EN = `{{- $d := .resource_details -}}
  474. {{ .resource_type }} {{ $d.name }} {{ if $d.project -}} in project {{ $d.project }} {{ end -}} status changed`
  475. STATUS_CHANGED_CONTENT_CN = `{{- $d := .resource_details -}}
  476. 您在{{ $d.project }}项目的
  477. {{- if $d.brand -}}
  478. {{ $d.brand }}平台
  479. {{- end -}}
  480. {{ .resource_type_display }}{{ $d.name }}状态发生变更,原状态为:{{ $d.old_status }},变更后状态为{{$d.new_status }}`
  481. STATUS_CHANGED_CONTENT_EN = `{{- $d := .resource_details -}}
  482. Your {{ if $d.brand -}} {{ $d.brand }} {{ end -}} {{ .resource_type }} {{ $d.name }} status has changed,old status: {{ $d.old_status }},new_status: {{$d.new_status }}{{ if $d.project -}} in project {{ $d.project }} {{ end -}} `
  483. )