Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
97341109
authored
Oct 29, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add names to vm create inputs and handle them in view
parent
d54c6d26
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
8 deletions
+19
-8
circle/dashboard/templates/dashboard/vm-create.html
+8
-5
circle/dashboard/templates/dashboard/vm-detail-resources.html
+3
-3
circle/dashboard/views.py
+8
-0
No files found.
circle/dashboard/templates/dashboard/vm-create.html
View file @
97341109
...
...
@@ -3,9 +3,11 @@
margin-bottom
:
15px
;
}
</style>
<form
method=
"POST"
action=
"/dashboard/vm/create/"
>
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"col-sm-10"
>
<select
class=
"select form-control"
id=
"vm-create-template-select"
>
<select
class=
"select form-control"
id=
"vm-create-template-select"
name=
"template-pk"
>
<option
value=
"-1"
>
Choose a VM template
</option>
{% for template in templates %}
<option
value=
"{{ template.pk }}"
>
{{ template.name}}
</option>
...
...
@@ -19,7 +21,7 @@
<a
class=
"btn btn-info vm-create-advanced-btn"
>
Advanced
<i
class=
"vm-create-advanced-icon icon-caret-down"
></i></a>
</div>
<div
class=
"col-sm-5 text-right"
>
<
a
class=
"btn btn-success "
><i
class=
"icon-play"
></i>
Start
</a
>
<
button
type=
"submit"
class=
"btn btn-success "
><i
class=
"icon-play"
></i>
Start
</button
>
</div>
</div>
...
...
@@ -38,7 +40,7 @@
</div>
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"js-hidden"
style=
"padding-top: 15px; max-width: 450px;"
>
<select
class=
"form-control"
id=
"vm-create-disk-add-form"
multiple
>
<select
class=
"form-control"
id=
"vm-create-disk-add-form"
multiple
name=
"disks"
>
{% for d in disks %}
<option
value=
"{{ d.pk }}"
>
{{ d.name }}
</option>
{% endfor %}
...
...
@@ -86,14 +88,14 @@
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"js-hidden"
style=
"padding-top: 15px; max-width: 450px;"
>
<h4>
Managed networks
</h4>
<select
class=
"form-control"
id=
"vm-create-network-add-managed"
multiple
>
<select
class=
"form-control"
id=
"vm-create-network-add-managed"
multiple
name=
"managed-vlans"
>
{% for v in vlans %}
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
{% endfor %}
</select>
<h4>
Unmanaged networks
</h4>
<select
class=
"form-control"
id=
"vm-create-network-add-unmanaged"
multiple
>
<select
class=
"form-control"
id=
"vm-create-network-add-unmanaged"
multiple
name=
"unmanaged-vlans"
>
{% for v in vlans %}
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
{% endfor %}
...
...
@@ -121,3 +123,4 @@
</div>
</div>
</div>
</form>
circle/dashboard/templates/dashboard/vm-detail-resources.html
View file @
97341109
...
...
@@ -3,7 +3,7 @@
<label
for=
"vm-cpu-priority-slider"
><i
class=
"icon-trophy"
></i>
CPU priority
</label>
</div>
<div
class=
"col-sm-9"
>
<input
type=
"text"
id=
"vm-cpu-priority-slider"
class=
"vm-slider"
value=
"{{ instance.priority }}"
data-slider-min=
"0"
data-slider-max=
"100"
data-slider-step=
"1"
data-slider-value=
"{{ instance.priority }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
<input
name=
"cpu-priority"
type=
"text"
id=
"vm-cpu-priority-slider"
class=
"vm-slider"
value=
"{{ instance.priority }}"
data-slider-min=
"0"
data-slider-max=
"100"
data-slider-step=
"1"
data-slider-value=
"{{ instance.priority }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
</div>
</p>
...
...
@@ -13,7 +13,7 @@
<label
for=
"cpu-count-slider"
><i
class=
"icon-cogs"
></i>
CPU count
</label>
</div>
<div
class=
"col-sm-9"
>
<input
type=
"text"
id=
"vm-cpu-count-slider"
class=
"vm-slider"
value=
" {{ instance.num_cores }}"
data-slider-min=
"0"
data-slider-max=
"8"
data-slider-step=
"1"
data-slider-value=
"{{ instance.num_cores }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
<input
name=
"cpu-count"
type=
"text"
id=
"vm-cpu-count-slider"
class=
"vm-slider"
value=
" {{ instance.num_cores }}"
data-slider-min=
"0"
data-slider-max=
"8"
data-slider-step=
"1"
data-slider-value=
"{{ instance.num_cores }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
</div>
</p>
...
...
@@ -23,7 +23,7 @@
<label
for=
"ram-slider"
><i
class=
"icon-ticket"
></i>
RAM amount
</label>
</div>
<div
class=
"col-sm-9"
>
<input
type=
"text"
id=
"vm-ram-size-slider"
class=
"vm-slider"
value=
"{{ instance.ram_size }}"
data-slider-min=
"128"
data-slider-max=
"4096"
data-slider-step=
"128"
data-slider-value=
"{{ instance.ram_size }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
MiB
<input
name=
"ram-size"
type=
"text"
id=
"vm-ram-size-slider"
class=
"vm-slider"
value=
"{{ instance.ram_size }}"
data-slider-min=
"128"
data-slider-max=
"4096"
data-slider-step=
"128"
data-slider-value=
"{{ instance.ram_size }}"
data-slider-orientation=
"horizontal"
data-slider-handle=
"square"
data-slider-tooltip=
"hide"
/>
MiB
</div>
</p>
...
...
circle/dashboard/views.py
View file @
97341109
...
...
@@ -120,3 +120,11 @@ class VmCreate(TemplateView):
})
return
context
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
resp
=
request
.
POST
.
copy
()
resp
[
'managed-vlans'
]
=
request
.
POST
.
getlist
(
'managed-vlans'
)
resp
[
'unmanaged-vlans'
]
=
request
.
POST
.
getlist
(
'unmanaged-vlans'
)
resp
[
'disks'
]
=
request
.
POST
.
getlist
(
'disks'
)
return
HttpResponse
(
json
.
dumps
(
resp
),
content_type
=
"application/json"
)
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