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
2810e1e2
authored
May 07, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: host details page added
parent
ed82dac9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
1 deletions
+45
-1
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+1
-1
firewall_gui/views.py
+43
-0
No files found.
cloud/urls.py
View file @
2810e1e2
...
...
@@ -105,6 +105,7 @@ urlpatterns = patterns('',
url
(
r'^firewall/blacklists/$'
,
'firewall_gui.views.list_blacklists'
),
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/autocomplete/vlan/$'
,
'firewall_gui.views.autocomplete_vlan'
),
url
(
r'^firewall/autocomplete/vlangroup/$'
,
'firewall_gui.views.autocomplete_vlangroup'
),
...
...
firewall_gui/static/js/project.js
View file @
2810e1e2
...
...
@@ -34,7 +34,7 @@ $.ajaxSetup({
* @type {Array}
*/
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
,
'blacklist'
];
var
entityControllers
=
[
'rule'
];
var
entityControllers
=
[
'rule'
,
'host'
];
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
[
'$routeProvider'
,
function
(
$routeProvider
)
{
for
(
var
i
in
listControllers
)
{
...
...
firewall_gui/views.py
View file @
2810e1e2
...
...
@@ -243,6 +243,49 @@ def show_rule(request, id):
}
return
HttpResponse
(
json
.
dumps
(
rule
),
content_type
=
'application/json'
)
def
show_host
(
request
,
id
):
host
=
get_object_or_404
(
Host
,
id
=
id
)
host
=
{
'id'
:
host
.
id
,
'reverse'
:
host
.
reverse
,
'name'
:
host
.
hostname
,
'mac'
:
host
.
mac
,
'ipv4'
:
host
.
ipv4
,
'ipv6'
:
host
.
ipv6
,
'pub_ipv4'
:
host
.
pub_ipv4
,
'shared_ip'
:
host
.
shared_ip
,
'description'
:
host
.
description
,
'comment'
:
host
.
comment
,
'location'
:
host
.
location
,
'vlan'
:
{
'name'
:
host
.
vlan
.
name
,
'id'
:
host
.
vlan
.
id
},
'owner'
:
{
'name'
:
str
(
host
.
owner
),
'id'
:
host
.
owner
.
id
},
'created_at'
:
host
.
created_at
.
isoformat
(),
'modified_at'
:
host
.
modified_at
.
isoformat
(),
'groups'
:
[{
'name'
:
group
.
name
,
'id'
:
group
.
id
,
}
for
group
in
host
.
groups
.
all
()],
'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
host
.
rules
.
all
()]
}
return
HttpResponse
(
json
.
dumps
(
host
),
content_type
=
'application/json'
)
def
autocomplete_vlan
(
request
):
return
HttpResponse
(
json
.
dumps
([{
'id'
:
vlan
.
id
,
...
...
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