github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/pkg/control/controldisplay/templates/md/output.tmpl (about) 1 {{ define "output" }} 2 {{/* we expect 0 or 1 root control runs */}} 3 {{ range .Data.Root.ControlRuns -}} 4 {{ template "control_run_template" . -}} 5 {{ end }} 6 {{/* we expect 0 or 1 root groups */}} 7 {{ range .Data.Root.Groups -}} 8 {{ template "root_group_template" . -}} 9 {{ end }} 10 11 \ 12 _Report run at `{{ .Data.StartTime.Format "2006-01-02 15:04:05" }}` using [`Steampipe {{ .Constants.SteampipeVersion }}`](https://steampipe.io) in dir `{{ .Constants.WorkingDir }}`._ 13 {{ end }} 14 15 {{/* templates */}} 16 {{ define "root_group_template"}} 17 # {{ .Title }} 18 {{ template "root_summary" .Summary.Status -}} 19 {{ if .ControlRuns }} 20 {{ range .ControlRuns -}} 21 {{ template "control_run_template" . -}} 22 {{ end -}} 23 {{ end -}} 24 {{ range .Groups -}} 25 {{ template "group_template" . -}} 26 {{ end -}} 27 {{ end -}} 28 {{ define "group_template"}} 29 # {{ .Title }} 30 {{ template "summary" .Summary.Status -}} 31 {{ if .ControlRuns }} 32 {{ range .ControlRuns -}} 33 {{ template "control_run_template" . -}} 34 {{ end -}} 35 {{ end -}} 36 {{ range .Groups -}} 37 {{ template "group_template" . -}} 38 {{ end -}} 39 {{ end -}} 40 {{ define "root_summary" }} 41 | | TOTAL | {{ .TotalCount }} | 42 |-|-|-| 43 | ✅ | OK | {{ .Ok }} | 44 | ⇨ | Skip | {{ .Skip }} | 45 | ℹ | Info | {{ .Info }} | 46 | ❌ | Alarm | {{ .Alarm }} | 47 | ❗ | Error | {{ .Error }} | 48 {{ end -}} 49 {{ define "summary" }} 50 | OK | Skip | Info | Alarm | Error | Total | 51 |-|-|-|-|-|-| 52 | {{ .Ok }} | {{ .Skip }} | {{ .Info }} | {{ .Alarm }} | {{ .Error }} | {{ .TotalCount }} | 53 {{ end -}} 54 {{ define "control_row_template" }} 55 | {{ template "statusicon" .Status }} | {{ .Reason }}| {{range .Dimensions}}`{{.Value}}` {{ end }} | 56 {{- end }} 57 {{ define "control_run_template"}} 58 ## {{ .Title }} 59 {{ if .Description }} 60 *{{ .Description }}*{{ end }} 61 {{ template "summary" .Summary -}} 62 {{ if .GetError }} 63 > Error: _{{ .GetError }}_ 64 {{ else }} 65 {{ $length := len .Rows }} 66 {{ if gt $length 0 }} 67 | | Reason | Dimensions | 68 |-|--------|------------| 69 {{- range .Rows }} 70 {{- template "control_row_template" . -}} 71 {{ end -}} 72 {{ end -}} 73 {{ end }} 74 {{ end }} 75 76 {{ define "statusicon" }} 77 {{- if eq . "ok" -}} 78 ✅ 79 {{- end -}} 80 {{- if eq . "skip" -}} 81 ⇨ 82 {{- end -}} 83 {{- if eq . "info" -}} 84 ℹ 85 {{- end -}} 86 {{- if eq . "alarm" -}} 87 ❌ 88 {{- end -}} 89 {{- if eq . "error" -}} 90 ❗ 91 {{- end -}} 92 {{- end -}}