containerlist.gohtml RawHistoryFolder
1<div class="flex flex-col p-4" hx-ext="response-targets">
2 <h1 class="text-lg md:text-xl font-bold text-gordonmascot-hblue">
3 {{index .Lang "manager" "content" "h1-containers"}}
4 </h1>
5 <table class="p-4 border-t-2 table-auto">
6 <thead>
7 <tr class="text-center text-gray-400">
8 <th>{{index .Lang "manager" "content" "thName"}}</th>
9 <th>{{index .Lang "manager" "content" "thPorts"}}</th>
10 <th>{{index .Lang "manager" "content" "thStatus"}}</th>
11 <th>{{index .Lang "manager" "content" "thState"}}</th>
12 <th>{{index .Lang "manager" "content" "thActions"}}</th>
13 </tr>
14 </thead>
15 <tbody>
16 {{ $Lang := .Lang }}
17 {{
18 range.containers
19 }}
20 <tr id="container-{{.ID}}" class="text-center hover:bg-slate-100">
21 <td>
22 <span
23 title="{{.Container.ID}}"
24 class="font-bold"
25 >{{.Name}}</span
26 >
27 </td>
28 <td class="port-container">{{ .Ports }}</td>
29 <td class="status-container">{{.Status}} (Up since {{.UpSince}})</td>
30 <td style="color: {{.StateColor}};">{{.State}}</td>
31 <td>
32 <button
33 id="start-button-{{.ID}}"
34 hx-post="/htmx/container-manager/start/{{.ID}}"
35 hx-target="#actionResponse-{{.ID}}"
36 hx-target-*="#error-message-{{.ID}}"
37 hx-swap="outerHTML"
38 class="py-2 px-4"
39 >
40 <span title="Start the container" class="iconf text-xl text-blue-600 hover:text-gordonmascot-hblue"></span>
41 </button>
42 <!-- EDIT -->
43 <button
44 id="edit-button-{{.ID}}"
45 hx-get="/htmx/container-manager/edit/{{.ID}}"
46 hx-target="#actionResponse-{{.ID}}"
47 hx-target-*="#error-message-{{.ID}}"
48 hx-swap="innerHTML"
49 class="py-2 px-4"
50 data-active="false"
51 _="on click toggle between .visible and .hidden on #actionResponse-{{.ID}}"
52 >
53 <span title="Edit the container" class="iconf text-2xl text-blue-600 hover:text-gordonmascot-hblue"></span>
54 </button>
55 <!-- stop -->
56 <button
57 id="stop-button-{{.ID}}"
58 hx-post="/htmx/container-manager/stop/{{.ID}}"
59 hx-target="#actionResponse-{{.ID}}"
60 hx-target-*="#error-message-{{.ID}}"
61 hx-swap="innerHTML"
62 hx-confirm="{{index $Lang "manager" "content" "confirm-container-stop"}}"
63 class="py-2 px-4"
64 >
65 <span title="Stop the container" class="iconf text-xl text-red-600 hover:text-red-900"></span>
66 </button>
67 <!-- REMOVE -->
68 <button
69 id="remove-button-img-{{.ID}}"
70 hx-delete="/htmx/container-manager/delete/{{.ID}}"
71 hx-target="#actionResponse-{{.ID}}"
72 hx-target-*="#error-message-{{.ID}}"
73 hx-swap="innerHTML"
74 hx-confirm="{{index $Lang "manager" "content" "confirm-delete"}}"
75 class="py-2 px-4"
76 >
77 <!-- iconoir trash -->
78 <span title="Remove the container" class="iconf text-xl text-red-600 hover:text-red-900"></span>
79 </button>
80 </td>
81 </tr>
82 <tr>
83 <td colspan="7">
84 <div id="actionResponse-{{.ID}}"></div>
85 <div id="error-message-{{.ID}}" class="text-red-500"></div>
86 </td>
87 </tr>
88 {{ else }}
89 <tr>
90 <td colspan="7" class="mt-2">
91 <p class="text-center text-gray-400 text-xl">
92 {{index $Lang "manager" "content" "no-containers"}}
93 </p>
94 </td>
95 </tr>
96 {{
97 end
98 }}
99 </tbody>
100 </table>
101</div>