Skip to content

Commit c412a65

Browse files
refactor(web): views
1 parent 9ef22b1 commit c412a65

File tree

5 files changed

+116
-107
lines changed

5 files changed

+116
-107
lines changed

web/src/uno.css

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/views/attachments.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h2>Attachments</h2>
77
<h2>
88
Seen {{.AttachmentsPageResult.Seen}} of {{.AttachmentsPageResult.TotalItems}}
9-
and showing {{.AttachmentsPageResult.PerPage}}
9+
and showing {{.AttachmentsPageResult.PerPage}}.
1010
</h2>
1111
</hgroup>
1212

web/views/endpoints.html

+66-63
Original file line numberDiff line numberDiff line change
@@ -7,76 +7,79 @@ <h2>Showing {{len .Endpoints}} endpoints.</h2>
77
</hgroup>
88

99
{{range $val := .Endpoints}}
10-
<article id="endpoint_{{$val.ID}}">
11-
<h3>{{$val.Name}}</h3>
10+
<section id="endpoint-{{$val.ID}}">
11+
<details>
12+
<summary>{{$val.Name}}</summary>
13+
<article>
14+
<div class="flex flex-col gap-4">
15+
<div class="flex justify-between gap-2">
16+
<div>
17+
<em title="Endpoint was created internally and cannot be modified.">
18+
Internal
19+
</em>
20+
</div>
21+
<div>
22+
<input disabled {{if $val.Internal}}checked{{end}} type="checkbox" role="switch" />
23+
</div>
24+
</div>
1225

13-
<div class="flex flex-col gap-4">
14-
<div class="flex justify-between gap-2">
15-
<div>
16-
<em title="Endpoint was created internally and cannot be modified.">
17-
Internal
18-
</em>
19-
</div>
20-
<div>
21-
<input disabled {{if $val.Internal}}checked{{end}} type="checkbox" role="switch" />
22-
</div>
23-
</div>
26+
<div class="flex justify-between gap-2">
27+
<div>Kind</div>
28+
<div>{{$val.Kind}}</div>
29+
</div>
2430

25-
<div class="flex justify-between gap-2">
26-
<div>Kind</div>
27-
<div>{{$val.Kind}}</div>
28-
</div>
31+
<div class="flex justify-between gap-2">
32+
<div>
33+
<em title="Do not send attachments to endpoint.">
34+
Attachment Disable
35+
</em>
36+
</div>
37+
<div>
38+
<input {{if $val.Internal}}disabled{{end}} {{if $val.AttachmentDisable}}checked{{end}} type="checkbox"
39+
role="switch" />
40+
</div>
41+
</div>
2942

30-
<div class="flex justify-between gap-2">
31-
<div>
32-
<em title="Do not send attachments to endpoint.">
33-
Attachment Disable
34-
</em>
35-
</div>
36-
<div>
37-
<input {{if $val.Internal}}disabled{{end}} {{if $val.AttachmentDisable}}checked{{end}} type="checkbox"
38-
role="switch" />
39-
</div>
40-
</div>
43+
<div class="flex justify-between gap-2">
44+
<div>
45+
<em title="Do not send text to endpoint.">
46+
Text Disable
47+
</em>
48+
</div>
49+
<div>
50+
<input {{if $val.Internal}}disabled{{end}} {{if $val.TextDisable}}checked{{end}} type="checkbox"
51+
role="switch" />
52+
</div>
53+
</div>
4154

42-
<div class="flex justify-between gap-2">
43-
<div>
44-
<em title="Do not send text to endpoint.">
45-
Text Disable
46-
</em>
47-
</div>
48-
<div>
49-
<input {{if $val.Internal}}disabled{{end}} {{if $val.TextDisable}}checked{{end}} type="checkbox"
50-
role="switch" />
55+
<label for="body_template">
56+
Body Template
57+
<textarea id="body_template" rows="4" {{if $val.Internal}}readonly{{end}}>{{$val.BodyTemplate}}</textarea>
58+
</label>
5159
</div>
52-
</div>
53-
54-
<label for="body_template">
55-
Body Template
56-
<textarea id="body_template" rows="4" {{if $val.Internal}}readonly{{end}}>{{$val.BodyTemplate}}</textarea>
57-
</label>
58-
</div>
5960

60-
{{if $val.Config}}
61-
<h4>Config</h4>
62-
<form>
63-
{{ range $key, $value := $val.Config }}
64-
<label for="config_{{$key}}">
65-
{{$key}}
66-
<textarea {{if $val.Internal}}readonly{{end}} {{if $value}}placeholder="**********" {{end}}
67-
id="config_{{$key}}"></textarea>
68-
</label>
69-
{{ end }}
70-
</form>
71-
{{ end }}
61+
{{if $val.Config}}
62+
<h4>Config</h4>
63+
<form>
64+
{{ range $key, $value := $val.Config }}
65+
<label for="config_{{$key}}">
66+
{{$key}}
67+
<textarea {{if $val.Internal}}readonly{{end}} {{if $value}}placeholder="**********" {{end}}
68+
id="config_{{$key}}"></textarea>
69+
</label>
70+
{{ end }}
71+
</form>
72+
{{ end }}
7273

73-
<form method="post" action="/endpoints/{{$val.ID}}/test" hx-post="/endpoints/{{$val.ID}}/test"
74-
class="pico-form-reset">
75-
<button type="submit" data-loading-disable data-loading-aria-busy>
76-
Test Endpoint
77-
</button>
78-
</form>
79-
</article>
74+
<form method="post" action="/endpoints/{{$val.ID}}/test" hx-post="/endpoints/{{$val.ID}}/test"
75+
class="pico-form-reset">
76+
<button type="submit" data-loading-disable data-loading-aria-busy>
77+
Test Endpoint
78+
</button>
79+
</form>
80+
</article>
81+
</details>
82+
</section>
8083
{{end}}
8184
</main>
8285

web/views/envelopes.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<h2>Envelopes</h2>
77
<h2>
88
Seen {{.MessagesPageResult.Seen}} of {{.MessagesPageResult.TotalItems}}
9-
and showing {{.MessagesPageResult.PerPage}}
9+
and showing {{.MessagesPageResult.PerPage}}.
1010
</h2>
1111
</hgroup>
1212

web/views/rules.html

+47-42
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,59 @@ <h2>Showing {{len .AggregateRules}} rules.</h2>
77
</hgroup>
88

99
{{range $val := .AggregateRules}}
10-
<article>
11-
<h3>{{$val.Rule.Name}}</h3>
10+
<section id="rule-{{$val.Rule.ID}}">
11+
<details>
12+
<summary class="pico-no-chevron">
13+
<div class="flex flex-justify-between">
14+
<div>{{$val.Rule.Name}}</div>
15+
<div>
1216

13-
<div class="flex flex-col gap-4">
14-
<div class="flex justify-between gap-2">
15-
<div>
16-
<em title="Endpoint was created internally and cannot be modified.">
17-
Internal
18-
</em>
17+
<div>
18+
{{template "p/rule-enable-form" $val.Rule}}
19+
</div>
20+
</div>
1921
</div>
20-
<div>
21-
<input disabled {{if $val.Rule.Internal}}checked{{end}} type="checkbox" role="switch" />
22-
</div>
23-
</div>
24-
<div class="flex justify-between gap-2">
25-
<div>
26-
Enable
27-
</div>
28-
<div>
29-
{{template "p/rule-enable-form" $val.Rule}}
30-
</div>
31-
</div>
22+
</summary>
23+
<article>
24+
<div class="flex flex-col gap-4">
25+
<div class="flex justify-between gap-2">
26+
<div>
27+
<em title="Endpoint was created internally and cannot be modified.">
28+
Internal
29+
</em>
30+
</div>
31+
<div>
32+
<input disabled {{if $val.Rule.Internal}}checked{{end}} type="checkbox" role="switch" />
33+
</div>
34+
</div>
3235

33-
<label for="rule-{{$val.Rule.ID}}-expression">
34-
Expression
35-
<textarea id="rule-{{$val.Rule.ID}}-expression" rows="4" {{if
36-
$val.Rule.Internal}}readonly{{end}}>{{$val.Rule.Expression}}</textarea>
37-
</label>
38-
</div>
36+
<label for="rule-{{$val.Rule.ID}}-expression">
37+
Expression
38+
<textarea id="rule-{{$val.Rule.ID}}-expression" rows="4" {{if
39+
$val.Rule.Internal}}readonly{{end}}>{{$val.Rule.Expression}}</textarea>
40+
</label>
41+
</div>
3942

40-
<h4>Endpoints</h4>
43+
<h4>Endpoints</h4>
4144

42-
<div class="flex flex-col gap-4">
43-
{{range $end := $val.Endpoints}}
44-
<div class="flex justify-between gap-2">
45-
<div class="text-ellipsis truncate">
46-
<a href="/endpoints#endpoint-{{$end.ID}}">
47-
{{$end.Name}}
48-
</a>
49-
</div>
50-
<div>
51-
<input {{if $val.Rule.Internal}}disabled{{end}} {{if $end.Enable}}checked{{end}} type="checkbox"
52-
role="switch" />
45+
<div class="flex flex-col gap-4">
46+
{{range $end := $val.Endpoints}}
47+
<div class="flex justify-between gap-2">
48+
<div class="text-ellipsis truncate">
49+
<a href="/endpoints#endpoint-{{$end.ID}}">
50+
{{$end.Name}}
51+
</a>
52+
</div>
53+
<div>
54+
<input {{if $val.Rule.Internal}}disabled{{end}} {{if $end.Enable}}checked{{end}} type="checkbox"
55+
role="switch" />
56+
</div>
57+
</div>
58+
{{end}}
5359
</div>
54-
</div>
55-
{{end}}
56-
</div>
57-
</article>
60+
</article>
61+
</details>
62+
</section>
5863
{{end}}
5964
</main>
6065

0 commit comments

Comments
 (0)