Commit 0a778b39 by Őry Máté

dashboard: fix VmMigrateView

parent e3519af3
...@@ -18,6 +18,8 @@ Choose a compute node to migrate {{obj}} to. ...@@ -18,6 +18,8 @@ Choose a compute node to migrate {{obj}} to.
<li class="panel panel-default"><div class="panel-body"> <li class="panel panel-default"><div class="panel-body">
<label for="migrate-to-{{n.pk}}"> <label for="migrate-to-{{n.pk}}">
<strong>{{ n }}</strong> <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 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 %} {% if selected == n.pk %}<div class="label label-success">{% trans "recommended" %}</div>{% endif %}
</label> </label>
......
...@@ -395,7 +395,7 @@ class VmMigrateView(VmOperationView): ...@@ -395,7 +395,7 @@ class VmMigrateView(VmOperationView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super(VmMigrateView, self).get_context_data(**kwargs) ctx = super(VmMigrateView, self).get_context_data(**kwargs)
ctx['nodes'] = [n for n in Node.objects.filter(enabled=True) ctx['nodes'] = [n for n in Node.objects.filter(enabled=True)
if n.state == "ONLINE"] if n.online]
return ctx return ctx
def post(self, request, extra=None, *args, **kwargs): def post(self, request, extra=None, *args, **kwargs):
......
...@@ -303,8 +303,8 @@ class Node(OperatedMixin, TimeStampedModel): ...@@ -303,8 +303,8 @@ class Node(OperatedMixin, TimeStampedModel):
def get_status_icon(self): def get_status_icon(self):
return { return {
'DISABLED': 'times-circle-o', 'DISABLED': 'fa-times-circle-o',
'OFFLINE': 'times-circle', 'OFFLINE': 'fa-times-circle',
'MISSING': 'fa-warning', 'MISSING': 'fa-warning',
'PASSIVE': 'fa-play-circle-o', 'PASSIVE': 'fa-play-circle-o',
'ACTIVE': 'fa-play-circle'}.get(self.get_state(), '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