You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Requires enabling the application permission to access and upload image or file resources
269
+
- Lark/Feishu Apps employ this method to render images
270
+
271
+
```go
272
+
{{ $root := . }}
273
+
{{ range $i, $v := .Images }}
274
+
{{ $transferURL := transferImage $root $v.Src }}
275
+
{{ if $transferURL }}{{ end }}
276
+
{{ end }}
277
+
```
278
+
279
+
12. **How to use logical AND, OR, and other conditions for conditional rendering/content display judgment?**
251
280
252
281
```
253
282
# Supported functions
@@ -280,7 +309,7 @@ CloseTime | int64 | No | Close time, EndTime is alert recovery time, CloseTime i
280
309
281
310
```
282
311
283
-
11. **How do I find more functions and their usage examples?**
312
+
13. **How do I find more functions and their usage examples?**
284
313
- Function list: https://github.com/flashcatcloud/sprig/blob/master/functions.go#L97
285
314
- Usage examples: Check corresponding _test.go files, e.g., date function test cases at https://github.com/flashcatcloud/sprig/blob/master/date_test.go
286
315
@@ -430,13 +459,22 @@ As shown below:
430
459
431
460
## Slack App
432
461
---
462
+
433
463
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:
{{if not (in $k "resource" "body_text")}}*{{$k}}* : {{toHtml $v}}{{end}}{{end}}
469
+
{{if not (in $k "resource" "body_text" "body_text_with_table")}}*{{$k}}* : {{$v}}{{end}}{{end}}
470
+
{{ $root := . }}
471
+
{{ range $i, $v := .Images }}
472
+
{{ $imageURL := imageSrcToURL $root $v.Src }}
473
+
{{ if $imageURL }}
474
+
---
475
+

476
+
{{ end }}
477
+
{{ end }}
440
478
```
441
479
442
480
As shown below:
@@ -448,6 +486,7 @@ If you want to display only key label information, you can refer to the code seg
448
486
- We've listed some common labels, you can add or remove as needed
449
487
- Messages can be around 15000 characters long, content beyond this will be truncated
450
488
- InSlack app, the system will automatically remove empty rendered lines (due to non-existent labels), so you can configure freely
489
+
- To display images, use three consecutive hyphens `---` to separate it from other content. The image syntax must begin with `![` format, as demonstrated in the FAQ section
0 commit comments