Commit f8fd524f authored by eskumon's avatar eskumon
Browse files

fix(frontend): Improve new machine page

	Disk, Swap and RAM numeric entry
	Enable SWAP volumes by default on new machine
	Minimum disk size entry set by the selected ISO

fixes #1150 & #1154
parent 10a17e0a
......@@ -80,32 +80,29 @@
<div class="form-group row" ng-if="backend == 'KVM'">
<label for="disk" class="col-xl-3 col-form-label"><%=l 'Disk Size: (GB)' %></label>
<div class="col-lg-2">
<input class="slider form-control" ng-model="ddsize" type="range" name="disk"
min="{{min_size}}" max="100" required="">
</div>{{ddsize}}
<a ng-show="!seeswap"
<input class="form-control" ng-model="ddsize" type="number" min ="{{min_size}}" name="disk" required="">
</div>
<a ng-show="seeswap"
ng-click="show_swap()"
align="right"><span class="badge badge-primary ml-2">Add swap</span></a>
<a ng-show="seeswap"
<a ng-show="!seeswap"
ng-click="show_swap()"
align="right"><span class="badge badge-primary ml-2">Remove swap</span></a>
<div ng-show="showMinSize">
<font color="orange"><%=l 'The Minimum Disk Size needed for this ISO is' %> {{min_size}}GB.</font>
</div>
</div>
<div class="form-group row" ng-show="seeswap" ng-if="backend == 'KVM'">
<div class="form-group row" ng-show="!seeswap" ng-if="backend == 'KVM'">
<label for="swap" class="col-xl-3 col-form-label"><%=l 'Swap Size: (GB)' %></label>
<div class="col-lg-2">
<input class="slider form-control" ng-model="swapsize.value"
type="range" name="swap" id="swap" min="1" max="4" ng-disabled="!seeswap">
</div>{{swapsize.value}}
<input class="form-control" ng-model="swapsize.value" type="number" min ="0.1"name="swap" id="swap" ng-disabled="seeswap">
</div>
</div>
<div class="form-group row" ng-show="backend == 'KVM' || backend == 'LXC'">
<label for="memory" class="col-xl-3 col-form-label"><%=l 'Ram: (GB)' %></label>
<div class="col-lg-2">
<input class="slider form-control" ng-model="ramSize" type="range"
name="memory" min="1" max="4" required>
</div>{{ramSize}}
<input class="form-control" ng-model="ramSize" type="number" min ="0.1" name="memory">
</div>
</div>
<div class="form-group row">
<div ng-show="new_machineForm.$submitted || new_machineForm.name.$touched">
......@@ -121,21 +118,6 @@
<strong><%=l 'Error' %></strong> <%=l 'Backend selection is required.' %>
</div>
</div>
<!-- <div ng-show="new_machineForm.$submitted || new_machineForm.ddsize.$touched">
<div ng-show="new_machineForm.ddsize.$error" class="alert alert-warning fade in">
<strong><%=l 'Error' %></strong> <%=l 'Disk size must be between 1 and 40 GB.' %>
</div>
</div>
<div ng-show="new_machineForm.$submitted || new_machineForm.swapsize.$touched">
<div ng-show="swapsize" class="alert alert-warning fade in">
<strong><%=l 'Error' %></strong> <%=l 'Swap size must be between 1 and 4 GB.' %>
</div>
</div>
<div ng-show="new_machineForm.$submitted || new_machineForm.ramsize.$touched">
<div ng-show="ramsize" class="alert alert-warning fade in">
<strong><%=l 'Error' %></strong> <%=l 'Ram size must be between 1 and 4 GB.' %>
</div>
</div> -->
<div ng-show="new_machineForm.$submitted || new_machineForm.id_iso.$touched">
<div ng-show="new_machineForm.id_iso.$error.required" class="alert alert-warning" role="alert">
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment