DEVELOPMENT ENVIRONMENT

~liljamo/felu

ref: cecbccc31b01b8db9a924c2852227e1cd2f246ae felu/internal/components/manage.templ -rw-r--r-- 1.0 KiB
cecbccc3Jonni Liljamo refactor: move more to handlers 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package components

import "git.src.quest/~skye/felu-ddns/internal/config"

func getDomainPattern() string {
	return config.FeluConfig.DNSPattern
}

templ Manage() {
	@ManageBase("Manage") {
		<div class="bg-teal-200">
			<form class="flex flex-col p-2 gap-2" hx-post="/manage/domains" hx-target="#add_domain_error">
				<label for="domain">Domain</label>
				<div>
					<input class="border" type="text" placeholder="..." name="domain" id="domain"/>
					<span>{ getDomainPattern() }</span>
				</div>
				<label for="a_record">A Record</label>
				<input class="border" type="text" placeholder="..." name="a_record" id="a_record"/>
				<div class="text-rose-600 text-center" id="add_domain_error"></div>
				<button class="border p-1" type="submit">Add</button>
			</form>
		</div>

		<div hx-get="/manage/partials/domains" hx-trigger="load, update-domain-list from:body" hx-target="this">
		</div>
	}
}

templ ManageSettings() {
	@ManageBase("Settings") {
		<div>
			user settings here, like updating email and password
		</div>
	}
}