flashduty-knowledge-base 1.2.4 → 1.2.5-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/en.js CHANGED
@@ -469,7 +469,7 @@ Nightingale/Flashcat to Flashduty alert severity mapping:
469
469
 
470
470
  </details>
471
471
 
472
- `,o=`---
472
+ `,i=`---
473
473
  title: "Prometheus Integration Guide"
474
474
  description: "Push Prometheus alert events to Flashduty through AlertManager using webhooks. When an alert is triggered, it sends a trigger event to Flashduty, and when the alert recovers, it sends a recovery event."
475
475
  date: "2024-05-11T10:00:00+08:00"
@@ -651,7 +651,7 @@ Prometheus to Flashduty severity mapping:
651
651
 
652
652
 
653
653
 
654
- `,i=`---
654
+ `,o=`---
655
655
  title: "Grafana Integration"
656
656
  description: "Sync Grafana alert events to Flashduty via webhook to achieve automated alert noise reduction."
657
657
  date: "2024-05-11T10:00:00+08:00"
@@ -3124,7 +3124,7 @@ Choose this option when you need to route alerts to different channels based on
3124
3124
  |2|Info|Info|
3125
3125
 
3126
3126
  </div>
3127
- `,L=`---
3127
+ `,x=`---
3128
3128
  title: "AWS EventBridge Alert Events"
3129
3129
  description: "Sync AWS EventBridge alert events to Flashduty via webhook for automated alert noise reduction"
3130
3130
  date: "2024-08-20T10:00:00+08:00"
@@ -3226,7 +3226,7 @@ Choose this option when you need to route alerts to different channels based on
3226
3226
 
3227
3227
  </div>
3228
3228
 
3229
- `,_=`---
3229
+ `,L=`---
3230
3230
  title: "Dynatrace Alert Events"
3231
3231
  description: "Sync Dynatrace alert events to Flashduty via webhook to achieve automated alert noise reduction."
3232
3232
  date: "2024-08-20T10:00:00+08:00"
@@ -3333,7 +3333,7 @@ Choose this option when you need to route alerts to different channels based on
3333
3333
  |CUSTOM_ALERT|Info|info|
3334
3334
 
3335
3335
  </div>
3336
- `,F=`---
3336
+ `,_=`---
3337
3337
  title: "Huawei Cloud LTS Alert Events"
3338
3338
  description: "Sync Huawei Cloud Log Tank Service (LTS) alert events to Flashduty via webhook for automated alert noise reduction."
3339
3339
  date: "2024-08-20T10:00:00+08:00"
@@ -3446,7 +3446,7 @@ Choose this option when you need to route alerts to different channels based on
3446
3446
  |Info|Info|Info|
3447
3447
 
3448
3448
  </div>
3449
- `,x=`---
3449
+ `,F=`---
3450
3450
  title: "Google Cloud Monitoring Alert Events"
3451
3451
  description: "Sync Google Cloud Monitoring alert events to Flashduty via webhook for automated alert noise reduction"
3452
3452
  date: "2024-07-05T10:00:00+08:00"
@@ -3772,7 +3772,7 @@ If you need to configure \`Custom Templating Variables\`, you can refer to the f
3772
3772
  |INFO|Info|Info|
3773
3773
 
3774
3774
  </div>
3775
- `,U=`---
3775
+ `,D=`---
3776
3776
  title: "SolarWinds Alert Events"
3777
3777
  description: "Sync SolarWinds alert events to Flashduty via webhook for automated alert noise reduction"
3778
3778
  date: "2024-08-20T10:00:00+08:00"
@@ -3875,7 +3875,7 @@ Choose this option when you need to route alerts to different channels based on
3875
3875
  |Info|Info|Info|
3876
3876
 
3877
3877
  </div>
3878
- `,E=`---
3878
+ `,U=`---
3879
3879
  title: "Volcengine Cloud Monitor Alert Events"
3880
3880
  description: "Sync Volcengine Cloud Monitor alert events to Flashduty via webhook for automated alert noise reduction"
3881
3881
  date: "2024-08-20T10:00:00+08:00"
@@ -3964,7 +3964,7 @@ Choose this method when you need to route alerts to different channels based on
3964
3964
  |Notice|Info|Info|
3965
3965
 
3966
3966
  </div>
3967
- `,D=`---
3967
+ `,E=`---
3968
3968
  title: "Volcengine Cloud Monitor Event Center Alert Events"
3969
3969
  description: "Sync Volcengine Cloud Monitor Event Center alert events to Flashduty via webhook for automated alert noise reduction"
3970
3970
  date: "2024-07-05T10:00:00+08:00"
@@ -4745,7 +4745,7 @@ When you need to route alerts to different channels based on alert payload infor
4745
4745
 
4746
4746
  </div>
4747
4747
 
4748
- `,O=`---
4748
+ `,j=`---
4749
4749
  title: "Custom Change Event Integration Guide"
4750
4750
  description: "Push change events from your own systems to Flashduty using standard protocols. Most incidents are caused by changes, and the correlation between changes and alerts helps quickly identify incident causes."
4751
4751
  date: "2024-05-11T10:00:00+08:00"
@@ -4802,7 +4802,7 @@ Labels are descriptions of events. You should enrich label content as much as po
4802
4802
 
4803
4803
  </details>
4804
4804
 
4805
- `,j=`---
4805
+ `,O=`---
4806
4806
  title: "Jira Issue Events"
4807
4807
  description: "Sync Jira Issue events to Flashduty via webhooks to collect change events."
4808
4808
  date: "2024-05-11T10:00:00+08:00"
@@ -4876,7 +4876,7 @@ Flashduty extracts the status.name information from the webhook payload by defau
4876
4876
  Please contact Flashduty if you wish to modify this mapping.
4877
4877
 
4878
4878
  </div>
4879
- `,$=`---
4879
+ `,H=`---
4880
4880
  title: Contributing to our documentation — Meilisearch documentation
4881
4881
  description: The Meilisearch documentation is open-source. Learn how to help make it even better.
4882
4882
  sidebarDepth: 3
@@ -5011,7 +5011,7 @@ Once published, you can access the application via mobile/PC client. First-time
5011
5011
  |Group Bot Webhook|Maximum 100 calls/minute|
5012
5012
  |Sending messages to the same user or group|Maximum 5 calls/second|
5013
5013
 
5014
- **Note:** Messages cannot be pushed normally when exceeding limits, please use notification channels reasonably`,H=`---
5014
+ **Note:** Messages cannot be pushed normally when exceeding limits, please use notification channels reasonably`,$=`---
5015
5015
  title: "Dingtalk Integration"
5016
5016
  description: "Integrate with Dingtalk custom application to receive and respond to alerts within Dingtalk"
5017
5017
  date: "2024-05-11T10:00:00+08:00"
@@ -5246,7 +5246,7 @@ Integrate WeCom third-party application to receive and respond to alerts within
5246
5246
  7. **Incident notification fails with \`WeCom License Not Activated\`?**
5247
5247
 
5248
5248
  - Contact Flashduty customer service or dedicated support for license purchase and activation
5249
- `,V=`---
5249
+ `,z=`---
5250
5250
  title: "Slack Integration"
5251
5251
  description: "Integrate with Slack to receive and respond to alerts within Slack"
5252
5252
  date: "2024-05-11T10:00:00+08:00"
@@ -5300,7 +5300,7 @@ Integrate with Slack to receive and respond to alerts within Slack.
5300
5300
 
5301
5301
  8. **Slack App shows Other questions error**
5302
5302
  - Try again, as this might be an unrecorded issue
5303
- - If the error persists, contact customer support`,z=`---
5303
+ - If the error persists, contact customer support`,V=`---
5304
5304
  title: "Microsoft Teams Integration"
5305
5305
  description: "Integrate Microsoft Teams as a third-party application to receive and respond to alerts within Microsoft Teams"
5306
5306
  date: "2024-05-11T10:00:00+08:00"
@@ -5395,7 +5395,7 @@ Please check in Integration Center => Instant Messaging => Microsoft Teams under
5395
5395
  Currently not supported
5396
5396
  </details>
5397
5397
 
5398
- `,K=`Configure alert webhooks to receive HTTP callbacks at your specified URL when alerts have specific actions (such as triggering or closing). The callback content includes the latest key information about the alert, allowing integration with your custom tools.
5398
+ `,J=`Configure alert webhooks to receive HTTP callbacks at your specified URL when alerts have specific actions (such as triggering or closing). The callback content includes the latest key information about the alert, allowing integration with your custom tools.
5399
5399
 
5400
5400
  <span id="EventTypes"></span>
5401
5401
 
@@ -5563,7 +5563,7 @@ curl -X POST 'https://example.com/alert/webhook?a=a' \\
5563
5563
  4. **Trusted IP whitelist for push sources?**
5564
5564
  - {ip_whitelist}
5565
5565
  - May be updated in the future, please check periodically
5566
- `,Z=`Configure incident webhooks to receive HTTP callbacks at your specified URL when incidents have specific actions (such as triggering or closing). The callback content includes the latest key information about the incident, allowing integration with your custom tools.
5566
+ `,K=`Configure incident webhooks to receive HTTP callbacks at your specified URL when incidents have specific actions (such as triggering or closing). The callback content includes the latest key information about the incident, allowing integration with your custom tools.
5567
5567
 
5568
5568
  <span id="EventTypes"></span>
5569
5569
 
@@ -5586,6 +5586,7 @@ The following event types are currently supported, with more potentially being a
5586
5586
  | i_rslv | Close incident (automatically or manually) |
5587
5587
  | i_reopen | Reopen incident |
5588
5588
  | i_merge | Manually merge incidents |
5589
+ | i_comm | Add comment |
5589
5590
  | i_r_title | Update incident title |
5590
5591
  | i_r_desc | Update incident description |
5591
5592
  | i_r_impact | Update incident impact |
@@ -5769,7 +5770,7 @@ curl -X POST 'https://example.com/incident/webhook?a=a' \\
5769
5770
 
5770
5771
  4. **Trusted IP whitelist for push sources?**
5771
5772
  - {ip_whitelist}
5772
- - May be updated in the future, please check periodically`,J=`Custom incident actions allow you to quickly invoke external interfaces during incident troubleshooting for incident self-healing, information enrichment, and other custom operations.
5773
+ - May be updated in the future, please check periodically`,Z=`Custom incident actions allow you to quickly invoke external interfaces during incident troubleshooting for incident self-healing, information enrichment, and other custom operations.
5773
5774
 
5774
5775
  ## I. Creating Actions
5775
5776
 
@@ -6017,6 +6018,88 @@ When an incident occurs and is confirmed to be caused by a change, directly trig
6017
6018
  ### Update Status Page
6018
6019
 
6019
6020
  When an incident is confirmed to affect online services, trigger external status page updates to prompt`,Q=`---
6021
+ title: "Jira Sync"
6022
+ description: "Sync incidents with Jira issues through Jira Sync Webhook."
6023
+ date: "2024-05-11T10:00:00+08:00"
6024
+ url: "https://docs.flashcat.cloud/en/flashduty/jira-sync"
6025
+ ---
6026
+
6027
+ Through Jira Sync Webhook, you can associate and synchronize Flashduty incidents with Jira Issues, enabling integration between Flashduty and Jira.
6028
+
6029
+ ## Prerequisites
6030
+ - This integration is compatible with Jira Cloud, as well as versions 7.x and 8.x of Jira Server and Jira Data Center.
6031
+ - Currently, only one-way synchronization of incident information and status to Jira is supported. Information in Jira will not sync back to Flashduty.
6032
+ - For Jira Cloud, use an API Token in the password field during authorization configuration; for Jira Server or Data Center, use your Jira account password.
6033
+
6034
+ ## Getting API Token in Jira Cloud (Jira Server and Data Center please skip)
6035
+
6036
+ - After logging into Jira Cloud, click your profile picture in the top right corner and select **Manage Account**.
6037
+ - On the **Manage Account** page, select the **Security** tab.
6038
+ - On the **Security** page, click **Create and manage API tokens**.
6039
+ - In the **Create and manage API tokens** dialog, enter an API token name and select an expiration time.
6040
+ - Click **Create** to generate the API token.
6041
+ - Copy the API token value and paste it into the API token field in Flashduty's authorization configuration.
6042
+
6043
+ ## Configuring Integration in Flashduty
6044
+
6045
+ ### 1. Create and Authenticate Jira Integration
6046
+ <div class="hide">
6047
+
6048
+ In the Integration Center, select **Webhook**, choose **Jira Sync** integration, and fill in the following authentication information.
6049
+
6050
+ </div>
6051
+
6052
+ - **Jira Platform Type**: Choose based on your version. For Data Center version, select Self-hosted (Server).
6053
+ - **Service URL**: For Cloud version, enter your actual access URL, e.g., https://your-domain.atlassian.net. For Server version, enter your service access URL, e.g., https://your-jira-server-url.com.
6054
+ - **Username**: Your Jira account name. For Cloud version, enter your email; for Server version, enter your Jira username.
6055
+ - **API Token/Password**: Your Jira account credentials. For Cloud version, enter API Token; for Server version, enter your Jira account password.
6056
+ - After completion, click **Next** to proceed with configuration.
6057
+
6058
+ **About Permissions**: Ensure your Jira account has permissions to access relevant projects, issue types, and create issues. Using an administrator account is recommended.
6059
+
6060
+ ### 2. Jira Integration Configuration
6061
+
6062
+ - **Integration Name**: Define a name for this integration.
6063
+ - **Trigger Mode**:
6064
+ - Automatic: Configure conditions for Flashduty to automatically sync qualifying incidents to Jira.
6065
+ - Manual: Manually trigger Jira sync from the incident details page's more actions menu (integration name serves as trigger name).
6066
+ - **Project ID**: Select the target Jira project for synchronization.
6067
+ - **Issue Type**: Select the target Jira issue type.
6068
+ - **Channel**: Select the channel where this integration will be active. Only incidents within this channel can sync to Jira.
6069
+ - **Severity Mapping**: If the selected issue type doesn't support priority fields, this mapping cannot be configured.
6070
+ - **Custom Field Mapping**: Choose to sync certain or all incident labels and custom field content to Jira fields (text type fields only).
6071
+
6072
+ ### 3. About Updates
6073
+
6074
+ - For incidents with existing Jira issues, updates to severity or status will automatically update in Jira, but Jira updates won't sync back to Flashduty.
6075
+ - Comments sync to Jira, but Jira comments won't sync back to Flashduty.
6076
+ - Updates to incident title, description, labels, or other fields won't update in Jira.
6077
+
6078
+ ### 4. Flashduty to Jira Mapping
6079
+
6080
+ #### Field Mapping
6081
+
6082
+ | Jira | Flashduty |
6083
+ | ---------- | -------- |
6084
+ | Summary | Title |
6085
+ | Description | Description |
6086
+ | Priority | Severity |
6087
+ | Reporter | Integration configured user |
6088
+ | Comments | Comments |
6089
+
6090
+ #### Status Mapping
6091
+
6092
+ | Jira | Flashduty |
6093
+ | ---------- | -------- |
6094
+ | Todo | Pending |
6095
+ | In Progress | In Progress |
6096
+ | Done | Resolved |
6097
+
6098
+ ### 5. Important Notes
6099
+
6100
+ - Flashduty syncs information according to default field mappings and your custom field configurations. If your Jira issue type has required fields without mapping relationships, Jira issue creation may fail.
6101
+ - Jira issue details are accessed using project KEY + number format. If you modify the project KEY, saved issue URLs in Flashduty may become inaccessible, so please modify project KEYs with caution.
6102
+ `,X=`---
6020
6103
  title: "Configure Notification Templates"
6021
6104
  description: "Customize notification content through template configuration"
6022
6105
  date: "2024-05-10T10:00:00+08:00"
@@ -6031,25 +6114,25 @@ url: "https://docs.flashcat.cloud/en/flashduty/template-settings"
6031
6114
 
6032
6115
  ## When Are Templates Used?
6033
6116
  ---
6034
- The system uses templates to render [Incident](#Incident) and trigger notifications when assigning incidents. Assignment may occur in the following scenarios:
6117
+ The system uses templates to render [Incident](#Incident) when assigning incidents, which may occur in the following scenarios:
6035
6118
 
6036
6119
  1. Manually create and assign an incident
6037
6120
  2. When an alert event is reported, the system automatically generates an incident and assigns it according to the matched escalation rule
6038
6121
  3. After an incident is created, manually change the assignment (reassign)
6039
- 4. Automatically escalate assignment according to escalation rule settings
6122
+ 4. System automatically escalates according to escalation rule settings
6040
6123
  5. When reopening a closed incident, reassign according to previous settings
6041
6124
 
6042
- We use \`Golang template syntax\` [template/html](https://pkg.go.dev/html/template@go1.18.1) to parse data, allowing you to accomplish any complex rendering requirements.
6125
+ We use \`Golang template syntax\` [template/html](https://pkg.go.dev/html/template@go1.18.1) to parse data, enabling you to accomplish any complex rendering requirements.
6043
6126
 
6044
- - For documentation, please refer to [here](https://www.topgoer.com/%E5%B8%B8%E7%94%A8%E6%A0%87%E5%87%86%E5%BA%93/template.html#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95), supporting logical conditions, loops, pipelines and common functions
6045
- - We reference the open source library [sprig](https://github.com/flashcatcloud/sprig/tree/flashcat), which includes hundreds of common functions that you can call directly in templates
6046
- - If you want to introduce more functions, feel free to submit a merge request
6127
+ - For documentation, please refer to [here](https://www.topgoer.com/%E5%B8%B8%E7%94%A8%E6%A0%87%E5%87%86%E5%BA%93/template.html#%E6%A8%A1%E6%9D%BF%E8%AF%AD%E6%B3%95), supporting logical conditions, loops, pipelines, and common functions;
6128
+ - We've incorporated the open-source library [sprig](https://github.com/flashcatcloud/sprig/tree/flashcat), which includes hundreds of common functions that you can directly call in templates;
6129
+ - If you wish to introduce more functions, feel free to submit a merge request
6047
6130
 
6048
6131
  ## What Variables Can I Reference?
6049
6132
  ---
6050
6133
  **Variable Reference Examples**:
6051
6134
 
6052
- \`\`\`
6135
+ \`\`\`go
6053
6136
  // Reference title
6054
6137
  {{.Title}}
6055
6138
 
@@ -6071,7 +6154,7 @@ ID | string | Yes | Incident ID
6071
6154
  \`Title\` | string | Yes | Incident title
6072
6155
  \`Description\` | string | Yes | Incident description, can be empty
6073
6156
  DetailUrl | string | Yes | Incident detail page URL
6074
- Num | string | Yes | Short incident identifier, for easy visual recognition only, may be duplicate
6157
+ Num | string | Yes | Short incident identifier, for easy visual recognition, may be duplicate
6075
6158
  \`IncidentSeverity\` | string | Yes | Severity level, enum values: Critical, Warning, Info
6076
6159
  IncidentStatus | string | Yes | Incident status, enum values: Critical, Warning, Info, Ok
6077
6160
  \`Progress\` | string | Yes | Processing progress, enum values: Triggered, Processing, Closed
@@ -6080,19 +6163,19 @@ LastTime | int64 | No | Latest event time, latest incorporated event time in ass
6080
6163
  EndTime | int64 | No | Recovery time, when all associated alerts recover, the incident will automatically recover and close. Unix timestamp in seconds, default 0
6081
6164
  SnoozedBefore | int64 | No | Snooze end time, Unix timestamp in seconds, default 0
6082
6165
  AckTime | int64 | No | First acknowledgment time, Unix timestamp in seconds, default 0
6083
- CloseTime | int64 | No | Close time, end_time is incident recovery time, close_time is processing progress close time. Incident automatically closes on recovery, manual closure does not affect recovery. Unix timestamp in seconds, default 0
6084
- Creator | [Person](#Person) | No | Creator information, does not exist when automatically generated by system
6085
- Closer | [Person](#Person) | No | Closer information, does not exist when incident recovers automatically
6166
+ CloseTime | int64 | No | Close time, end_time is incident recovery time, close_time is processing progress close time. Incident automatically closes upon recovery, manual closure doesn't affect recovery. Unix timestamp in seconds, default 0
6167
+ Creator | [Person](#Person) | No | Creator information, not present when automatically generated by system
6168
+ Closer | [Person](#Person) | No | Closer information, not present when incident recovers automatically
6086
6169
  AssignedTo | [Assignment](Assignment) | No | Assignment configuration
6087
- Responders | [][Responder](#Responder) | No | List of responders, initialized based on assignment configuration, will also have corresponding records if non-assigned personnel acknowledge the incident
6170
+ Responders | [][Responder](#Responder) | No | Responder list, initialized based on assignment configuration, also includes records if non-assigned personnel acknowledge the incident
6088
6171
  ChannelID | int64 | No | Channel ID, value is 0 when manually creating global incident
6089
6172
  ChannelName | string | No | Channel name
6090
6173
  GroupMethod | string | No | Grouping method, enum values: n: no grouping, p: rule-based grouping, i: intelligent grouping
6091
- \`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings. No information when manually created, label information from first alert when automatically created
6174
+ \`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings. No information when manually created, contains first alert's label information when automatically created
6092
6175
  AlertCnt | int64 | Yes | Number of associated alerts
6093
6176
  Alerts | [][Alert](#Alert) | No | Associated alert details, no information when manually created
6094
6177
  FireType | string | No | Notification type, enum values: fire: notify, refire: loop notification
6095
- IsFlapping | bool | No | Whether in flapping state, i.e. frequent occurrence and recovery, related to convergence configuration
6178
+ IsFlapping | bool | No | Whether in flapping state, i.e., frequent occurrence and recovery, related to convergence configuration
6096
6179
  Impact | string | No | Incident impact, filled after incident closure
6097
6180
  RootCause | string | No | Root cause, filled after incident closure
6098
6181
  Resolution | string | No | Resolution, filled after incident closure
@@ -6109,11 +6192,11 @@ email | string | Yes | Email address
6109
6192
  **Assignment** (Indirect Reference):
6110
6193
  Field|Type|Required|Description
6111
6194
  :-:|:-:|:-:|:---
6112
- PersonIDs | []string| No | List of person IDs, exists only when assigning by person
6195
+ PersonIDs | []string| No | Person ID list, exists only when assigning by person
6113
6196
  EscalateRuleID | string | No | Escalation rule ID, exists only when assigning by rule
6114
6197
  EscalateRuleName | string | No | Escalation rule name
6115
6198
  LayerIdx | string | No | Assignment level, corresponds to escalation rule level index, starts from 0
6116
- Type | string | Yes | Assignment type, enum values: assign: assign, reassign: reassign, escalate: escalate assignment, reopen: reopen assignment
6199
+ Type | string | Yes | Assignment type, enum values: assign: assign, reassign: reassign, escalate: escalation assign, reopen: reopen assign
6117
6200
 
6118
6201
  <span id="Responder"></span>
6119
6202
  **Responder** (Indirect Reference):
@@ -6136,44 +6219,44 @@ AlertStatus | string | Yes | Alert status, enum values: Critical, Warning, Info,
6136
6219
  Progress | string | Yes | Processing progress, enum values: Triggered, Processing, Closed
6137
6220
  StartTime | int64 | Yes | Trigger time, Unix timestamp in seconds
6138
6221
  EndTime | int64 | No | Recovery time, Unix timestamp in seconds, default 0
6139
- CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime is processing progress close time. Alert automatically closes on recovery, manual closure does not affect recovery. Unix timestamp in seconds, default 0
6222
+ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime is processing progress close time. Alert automatically closes upon recovery, manual closure doesn't affect alert recovery. Unix timestamp in seconds, default 0
6140
6223
  \`Labels\` | map[string]string | No | Label key-value pairs, both Key and Value are strings
6141
6224
 
6142
- ## FAQ
6225
+ ## Common Questions
6143
6226
  ---
6144
- 1. **How do I know what label information is in \`Labels\`?**
6227
+ 1. **How do I know what label information is available in \`Labels\`?**
6145
6228
 
6146
6229
  - Manually created incidents have no labels
6147
- - Automatically created incidents have labels, same as the labels of the first incorporated alert. Go to the \`Alerts\` page, find an incident and view its details to see all label information
6230
+ - Automatically created incidents have labels, matching the first incorporated alert's labels. Go to the \`Incidents\` page, find an incident and view its details to see all label information
6148
6231
 
6149
6232
  2. **Why is the \`default template\` used when I configured custom template rendering?**
6150
6233
 
6151
6234
  - When creating a custom template, the system uses mock data to render the template to check for syntax errors
6152
- - Mock data has limited coverage and may not match some logical branches in your template, which could fail during actual execution
6153
- - After rendering fails, the system will use the default template as a fallback to ensure message delivery
6154
- - When unsure if a referenced variable exists, it's recommended to use logical conditions to avoid rendering exceptions, e.g. for the \`resource\` label:
6235
+ - Mock data has limited coverage and may not match some logic branches in your template during actual operation
6236
+ - If rendering fails, the system will use the default template as a fallback to ensure message delivery
6237
+ - When unsure if a referenced variable exists, it's recommended to use logical conditions to avoid rendering errors, e.g., for the \`resource\` label:
6155
6238
 
6156
- \`\`\`
6239
+ \`\`\`go
6157
6240
  // Wrong approach: directly read label
6158
6241
  {{.Labels.resource}}
6159
6242
 
6160
- // Recommended approach: check first, then read label
6243
+ // Recommended: check first, then read label
6161
6244
  {{if .Labels.resource}}{{.Labels.resource}}{{end}}
6162
6245
  \`\`\`
6163
6246
 
6164
- 3. **Why are characters like ">" \`escaped\` in the incident title?**
6247
+ 3. **Why are characters like ">" \`escaped\` in incident titles?**
6165
6248
 
6166
- \`\`\`
6249
+ \`\`\`go
6167
6250
  // Use toHtml function
6168
6251
  {{toHtml .Title}}
6169
6252
 
6170
- // Use first non-empty value for rendering, avoid writing complex if logic
6253
+ // Use first non-empty value for rendering, avoiding complex if logic
6171
6254
  {{toHtml .Title .TitleEnglish}}
6172
6255
  \`\`\`
6173
6256
 
6174
- 4. **Time variables are timestamps, how to \`format time\`?**
6257
+ 4. **Time variables are timestamps, how do I \`convert time formats\`?**
6175
6258
 
6176
- \`\`\`
6259
+ \`\`\`go
6177
6260
  // date function converts timestamp to readable format
6178
6261
  // "2006-01-02 15:04:05" is a common format, search online for more formats
6179
6262
  {{date "2006-01-02 15:04:05" .StartTime}}
@@ -6183,24 +6266,24 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
6183
6266
  \`\`\`
6184
6267
 
6185
6268
  5. **How to reference external variables inside a for loop?**
6186
- \`\`\`
6269
+ \`\`\`go
6187
6270
  // Add "$" before external variables
6188
6271
  {{range .Responders}}
6189
- {{if eq $.Progress "Triggered"}}
6190
- [Pending]{{.Email}}
6191
- {{end}}
6272
+ {{if eq $.Progress "Triggered"}}
6273
+ [Pending]{{.Email}}
6274
+ {{end}}
6192
6275
  {{end}}
6193
6276
  \`\`\`
6194
- 6. **How to extract field values with "." in names, like "obj.instance" in labels?**
6277
+ 6. **How do I extract field values with "." in names, like "obj.instance" in labels?**
6195
6278
 
6196
- \`\`\`
6279
+ \`\`\`go
6197
6280
  // Use index function
6198
6281
  {{index .Labels "obj.instance"}}
6199
6282
  \`\`\`
6200
6283
 
6201
- 7. **How to extract and deduplicate label information from incident associated alerts?**
6284
+ 7. **How do I extract and deduplicate label information from incident-associated alerts?**
6202
6285
 
6203
- \`\`\`
6286
+ \`\`\`go
6204
6287
  // Use alertLabels function to get deduplicated array
6205
6288
  {{alertLabels . "resource"}}
6206
6289
 
@@ -6208,9 +6291,9 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
6208
6291
  {{joinAlertLabels . "resource" "sep"}}
6209
6292
  \`\`\`
6210
6293
 
6211
- 8. **How to iterate and print labels?**
6294
+ 8. **How do I iterate and print labels?**
6212
6295
 
6213
- \`\`\`
6296
+ \`\`\`go
6214
6297
  // Complete iteration
6215
6298
  {{range $k, $v := .Labels}}
6216
6299
  {{$k}} : {{toHtml $v}}
@@ -6230,36 +6313,38 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
6230
6313
  {{end}}
6231
6314
  {{end}}
6232
6315
 
6233
- 9. **How to extract information from JSON fields?**
6316
+ 9. **How do I extract information from JSON fields?**
6234
6317
 
6235
- - The jsonGet function helps you extract values matching conditions from JSON format data via path
6236
- - Target data extracted by jsonGet function must be valid JSON
6318
+ - jsonGet function helps extract values from JSON format data using path
6319
+ - Target data for jsonGet function must be valid JSON
6237
6320
  - Basic usage: {{jsonGet .Labels.xxx "yyy"}}, where xxx must be valid JSON and yyy is a valid extraction path
6238
6321
  - For JSON path syntax, refer to [gjson.dev](https://gjson.dev/), where you can input target data and extraction path for real-time preview
6239
6322
 
6240
- \`\`\`
6323
+ \`\`\`go
6241
6324
  // Extract detail_url field from rule_note label
6242
6325
  {{jsonGet .Labels.rule_note "detail_url"}}
6243
6326
 
6244
6327
  // Extract name field from first element in JSON array
6245
6328
  {{jsonGet .Labels.slice "0.name"}}
6246
6329
 
6247
- // Iterate each element in JSON array, match instanceId field of object with userId==7777
6330
+ // Iterate through JSON array elements, match instanceId field of object with userId==7777
6248
6331
  {{jsonGet .Labels.rule_note "#(userId==7777)#.instanceId" }}
6249
6332
 
6250
6333
  \`\`\`
6251
6334
 
6252
- 10. **Where can I find more functions and usage examples?**
6335
+ 10. **How do I find more functions and their usage examples?**
6253
6336
  - Function list: https://github.com/flashcatcloud/sprig/blob/master/functions.go#L97
6254
- - Usage examples: Check corresponding _test.go files, e.g. date function test cases at https://github.com/flashcatcloud/sprig/blob/master/date_test.go
6337
+ - Usage examples: Check corresponding _test.go files, e.g., date function test cases at https://github.com/flashcatcloud/sprig/blob/master/date_test.go
6255
6338
 
6256
- Below are specific instructions for each notification channel.
6339
+ Below are specific instructions for each notification channel.
6340
+
6341
+ <div class="feishu_app hide">
6257
6342
 
6258
6343
  ## Feishu/Lark App
6259
6344
  ---
6260
- You need to configure \`Integration Center - IM - Feishu/Lark\` integration first to send message cards. If custom content is not set, the system default template will be used to render all label information:
6345
+ You need to configure \`Integration Center-Instant Message-Feishu\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering all label information:
6261
6346
 
6262
- \`\`\`
6347
+ \`\`\`go
6263
6348
  {{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
6264
6349
  {{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6265
6350
  {{range $k, $v := .Labels}}
@@ -6268,15 +6353,14 @@ You need to configure \`Integration Center - IM - Feishu/Lark\` integration firs
6268
6353
 
6269
6354
  As shown below:
6270
6355
 
6271
- <img src="https://download.flashcat.cloud/flashduty/doc/en/fd/template-feishu-1.png" width="800">
6272
-
6356
+ <img src="https://download.flashcat.cloud/flashduty/changelog/20230720/feishu_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
6273
6357
 
6274
- If you want to display only key label information, you can refer to the code snippet below:
6358
+ If you want to display only key label information, you can refer to the code segment below:
6275
6359
 
6276
- - We've listed some common labels that you can add or remove as needed
6277
- - In Feishu/Lark app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
6360
+ - We've listed some common labels, you can add or remove as needed
6361
+ - In Feishu app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
6278
6362
 
6279
- \`\`\`
6363
+ \`\`\`go
6280
6364
  {{if (index .Labels "resource")}}resource:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6281
6365
  {{if (index .Labels "check")}}check:{{toHtml (index .Labels "check")}}{{end}}
6282
6366
  {{if (index .Labels "metric")}}metric:{{index .Labels "metric"}}{{end}}
@@ -6298,12 +6382,15 @@ If you want to display only key label information, you can refer to the code sni
6298
6382
  {{if (index .Labels "mode")}}mode:{{index .Labels "mode"}}{{end}}
6299
6383
  {{if (index .Labels "runbook_url")}}runbook_url:{{toHtml (index .Labels "runbook_url")}}{{end}}
6300
6384
  \`\`\`
6385
+ </div>
6386
+
6387
+ <div class="dingtalk_app hide">
6301
6388
 
6302
6389
  ## Dingtalk App
6303
6390
  ---
6304
- You need to configure \`Integration Center - IM - Dingtalk\` integration first to send message cards. If custom content is not set, the system default template will be used to render all label information:
6391
+ You need to configure \`Integration Center-Instant Message-Dingtalk\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering all label information:
6305
6392
 
6306
- \`\`\`
6393
+ \`\`\`go
6307
6394
  {{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
6308
6395
  {{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6309
6396
  {{range $k, $v := .Labels}}
@@ -6311,15 +6398,15 @@ You need to configure \`Integration Center - IM - Dingtalk\` integration first t
6311
6398
  \`\`\`
6312
6399
 
6313
6400
  As shown below:
6314
- <img src="https://download.flashcat.cloud/flashduty/doc/en/fd/template-ding-1.png" width="800">
6315
6401
 
6402
+ <img src="https://download.flashcat.cloud/flashduty/changelog/20230720/dingtalk_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
6316
6403
 
6317
- If you want to display only key label information, you can refer to the code snippet below:
6404
+ If you want to display only key label information, you can refer to the code segment below:
6318
6405
 
6319
- - We've listed some common labels that you can add or remove as needed
6320
- - In Dingtalk app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
6406
+ - We've listed some common labels, you can add or remove as needed
6407
+ - In Dingtalk app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
6321
6408
 
6322
- \`\`\`
6409
+ \`\`\`go
6323
6410
  {{if (index .Labels "resource")}}**resource**:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6324
6411
  {{if (index .Labels "metric")}}**metric**:{{index .Labels "metric"}}{{end}}
6325
6412
  {{if (index .Labels "prom_ql")}}**prom_ql**:{{toHtml (index .Labels "prom_ql")}}{{end}}
@@ -6340,15 +6427,19 @@ If you want to display only key label information, you can refer to the code sni
6340
6427
  {{if (index .Labels "mode")}}**mode**:{{index .Labels "mode"}}{{end}}
6341
6428
  {{if (index .Labels "runbook_url")}}**runbook_url**:{{index .Labels "runbook_url"}}{{end}}
6342
6429
  \`\`\`
6430
+ </div>
6431
+
6432
+ <div class="wecom_app hide">
6343
6433
 
6344
6434
  ## WeCom App
6345
6435
  ---
6346
- You need to configure \`Integration Center - IM - WeCom\` integration first to send message cards. If custom content is not set, the system default template will be used to render only common label information:
6347
6436
 
6348
- - We've listed some common labels that you can add or remove as needed
6349
- - In WeCom app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
6437
+ You need to configure \`Integration Center-Instant Message-WeCom\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
6350
6438
 
6351
- \`\`\`
6439
+ - We've listed some common labels, you can add or remove as needed
6440
+ - In WeCom app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
6441
+
6442
+ \`\`\`go
6352
6443
  {{if (index .Labels "resource")}}resource:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6353
6444
  {{if (index .Labels "metric")}}metric:{{index .Labels "metric"}}{{end}}
6354
6445
  {{if (index .Labels "prom_ql")}}prom_ql:{{toHtml (index .Labels "prom_ql")}}{{end}}
@@ -6372,16 +6463,19 @@ You need to configure \`Integration Center - IM - WeCom\` integration first to s
6372
6463
 
6373
6464
  As shown below:
6374
6465
 
6375
- <img src="https://download.flashcat.cloud/flashduty/doc/en/fd/template-wecom-1.png" width="800">
6466
+ <img src="https://download.flashcat.cloud/flashduty/changelog/20230720/wecom_app_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
6376
6467
 
6468
+ **Note: WeCom limits card length. In the template rendering area, you can render no more than 8 lines of content. Content beyond 8 lines will be hidden**
6377
6469
 
6378
- **Note: WeCom limits card length. In the template rendering area, you can render up to 8 lines of content. Content beyond 8 lines will be hidden**
6470
+ </div>
6471
+
6472
+ <div class="slack_app hide">
6379
6473
 
6380
6474
  ## Slack App
6381
6475
  ---
6382
- You need to configure \`Integration Center - IM - Slack\` integration first to send message cards. If custom content is not set, the system default template will be used to render only common label information:
6476
+ You need to configure \`Integration Center-Instant Message-Slack\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
6383
6477
 
6384
- \`\`\`
6478
+ \`\`\`go
6385
6479
  {{if .Description}}*description* :{{toHtml .Labels.body_text .Description}}{{end}}
6386
6480
  {{if .Labels.resource}}*resource* : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6387
6481
  {{range $k, $v := .Labels}}
@@ -6392,18 +6486,18 @@ As shown below:
6392
6486
 
6393
6487
  <img src="https://download.flashcat.cloud/flashduty/integration/slack/slack_app_message.png" alt="drawing" style="display: block; margin: 0 auto;" width="600"/>
6394
6488
 
6395
- If you want to display only key label information, you can refer to the code snippet below:
6489
+ If you want to display only key label information, you can refer to the code segment below:
6396
6490
 
6397
- - We've listed some common labels that you can add or remove as needed
6398
- - Messages can be around 15000 characters long, content beyond that will be truncated
6399
- - In Slack app, the system will automatically remove empty lines (caused by non-existent labels) during rendering, so you can configure freely
6491
+ - We've listed some common labels, you can add or remove as needed
6492
+ - Messages can be around 15000 characters long, content beyond this will be truncated
6493
+ - In Slack app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
6400
6494
 
6401
- \`\`\`
6495
+ \`\`\`go
6402
6496
  {{if (index .Labels "resource")}}*resource*:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6403
6497
  {{if (index .Labels "metric")}}*metric*:{{index .Labels "metric"}}{{end}}
6404
6498
  {{if (index .Labels "prom_ql")}}*prom_ql*:{{toHtml (index .Labels "prom_ql")}}{{end}}
6405
6499
  {{if (index .Labels "trigger_value")}}*trigger_value*:{{index .Labels "trigger_value"}}{{end}}
6406
- {{if (index .Labels "host_ql")}}*host_ql*:{{toHtml (index .Labels "host_ql")}}{{end}}
6500
+ {{if (index .Labels "host_ql")}}*host_ql*:{{index .Labels "host_ql"}}{{end}}
6407
6501
  {{if (index .Labels "region")}}*region*:{{index .Labels "region"}}{{end}}
6408
6502
  {{if (index .Labels "cluster")}}*cluster*:{{index .Labels "cluster"}}{{end}}
6409
6503
  {{if (index .Labels "business")}}*business*:{{index .Labels "business"}}{{end}}
@@ -6418,16 +6512,392 @@ If you want to display only key label information, you can refer to the code sni
6418
6512
  {{if (index .Labels "name")}}*name*:{{index .Labels "name"}}{{end}}
6419
6513
  {{if (index .Labels "mode")}}*mode*:{{index .Labels "mode"}}{{end}}
6420
6514
  {{if (index .Labels "runbook_url")}}*runbook_url*:{{index .Labels "runbook_url"}}{{end}}
6421
- \`\`\`
6515
+ \`\`\`
6516
+ </div>
6422
6517
 
6423
- ## Zoom Bot
6518
+ <div class="teams_app hide">
6519
+
6520
+ ## Microsoft Teams App
6424
6521
  ---
6425
- - Messages \`can be around 4000 characters long, content beyond that will be truncated\`
6426
- - If text contains \`<br>\`, during rendering the system will \`first remove empty lines, then replace <br> with newline\`
6427
- - Message format \`follows Zoom message format\`. Current bot application doesn't support Markdown, refer to official website for other formats: https://developers.zoom.us/docs/team-chat-apps/customizing-messages/
6428
- - If custom content is not set, the system default template will be used to display only key information:
6522
+ You need to configure \`Integration Center-Instant Message-Microsoft Teams\` integration first to send message cards. If custom content is not set, the system default template will be used, rendering only common label information:
6523
+
6524
+ \`\`\`
6525
+ {{if .Description}}**description** :{{toHtml .Labels.body_text .Description}}{{end}}
6526
+ {{if .Labels.resource}}**resource** : {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6527
+ {{range $k, $v := .Labels}}
6528
+ {{if not (in $k "resource" "body_text" "body_text_with_table")}}**{{$k}}** : {{toHtml $v}}{{end}}{{end}}
6529
+ \`\`\`
6530
+
6531
+ As shown below:
6532
+
6533
+ <img src="https://download.flashcat.cloud/flashduty/integration/microsoft-teams/teams_app_message.png" alt="drawing" style="display: block; margin: 0 auto;" width="300"/>
6534
+
6535
+ If you want to display only key label information, you can refer to the code segment below:
6536
+
6537
+ - We've listed some common labels, you can add or remove as needed
6538
+ - Messages can be around 28KB in size, content beyond this will result in an error
6539
+ - In Microsoft Teams app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
6429
6540
 
6430
6541
  \`\`\`
6542
+ {{if (index .Labels "resource")}}**resource**:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}
6543
+ {{if (index .Labels "metric")}}**metric**:{{index .Labels "metric"}}{{end}}
6544
+ {{if (index .Labels "prom_ql")}}**prom_ql**:{{toHtml (index .Labels "prom_ql")}}{{end}}
6545
+ {{if (index .Labels "trigger_value")}}**trigger_value**:{{index .Labels "trigger_value"}}{{end}}
6546
+ {{if (index .Labels "host_ql")}}**host_ql**:{{index .Labels "host_ql"}}{{end}}
6547
+ {{if (index .Labels "region")}}**region**:{{index .Labels "region"}}{{end}}
6548
+ {{if (index .Labels "cluster")}}**cluster**:{{index .Labels "cluster"}}{{end}}
6549
+ {{if (index .Labels "business")}}**business**:{{index .Labels "business"}}{{end}}
6550
+ {{if (index .Labels "service")}}**service**:{{index .Labels "service"}}{{end}}
6551
+ {{if (index .Labels "env")}}**env**:{{index .Labels "env"}}{{end}}
6552
+ {{if (index .Labels "type")}}**type**:{{index .Labels "type"}}{{end}}
6553
+ {{if (index .Labels "topic")}}**topic**:{{index .Labels "topic"}}{{end}}
6554
+ {{if (index .Labels "cpu")}}**cpu**:{{index .Labels "cpu"}}{{end}}
6555
+ {{if (index .Labels "device")}}**device**:{{index .Labels "device"}}{{end}}
6556
+ {{if (index .Labels "path")}}**path**:{{index .Labels "path"}}{{end}}
6557
+ {{if (index .Labels "fstype")}}**fstype**:{{index .Labels "fstype"}}{{end}}
6558
+ {{if (index .Labels "name")}}**name**:{{index .Labels "name"}}{{end}}
6559
+ {{if (index .Labels "mode")}}**mode**:{{index .Labels "mode"}}{{end}}
6560
+ {{if (index .Labels "runbook_url")}}**runbook_url**:{{index .Labels "runbook_url"}}{{end}}
6561
+ \`\`\`
6562
+ </div>
6563
+
6564
+ <div class="sms hide">
6565
+
6566
+ ## Feishu/Lark Bot
6567
+ ---
6568
+ Feishu/Lark bot supports message cards, rich text, and plain text formats. The default template is in message card format.
6569
+
6570
+ - The msg_type field is required for message cards and rich text, otherwise it will be sent as plain text format
6571
+ - The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
6572
+ - If no custom content is set, the system default template will be used to display key information:
6573
+
6574
+ 1. Message Card
6575
+ msg_type is required, value should be interactive
6576
+ \`\`\`
6577
+ {
6578
+ "msg_type": "interactive",
6579
+ "card": {
6580
+ "config": {
6581
+ "wide_screen_mode": true,
6582
+ "enable_forward": true
6583
+ },
6584
+ "header": {
6585
+ "template": "{{if eq .IncidentSeverity "Critical"}}red{{else if eq .IncidentSeverity "Warning"}}orange{{else}}yellow{{end}}",
6586
+ "title": {
6587
+ "content": "{{fireReason .}}INC #{{.Num}} {{toHtml .Title}}",
6588
+ "tag": "plain_text"
6589
+ }
6590
+ },
6591
+ "elements": [{
6592
+ "tag": "div",
6593
+ "fields": [{
6594
+ "text": {
6595
+ "tag": "lark_md",
6596
+ "content": "**🏢 Channel:**{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}"
6597
+ }
6598
+ },
6599
+ {
6600
+ "text": {
6601
+ "tag": "lark_md",
6602
+ "content": "**{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} Severity:**{{.IncidentSeverity}}"
6603
+ }
6604
+ },
6605
+ {
6606
+ "text": {
6607
+ "tag": "lark_md",
6608
+ "content": "**⏰ Triggered at:**{{date "2006-01-02 15:04:05" .StartTime}}{{if gt .AlertCnt 1}}"
6609
+ }
6610
+ },
6611
+ {
6612
+ "text": {
6613
+ "tag": "lark_md",
6614
+ "content": "**🔔 Grouped alerts:**{{.AlertCnt}} {{end}}{{if .Labels.resource}}"
6615
+ }
6616
+ },
6617
+ {
6618
+ "tag": "div",
6619
+ "text": {
6620
+ "tag": "lark_md",
6621
+ "content": "**📌 Alert targets:**{{toHtml (joinAlertLabels . "resource" ",")}} {{end}}{{if .Description}}"
6622
+ }
6623
+ },
6624
+ {
6625
+ "tag": "div",
6626
+ "text": {
6627
+ "tag": "lark_md",
6628
+ "content": "**🔍 Description:**{{.Description}}{{end}}{{if gt (len .Responders) 0}}"
6629
+ }
6630
+ },
6631
+ {
6632
+ "tag": "div",
6633
+ "text": {
6634
+ "tag": "lark_md",
6635
+ "content": "**👨‍💻 Responders:**{{range .Responders}}@{{.PersonName}} {{end}}{{end}}"
6636
+ }
6637
+ }
6638
+ ]
6639
+ },
6640
+ {
6641
+ "tag": "hr"
6642
+ },
6643
+ {
6644
+ "tag": "action",
6645
+ "actions": [{
6646
+ "tag": "button",
6647
+ "text": {
6648
+ "tag": "plain_text",
6649
+ "content": "Details"
6650
+ },
6651
+ "type": "primary",
6652
+ "url": "{{.DetailUrl}}"
6653
+ },
6654
+ {
6655
+ "tag": "button",
6656
+ "text": {
6657
+ "tag": "plain_text",
6658
+ "content": "Acknowledge"
6659
+ },
6660
+ "type": "primary",
6661
+ "url": "{{.DetailUrl}}?ack=1"
6662
+ }
6663
+ ]
6664
+ }]
6665
+ }
6666
+ }
6667
+ \`\`\`
6668
+
6669
+ 2. Rich Text
6670
+ msg_type is required, value should be post
6671
+ \`\`\`
6672
+ {
6673
+ "msg_type": "post",
6674
+ "post": {
6675
+ "zh_cn": {
6676
+ "title": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} {{fireReason .}}INC #{{.Num}} {{toHtml .Title}}",
6677
+ "content": [
6678
+ [{
6679
+ "tag": "text",
6680
+ "text": "🏢 "
6681
+ }, {
6682
+ "tag": "text",
6683
+ "text": "Channel:",
6684
+ "text_type": "bold"
6685
+ }, {
6686
+ "tag": "text",
6687
+ "text": "{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}\\n"
6688
+ }],
6689
+ [{
6690
+ "tag": "text",
6691
+ "text": "{{if eq .IncidentSeverity "Critical"}}🔴{{else if eq .IncidentSeverity "Warning"}}⚠️{{else}}ℹ️{{end}} "
6692
+ }, {
6693
+ "tag": "text",
6694
+ "text": "Severity:",
6695
+ "text_type": "bold"
6696
+ }, {
6697
+ "tag": "text",
6698
+ "text": "{{.IncidentSeverity}}\\n",
6699
+ "text_type": "{{if eq .IncidentSeverity "Critical"}}bold{{end}}"
6700
+ }],
6701
+ [{
6702
+ "tag": "text",
6703
+ "text": "⏰ "
6704
+ }, {
6705
+ "tag": "text",
6706
+ "text": "Triggered at:",
6707
+ "text_type": "bold"
6708
+ }, {
6709
+ "tag": "text",
6710
+ "text": "{{date "2006-01-02 15:04:05" .StartTime}}\\n"
6711
+ }],
6712
+ {{if gt .AlertCnt 1}}[{
6713
+ "tag": "text",
6714
+ "text": "🔔 "
6715
+ }, {
6716
+ "tag": "text",
6717
+ "text": "Grouped alerts:",
6718
+ "text_type": "bold"
6719
+ }, {
6720
+ "tag": "text",
6721
+ "text": "{{.AlertCnt}}\\n"
6722
+ }],{{end}}
6723
+ {{if .Labels.resource}}[{
6724
+ "tag": "text",
6725
+ "text": "📋 "
6726
+ }, {
6727
+ "tag": "text",
6728
+ "text": "Alert targets:",
6729
+ "text_type": "bold"
6730
+ }, {
6731
+ "tag": "text",
6732
+ "text": "{{toHtml (joinAlertLabels . "resource" ", ")}}\\n"
6733
+ }],{{end}}
6734
+ {{if .Description}}[{
6735
+ "tag": "text",
6736
+ "text": "📝 "
6737
+ }, {
6738
+ "tag": "text",
6739
+ "text": "Description:",
6740
+ "text_type": "bold"
6741
+ }, {
6742
+ "tag": "text",
6743
+ "text": "{{toHtml .Description}}\\n"
6744
+ }],{{end}}
6745
+ {{if gt (len .Responders) 0}}[{
6746
+ "tag": "text",
6747
+ "text": "👨‍💻 "
6748
+ }, {
6749
+ "tag": "text",
6750
+ "text": "Responders:",
6751
+ "text_type": "bold"
6752
+ }, {
6753
+ "tag": "text",
6754
+ "text": "{{range .Responders}}@{{.PersonName}} {{end}}\\n"
6755
+ }],{{end}}
6756
+ [{
6757
+ "tag": "a",
6758
+ "href": "{{.DetailUrl}}",
6759
+ "text": "Details"
6760
+ },{
6761
+ "tag": "text",
6762
+ "text": " "
6763
+ },{
6764
+ "tag": "a",
6765
+ "href": "{{.DetailUrl}}?ack=1",
6766
+ "text": "Acknowledge"
6767
+ }]
6768
+ ]
6769
+ }
6770
+ }
6771
+ }
6772
+ \`\`\`
6773
+
6774
+ 3. Plain Text
6775
+ \`\`\`
6776
+ {{fireReason .}}INC #{{.Num}} {{toHtml .Title}}
6777
+ -----
6778
+ Channel:{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
6779
+ Severity:{{.IncidentSeverity}}
6780
+ Triggered at:{{date "2006-01-02 15:04:05" .StartTime}}
6781
+ Duration:{{ago .StartTime}}{{if gt .AlertCnt 1}}
6782
+ Grouped alerts:{{.AlertCnt}}{{end}}{{if .Labels.resource}}
6783
+ Alert targets:{{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
6784
+ Description:{{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
6785
+ Responders:{{range .Responders}}@{{.PersonName}} {{end}}{{end}}
6786
+ <br>Details:{{.DetailUrl}}
6787
+ \`\`\`
6788
+ </div>
6789
+
6790
+ <div class="dingtalk hide">
6791
+
6792
+ ## Dingtalk Bot
6793
+ ---
6794
+ Dingtalk bot only supports sending Markdown messages ([syntax restrictions](https://open.dingtalk.com/document/robots/custom-robot-access#title-7ur-3ok-s1a)).
6795
+
6796
+ - The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
6797
+ - If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
6798
+ - If no custom content is set, the system default template will be used to display key information:
6799
+
6800
+ \`\`\`
6801
+ {{fireReason .}}INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}
6802
+
6803
+ ---
6804
+ - Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
6805
+ - Severity: {{$s := colorSeverity .IncidentSeverity}}{{toHtml $s}}
6806
+ - Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
6807
+ - Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
6808
+ - Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
6809
+ - Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
6810
+ - Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
6811
+ - Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
6812
+ ---
6813
+ <br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
6814
+ \`\`\`
6815
+ </div>
6816
+
6817
+ <div class="wecom hide">
6818
+
6819
+ ## WeCom Bot
6820
+ ---
6821
+ WeCom bot only supports sending Markdown messages ([syntax restrictions](https://developer.work.weixin.qq.com/document/path/91770#markdown%E7%B1%BB%E5%9E%8B)).
6822
+
6823
+ - The maximum message length is \`4000 bytes, content exceeding this limit will be truncated\`
6824
+ - If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
6825
+ - If no custom content is set, the system default template will be used to display key information:
6826
+
6827
+ \`\`\`
6828
+ {{fireReason .}}**INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}**
6829
+ > Channel: <font color="warning">{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}</font>
6830
+ > Severity: <font color="warning">{{.IncidentSeverity}}</font>
6831
+ > Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
6832
+ > Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
6833
+ > Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
6834
+ > Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
6835
+ > Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
6836
+ > Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
6837
+ <br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
6838
+ \`\`\`
6839
+ </div>
6840
+
6841
+ <div class="telegram hide">
6842
+
6843
+ ## Telegram Bot
6844
+ ---
6845
+
6846
+ - Configure a Telegram service address accessible in mainland China
6847
+ - The maximum message length is \`4096 characters, content exceeding this limit will not be sent\`
6848
+ - If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
6849
+ - If no custom content is set, the system default template will be used to display key information:
6850
+
6851
+ \`\`\`
6852
+ {{fireReason .}}INC [#{{.Num}}]({{.DetailUrl}}) {{toHtml .Title}}
6853
+ -----
6854
+ Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
6855
+ Severity: {{.IncidentSeverity}}
6856
+ Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
6857
+ Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
6858
+ Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
6859
+ Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}({{.Labels.resource}}){{end}}{{if .Description}}
6860
+ Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
6861
+ Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
6862
+
6863
+ <br>[Details]({{.DetailUrl}})|[Acknowledge]({{.DetailUrl}}?ack=1)
6864
+ \`\`\`
6865
+ </div>
6866
+
6867
+ <div class="slack hide">
6868
+
6869
+ ## Slack Bot
6870
+ ---
6871
+ - Messages can be \`approximately 15000 characters long, content exceeding this limit will be truncated\`
6872
+ - If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
6873
+ - If no custom content is set, the system default template will be used to display key information:
6874
+
6875
+ \`\`\`
6876
+ {{fireReason .}}INC <{{.DetailUrl}}|#{{.Num}}> {{toHtml .Title}}
6877
+ -----
6878
+ Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}
6879
+ Severity: {{.IncidentSeverity}}
6880
+ Triggered at: {{date "2006-01-02 15:04:05" .StartTime}}
6881
+ Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}
6882
+ Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}
6883
+ Alert targets: {{toHtml (joinAlertLabels . "resource" ", ")}}{{end}}{{if .Description}}
6884
+ Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}
6885
+ Responders: {{range .Responders}}@{{.PersonName}} {{end}}{{end}}
6886
+ -----
6887
+ <br><{{.DetailUrl}}|Details>|<{{.DetailUrl}}?ack=1|Acknowledge>
6888
+ \`\`\`
6889
+ </div>
6890
+
6891
+ <div class="zoom hide">
6892
+
6893
+ ## Zoom Bot
6894
+ ---
6895
+ - Messages can be \`approximately 4000 characters long, content exceeding this limit will be truncated\`
6896
+ - If the text contains \`<br>\`, when rendering, the system will \`first remove empty lines, then replace <br> with line breaks\`
6897
+ - Message format \`follows Zoom message format\`. The current bot application doesn't support Markdown. For other formats, please refer to the official documentation: https://developers.zoom.us/docs/team-chat-apps/customizing-messages/
6898
+ - If no custom content is set, the system default template will be used to display key information:
6899
+
6900
+ \`\`\`json
6431
6901
  {"head": {
6432
6902
  "text": "{{fireReason .}}INC [#{{.Num}}] {{toHtml .Title}}",
6433
6903
  "style": {
@@ -6439,7 +6909,7 @@ If you want to display only key label information, you can refer to the code sni
6439
6909
  "body": [
6440
6910
  {
6441
6911
  "type": "message",
6442
- "text": "Channel{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}",
6912
+ "text": "Channel: {{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}",
6443
6913
  "style": {
6444
6914
  "bold": false,
6445
6915
  "italic": false
@@ -6447,7 +6917,7 @@ If you want to display only key label information, you can refer to the code sni
6447
6917
  },
6448
6918
  {
6449
6919
  "type": "message",
6450
- "text": "Severity{{.IncidentSeverity}}",
6920
+ "text": "Severity: {{.IncidentSeverity}}",
6451
6921
  "style": {
6452
6922
  "bold": false,
6453
6923
  "italic": false,
@@ -6456,7 +6926,7 @@ If you want to display only key label information, you can refer to the code sni
6456
6926
  },
6457
6927
  {
6458
6928
  "type": "message",
6459
- "text": "Duration{{ago .StartTime}}{{if gt .AlertCnt 1}}",
6929
+ "text": "Duration: {{ago .StartTime}}{{if gt .AlertCnt 1}}",
6460
6930
  "style": {
6461
6931
  "bold": false,
6462
6932
  "italic": false
@@ -6464,7 +6934,7 @@ If you want to display only key label information, you can refer to the code sni
6464
6934
  },
6465
6935
  {
6466
6936
  "type": "message",
6467
- "text": "Grouped alerts{{.AlertCnt}}{{end}}{{if .Labels.resource}}",
6937
+ "text": "Grouped alerts: {{.AlertCnt}}{{end}}{{if .Labels.resource}}",
6468
6938
  "style": {
6469
6939
  "bold": false,
6470
6940
  "italic": false
@@ -6472,7 +6942,7 @@ If you want to display only key label information, you can refer to the code sni
6472
6942
  },
6473
6943
  {
6474
6944
  "type": "message",
6475
- "text": "Resource:{{.Labels.resource}}{{end}}{{if .Description}}",
6945
+ "text": "Alert targets: {{.Labels.resource}}{{end}}{{if .Description}}",
6476
6946
  "style": {
6477
6947
  "bold": false,
6478
6948
  "italic": false
@@ -6480,7 +6950,7 @@ If you want to display only key label information, you can refer to the code sni
6480
6950
  },
6481
6951
  {
6482
6952
  "type": "message",
6483
- "text": "Description{{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}",
6953
+ "text": "Description: {{toHtml .Description}}{{end}}{{if gt (len .Responders) 0}}",
6484
6954
  "style": {
6485
6955
  "bold": false,
6486
6956
  "italic": false
@@ -6488,7 +6958,7 @@ If you want to display only key label information, you can refer to the code sni
6488
6958
  },
6489
6959
  {
6490
6960
  "type": "message",
6491
- "text": "Responders{{range .Responders}}@{{.PersonName}}{{end}}{{end}}",
6961
+ "text": "Responders: {{range .Responders}}@{{.PersonName}}{{end}}{{end}}",
6492
6962
  "style": {
6493
6963
  "bold": false,
6494
6964
  "italic": false
@@ -6496,12 +6966,12 @@ If you want to display only key label information, you can refer to the code sni
6496
6966
  },
6497
6967
  {
6498
6968
  "type": "message",
6499
- "text": "View details",
6969
+ "text": "View Details",
6500
6970
  "link": "{{.DetailUrl}}{{if .IsFlapping}}"
6501
6971
  },
6502
6972
  {
6503
6973
  "type": "message",
6504
- "text": "Note: Current incident status changes frequently, notifications will be suppressed for {{.Flapping.MuteMinutes}} minutes. Please optimize your alert policy.{{end}}{{if .IsInStorm}}",
6974
+ "text": "Note: The current incident status is changing frequently. Notifications will be suppressed for {{.Flapping.MuteMinutes}} minutes. Please optimize your alert policy.{{end}}{{if .IsInStorm}}",
6505
6975
  "style": {
6506
6976
  "bold": true,
6507
6977
  "italic": false
@@ -6509,7 +6979,7 @@ If you want to display only key label information, you can refer to the code sni
6509
6979
  },
6510
6980
  {
6511
6981
  "type": "message",
6512
- "text": "Note: Current incident has grouped {{.AlertCnt}} alerts, triggering alert storm. Please handle urgently!{{end}}",
6982
+ "text": "Note: The current incident has grouped {{.AlertCnt}} alerts, triggering an alert storm. Please handle with urgency!{{end}}",
6513
6983
  "style": {
6514
6984
  "bold": true,
6515
6985
  "italic": false
@@ -6518,105 +6988,112 @@ If you want to display only key label information, you can refer to the code sni
6518
6988
  ]
6519
6989
  }
6520
6990
  \`\`\`
6991
+ </div>
6992
+
6993
+ <div class="sms hide">
6521
6994
 
6522
6995
  ## SMS
6523
6996
  ---
6524
- If custom content is not set, the system default template will be used for notification:
6997
+ If no custom content is set, the system default template will be used for notifications:
6525
6998
 
6526
- \`\`\`
6999
+ \`\`\`go
6527
7000
  You have a pending incident: {{toHtml .Title}}, Channel: {{.ChannelName}}, Severity: {{.IncidentSeverity}}{{if gt .AlertCnt 1}}, Grouped {{.AlertCnt}} alerts{{end}}
6528
7001
  \`\`\`
7002
+ </div>
7003
+
7004
+ <div class="email hide">
6529
7005
 
6530
7006
  ## Email
6531
7007
  ---
6532
- If custom content is not set, the system default template will be used for notification:
7008
+ If no custom content is set, the system default template will be used for notifications:
6533
7009
 
6534
- \`\`\`
7010
+ \`\`\`html
6535
7011
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6536
7012
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6537
7013
  <title>{{.Title}}</title>
6538
7014
  <html lang="en">
6539
7015
 
6540
7016
  <head data-id="__react-email-head">
6541
- <style>
6542
- .bg-Critical { background-color: #C80000; }
6543
- .bg-Warning { background-color: #FA7D00; }
6544
- .bg-Info { background-color: #FABE00; }
6545
- .bg-Ok { background-color: rgb(132 204 22); }
6546
- .text-Critical { color: #C80000; }
6547
- .text-Warning { color: #FA7D00; }
6548
- .text-Info { color: #FABE00; }
6549
- .text-Ok { color: rgb(132 204 22); }
6550
- .text-title {font-weight:500;width:6rem;flex-shrink:0}
6551
- .text-content {color:rgb(55,65,81)}
6552
- </style>
7017
+ <style>
7018
+ .bg-Critical { background-color: #C80000; }
7019
+ .bg-Warning { background-color: #FA7D00; }
7020
+ .bg-Info { background-color: #FABE00; }
7021
+ .bg-Ok { background-color: rgb(132 204 22); }
7022
+ .text-Critical { color: #C80000; }
7023
+ .text-Warning { color: #FA7D00; }
7024
+ .text-Info { color: #FABE00; }
7025
+ .text-Ok { color: rgb(132 204 22); }
7026
+ .text-title {font-weight:500;width:6rem;flex-shrink:0}
7027
+ .text-content {color:rgb(55,65,81)}
7028
+ </style>
6553
7029
  </head>
6554
7030
 
6555
7031
  <body data-id="__react-email-body" style="background-color:rgb(255,255,255);border-radius:0.25rem;margin-top:2.5rem;margin-bottom:2.5rem;margin-left:auto;margin-right:auto;padding:1rem;min-width:400px;max-width:660px;font-family:ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji">
6556
- <div style="width:100%;height:0.375rem;margin-bottom:2rem" class="bg-{{.IncidentSeverity}}"></div>
6557
- <div style="display:flex;align-items:center;margin-bottom:1.5rem">
6558
- <div style="display:flex;align-items:flex-end;gap:1rem"><img witdh="120" data-id="react-email-img" src="https://console.flashcat.cloud/image/saas-logo.png" height="40" style="display:block;outline:none;border:none;text-decoration:none" /><span style="font-size:1.25rem;line-height:1.75rem;font-weight:600">You have a pending incident</span></div>
6559
- </div>
6560
- <div style="background-color:rgb(243,244,246);padding:2rem;margin-top:1rem;border-radius:0.5rem">
6561
- <div style="display:flex;flex-direction:column;gap:0.75rem">
6562
- <div style="display:flex">
6563
- <div class="text-title">Title</div>
6564
- <div class="text-content">{{.Title}}</div>
6565
- </div>
6566
- <div style="display:flex">
6567
- <div class="text-title">Severity</div>
6568
- <div class="text-{{.IncidentSeverity}}">{{.IncidentSeverity}}</div>
6569
- </div>
6570
- <div style="display:flex">
6571
- <div class="text-title">Channel</div>
6572
- <div class="text-content">{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}</div>
6573
- </div>
6574
- <div style="display:flex">
6575
- <div class="text-title">Triggered at</div>
6576
- <div class="text-content">{{date "2006-01-02 15:04:05" .StartTime}}</div>
6577
- </div>
6578
- {{if .CreatorID}}
6579
- <div style="display:flex">
6580
- <div class="text-title">Creator</div>
6581
- <div class="text-content">{{.Creator.PersonName}}</div>
6582
- </div>
6583
- {{end}}
6584
- {{if gt (len .Responders) 0}}
6585
- <div style="display:flex">
6586
- <div class="text-title">Responders</div>
6587
- <div class="text-content">{{range .Responders}}@{{.PersonName}} {{end}}</div>
6588
- </div>
6589
- {{end}}
6590
- <div style="display:flex">
6591
- <div class="text-title">Progress</div>
6592
- <div class="text-content">{{.Progress}}</div>
6593
- </div>
6594
- <div style="display:flex">
6595
- <div class="text-title">Description</div>
6596
- <div style="color:rgb(55,65,81);margin-top:0.125rem">
6597
- <div data-id="react-email-markdown">{{toHtml .Description}}</div>
6598
- </div>
6599
- </div>
6600
- {{if .Labels.resource}}
6601
- <div style="display:flex;margin-bottom:0.5rem;">
6602
- <div style="color:#000;font-weight:500;width:6rem;margin-right:1rem;">Resource</div>
6603
- <div style="color:rgb(55,65,81);margin-top:0.125rem">
6604
- <div data-id="react-email-markdown">{{toHtml (joinAlertLabels . "resource" ", ")}}</div>
6605
- </div>
6606
- </div>
6607
- {{end}}
6608
- </div>
6609
- <div style="display:flex;gap:1rem;margin-top:2rem"><a href="{{.DetailUrl}}?ack=1" data-id="react-email-button" target="_blank" style="line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(108,83,177);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(255,255,255);font-weight:600;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms">Acknowledge</div></span><span></span></a><a href="{{.DetailUrl}}" data-id="react-email-button" target="_blank" style="color:#61dafb;line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(255,255,255);border-width: 1px;border-style:solid;border-color:rgb(229,231,235);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(0,0,0);font-weight:600">View Details</div></span><span></span></a></div>
6610
- </div>
6611
- <div style="display:flex;justify-content:flex-end;align-items:flex-end;margin-top:2rem">
6612
- <div style="font-size:0.875rem;line-height:1.25rem;font-weight:500">ALL RIGHTS RESERVED © Beijing Flashcat Cloud Technology Co.,Ltd.</div>
6613
- </div>
7032
+ <div style="width:100%;height:0.375rem;margin-bottom:2rem" class="bg-{{.IncidentSeverity}}"></div>
7033
+ <div style="display:flex;align-items:center;margin-bottom:1.5rem">
7034
+ <div style="display:flex;align-items:flex-end;gap:1rem"><img witdh="120" data-id="react-email-img" src="https://console.flashcat.cloud/image/saas-logo.png" height="40" style="display:block;outline:none;border:none;text-decoration:none" /><span style="font-size:1.25rem;line-height:1.75rem;font-weight:600">You have a pending incident</span></div>
7035
+ </div>
7036
+ <div style="background-color:rgb(243,244,246);padding:2rem;margin-top:1rem;border-radius:0.5rem">
7037
+ <div style="display:flex;flex-direction:column;gap:0.75rem">
7038
+ <div style="display:flex">
7039
+ <div class="text-title">Title</div>
7040
+ <div class="text-content">{{.Title}}</div>
7041
+ </div>
7042
+ <div style="display:flex">
7043
+ <div class="text-title">Severity</div>
7044
+ <div class="text-{{.IncidentSeverity}}">{{.IncidentSeverity}}</div>
7045
+ </div>
7046
+ <div style="display:flex">
7047
+ <div class="text-title">Channel</div>
7048
+ <div class="text-content">{{if .ChannelName}}{{.ChannelName}}{{else}}None{{end}}</div>
7049
+ </div>
7050
+ <div style="display:flex">
7051
+ <div class="text-title">Triggered at</div>
7052
+ <div class="text-content">{{date "2006-01-02 15:04:05" .StartTime}}</div>
7053
+ </div>
7054
+ {{if .CreatorID}}
7055
+ <div style="display:flex">
7056
+ <div class="text-title">Creator</div>
7057
+ <div class="text-content">{{.Creator.PersonName}}</div>
7058
+ </div>
7059
+ {{end}}
7060
+ {{if gt (len .Responders) 0}}
7061
+ <div style="display:flex">
7062
+ <div class="text-title">Responders</div>
7063
+ <div class="text-content">{{range .Responders}}@{{.PersonName}} {{end}}</div>
7064
+ </div>
7065
+ {{end}}
7066
+ <div style="display:flex">
7067
+ <div class="text-title">Progress</div>
7068
+ <div class="text-content">{{.Progress}}</div>
7069
+ </div>
7070
+ <div style="display:flex">
7071
+ <div class="text-title">Description</div>
7072
+ <div style="color:rgb(55,65,81);margin-top:0.125rem">
7073
+ <div data-id="react-email-markdown">{{toHtml .Description}}</div>
7074
+ </div>
7075
+ </div>
7076
+ {{if .Labels.resource}}
7077
+ <div style="display:flex;margin-bottom:0.5rem;">
7078
+ <div style="color:#000;font-weight:500;width:6rem;margin-right:1rem;">Alert targets</div>
7079
+ <div style="color:rgb(55,65,81);margin-top:0.125rem">
7080
+ <div data-id="react-email-markdown">{{toHtml (joinAlertLabels . "resource" ", ")}}</div>
7081
+ </div>
7082
+ </div>
7083
+ {{end}}
7084
+ </div>
7085
+ <div style="display:flex;gap:1rem;margin-top:2rem"><a href="{{.DetailUrl}}?ack=1" data-id="react-email-button" target="_blank" style="line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(108,83,177);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(255,255,255);font-weight:600;transition-property:color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms">Acknowledge</div></span><span></span></a><a href="{{.DetailUrl}}" data-id="react-email-button" target="_blank" style="color:#61dafb;line-height:100%;text-decoration:none;display:inline-block;max-width:100%;padding:0px 0px"><span></span><span style="max-width:100%;display:inline-block;line-height:120%;mso-padding-alt:0px;mso-text-raise:0"><div style="padding-left:2rem;padding-right:2rem;padding-top:0.5rem;padding-bottom:0.5rem;background-color:rgb(255,255,255);border-width: 1px;border-style:solid;border-color:rgb(229,231,235);border-radius:0.25rem;font-size:1rem;line-height:1.5rem;color:rgb(0,0,0);font-weight:600">View Details</div></span><span></span></a></div>
7086
+ </div>
7087
+ <div style="display:flex;justify-content:flex-end;align-items:flex-end;margin-top:2rem">
7088
+ <div style="font-size:0.875rem;line-height:1.25rem;font-weight:500">ALL RIGHTS RESERVED © Beijing Flashcat Cloud Technology Co.,Ltd.</div>
7089
+ </div>
6614
7090
  </body>
6615
7091
 
6616
7092
  </html>
6617
7093
  \`\`\`
6618
7094
 
6619
- As shown below:
6620
- <img src="https://download.flashcat.cloud/flashduty/doc/en/fd/template-mail-1.png" width="800">
7095
+ As shown in the image below:
7096
+
7097
+ <img src="https://download.flashcat.cloud/flashduty/changelog/20230720/email_render.png" alt="drawing" style="display: block; margin: 0 auto;" width="500"/>
6621
7098
 
6622
- `,X={CustomAlert:n,Email:t,N9e:a,Prometheus:o,Grafana:i,Zabbix:s,UptimeKuma:r,AliyunARMS:l,AliyunCmEvent:d,AliyunCm:c,AliyunSLS:e,AWSCW:e,AzureMonitor:h,BaiDuBCM:u,HuaWeiCES:g,InfluxDB:p,OpenFalcon:m,PagerDuty:f,TencentBK:y,TencentCLS:v,TencentCm:b,TencentEb:w,OceanBase:C,Graylog:k,Skywalking:I,Sentry:S,Jiankongbao:A,AWSEventBridge:L,Dynatrace:_,HuaweiyunLTS:F,GoogleCM:x,Zilliz:Y,Splunk:R,AppDynamics:T,SolarWinds:U,VolcEngineMetric:E,VolcEngineEvent:D,VolcEngineTLS:N,OpManager:P,Meraki:M,StateCloud:W,Guance:G,CustomChange:O,Jira:j,Lark:$,Dingtalk:H,Wecom:B,Slack:V,MicrosoftTeams:z,AlertWebhook:K,IncidentWebhook:Z,CustomAction:J,Templates:Q,HuaweiyunAPM:q};module.exports=X;
7099
+ </div>`,ee={CustomAlert:n,Email:t,N9e:a,Prometheus:i,Grafana:o,Zabbix:s,UptimeKuma:r,AliyunARMS:l,AliyunCmEvent:d,AliyunCm:c,AliyunSLS:e,AWSCW:e,AzureMonitor:h,BaiDuBCM:u,HuaWeiCES:g,InfluxDB:p,OpenFalcon:m,PagerDuty:f,TencentBK:y,TencentCLS:v,TencentCm:b,TencentEb:w,OceanBase:C,Graylog:k,Skywalking:I,Sentry:S,Jiankongbao:A,AWSEventBridge:x,Dynatrace:L,HuaweiyunLTS:_,GoogleCM:F,Zilliz:Y,Splunk:R,AppDynamics:T,SolarWinds:D,VolcEngineMetric:U,VolcEngineEvent:E,VolcEngineTLS:N,OpManager:P,Meraki:M,StateCloud:W,Guance:G,CustomChange:j,Jira:O,Lark:H,Dingtalk:$,Wecom:B,Slack:z,MicrosoftTeams:V,AlertWebhook:J,IncidentWebhook:K,CustomAction:Z,Templates:X,HuaweiyunAPM:q,JiraSync:Q};module.exports=ee;