smon/views/pages/notifications.gotmpl

47 lines
1.4 KiB
Go Template
Raw Normal View History

2024-06-29 15:21:52 +02:00
{{ define "page" }}
{{ block "page_label" . }}{{end}}
{{ $version := .VERSION }}
{{ $theme := .CONFIG.THEME }}
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/{{ .CONFIG.THEME }}/notifications.css">
2024-06-29 19:30:26 +02:00
<script type="text/javascript">
function dialogClick(evt) {
if (evt.target.tagName.toUpperCase() == 'DIALOG') {
evt.target.close()
}
}
</script>
2024-07-04 13:29:39 +02:00
{{ block "timefilter" . }}{{ end }}
2024-06-29 15:21:52 +02:00
<div id="notifications">
<div class="header">Sent</div>
<div class="header">OK</div>
<div class="header">Trigger name</div>
<div class="header">Service</div>
2024-06-29 18:09:56 +02:00
<div class="header">Error</div>
2024-06-29 15:21:52 +02:00
{{ range .Data.Notifications }}
<div>{{ format_time .Sent }}</div>
2024-06-29 19:30:26 +02:00
<div>{{ if .OK }}<span class="ok">✔</span>{{ else }}<span class="error">✗</span>{{ end }}</div>
2024-06-29 15:21:52 +02:00
<div>{{ .TriggerName }}</div>
<div>{{ .Prio }}:{{ .Service }}</div>
2024-06-29 19:30:26 +02:00
<div>
{{ if .Error.Valid }}
<img src="/images/{{ $version }}/{{ $theme }}/info-filled.svg" onclick="document.getElementById('error-{{ .ID }}').showModal()">
<dialog id="error-{{ .ID }}" onclick="dialogClick(event)">
<div style="padding: 16px 32px">
<pre>{{ .ErrorIndented }}</pre>
<div style="text-align: center">
<button onclick="document.getElementById('error-{{ .ID }}').close()">Close</button>
</div>
</div>
</dialog>
{{ else }}
<img src="/images/{{ $version }}/{{ $theme }}/info-outline.svg">
{{ end }}
</div>
2024-06-29 15:21:52 +02:00
{{ end }}
</div>
{{ end }}