Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
8dc295a5
authored
Jul 06, 2015
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: resize request only for resizable disks
parent
747fd41c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
circle/dashboard/templates/dashboard/_disk-list-element.html
+3
-1
circle/request/templates/request/initials/resize.html
+2
-2
circle/request/views.py
+4
-1
circle/storage/models.py
+4
-0
No files found.
circle/dashboard/templates/dashboard/_disk-list-element.html
View file @
8dc295a5
...
...
@@ -12,10 +12,12 @@
{% if op.resize_disk.disabled %}disabled{% endif %}"
>
<i
class=
"fa fa-{{ op.resize_disk.icon }} fa-fw-12"
></i>
{% trans "Resize" %}
</a>
{% el
s
e %}
{% el
if d.is_resizabl
e %}
<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" %}
</a>
{% else %}
<small
class=
"text-muted"
>
{% trans "Cannot be resized" %}
</small>
{% endif %}
{% if op.remove_disk %}
<a
href=
"{{ op.remove_disk.get_url }}?disk={{d.pk}}"
...
...
circle/request/templates/request/initials/resize.html
View file @
8dc295a5
{% spaceless %}
{% if LANGUAGE_CODE == "en" %}
Why do you need bigger disk?
Why do you need
a
bigger disk?
{% else %} {# place your translations here #}
Why do you need bigger disk?
Why do you need
a
bigger disk?
{% endif %}
{% endspaceless %}
circle/request/views.py
View file @
8dc295a5
...
...
@@ -327,8 +327,11 @@ class ResizeRequestView(VmRequestMixin, FormView):
return
context
def
form_valid
(
self
,
form
):
vm
=
self
.
get_vm
()
disk
=
self
.
get_disk
()
if
not
disk
.
is_resizable
:
raise
SuspiciousOperation
vm
=
self
.
get_vm
()
data
=
form
.
cleaned_data
user
=
self
.
request
.
user
...
...
circle/storage/models.py
View file @
8dc295a5
...
...
@@ -539,3 +539,7 @@ class Disk(TimeStampedModel):
def
get_absolute_url
(
self
):
return
reverse
(
'dashboard.views.disk-detail'
,
kwargs
=
{
'pk'
:
self
.
pk
})
@property
def
is_resizable
(
self
):
return
self
.
type
in
(
'qcow2-norm'
,
'raw-rw'
)
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