Add/edit notifications

This commit is contained in:
Magnus Åhall 2024-06-28 15:28:52 +02:00
parent 1ede36b8aa
commit c7ad2aa1b6
19 changed files with 531 additions and 11 deletions

View file

@ -62,6 +62,12 @@
return
location.href = `/section/delete/${id}`
}
function newNotification() {
const select = document.getElementById('notification-create-type')
const nType = select.value
location.href = `/configuration/notification?type=${nType}`
}
</script>
{{ block "page_label" . }}{{end}}
@ -108,4 +114,24 @@
<button style="margin-left: 8px;">Update</button>
</form>
<h1>Notifications</h1>
<select id="notification-create-type">
{{ range .Data.AvailableServices }}
<option>{{ .GetType }}</option>
{{ end }}
</select>
<button onclick="newNotification()">Create</button>
<div id="services">
<div class="header">Prio</div>
<div class="header">Type</div>
<div class="header">Target</div>
<div class="line"></div>
{{ range .Data.NotificationServices }}
<div><a href="/configuration/notification?prio={{ .GetPrio }}">{{ .GetPrio }}</a></div>
<div><a href="/configuration/notification?prio={{ .GetPrio }}">{{ .GetType }}</a></div>
<div><a href="/configuration/notification?prio={{ .GetPrio }}">{{ .String }}</a></div>
{{ end }}
</div>
{{ end }}