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
7f80408e
authored
Oct 21, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add remove_port template
parent
d0cc86ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
15 deletions
+24
-15
circle/dashboard/forms.py
+0
-15
circle/dashboard/templates/dashboard/_vm-remove-port.html
+23
-0
circle/dashboard/views/vm.py
+1
-0
No files found.
circle/dashboard/forms.py
View file @
7f80408e
...
...
@@ -948,21 +948,6 @@ class VmPortRemoveForm(OperationForm):
if
self
.
rule
:
self
.
fields
[
'rule'
]
.
widget
=
HiddenInput
()
@property
def
helper
(
self
):
helper
=
super
(
VmPortRemoveForm
,
self
)
.
helper
if
self
.
rule
:
helper
.
layout
=
Layout
(
AnyTag
(
"div"
,
HTML
(
format_html
(
_
(
"<label>Port:</label> {0}/{1}"
),
escape
(
self
.
rule
.
dport
),
escape
(
self
.
rule
.
proto
))),
css_class
=
"form-group"
,
),
Field
(
"rule"
),
)
return
helper
class
VmPortAddForm
(
OperationForm
):
port
=
forms
.
IntegerField
(
required
=
True
,
label
=
_
(
'Port'
),
...
...
circle/dashboard/templates/dashboard/_vm-remove-port.html
0 → 100644
View file @
7f80408e
{% extends "dashboard/operate.html" %}
{% load i18n %}
{% load crispy_forms_tags %}
{% block formfields %}
{% if form %}
{% crispy form %}
{% endif %}
{% if form.fields.rule.initial != None %}
{% with rule=form.fields.rule.initial %}
<dl>
<dt>
{% trans "Port" %}:
</dt>
<dd>
{{ rule.dport }}/{{ rule.proto }}
</dd>
<dt>
{% trans "Host" %}:
</dt>
<dd>
{{ rule.host.hostname }}
</dd>
<dt>
{% trans "Vlan" %}:
</dt>
<dd>
{{ rule.host.vlan.name }}
</dd>
</dl>
{% endwith %}
{% endif %}
{% endblock %}
circle/dashboard/views/vm.py
View file @
7f80408e
...
...
@@ -418,6 +418,7 @@ class VmMigrateView(FormOperationMixin, VmOperationView):
class
VmPortRemoveView
(
FormOperationMixin
,
VmOperationView
):
template_name
=
'dashboard/_vm-remove-port.html'
op
=
'remove_port'
show_in_toolbar
=
False
with_reload
=
True
...
...
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