fix wrong var name

This commit is contained in:
forest 2021-02-17 21:57:57 -06:00
parent 88905b944d
commit 70628039c4
1 changed files with 7 additions and 7 deletions

View File

@ -69,7 +69,7 @@ def index():
mappedVms = []
for vm in vms:
ip_display = x['ipv4']
ip_display = vm['ipv4']
if not ip_display:
if vm["state"] == "running":
ip_display = "..booting.."
@ -77,20 +77,20 @@ def index():
ip_display = "unknown"
ip_display_class = "ok"
if not x['ipv4']:
if not vm['ipv4']:
if vm["state"] == "running":
ip_display_class = "waiting-pulse"
else:
ip_display_class = "yellow"
mappedVms.append(dict(
id=x['id'],
size=x['size'],
state=x['state'],
id=vm['id'],
size=vm['size'],
state=vm['state'],
ipv4=ip_display,
ipv4_status=ip_display_class,
os=x['os'],
created=x['created'].strftime("%b %d %Y")
os=vm['os'],
created=vm['created'].strftime("%b %d %Y")
))
return render_template("capsuls.html", vms=mappedVms, has_vms=len(vms) > 0, created=created)