Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
dbdf9d47
authored
Mar 03, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-network-oui' into 'master'
Display nic hardware vendor
parents
5198bd4f
e7feac88
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletions
+18
-1
circle/firewall/models.py
+12
-1
circle/network/tables.py
+3
-0
circle/network/templates/network/columns/mac.html
+3
-0
No files found.
circle/firewall/models.py
View file @
dbdf9d47
...
...
@@ -2,7 +2,7 @@
from
itertools
import
islice
,
chain
import
logging
from
netaddr
import
IPSet
from
netaddr
import
IPSet
,
EUI
from
django.contrib.auth.models
import
User
from
django.db
import
models
...
...
@@ -706,6 +706,17 @@ class Host(models.Model):
def
get_absolute_url
(
self
):
return
(
'network.host'
,
None
,
{
'pk'
:
self
.
pk
})
@property
def
eui
(
self
):
return
EUI
(
self
.
mac
)
@property
def
hw_vendor
(
self
):
try
:
return
self
.
eui
.
oui
.
registration
()
.
org
except
:
return
None
class
Firewall
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
20
,
unique
=
True
,
...
...
circle/network/tables.py
View file @
dbdf9d47
...
...
@@ -36,6 +36,9 @@ class GroupTable(Table):
class
HostTable
(
Table
):
hostname
=
LinkColumn
(
'network.host'
,
args
=
[
A
(
'pk'
)])
mac
=
TemplateColumn
(
template_name
=
"network/columns/mac.html"
)
class
Meta
:
model
=
Host
...
...
circle/network/templates/network/columns/mac.html
0 → 100644
View file @
dbdf9d47
{% load i18n %}
<span
title=
"{% blocktrans with vendor=record.hw_vendor|default:"
n
/
a
"
%}
Vendor:
{{
vendor
}}{%
endblocktrans
%}"
>
{{ record.mac }}
</span>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment