Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
77e20908
authored
Apr 29, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: list vlans
parent
4fdfdd8b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+3
-0
firewall_gui/views.py
+17
-0
No files found.
cloud/urls.py
View file @
77e20908
...
...
@@ -96,4 +96,5 @@ urlpatterns = patterns('',
url
(
r'^firewall/$'
,
'firewall_gui.views.index'
),
url
(
r'^firewall/rules/$'
,
'firewall_gui.views.list_rules'
),
url
(
r'^firewall/hosts/$'
,
'firewall_gui.views.list_hosts'
),
url
(
r'^firewall/vlans/$'
,
'firewall_gui.views.list_vlans'
),
)
firewall_gui/static/js/project.js
View file @
77e20908
...
...
@@ -6,6 +6,9 @@ var module = angular.module('firewall', []).config(
}).
when
(
'/hosts/'
,
{
templateUrl
:
'/static/partials/host-list.html'
,
controller
:
ListController
(
'/firewall/hosts/'
)
}).
when
(
'/vlans/'
,
{
templateUrl
:
'/static/partials/vlan-list.html'
,
controller
:
ListController
(
'/firewall/vlans/'
)
}).
otherwise
({
redirectTo
:
'/rules/'
...
...
firewall_gui/views.py
View file @
77e20908
...
...
@@ -77,3 +77,20 @@ def list_hosts(request):
}
for
group
in
host
.
groups
.
all
()]
}
for
host
in
Host
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
hosts
),
content_type
=
"application/json"
)
def
list_vlans
(
request
):
vlans
=
[{
"id"
:
vlan
.
id
,
"vid"
:
vlan
.
vid
,
"name"
:
vlan
.
name
,
"ipv4"
:
vlan
.
ipv4
+
"/"
+
str
(
vlan
.
prefix4
),
"ipv6"
:
vlan
.
ipv6
+
"/"
+
str
(
vlan
.
prefix6
),
"nat"
:
vlan
.
snat_ip
,
"description"
:
vlan
.
description
,
"domain"
:
{
"id"
:
vlan
.
domain
.
id
,
"name"
:
vlan
.
domain
.
name
,
}
}
for
vlan
in
Vlan
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
vlans
),
content_type
=
"application/json"
)
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