Commit 35d54526 authored by joelalju's avatar joelalju
Browse files

[#447]Minimum size enforced

parent 44321e19
...@@ -189,8 +189,9 @@ sub _update_isos { ...@@ -189,8 +189,9 @@ sub _update_isos {
,xml => 'yakkety64-amd64.xml' ,xml => 'yakkety64-amd64.xml'
,xml_volume => 'yakkety64-volume.xml' ,xml_volume => 'yakkety64-volume.xml'
,url => 'http://releases.ubuntu.com/17.10/' ,url => 'http://releases.ubuntu.com/17.10/'
,file_re => ,'ubuntu-17.10.*desktop-amd64.iso' ,file_re => 'ubuntu-17.10.*desktop-amd64.iso'
,md5_url => ,'$url/MD5SUMS' ,md5_url => '$url/MD5SUMS'
,min_disk_size => '9'
} }
,zesty => { ,zesty => {
name => 'Ubuntu Zesty Zapus' name => 'Ubuntu Zesty Zapus'
...@@ -199,8 +200,8 @@ sub _update_isos { ...@@ -199,8 +200,8 @@ sub _update_isos {
,xml => 'yakkety64-amd64.xml' ,xml => 'yakkety64-amd64.xml'
,xml_volume => 'yakkety64-volume.xml' ,xml_volume => 'yakkety64-volume.xml'
,url => 'http://releases.ubuntu.com/17.04/' ,url => 'http://releases.ubuntu.com/17.04/'
,file_re => ,'ubuntu-17.04.*desktop-amd64.iso' ,file_re => 'ubuntu-17.04.*desktop-amd64.iso'
,md5_url => ,'http://releases.ubuntu.com/17.04/MD5SUMS' ,md5_url => 'http://releases.ubuntu.com/17.04/MD5SUMS'
} }
,serena64 => { ,serena64 => {
name => 'Mint 18.1 Mate 64 bits' name => 'Mint 18.1 Mate 64 bits'
...@@ -1164,6 +1165,7 @@ sub list_domains { ...@@ -1164,6 +1165,7 @@ sub list_domains {
return @domains; return @domains;
} }
=head2 list_domains_data =head2 list_domains_data
List all domains in raw format. Return a list of id => { name , id , is_active , is_base } List all domains in raw format. Return a list of id => { name , id , is_active , is_base }
......
...@@ -51,10 +51,25 @@ ravadaApp.directive("solShowMachine", swMach) ...@@ -51,10 +51,25 @@ ravadaApp.directive("solShowMachine", swMach)
}); });
}; };
$scope.name_duplicated = false; $scope.name_duplicated = false;
$scope.ddsize=20;
$scope.swapsize={value:1};
$scope.ramSize=1;
$scope.seeswap=0;
$scope.change_iso = function(device) { $scope.showMinSize = false;
if (device != null) { $scope.min_size = 1;
return device; $scope.change_iso = function(id) {
if (id.min_disk_size != null) {
$scope.showMinSize = true;
$scope.min_size = id.min_disk_size;
}
else {
$scope.showMinSize = false;
$scope.min_size = 1;
}
if (id.device != null) {
return id.device;
} }
else return "<NONE>"; else return "<NONE>";
}; };
...@@ -73,16 +88,14 @@ ravadaApp.directive("solShowMachine", swMach) ...@@ -73,16 +88,14 @@ ravadaApp.directive("solShowMachine", swMach)
$scope.name_duplicated=false; $scope.name_duplicated=false;
} }
}; };
$scope.ddsize=20;
$scope.swapsize={value:1};
$scope.ramSize=1;
$scope.seeswap=0;
$scope.type = function(v) { $scope.type = function(v) {
return typeof(v); return typeof(v);
} }
$scope.show_swap = function() { $scope.show_swap = function() {
$scope.seeswap = !($scope.seeswap); $scope.seeswap = !($scope.seeswap);
}; };
$http.get('/list_machines.json').then(function(response) { $http.get('/list_machines.json').then(function(response) {
$scope.base = response.data; $scope.base = response.data;
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
name ="id_iso" name ="id_iso"
ng-model="id_iso" ng-model="id_iso"
ng-options="item.name for item in images track by item.id" ng-options="item.name for item in images track by item.id"
ng-change="iso_file = change_iso(id_iso.device)" ng-change="iso_file = change_iso(id_iso)"
required="" required=""
></select> ></select>
<div ng-show="id_iso.description"> <div ng-show="id_iso.description">
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
ng-model="iso_file" ng-model="iso_file"
ng-options="item for item in isos track by item" ng-options="item for item in isos track by item"
required="" required=""
></select> ></select>
</div> </div>
</div> </div>
...@@ -78,19 +79,22 @@ ...@@ -78,19 +79,22 @@
</div> </div>
<div class="form-group row" ng-if="backend == 'KVM'"> <div class="form-group row" ng-if="backend == 'KVM'">
<label for="disk" class="col-lg-3 control-label"><%=l 'Disk Size: (GB)' %></label> <label for="disk" class="col-lg-3 control-label"><%=l 'Disk Size: (GB)' %></label>
<div class="col-lg-2"> <div class="col-lg-2">
<input class="slider form-control" ng-model="ddsize" type="range" name="disk" <input class="slider form-control" ng-model="ddsize" type="range" name="disk"
min="1" max="100" value="20" required=""> min="{{min_size}}" max="100" value="20" required="">
</div>{{ddsize}} </div>{{ddsize}}
<a ng-show="!seeswap" <a ng-show="!seeswap"
ng-click="show_swap()" ng-click="show_swap()"
class="label label-primary" class="label label-primary"
align="right">Add swap</a> align="right">Add swap</a>
<a ng-show="seeswap" <a ng-show="seeswap"
ng-click="show_swap()" ng-click="show_swap()"
class="label label-primary" class="label label-primary"
align="right">Remove swap</a> align="right">Remove swap</a>
<div ng-show="showMinSize">
<font color="#500000"><%=l 'The Minimum Disk Size needed for this ISO is' %> {{min_size}}GB.</font>
</div>
</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-lg-3 control-label"><%=l 'Swap Size: (GB)' %></label> <label for="swap" class="col-lg-3 control-label"><%=l 'Swap Size: (GB)' %></label>
......
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