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
20170089
authored
Apr 29, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: list vlangroups
parent
77e20908
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+3
-0
firewall_gui/views.py
+18
-0
No files found.
cloud/urls.py
View file @
20170089
...
...
@@ -97,4 +97,5 @@ urlpatterns = patterns('',
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'
),
url
(
r'^firewall/vlangroups/$'
,
'firewall_gui.views.list_vlangroups'
),
)
firewall_gui/static/js/project.js
View file @
20170089
...
...
@@ -9,6 +9,9 @@ var module = angular.module('firewall', []).config(
}).
when
(
'/vlans/'
,
{
templateUrl
:
'/static/partials/vlan-list.html'
,
controller
:
ListController
(
'/firewall/vlans/'
)
}).
when
(
'/vlangroups/'
,
{
templateUrl
:
'/static/partials/vlangroup-list.html'
,
controller
:
ListController
(
'/firewall/vlangroups/'
)
}).
otherwise
({
redirectTo
:
'/rules/'
...
...
firewall_gui/views.py
View file @
20170089
...
...
@@ -94,3 +94,21 @@ def list_vlans(request):
}
for
vlan
in
Vlan
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
vlans
),
content_type
=
"application/json"
)
def
list_vlangroups
(
request
):
vlangroups
=
[{
"id"
:
group
.
id
,
"name"
:
group
.
name
,
"vlans"
:
[{
"id"
:
vlan
.
id
,
"name"
:
vlan
.
name
}
for
vlan
in
group
.
vlans
.
all
()],
"description"
:
group
.
description
,
"owner"
:
{
"id"
:
group
.
owner
.
id
,
"name"
:
str
(
group
.
owner
)
},
"created_at"
:
group
.
created_at
.
isoformat
(),
"modified_at"
:
group
.
modified_at
.
isoformat
(),
}
for
group
in
VlanGroup
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
vlangroups
),
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