Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b0a5f07e
authored
Apr 29, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: list hostgroups
parent
20170089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
+18
-0
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+3
-0
firewall_gui/views.py
+14
-0
No files found.
cloud/urls.py
View file @
b0a5f07e
...
...
@@ -98,4 +98,5 @@ urlpatterns = patterns('',
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'
),
url
(
r'^firewall/hostgroups/$'
,
'firewall_gui.views.list_hostgroups'
),
)
firewall_gui/static/js/project.js
View file @
b0a5f07e
...
...
@@ -12,6 +12,9 @@ var module = angular.module('firewall', []).config(
}).
when
(
'/vlangroups/'
,
{
templateUrl
:
'/static/partials/vlangroup-list.html'
,
controller
:
ListController
(
'/firewall/vlangroups/'
)
}).
when
(
'/hostgroups/'
,
{
templateUrl
:
'/static/partials/hostgroup-list.html'
,
controller
:
ListController
(
'/firewall/hostgroups/'
)
}).
otherwise
({
redirectTo
:
'/rules/'
...
...
firewall_gui/views.py
View file @
b0a5f07e
...
...
@@ -112,3 +112,17 @@ def list_vlangroups(request):
}
for
group
in
VlanGroup
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
vlangroups
),
content_type
=
"application/json"
)
def
list_hostgroups
(
request
):
groups
=
[{
"id"
:
group
.
id
,
"name"
:
group
.
name
,
"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
Group
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
groups
),
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