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
9355815f
authored
Apr 24, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: view response updated
parent
42f74a54
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
10 deletions
+15
-10
firewall_gui/views.py
+15
-10
No files found.
firewall_gui/views.py
View file @
9355815f
...
@@ -10,26 +10,27 @@ def index(request):
...
@@ -10,26 +10,27 @@ def index(request):
def
list_rules
(
request
):
def
list_rules
(
request
):
rules
=
[{
rules
=
[{
'id'
:
rule
.
id
,
'id'
:
rule
.
id
,
'
vlan
'
:
{
'
target
'
:
{
'name'
:
rule
.
vlan
.
name
,
'name'
:
rule
.
vlan
.
name
,
'id'
:
rule
.
vlan
.
id
,
'id'
:
rule
.
vlan
.
id
,
}
if
rule
.
vlan
else
None
,
'type'
:
'vlan'
,
'vlangroup'
:
{
}
if
rule
.
vlan
else
{
'name'
:
rule
.
vlangroup
.
name
,
'name'
:
rule
.
vlangroup
.
name
,
'id'
:
rule
.
vlangroup
.
id
,
'id'
:
rule
.
vlangroup
.
id
,
}
if
rule
.
vlangroup
else
None
,
'type'
:
'vlangroup'
,
'hostgroup'
:
{
}
if
rule
.
vlangroup
else
{
'name'
:
rule
.
hostgroup
.
name
,
'name'
:
rule
.
hostgroup
.
name
,
'id'
:
rule
.
hostgroup
.
id
,
'id'
:
rule
.
hostgroup
.
id
,
}
if
rule
.
hostgroup
else
None
,
'type'
:
'hostgroup'
,
'firewall'
:
{
}
if
rule
.
hostgroup
else
{
'name'
:
rule
.
firewall
.
name
,
'name'
:
rule
.
firewall
.
name
,
'id'
:
rule
.
firewall
.
id
,
'id'
:
rule
.
firewall
.
id
,
}
if
rule
.
firewall
else
None
,
'type'
:
'firewall'
,
'host'
:
{
}
if
rule
.
firewall
else
{
'name'
:
rule
.
host
.
hostname
,
'name'
:
rule
.
host
.
hostname
,
'id'
:
rule
.
host
.
id
,
'id'
:
rule
.
host
.
id
,
}
if
rule
.
host
else
None
,
'type'
:
'host'
,
},
'type'
:
rule
.
r_type
,
'type'
:
rule
.
r_type
,
'direction'
:
rule
.
get_direction_display
(),
'direction'
:
rule
.
get_direction_display
(),
'proto'
:
rule
.
proto
,
'proto'
:
rule
.
proto
,
...
@@ -37,6 +38,10 @@ def list_rules(request):
...
@@ -37,6 +38,10 @@ def list_rules(request):
'name'
:
str
(
rule
.
owner
),
'name'
:
str
(
rule
.
owner
),
'id'
:
rule
.
owner
.
id
'id'
:
rule
.
owner
.
id
},
},
'foreignNetwork'
:
{
'name'
:
rule
.
foreign_network
.
name
,
'id'
:
rule
.
foreign_network
.
id
,
},
'created_at'
:
rule
.
created_at
.
isoformat
(),
'created_at'
:
rule
.
created_at
.
isoformat
(),
'modified_at'
:
rule
.
modified_at
.
isoformat
(),
'modified_at'
:
rule
.
modified_at
.
isoformat
(),
'nat'
:
rule
.
nat
,
'nat'
:
rule
.
nat
,
...
...
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