Skip to content

Commit

Permalink
container: add color for title
Browse files Browse the repository at this point in the history
  • Loading branch information
lisaac committed Jul 6, 2023
1 parent 8d4b977 commit 0b868de
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,17 @@ local start_stop_remove = function(m, cmd)
end
end

local c_color
if container_info.State.Status == 'running' then
c_color = 'green'
elseif container_info.State.Status == 'restarting' then
c_color = 'yellow'
else
c_color = 'red'
end

m=SimpleForm("docker",
translatef("Docker - Container (%s)", container_info.Name:sub(2)),
translatef("Docker - Container (<font color='%s'>%s</font>)", c_color, container_info.Name:sub(2)),
translate("On this page, the selected container can be managed."))
m.redirect = luci.dispatcher.build_url("admin/docker/containers")

Expand Down

0 comments on commit 0b868de

Please sign in to comment.