Commit 7f20e972 by Oláh István Gergely

dashboard: add get_status_icon to nodes, change node status icons

parent 40ae32c2
...@@ -317,6 +317,14 @@ class Node(OperatedMixin, TimeStampedModel): ...@@ -317,6 +317,14 @@ class Node(OperatedMixin, TimeStampedModel):
cls.objects.filter(enabled=enabled).select_related('host') cls.objects.filter(enabled=enabled).select_related('host')
if == online]) if == online])
def get_status_icon(self):
return {
'OFFLINE': 'icon-minus-sign',
'DISABLED': 'icon-moon',
'MISSING': 'icon-warning-sign',
'ONLINE': 'icon-play-sign'}.get(self.get_state(),
@permalink @permalink
def get_absolute_url(self): def get_absolute_url(self):
return ('dashboard.views.node-detail', None, {'pk':}) return ('dashboard.views.node-detail', None, {'pk':})
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