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
Hide 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 @@
...
@@ -3,9 +3,11 @@
margin-bottom
:
15px
;
margin-bottom
:
15px
;
}
}
</style>
</style>
<form
method=
"POST"
action=
"/dashboard/vm/create/"
>
{% csrf_token %}
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm-10"
>
<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>
<option
value=
"-1"
>
Choose a VM template
</option>
{% for template in templates %}
{% for template in templates %}
<option
value=
"{{ template.pk }}"
>
{{ template.name}}
</option>
<option
value=
"{{ template.pk }}"
>
{{ template.name}}
</option>
...
@@ -19,7 +21,7 @@
...
@@ -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>
<a
class=
"btn btn-info vm-create-advanced-btn"
>
Advanced
<i
class=
"vm-create-advanced-icon icon-caret-down"
></i></a>
</div>
</div>
<div
class=
"col-sm-5 text-right"
>
<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>
</div>
</div>
...
@@ -38,7 +40,7 @@
...
@@ -38,7 +40,7 @@
</div>
</div>
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"js-hidden"
style=
"padding-top: 15px; max-width: 450px;"
>
<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 %}
{% for d in disks %}
<option
value=
"{{ d.pk }}"
>
{{ d.name }}
</option>
<option
value=
"{{ d.pk }}"
>
{{ d.name }}
</option>
{% endfor %}
{% endfor %}
...
@@ -86,14 +88,14 @@
...
@@ -86,14 +88,14 @@
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"col-sm-8"
style=
"padding-top: 3px;"
>
<div
class=
"js-hidden"
style=
"padding-top: 15px; max-width: 450px;"
>
<div
class=
"js-hidden"
style=
"padding-top: 15px; max-width: 450px;"
>
<h4>
Managed networks
</h4>
<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 %}
{% for v in vlans %}
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
{% endfor %}
{% endfor %}
</select>
</select>
<h4>
Unmanaged networks
</h4>
<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 %}
{% for v in vlans %}
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
<option
value=
"{{ v.pk }}"
>
{{ v.name }}
</option>
{% endfor %}
{% endfor %}
...
@@ -121,3 +123,4 @@
...
@@ -121,3 +123,4 @@
</div>
</div>
</div>
</div>
</div>
</div>
</form>
circle/dashboard/templates/dashboard/vm-detail-resources.html
View file @
97341109
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<label
for=
"vm-cpu-priority-slider"
><i
class=
"icon-trophy"
></i>
CPU priority
</label>
<label
for=
"vm-cpu-priority-slider"
><i
class=
"icon-trophy"
></i>
CPU priority
</label>
</div>
</div>
<div
class=
"col-sm-9"
>
<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>
</div>
</p>
</p>
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
<label
for=
"cpu-count-slider"
><i
class=
"icon-cogs"
></i>
CPU count
</label>
<label
for=
"cpu-count-slider"
><i
class=
"icon-cogs"
></i>
CPU count
</label>
</div>
</div>
<div
class=
"col-sm-9"
>
<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>
</div>
</p>
</p>
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
<label
for=
"ram-slider"
><i
class=
"icon-ticket"
></i>
RAM amount
</label>
<label
for=
"ram-slider"
><i
class=
"icon-ticket"
></i>
RAM amount
</label>
</div>
</div>
<div
class=
"col-sm-9"
>
<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>
</div>
</p>
</p>
...
...
circle/dashboard/views.py
View file @
97341109
...
@@ -120,3 +120,11 @@ class VmCreate(TemplateView):
...
@@ -120,3 +120,11 @@ class VmCreate(TemplateView):
})
})
return
context
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