DEVELOPMENT ENVIRONMENT

~liljamo/felu

ref: 0.1.6 felu/internal/components/adminpartials.templ -rw-r--r-- 1.8 KiB
8c173e8fJonni Liljamo feat: manual updating of A records 1 year, 14 days 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
package components

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

templ AdminPartialUsersList(users []db.User) {
	<table class="table-auto">
		<thead>
			<tr>
				<th class="text-start p-2">
					Id
				</th>
				<th class="text-start p-2">
					Email
				</th>
				<th class="text-start p-2">
					Is Admin
				</th>
			</tr>
		</thead>
		<tbody>
			for _, user := range users {
				<tr class="border">
					<td>
						<div class="p-2">
							<input class="border" value={ user.Id } disabled/>
						</div>
					</td>
					<td>
						<div class="p-2">
							{ user.Email }
						</div>
					</td>
					<td>
						<div class="p-2">
							{ strconv.FormatBool(user.IsAdmin) }
						</div>
					</td>
				</tr>
			}
		</tbody>
	</table>
}

templ AdminPartialDomainsList(domains []db.Domain) {
	<table class="table-auto">
		<thead>
			<tr>
				<th class="text-start p-2">
					Id
				</th>
				<th class="text-start p-2">
					Domain
				</th>
				<th class="text-start p-2">
					A Record
				</th>
				<th class="text-start p-2">
					Owner (ID/Email)
				</th>
			</tr>
		</thead>
		<tbody>
			for _, domain := range domains {
				<tr class="border">
					<td>
						<div class="p-2">
							<input class="border" value={ domain.Id } disabled/>
						</div>
					</td>
					<td>
						<div class="p-2">
							{ domain.Domain }
						</div>
					</td>
					<td>
						<div class="p-2">
							{ domain.A }
						</div>
					</td>
					<td>
						<div class="p-2">
							<div class="flex flex-row-reverse gap-1">
								<input class="peer" type="checkbox"/>
								<input class="border hidden peer-checked:block" value={ domain.Owner.Email } disabled/>
								<input class="border block peer-checked:hidden" value={ domain.Owner.ID } disabled/>
							</div>
						</div>
					</td>
				</tr>
			}
		</tbody>
	</table>
}