Skip to content

Commit

Permalink
Merge pull request #32 from JoeyBarnes/main
Browse files Browse the repository at this point in the history
Dynamic Alert Details
  • Loading branch information
JoeyBarnes authored Oct 6, 2023
2 parents 3f841a8 + 474ef84 commit 25add3c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 183 deletions.
49 changes: 0 additions & 49 deletions docs/layouts/partials/activityAlertProperties.html

This file was deleted.

57 changes: 0 additions & 57 deletions docs/layouts/partials/logAlertProperties.html

This file was deleted.

60 changes: 0 additions & 60 deletions docs/layouts/partials/metricAlertProperties.html

This file was deleted.

35 changes: 18 additions & 17 deletions docs/layouts/shortcodes/alertList.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<th>Description</th>
</tr>
<!-- Loop through alerts under category/type -->
{{ range sort .alerts }}
{{ range sort .alerts "name" "asc" }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
<tr>
<td><a href="#{{ anchorize .name }}">{{ .name }}</a></td>
Expand All @@ -34,29 +34,30 @@
<br>

<!-- Create a detail entry for each alert under category/type -->
{{ range sort .alerts }}
{{ range sort .alerts "name" "asc" }}
{{ if or (eq .visible true) (eq $.Site.Params.ambaDevMode true) }}
<br><br>
<div id="{{ anchorize .name }}">
<hr style="height: 4px;">
<h3>{{ .name }} - {{ .type }} Alert</h3>
<div style="text-indent: 1%;"><i>{{ .description }}</i></div>
<h4>Recommended Properties:</h4>
{{ if eq .type "Metric" }}
{{- partial "metricAlertProperties" .properties }}
{{ else if eq .type "Log" }}
{{- partial "logAlertProperties" .properties }}
{{ else if eq .type "ActivityLog" }}
{{- partial "activityAlertProperties" .properties }}
{{ end }}
{{ if .properties.query }}
<div>
<h4>Query:</h4>
<div>
{{ transform.Highlight .properties.query "plaintext" }}
</div>
</div>
{{ end }}
<table>
{{ range $key, $value := .properties }}
<tr>
<td>{{ $key }}</td>
<td>
{{ if or (reflect.IsMap $value) (reflect.IsSlice $value) }}
{{ transform.Highlight (encoding.Jsonify (dict "indent" " ") $value) "json" }}
{{ else if eq $key "query" }}
{{ transform.Highlight $value "plaintext" }}
{{ else }}
{{ $value }}
{{ end }}
</td>
</tr>
{{ end }}
</table>
<h4>References:</h4>
<table>
{{ range .references }}
Expand Down

0 comments on commit 25add3c

Please sign in to comment.