51 lines
1.8 KiB
Plaintext
51 lines
1.8 KiB
Plaintext
<%- result.each do |f| -%>
|
|
<tr hx-indicator="#spinner-<%= f["name"] %>">
|
|
<td>
|
|
<%= f["name"] %>
|
|
<img id="spinner-<%= f["name"] %>" src="bars.svg" class="htmx-indicator">
|
|
</td>
|
|
<td>
|
|
<table>
|
|
<thead>
|
|
<th>ID</th>
|
|
<th>Current?</th>
|
|
<th>Actions</th>
|
|
</thead>
|
|
<tbody>
|
|
<%- f["containers"].as(Array(Docr::Types::ContainerSummary)).each do |c| -%>
|
|
<tr>
|
|
<td><tt><%= c.@names[0].split("-")[-1] %></tt></td>
|
|
<td>
|
|
<%- if c.image_id == f["latest_image"] -%>
|
|
<span style="color:green;""> 🟢</span>
|
|
<%- else -%>
|
|
<span style="color:red;""> 🟢</span>
|
|
<%- end -%>
|
|
</td>
|
|
<td>
|
|
<button hx-target="#terminal" hx-get="funkos/terminal/logs/<%= c.@names[0].lstrip("/") %>/">Logs</button>
|
|
<button hx-target="#terminal" hx-get="funkos/terminal/shell/<%= c.@names[0].lstrip("/") %>/">Shell</button>
|
|
</td>
|
|
</tr>
|
|
<%- end -%>
|
|
</tbody>
|
|
</p>
|
|
</td>
|
|
|
|
</table>
|
|
<td>
|
|
<%- if f["name"] == "proxy" -%>
|
|
<%- else -%>
|
|
<%- if f["scale"].as(String).to_i > 0 -%>
|
|
<button disabled hx-get="funkos/<%= f["name"] %>/start">Start</button>
|
|
<button hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
|
<%- else -%>
|
|
<button hx-get="funkos/<%= f["name"] %>/start" hx-on:htmx:after-request="update_funkos()">Start</button>
|
|
<button disabled hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
|
<%- end -%>
|
|
<button hx-get="funkos/<%= f["name"] %>/restart" hx-on:htmx:after-request="update_funkos()">Restart</button>
|
|
<%- end -%>
|
|
</td>
|
|
</tr>
|
|
<%- end -%>
|