Skip to content

Commit

Permalink
Merge pull request #588 from grycap/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
micafer authored Oct 28, 2024
2 parents 1529465 + a1da3f5 commit 7eab15c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,9 @@ def managevm(op=None, infid=None, vmid=None):
elif op == "resize":
form_data = request.form.to_dict()
cpu = int(form_data['cpu'])
memory = int(form_data['memory'])
memory = float(form_data['memory'])
gpu = int(form_data.get('gpu', 0))
disk_size = int(form_data.get('disk_size', 0))
disk_size = float(form_data.get('disk_size', 0))

vminforesp = im.get_vm_info(infid, vmid, auth_data, "text/plain")
if vminforesp.ok:
Expand Down Expand Up @@ -523,7 +523,8 @@ def showinfrastructures():
infrastructures[inf_id]['cloud_type'] = infra_data["site"]["type"]
infrastructures[inf_id]['site'] = Markup(site_info)

return render_template('infrastructures.html', infrastructures=infrastructures, reload=reload_infid)
return render_template('infrastructures.html', infrastructures=infrastructures,
reload=reload_infid, inf_list=inf_list)

@app.route('/infrastructures/state')
@authorized_with_valid_token
Expand Down
3 changes: 2 additions & 1 deletion app/templates/infrastructures.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,9 @@ <h4 class="font-weight-bold text-primary">My Infrastructures</h4>
<!--Table head-->
<!--Table body-->
<tbody>
{% for infId, infInfo in infrastructures.items() %}
{% for infId in inf_list %}
<tr>
{% set infInfo=infrastructures[infId] %}
<th scope="row">
{% if infInfo["name"] != "" %}
{{infInfo["name"]}}
Expand Down
8 changes: 4 additions & 4 deletions app/templates/vminfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -328,21 +328,21 @@ <h5 class="modal-title" id="managevm_resize_label">VM resize</h5>

<div class="row form-group">
<div class="col">
CPU Number: <input name="cpu" class="col-sm-12" type="number" value="{{ cpu }}" required/>
CPU Number: <input name="cpu" class="col-sm-12" type="number" min="0" step="1" value="{{ cpu }}" required/>
</div>
<div class="col">
{% set memory_parts = memory.split() %}
Memory (GB): <input name="memory" class="col-sm-12" type="number" value="{{ memory_parts[0] | int }}" required/>
Memory (GB): <input name="memory" class="col-sm-12" type="number" min="0" value="{{ memory_parts[0] | float }}" required/>
</div>
</div>

<div class="row form-group">
<div class="col">
GPU Number: <input name="gcpu" class="col-sm-12" type="number" value="{{ gpu }}"/>
GPU Number: <input name="gcpu" class="col-sm-12" type="number" min="0" step="1" value="{{ gpu }}"/>
</div>
<div class="col">
{% set disk_size_parts = disk_size.split() %}
Disk Size (GB): <input name="disk_size" class="col-sm-12" type="number" value="{{ disk_size_parts[0] | int }}"/>
Disk Size (GB): <input name="disk_size" class="col-sm-12" type="number" min="0" value="{{ disk_size_parts[0] | float }}"/>
</div>
</div>

Expand Down

0 comments on commit 7eab15c

Please sign in to comment.