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
Commit
7bb777ef
authored
Sep 10, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network: new CNAME button for host edit
parent
efdebdff
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
circle/network/templates/network/host-edit.html
+8
-4
circle/network/views.py
+17
-4
No files found.
circle/network/templates/network/host-edit.html
View file @
7bb777ef
...
...
@@ -23,7 +23,7 @@
{% if rule_list.data.data.count > 0 %}
{% render_table rule_list %}
{% else %}
{% trans "No rules associated with this host!
" %}
{% trans "No rules associated with this host.
" %}
{% endif %}
<div
class=
"page-header"
>
...
...
@@ -48,7 +48,7 @@
<h3>
{% trans "Add host group" %}
</h3>
</div>
{% if not_used_groups|length == 0 %}
No more groups to add!
{% trans "No more groups to add" %}
{% else %}
<form
action=
"{% url "
network
.
add_host_group
"
pk=
host_pk
%}"
method=
"POST"
>
{% csrf_token %}
...
...
@@ -65,15 +65,19 @@
</form>
{% endif %}
<div
class=
"page-header"
>
<a
href=
"{% url "
network
.
record_create
"
%}?
host=
{{
host_pk
}}"
class=
"btn btn-xs btn-success pull-right"
>
<i
class=
"fa fa-plus-circle"
></i>
{% trans "Add new CNAME record" %}
</a>
<h3>
{% trans "Records" %}
</h3>
</div>
{% render_table records_table %}
</div>
<!-- col-sm-5 -->
</div>
<!-- row -->
{% endblock %}
{% block extra_etc %}
<script
src=
"{% static "
js
/
host
.
js
"
%}"
></script>
<script
src=
"{% static "
js
/
host
.
js
"
%}"
></script>
{% endblock %}
circle/network/views.py
View file @
7bb777ef
...
...
@@ -505,10 +505,23 @@ class RecordCreate(LoginRequiredMixin, SuperuserRequiredMixin,
success_message
=
_
(
u'Successfully created record!'
)
def
get_initial
(
self
):
return
{
# 'owner': 1,
'domain'
:
self
.
request
.
GET
.
get
(
'domain'
),
}
host_pk
=
self
.
request
.
GET
.
get
(
"host"
)
try
:
host
=
Host
.
objects
.
get
(
pk
=
host_pk
)
except
(
Host
.
DoesNotExist
,
ValueError
):
host
=
None
initial
=
{
'owner'
:
self
.
request
.
user
}
if
host
:
initial
.
update
({
'type'
:
"CNAME"
,
'host'
:
host
,
'address'
:
host
.
get_fqdn
(),
})
else
:
initial
[
'domain'
]
=
self
.
request
.
GET
.
get
(
'domain'
)
return
initial
class
RecordDelete
(
LoginRequiredMixin
,
SuperuserRequiredMixin
,
DeleteView
):
...
...
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