Commit 0a778b39 by Őry Máté

dashboard: fix VmMigrateView

parent e3519af3
......@@ -18,6 +18,8 @@ Choose a compute node to migrate {{obj}} to.
<li class="panel panel-default"><div class="panel-body">
<label for="migrate-to-{{n.pk}}">
<strong>{{ n }}</strong>
<div class="label label-primary"><i class="fa {{n.get_status_icon}}"></i>
{{n.get_status_display}}</div>
{% if current == n.pk %}<div class="label label-info">{% trans "current" %}</div>{% endif %}
{% if selected == n.pk %}<div class="label label-success">{% trans "recommended" %}</div>{% endif %}
</label>
......
......@@ -395,7 +395,7 @@ class VmMigrateView(VmOperationView):
def get_context_data(self, **kwargs):
ctx = super(VmMigrateView, self).get_context_data(**kwargs)
ctx['nodes'] = [n for n in Node.objects.filter(enabled=True)
if n.state == "ONLINE"]
if n.online]
return ctx
def post(self, request, extra=None, *args, **kwargs):
......
......@@ -303,8 +303,8 @@ class Node(OperatedMixin, TimeStampedModel):
def get_status_icon(self):
return {
'DISABLED': 'times-circle-o',
'OFFLINE': 'times-circle',
'DISABLED': 'fa-times-circle-o',
'OFFLINE': 'fa-times-circle',
'MISSING': 'fa-warning',
'PASSIVE': 'fa-play-circle-o',
'ACTIVE': 'fa-play-circle'}.get(self.get_state(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment