Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
8b639567
authored
May 07, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: vlangroup details page added
parent
bc7234e7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
2 deletions
+41
-2
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+2
-2
firewall_gui/templates/firewall/index.html
+8
-0
firewall_gui/views.py
+30
-0
No files found.
cloud/urls.py
View file @
8b639567
...
@@ -107,6 +107,7 @@ urlpatterns = patterns('',
...
@@ -107,6 +107,7 @@ urlpatterns = patterns('',
url
(
r'^firewall/rules/(?P<id>\d+)/$'
,
'firewall_gui.views.show_rule'
),
url
(
r'^firewall/rules/(?P<id>\d+)/$'
,
'firewall_gui.views.show_rule'
),
url
(
r'^firewall/hosts/(?P<id>\d+)/$'
,
'firewall_gui.views.show_host'
),
url
(
r'^firewall/hosts/(?P<id>\d+)/$'
,
'firewall_gui.views.show_host'
),
url
(
r'^firewall/vlans/(?P<id>\d+)/$'
,
'firewall_gui.views.show_vlan'
),
url
(
r'^firewall/vlans/(?P<id>\d+)/$'
,
'firewall_gui.views.show_vlan'
),
url
(
r'^firewall/vlangroups/(?P<id>\d+)/$'
,
'firewall_gui.views.show_vlangroup'
),
url
(
r'^firewall/autocomplete/vlan/$'
,
'firewall_gui.views.autocomplete_vlan'
),
url
(
r'^firewall/autocomplete/vlan/$'
,
'firewall_gui.views.autocomplete_vlan'
),
url
(
r'^firewall/autocomplete/vlangroup/$'
,
'firewall_gui.views.autocomplete_vlangroup'
),
url
(
r'^firewall/autocomplete/vlangroup/$'
,
'firewall_gui.views.autocomplete_vlangroup'
),
...
...
firewall_gui/static/js/project.js
View file @
8b639567
...
@@ -34,7 +34,7 @@ $.ajaxSetup({
...
@@ -34,7 +34,7 @@ $.ajaxSetup({
* @type {Array}
* @type {Array}
*/
*/
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
,
'blacklist'
];
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
,
'blacklist'
];
var
entityControllers
=
[
'rule'
,
'host'
,
'vlan'
];
var
entityControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
];
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
[
'$routeProvider'
,
function
(
$routeProvider
)
{
[
'$routeProvider'
,
function
(
$routeProvider
)
{
for
(
var
i
in
listControllers
)
{
for
(
var
i
in
listControllers
)
{
...
@@ -153,7 +153,7 @@ function EntityController(url) {
...
@@ -153,7 +153,7 @@ function EntityController(url) {
return
true
;
return
true
;
}
}
});
});
[
'vlan'
,
'host'
,
'firewall'
].
forEach
(
function
(
t
)
{
[
'vlan'
,
'
vlangroup'
,
'
host'
,
'firewall'
].
forEach
(
function
(
t
)
{
$
(
'#'
+
t
).
typeahead
({
$
(
'#'
+
t
).
typeahead
({
source
:
function
(
query
,
process
)
{
source
:
function
(
query
,
process
)
{
$
.
ajax
({
$
.
ajax
({
...
...
firewall_gui/templates/firewall/index.html
View file @
8b639567
...
@@ -15,6 +15,14 @@
...
@@ -15,6 +15,14 @@
body
{
body
{
padding-top
:
60px
;
padding-top
:
60px
;
}
}
.label
{
margin
:
3px
;
padding
:
5px
;
}
.label
a
{
color
:
black
;
font-weight
:
normal
;
}
</style>
</style>
<link
href=
"{% static "
css
/
bootstrap-responsive
.
min
.
css
"
%}"
rel=
"stylesheet"
>
<link
href=
"{% static "
css
/
bootstrap-responsive
.
min
.
css
"
%}"
rel=
"stylesheet"
>
...
...
firewall_gui/views.py
View file @
8b639567
...
@@ -323,6 +323,36 @@ def show_vlan(request, id):
...
@@ -323,6 +323,36 @@ def show_vlan(request, id):
}
}
return
HttpResponse
(
json
.
dumps
(
vlan
),
content_type
=
'application/json'
)
return
HttpResponse
(
json
.
dumps
(
vlan
),
content_type
=
'application/json'
)
def
show_vlangroup
(
request
,
id
):
group
=
get_object_or_404
(
VlanGroup
,
id
=
id
)
group
=
{
'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
(),
'rules'
:
[{
'id'
:
rule
.
id
,
'direction'
:
rule
.
get_direction_display
(),
'proto'
:
rule
.
proto
,
'owner'
:
{
'id'
:
rule
.
owner
.
id
,
'name'
:
str
(
rule
.
owner
),
},
'accept'
:
rule
.
accept
,
'nat'
:
rule
.
nat
}
for
rule
in
group
.
rules
.
all
()]
}
return
HttpResponse
(
json
.
dumps
(
group
),
content_type
=
'application/json'
)
def
autocomplete_vlan
(
request
):
def
autocomplete_vlan
(
request
):
return
HttpResponse
(
json
.
dumps
([{
return
HttpResponse
(
json
.
dumps
([{
...
...
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