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
e655ed8a
authored
May 07, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: hostgroup details page added
parent
d10a77d8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
103 additions
and
1 deletions
+103
-1
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+1
-1
firewall_gui/static/partials/hostgroup-edit.html
+75
-0
firewall_gui/views.py
+26
-0
No files found.
cloud/urls.py
View file @
e655ed8a
...
...
@@ -108,6 +108,7 @@ urlpatterns = patterns('',
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/vlangroups/(?P<id>\d+)/$'
,
'firewall_gui.views.show_vlangroup'
),
url
(
r'^firewall/hostgroups/(?P<id>\d+)/$'
,
'firewall_gui.views.show_hostgroup'
),
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 @
e655ed8a
...
...
@@ -34,7 +34,7 @@ $.ajaxSetup({
* @type {Array}
*/
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
,
'blacklist'
];
var
entityControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
];
var
entityControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
];
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
[
'$routeProvider'
,
function
(
$routeProvider
)
{
for
(
var
i
in
listControllers
)
{
...
...
firewall_gui/static/partials/hostgroup-edit.html
0 → 100644
View file @
e655ed8a
<form
class=
"form-horizontal"
>
<div
class=
"span5"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"ID"
>
ID
</label>
<div
class=
"controls"
>
<input
class=
"input-mini"
type=
"text"
id=
"ID"
placeholder=
"ID"
value=
"{{entity.id}}"
disabled=
"disabled"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"created_at"
>
Created at
</label>
<div
class=
"controls"
>
<input
class=
"input"
type=
"text"
id=
"created_at"
ng-model=
"entity.created_at"
disabled=
"disabled"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"modified_at"
>
Modified at
</label>
<div
class=
"controls"
>
<input
class=
"input"
type=
"text"
id=
"modified_at"
ng-model=
"entity.modified_at"
disabled=
"disabled"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"name"
>
Name
</label>
<div
class=
"controls"
>
<input
type=
"text"
id=
"name"
ng-model=
"entity.name"
/>
</div>
</div>
</div>
<div
class=
"span5"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"owner"
>
Owner
</label>
<div
class=
"controls"
>
<input
type=
"text"
autocomplete=
"off"
id=
"owner"
ng-model=
"entity.owner.name"
/>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"description"
>
Description
</label>
<div
class=
"controls"
>
<textarea
rows=
"4"
id=
"description"
ng-model=
"entity.description"
>
</textarea>
</div>
</div>
<div
class=
"control-group"
>
<div
class=
"controls"
>
<button
type=
"submit"
class=
"btn"
>
Save (nem működik!)
</button>
</div>
</div>
</div>
</form>
<div
class=
"span12"
>
<h3>
Rules belonging to this hostgroup
</h3>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
Direction
</th>
<th>
Protocol
</th>
<th>
Accept
</th>
<th>
NAT
</th>
<th
colspan=
"2"
>
Owner
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"rule in entity.rules"
>
<td>
{{rule.direction}}
</td>
<td>
{{rule.proto}}
</td>
<td>
{{rule.accept}}
</td>
<td>
{{rule.nat}}
</td>
<td>
{{rule.owner.name}}
</td>
<td>
<a
class=
"btn"
href=
"#/rules/{{rule.id}}/"
>
Edit
</a>
<a
class=
"btn btn-danger"
href=
"#/rules/{{rule.id}}/delete/"
>
Delete
</a>
</td>
</tr>
</tbody>
</table>
</div>
firewall_gui/views.py
View file @
e655ed8a
...
...
@@ -353,6 +353,32 @@ def show_vlangroup(request, id):
}
return
HttpResponse
(
json
.
dumps
(
group
),
content_type
=
'application/json'
)
def
show_hostgroup
(
request
,
id
):
group
=
get_object_or_404
(
Group
,
id
=
id
)
group
=
{
'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
(),
'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
):
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