mirror of
https://github.com/ComputerScienceHouse/proxstar.git
synced 2025-03-09 15:40:09 +00:00
use javascript for vm creation, show warnings if fields arent filled, display IP instead of MAC for interfaces
This commit is contained in:
parent
5198780746
commit
6d589f7bf8
7 changed files with 173 additions and 66 deletions
|
@ -16,42 +16,40 @@
|
|||
{% endfor %}
|
||||
<p>Before you can create any more VMs, you must first either power off (CPU/Memory) or delete (Disk) existing VMs until you have enough resources available.</p>
|
||||
{% else %}
|
||||
<form action="create" method="post">
|
||||
<div class="form-group">
|
||||
<label for="name">VM Name</label>
|
||||
<input type="text" name="name" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cores">Cores</label>
|
||||
<select name="cores" class="form-control">
|
||||
{% for i in range(1, 4 - usage['cpu'] + 1) %}
|
||||
<option value="{{ i }}">{{ i }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="memory">Memory</label>
|
||||
<select name="memory" class="form-control">
|
||||
{% for i in range(1, 4 - usage['mem'] + 1) %}
|
||||
<option value="{{ i * 1024 }}">{{ i }}GB</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk</label>
|
||||
<input type="text" name="disk" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="iso">ISO</label>
|
||||
<select name="iso" class="form-control">
|
||||
<option value="none"></option>
|
||||
{% for iso in isos %}
|
||||
<option value="{{ iso }}">{{ iso }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-success" type="submit" value="Create">Create</button>
|
||||
</form>
|
||||
<div class="form-group">
|
||||
<label for="name">VM Name</label>
|
||||
<input type="text" name="name" id="name" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="cores">Cores</label>
|
||||
<select name="cores" id="cores" class="form-control">
|
||||
{% for i in range(1, limits['cpu'] - usage['cpu'] + 1) %}
|
||||
<option value="{{ i }}">{{ i }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="mem">Memory</label>
|
||||
<select name="mem" id="mem" class="form-control">
|
||||
{% for i in range(1, limits['mem'] - usage['mem'] + 1) %}
|
||||
<option value="{{ i * 1024 }}">{{ i }}GB</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="disk">Disk</label>
|
||||
<input type="text" name="disk" id="disk" class="form-control">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="iso">ISO</label>
|
||||
<select name="iso" id="iso" class="form-control">
|
||||
<option value="none"></option>
|
||||
{% for iso in isos %}
|
||||
<option value="{{ iso }}">{{ iso }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button class="btn btn-success" id="create-vm" name="create">CREATE</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue