imagelist.gohtml RawHistoryFolder
1<div class="flex flex-col p-4">
2 <!-- Upload button aligned right of Images -->
3 <div class="flex justify-between items-center mb-1">
4 <h1 class="text-lg md:text-xl font-bold text-gordonmascot-hblue">Images</h1>
5 <button
6 class="py-1 px-2 bg-blue-500 hover:bg-blue-700 text-white font-bold rounded"
7 id="upload-button"
8 hx-get="/htmx/upload-image"
9 hx-target="#upload-image"
10 hx-swap="innerHTML"
11 title="Manually upload a .tar container image"
12 _="on click toggle between .visible and .hidden on #upload-image then add .hidden to .create-container"
13 >
14
15 <span class="iconf text-xl align-middle"> </span>
16 Upload
17 </button>
18 </div>
19 <div id="upload-image"></div>
20 <table class="p-4 border-t-2">
21 <tbody>
22 {{
23 range.Images
24 }}
25 <tr id="img-{{.ShortID}}" hx-ext="response-targets" class=" hover:bg-slate-100">
26 <td>
27 <span title="{{.ShortID}}">{{.Name}}</span>
28 </td>
29 <td>
30 <span title="Image creation date">{{.CreatedStr}}</span>
31 </td>
32 <td>{{.SizeStr}}</td>
33 <td align="right">
34
35 <button
36 id="add-button-img-{{.ShortID}}"
37 hx-get="/htmx/create-container/{{.ShortID}}"
38 hx-target="#create-container-{{.ShortID}}"
39 hx-target-*="#error-message-div-{{.ShortID}}"
40 hx-swap="innerHTML"
41 class="py-2 px-4"
42 _="on click toggle between .visible and .hidden on #create-container-{{.ShortID}} then add .hidden to #upload-image"
43 >
44 <span title="Deploy a container using this image" class="iconf text-xl text-blue-600 hover:text-gordonmascot-hblue"></span>
45 </button>
46
47 <button
48 id="remove-button-img-{{.ShortID}}"
49 hx-delete="/htmx/image-manager/delete/{{.ShortID}}"
50 hx-target="#img-{{.ShortID}}"
51 hx-target-*="#error-message-div-{{.ShortID}}"
52 hx-swap="innerHTML"
53 hx-confirm="Are you sure you want to delete this container image?"
54 class="py-2 px-4"
55 >
56 <span title="Remove this image" class="iconf text-xl text-red-600 hover:text-red-900"></span>
57 </button>
58 </td>
59 </tr>
60 <t>
61 <td colspan="4">
62 <div id="error-message-div-{{.ShortID}}" class="text-red-500"></div>
63 <div class="create-container" id="create-container-{{.ShortID}}"></div>
64 </td>
65 </tr>
66 {{ else }}
67 <tr>
68 <td colspan="4" class="mt-2">No images found.</td>
69 </tr>
70 {{
71 end
72 }}
73 </tbody>
74 </table>
75</div>