Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
ee7c6c6a
authored
Apr 29, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: list dns records
parent
704e21f5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
68 additions
and
1 deletions
+68
-1
cloud/urls.py
+1
-0
firewall_gui/static/js/project.js
+1
-1
firewall_gui/static/partials/record-list.html
+41
-0
firewall_gui/views.py
+25
-0
No files found.
cloud/urls.py
View file @
ee7c6c6a
...
@@ -101,4 +101,5 @@ urlpatterns = patterns('',
...
@@ -101,4 +101,5 @@ urlpatterns = patterns('',
url
(
r'^firewall/hostgroups/$'
,
'firewall_gui.views.list_hostgroups'
),
url
(
r'^firewall/hostgroups/$'
,
'firewall_gui.views.list_hostgroups'
),
url
(
r'^firewall/firewalls/$'
,
'firewall_gui.views.list_firewalls'
),
url
(
r'^firewall/firewalls/$'
,
'firewall_gui.views.list_firewalls'
),
url
(
r'^firewall/domains/$'
,
'firewall_gui.views.list_domains'
),
url
(
r'^firewall/domains/$'
,
'firewall_gui.views.list_domains'
),
url
(
r'^firewall/records/$'
,
'firewall_gui.views.list_records'
),
)
)
firewall_gui/static/js/project.js
View file @
ee7c6c6a
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
* and the `/static/partials/rule-list.html` template will be used.
* and the `/static/partials/rule-list.html` template will be used.
* @type {Array}
* @type {Array}
*/
*/
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
];
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
];
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
[
'$routeProvider'
,
function
(
$routeProvider
)
{
[
'$routeProvider'
,
function
(
$routeProvider
)
{
...
...
firewall_gui/static/partials/record-list.html
0 → 100644
View file @
ee7c6c6a
<div
class=
"navbar"
>
<div
class=
"navbar-inner"
>
<div
class=
"pagination pull-left"
>
<ul>
<li
ng-click=
"prevPage()"
ng-class=
"{disabled: page == 1}"
><a
href
>
Előző
</a></li>
<li
ng-repeat=
"_page in pages"
ng-click=
"setPage(_page)"
ng-class=
"{active: _page == page}"
>
<a
href
>
{{_page}}
</a>
</li>
<li
ng-click=
"nextPage()"
ng-class=
"{disabled: page == pages.length}"
><a
href
>
Next
</a></li>
</ul>
</div>
<form
class=
"navbar-search"
style=
"margin: 20px"
>
<input
type=
"text"
class=
"search-query"
placeholder=
"Search"
ng-model=
"query"
>
</form>
</div>
</div>
<table
class=
"table table-striped"
>
<tr>
<th>
Név
</th>
<th>
Típus
</th>
<th>
Domain
</th>
<th>
Hoszt
</th>
<th>
Cím
</th>
<th>
TTL
</th>
<th>
Leírás
</th>
<th
colspan=
"2"
>
Tulajdonos
</th>
</tr>
<tr
ng-repeat=
"record in getPage()"
>
<td><a
href=
"#/records/{{record.id}}"
>
{{record.name}}
</a></td>
<td>
{{record.type}}
</td>
<td><a
href=
"#/domains/{{record.domain.id}}"
>
{{record.domain.name}}
</a></td>
<td><a
href=
"#/hosts/{{record.host.id}}"
>
{{record.host.name}}
</a></td>
<td>
{{record.address}}
</td>
<td>
{{record.ttl}}
</td>
<td>
{{record.owner.name}}
</td>
<td>
<a
class=
"btn"
href=
"#/records/{{record.id}}/"
>
Szerkesztés
</a>
<a
class=
"btn btn-danger"
href=
"#/records/{{record.id}}/delete/"
>
Törlés
</a>
</td>
</tr>
</table>
firewall_gui/views.py
View file @
ee7c6c6a
...
@@ -147,3 +147,28 @@ def list_domains(request):
...
@@ -147,3 +147,28 @@ def list_domains(request):
}
}
}
for
domain
in
Domain
.
objects
.
all
()]
}
for
domain
in
Domain
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
domains
),
content_type
=
"application/json"
)
return
HttpResponse
(
json
.
dumps
(
domains
),
content_type
=
"application/json"
)
def
list_records
(
request
):
records
=
[{
"id"
:
record
.
id
,
"name"
:
record
.
name
,
"domain"
:
{
"id"
:
record
.
domain
.
id
,
"name"
:
record
.
domain
.
name
,
},
"host"
:
{
"id"
:
record
.
host
.
id
,
"name"
:
record
.
host
.
hostname
,
}
if
record
.
host
else
None
,
"type"
:
record
.
type
,
"address"
:
record
.
address
,
"ttl"
:
record
.
ttl
,
"owner"
:
{
"id"
:
record
.
owner
.
id
,
"name"
:
str
(
record
.
owner
)
},
"description"
:
record
.
description
,
"created_at"
:
record
.
created_at
.
isoformat
(),
"modified_at"
:
record
.
modified_at
.
isoformat
()
}
for
record
in
Record
.
objects
.
all
()]
return
HttpResponse
(
json
.
dumps
(
records
),
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