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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
circle/dashboard/templates/dashboard/_disk-list-element.html
+12
-12
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
op.resize_disk
%}
{% if
d.is_resizable
%}
<a
href=
"{{ op.resize_disk.get_url }}?disk={{d.pk}}"
{% if op.resize_disk %}
class=
"btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
<a
href=
"{{ op.resize_disk.get_url }}?disk={{d.pk}}"
{% if op.resize_disk.disabled %}disabled{% endif %}"
>
class=
"btn btn-xs btn-{{ op.resize_disk.effect }} operation disk-resize-btn
<i
class=
"fa fa-{{ op.resize_disk.icon }} fa-fw-12"
></i>
{% trans "Resize" %}
{% if op.resize_disk.disabled %}disabled{% endif %}"
>
</a>
<i
class=
"fa fa-{{ op.resize_disk.icon }} fa-fw-12"
></i>
{% trans "Resize" %}
{% elif d.is_resizable %}
</a>
<a
href=
"{% url "
request
.
views
.
request-resize
"
vm_pk=
instance.pk
disk_pk=
d.pk
%}"
class=
"btn btn-xs btn-primary operation"
>
{% else %}
<
i
class=
"fa fa-arrows-alt fa-fw-12"
></i>
{% trans "Request resize" %}
<
a
href=
"{% url "
request
.
views
.
request-resize
"
vm_pk=
instance.pk
disk_pk=
d.pk
%}"
class=
"btn btn-xs btn-primary operation"
>
</a>
<i
class=
"fa fa-arrows-alt fa-fw-12"
></i>
{% trans "Request resize" %}
{% else %}
</a>
<small
class=
"text-muted"
>
{% trans "Cannot be resized" %}
</small>
{% endif %}
{% 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