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
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
6d9b4e6c
authored
May 28, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: create new dns record
parent
f4628cc0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
24 deletions
+45
-24
firewall_gui/views.py
+45
-24
No files found.
firewall_gui/views.py
View file @
6d9b4e6c
...
@@ -477,30 +477,51 @@ def show_hostgroup(request, id=None):
...
@@ -477,30 +477,51 @@ def show_hostgroup(request, id=None):
}
}
return
HttpResponse
(
json
.
dumps
(
group
),
content_type
=
'application/json'
)
return
HttpResponse
(
json
.
dumps
(
group
),
content_type
=
'application/json'
)
def
show_record
(
request
,
id
):
def
show_record
(
request
,
id
=
None
):
record
=
get_object_or_404
(
Record
,
id
=
id
)
try
:
record
=
{
record
=
get_object_or_404
(
Record
,
id
=
id
)
'id'
:
record
.
id
,
record
=
{
'name'
:
record
.
name
,
'id'
:
record
.
id
,
'domain'
:
{
'name'
:
record
.
name
,
'id'
:
record
.
domain
.
id
,
'domain'
:
{
'name'
:
record
.
domain
.
name
'id'
:
record
.
domain
.
id
,
},
'name'
:
record
.
domain
.
name
'host'
:
{
},
'id'
:
record
.
host
.
id
,
'host'
:
{
'name'
:
record
.
host
.
hostname
'id'
:
record
.
host
.
id
,
}
if
record
.
host
else
None
,
'name'
:
record
.
host
.
hostname
'type'
:
record
.
type
,
}
if
record
.
host
else
None
,
'address'
:
record
.
address
,
'type'
:
record
.
type
,
'ttl'
:
record
.
ttl
,
'address'
:
record
.
address
,
'owner'
:
{
'ttl'
:
record
.
ttl
,
'id'
:
record
.
owner
.
id
,
'owner'
:
{
'name'
:
record
.
owner
.
username
'id'
:
record
.
owner
.
id
,
},
'name'
:
record
.
owner
.
username
'description'
:
record
.
description
,
},
'created_at'
:
record
.
created_at
.
isoformat
(),
'description'
:
record
.
description
,
'modified_at'
:
record
.
modified_at
.
isoformat
(),
'created_at'
:
record
.
created_at
.
isoformat
(),
}
'modified_at'
:
record
.
modified_at
.
isoformat
(),
}
except
:
record
=
{
'id'
:
None
,
'name'
:
None
,
'domain'
:
{
'name'
:
None
},
'host'
:
{
'name'
:
None
},
'type'
:
None
,
'address'
:
None
,
'ttl'
:
None
,
'owner'
:
{
'name'
:
None
},
'description'
:
''
,
'created_at'
:
None
,
'modified_at'
:
None
,
}
return
HttpResponse
(
json
.
dumps
(
record
),
content_type
=
'application/json'
)
return
HttpResponse
(
json
.
dumps
(
record
),
content_type
=
'application/json'
)
def
show_domain
(
request
,
id
):
def
show_domain
(
request
,
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