Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2be155b5
authored
9 years ago
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: enable port closing for operators
and disable the remove button for non ops
parent
7594f0a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
circle/dashboard/templates/dashboard/vm-detail/network.html
+5
-2
circle/vm/operations.py
+1
-0
No files found.
circle/dashboard/templates/dashboard/vm-detail/network.html
View file @
2be155b5
...
...
@@ -83,7 +83,8 @@
<span
class=
"operation-wrapper"
>
<a
href=
"{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}"
class=
"btn btn-link btn-xs operation"
title=
"{% trans "
Remove
"
%}"
>
title=
"{% trans "
Remove
"
%}"
{%
if
not
op
.
remove_port
%}
disabled
{%
endif
%}
>
<i
class=
"fa fa-times"
><span
class=
"sr-only"
>
{% trans "Remove" %}
</span></i>
</a>
</span>
...
...
@@ -118,7 +119,9 @@
{{ l.private }}/{{ l.proto }}
</td>
<td>
<a
href=
"{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}"
class=
"btn btn-link btn-xs vm-details-remove-port"
data-rule=
"{{ l.ipv6.pk }}"
title=
"{% trans "
Remove
"
%}"
><i
class=
"fa fa-times"
><span
class=
"sr-only"
>
{% trans "Remove" %}
</span></i></a>
<a
href=
"{{ op.remove_port.get_url }}?rule={{ l.ipv4.pk }}"
class=
"btn btn-link btn-xs vm-details-remove-port"
data-rule=
"{{ l.ipv6.pk }}"
title=
"{% trans "
Remove
"
%}"
{%
if
not
op
.
remove_port
%}
disabled
{%
endif
%}
>
<i
class=
"fa fa-times"
><span
class=
"sr-only"
>
{% trans "Remove" %}
</span></i>
</a>
</td>
</tr>
{% endif %}
...
...
This diff is collapsed.
Click to expand it.
circle/vm/operations.py
View file @
2be155b5
...
...
@@ -629,6 +629,7 @@ class RemovePortOperation(InstanceOperation):
name
=
_
(
"close port"
)
description
=
_
(
"Close the specified port."
)
concurrency_check
=
False
acl_level
=
"operator"
required_perms
=
(
'vm.config_ports'
,
)
def
_operation
(
self
,
activity
,
rule
):
...
...
This diff is collapsed.
Click to expand it.
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