Make frontend sort-of-ok
This commit is contained in:
parent
64778bba19
commit
dcd5c615b4
@ -15,8 +15,10 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Status</th>
|
<th>Scale</th>
|
||||||
<th>Action</th>
|
<th>Containers</th>
|
||||||
|
<th>Images</th>
|
||||||
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id="funko-list">
|
<tbody id="funko-list">
|
||||||
|
@ -79,12 +79,11 @@ module Funko
|
|||||||
result = [] of Hash(String, String)
|
result = [] of Hash(String, String)
|
||||||
|
|
||||||
funkos.each do |funko|
|
funkos.each do |funko|
|
||||||
state = "FIXME"
|
|
||||||
|
|
||||||
result << {
|
result << {
|
||||||
"name" => funko.name,
|
"name" => funko.name,
|
||||||
"state" => state,
|
"scale" => funko.scale.to_s,
|
||||||
"status" => "FIXME",
|
"containers" => funko.containers.size.to_s,
|
||||||
|
"images" => funko.images.size.to_s,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ module Funko
|
|||||||
all: true,
|
all: true,
|
||||||
).each { |container|
|
).each { |container|
|
||||||
container.@names.each { |name|
|
container.@names.each { |name|
|
||||||
names << name.split("-", 2)[1].lstrip("/") if name.starts_with?("/faaso-")
|
names << name.split("-", 3)[1].lstrip("/") if name.starts_with?("/faaso-")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,32 +1,21 @@
|
|||||||
<%- result.each do |f| -%>
|
<%- result.each do |f| -%>
|
||||||
<tr hx-indicator="#spinner-<%= f["name"] %>">
|
<tr hx-indicator="#spinner-<%= f["name"] %>">
|
||||||
<td><%= f["name"] %></td>
|
<td><%= f["name"] %></td>
|
||||||
<%- if f["name"] == "proxy" -%>
|
<td><%= f["scale"] %></td>
|
||||||
<td>Running</td>
|
<td><%= f["containers"] %></td>
|
||||||
<%- else -%>
|
<td><%= f["images"] %></td>
|
||||||
<td><%= f["status"] %></td>
|
|
||||||
<%- end -%>
|
|
||||||
<td>
|
<td>
|
||||||
<%- if f["name"] == "proxy" -%>
|
<%- if f["name"] == "proxy" -%>
|
||||||
<%- else -%>
|
<%- else -%>
|
||||||
<%- if f["state"] == "running" -%>
|
<%- if f["scale"].to_i > 0 -%>
|
||||||
<button disabled hx-get="funkos/<%= f["name"] %>/start">Start</button>
|
<button disabled hx-get="funkos/<%= f["name"] %>/start">Start</button>
|
||||||
<button hx-get="funkos/<%= f["name"] %>/pause" hx-on:htmx:after-request="update_funkos()">Pause</button>
|
|
||||||
<button hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
<button hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
||||||
<button hx-get="funkos/<%= f["name"] %>/restart" hx-on:htmx:after-request="update_funkos()">Restart</button>
|
<button hx-get="funkos/<%= f["name"] %>/restart" hx-on:htmx:after-request="update_funkos()">Restart</button>
|
||||||
<%- end -%>
|
<%- else -%>
|
||||||
<%- if f["state"] == "paused" -%>
|
|
||||||
<button hx-get="funkos/<%= f["name"] %>/start" hx-on:htmx:after-request="update_funkos()">Start</button>
|
<button hx-get="funkos/<%= f["name"] %>/start" hx-on:htmx:after-request="update_funkos()">Start</button>
|
||||||
<button disabled hx-get="funkos/<%= f["name"] %>/pause">Pause</button>
|
<button disabled hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
||||||
<button hx-get="funkos/<%= f["name"] %>/stop" hx-on:htmx:after-request="update_funkos()">Stop</button>
|
|
||||||
<button hx-get="funkos/<%= f["name"] %>/restart" hx-on:htmx:after-request="update_funkos()">Restart</button>
|
<button hx-get="funkos/<%= f["name"] %>/restart" hx-on:htmx:after-request="update_funkos()">Restart</button>
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<%- if f["state"] == "stopped" -%>
|
|
||||||
<button hx-get="funkos/<%= f["name"] %>/start" hx-on:htmx:after-request="update_funkos()">Start</button>
|
|
||||||
<button disabled hx-get="funkos/<%= f["name"] %>/pause">Pause</button>
|
|
||||||
<button disabled hx-get="funkos/<%= f["name"] %>/stop">Stop</button>
|
|
||||||
<button disabled hx-get="funkos/<%= f["name"] %>/restart">Restart</button>
|
|
||||||
<%- end -%>
|
|
||||||
<%- end -%>
|
<%- end -%>
|
||||||
<img id="spinner-<%= f["name"] %>" src="https://htmx.org/img/bars.svg" class="htmx-indicator">
|
<img id="spinner-<%= f["name"] %>" src="https://htmx.org/img/bars.svg" class="htmx-indicator">
|
||||||
</td>
|
</td>
|
||||||
|
@ -8,24 +8,3 @@
|
|||||||
ReverseOnly Yes
|
ReverseOnly Yes
|
||||||
ReverseMagic Yes
|
ReverseMagic Yes
|
||||||
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
ReversePath "/admin/" "http://127.0.0.1:3000/"
|
||||||
ReversePath "/faaso/hello-101807275100116/" "http://hello-101807275100116:3000/"
|
|
||||||
ReversePath "/faaso/hello-109717610410253/" "http://hello-109717610410253:3000/"
|
|
||||||
ReversePath "/faaso/hello-115791188481102/" "http://hello-115791188481102:3000/"
|
|
||||||
ReversePath "/faaso/hello-489850679780/" "http://hello-489850679780:3000/"
|
|
||||||
ReversePath "/faaso/hello-52122101707950/" "http://hello-52122101707950:3000/"
|
|
||||||
ReversePath "/faaso/hello-53828586108120/" "http://hello-53828586108120:3000/"
|
|
||||||
ReversePath "/faaso/hello-5412177121100122/" "http://hello-5412177121100122:3000/"
|
|
||||||
ReversePath "/faaso/hello-679912011112183/" "http://hello-679912011112183:3000/"
|
|
||||||
ReversePath "/faaso/hello-687849738368/" "http://hello-687849738368:3000/"
|
|
||||||
ReversePath "/faaso/hello-689880877456/" "http://hello-689880877456:3000/"
|
|
||||||
ReversePath "/faaso/hello-6987113768753/" "http://hello-6987113768753:3000/"
|
|
||||||
ReversePath "/faaso/hello-7273704811390/" "http://hello-7273704811390:3000/"
|
|
||||||
ReversePath "/faaso/hello-761221081008155/" "http://hello-761221081008155:3000/"
|
|
||||||
ReversePath "/faaso/hello-9798100678476/" "http://hello-9798100678476:3000/"
|
|
||||||
ReversePath "/faaso/hello-98103104100103100/" "http://hello-98103104100103100:3000/"
|
|
||||||
ReversePath "/faaso/hello-e24ojr/" "http://hello-e24ojr:3000/"
|
|
||||||
ReversePath "/faaso/hello-foo/" "http://hello-foo:3000/"
|
|
||||||
ReversePath "/faaso/hello-gfvij3/" "http://hello-gfvij3:3000/"
|
|
||||||
ReversePath "/faaso/hello-ngisvh/" "http://hello-ngisvh:3000/"
|
|
||||||
ReversePath "/faaso/hello-rqp8o3/" "http://hello-rqp8o3:3000/"
|
|
||||||
ReversePath "/faaso/hello-xtpu69/" "http://hello-xtpu69:3000/"
|
|
Loading…
Reference in New Issue
Block a user