Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
03e045a2
authored
Sep 23, 2014
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dasboard: add VmDiskResizeView
parent
47caf620
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletions
+26
-1
circle/dashboard/views/vm.py
+26
-1
No files found.
circle/dashboard/views/vm.py
View file @
03e045a2
...
...
@@ -58,7 +58,7 @@ from ..forms import (
AclUserOrGroupAddForm
,
VmResourcesForm
,
TraitsForm
,
RawDataForm
,
VmAddInterfaceForm
,
VmCreateDiskForm
,
VmDownloadDiskForm
,
VmSaveForm
,
VmRenewForm
,
VmStateChangeForm
,
VmListSearchForm
,
VmCustomizeForm
,
TransferOwnershipForm
,
TransferOwnershipForm
,
VmDiskResizeForm
,
)
from
..models
import
Favourite
,
Profile
...
...
@@ -365,6 +365,30 @@ class VmAddInterfaceView(FormOperationMixin, VmOperationView):
return
val
class
VmDiskResizeView
(
FormOperationMixin
,
VmOperationView
):
op
=
'resize_disk'
form_class
=
VmDiskResizeForm
show_in_toolbar
=
False
icon
=
'arrows-alt'
effect
=
"success"
def
get_form_kwargs
(
self
):
choices
=
self
.
get_op
()
.
instance
.
disks
disk_pk
=
self
.
request
.
GET
.
get
(
'disk'
)
if
disk_pk
:
try
:
default
=
choices
.
get
(
pk
=
disk_pk
)
except
(
ValueError
,
Disk
.
DoesNotExist
):
raise
SuspiciousOperation
()
else
:
raise
SuspiciousOperation
()
val
=
super
(
VmDiskResizeView
,
self
)
.
get_form_kwargs
()
val
.
update
({
'choices'
:
choices
,
'default'
:
default
})
return
val
class
VmCreateDiskView
(
FormOperationMixin
,
VmOperationView
):
op
=
'create_disk'
...
...
@@ -601,6 +625,7 @@ vm_ops = OrderedDict([
op
=
'destroy'
,
icon
=
'times'
,
effect
=
'danger'
)),
(
'create_disk'
,
VmCreateDiskView
),
(
'download_disk'
,
VmDownloadDiskView
),
(
'resize_disk'
,
VmDiskResizeView
),
(
'add_interface'
,
VmAddInterfaceView
),
(
'renew'
,
VmRenewView
),
(
'resources_change'
,
VmResourcesChangeView
),
...
...
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