fine-tuning vm list page ip display depending on state

This commit is contained in:
forest 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" vm["state"] = "unknown"
vms = list(map( vms = list(map(
lambda x: dict( lambda x: dict(
id=x['id'], id=x['id'],
size=x['size'], size=x['size'],
state=x['state'], state=x['state'],
ipv4=(x['ipv4'] if x['ipv4'] else "..booting.."), ipv4=(x['ipv4'] if x['ipv4'] else ("..booting.." if vm["state"] == "running" else "unknown")),
ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"), ipv4_status=("ok" if x['ipv4'] else ("waiting-pulse" if vm["state"] == "running" else "yellow"),
os=x['os'], os=x['os'],
created=x['created'].strftime("%b %d %Y") created=x['created'].strftime("%b %d %Y")
), vms ), vms

View File

@ -333,6 +333,9 @@ pre.code.wrap {
color: #069e5f; color: #069e5f;
} }
.yellow {
color: rgba(221, 169, 56, 0.8);
}
footer, p { footer, p {
text-align: left; text-align: left;