fine-tuning vm list page ip display depending on state

This commit is contained in:
2021-02-17 21:29:03 -06:00
parent 5d3dbac9ba
commit 1de0388df2
2 changed files with 6 additions and 2 deletions

View File

@ -67,13 +67,14 @@ def index():
vm["state"] = "unknown"
vms = list(map(
lambda x: dict(
id=x['id'],
size=x['size'],
state=x['state'],
ipv4=(x['ipv4'] if x['ipv4'] else "..booting.."),
ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"),
ipv4=(x['ipv4'] if x['ipv4'] else ("..booting.." if vm["state"] == "running" else "unknown")),
ipv4_status=("ok" if x['ipv4'] else ("waiting-pulse" if vm["state"] == "running" else "yellow"),
os=x['os'],
created=x['created'].strftime("%b %d %Y")
), vms