Commit e7769c2f by Oláh István Gergely Committed by Őry Máté

dashboard: fix node activity

parent db3c3c74
......@@ -9,7 +9,7 @@
<div class="row">
<div class="col-md-4" id="node-info-pane">
<div id="node-info-data" class="big">
<span id="node-status-label" class="label {% if node.state == 'Online' %}label-success
<span id="node-details-state" class="label {% if node.state == 'Online' %}label-success
{% elif node.state == 'Missing' %}label-danger
{% elif node.state == 'Disabled' %}label-warning
{% elif node.state == 'Offline' %}label-warning
......
......@@ -35,7 +35,7 @@ from .tables import (VmListTable, NodeListTable, NodeVmListTable,
TemplateListTable, LeaseListTable, GroupListTable,)
from vm.models import (Instance, InstanceTemplate, InterfaceTemplate,
InstanceActivity, Node, instance_activity, Lease,
Interface)
Interface, NodeActivity)
from firewall.models import Vlan, Host, Rule
from dashboard.models import Favourite
......@@ -444,6 +444,10 @@ class NodeDetailView(LoginRequiredMixin, SuperuserRequiredMixin, DetailView):
context = super(NodeDetailView, self).get_context_data(**kwargs)
instances = Instance.active.filter(node=self.object)
context['table'] = NodeVmListTable(instances)
na = NodeActivity.objects.filter(
node=self.object, parent=None
).order_by('-started').select_related()
context['activities'] = na
return context
def post(self, request, *args, **kwargs):
......
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