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
fb293c07
authored
Aug 31, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: disabled resizing disks w wrong type
parent
7abcec33
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
circle/dashboard/templates/dashboard/_disk-list-element.html
+3
-3
circle/vm/operations.py
+3
-0
No files found.
circle/dashboard/templates/dashboard/_disk-list-element.html
View file @
fb293c07
...
@@ -6,18 +6,18 @@
...
@@ -6,18 +6,18 @@
<span
class=
"operation-wrapper pull-right"
>
<span
class=
"operation-wrapper pull-right"
>
{% if d.is_resizable %}
{% if op.resize_disk %}
{% if op.resize_disk %}
<a
href=
"{{ op.resize_disk.get_url }}?disk={{d.pk}}"
<a
href=
"{{ op.resize_disk.get_url }}?disk={{d.pk}}"
class=
"btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
class=
"btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
{% if op.resize_disk.disabled %}disabled{% endif %}"
>
{% if op.resize_disk.disabled %}disabled{% endif %}"
>
<i
class=
"fa fa-{{ op.resize_disk.icon }} fa-fw-12"
></i>
{% trans "Resize" %}
<i
class=
"fa fa-{{ op.resize_disk.icon }} fa-fw-12"
></i>
{% trans "Resize" %}
</a>
</a>
{% elif d.is_resizabl
e %}
{% els
e %}
<a
href=
"{% url "
request
.
views
.
request-resize
"
vm_pk=
instance.pk
disk_pk=
d.pk
%}"
class=
"btn btn-xs btn-primary operation"
>
<a
href=
"{% url "
request
.
views
.
request-resize
"
vm_pk=
instance.pk
disk_pk=
d.pk
%}"
class=
"btn btn-xs btn-primary operation"
>
<i
class=
"fa fa-arrows-alt fa-fw-12"
></i>
{% trans "Request resize" %}
<i
class=
"fa fa-arrows-alt fa-fw-12"
></i>
{% trans "Request resize" %}
</a>
</a>
{% else %}
{% endif %}
<small
class=
"text-muted"
>
{% trans "Cannot be resized" %}
</small>
{% endif %}
{% endif %}
{% if op.remove_disk %}
{% if op.remove_disk %}
<a
href=
"{{ op.remove_disk.get_url }}?disk={{d.pk}}"
<a
href=
"{{ op.remove_disk.get_url }}?disk={{d.pk}}"
...
...
circle/vm/operations.py
View file @
fb293c07
...
@@ -305,6 +305,9 @@ class ResizeDiskOperation(RemoteInstanceOperation):
...
@@ -305,6 +305,9 @@ class ResizeDiskOperation(RemoteInstanceOperation):
size
=
filesizeformat
(
kwargs
[
'size'
]),
name
=
kwargs
[
'disk'
]
.
name
)
size
=
filesizeformat
(
kwargs
[
'size'
]),
name
=
kwargs
[
'disk'
]
.
name
)
def
_operation
(
self
,
disk
,
size
):
def
_operation
(
self
,
disk
,
size
):
if
not
disk
.
is_resizable
:
raise
HumanReadableException
.
create
(
ugettext_noop
(
'Disk type "
%(type)
s" is not resizable.'
),
type
=
disk
.
type
)
super
(
ResizeDiskOperation
,
self
)
.
_operation
(
disk
=
disk
,
size
=
size
)
super
(
ResizeDiskOperation
,
self
)
.
_operation
(
disk
=
disk
,
size
=
size
)
disk
.
size
=
size
disk
.
size
=
size
disk
.
save
()
disk
.
save
()
...
...
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