Initial Depends and Bundle support added
See above. Change-Id: Id2180e47f308807e6915d8e4a008ae1d39cee59a
This commit is contained in:
parent
03b496532f
commit
9fe9cbc99a
|
@ -71,7 +71,6 @@
|
|||
//FIXME [{'name':'heat', 'type':'orchestration'}, {'name':'glance', 'type':'image'}]
|
||||
serviceCatalog.get().then(function(catalog){
|
||||
angular.forEach(catalog, function(entry){
|
||||
console.log(entry, $scope.supported_service_type_to_label);
|
||||
if(entry.name in $scope.supported_service_type_to_label) {
|
||||
$scope.service_filters_selections[entry.name] = true;
|
||||
}
|
||||
|
@ -82,8 +81,16 @@
|
|||
this.update_assets_filtered = function(){
|
||||
$scope.assets_filtered.length = 0;
|
||||
angular.forEach($scope.assets, function(asset){
|
||||
if($scope.service_filters_selections[asset.service.type] == true){
|
||||
$scope.assets_filtered.push(asset);
|
||||
if($scope.service_filters_selections[asset.service.type] == true || asset.service.type == 'bundle'){
|
||||
var filtered_dep = false;
|
||||
angular.forEach(asset.depends, function(dep){
|
||||
if($scope.service_filters_selections[dep.asset.service.type] == false){
|
||||
filtered_dep = true;
|
||||
}
|
||||
});
|
||||
if(!filtered_dep) {
|
||||
$scope.assets_filtered.push(asset);
|
||||
}
|
||||
}
|
||||
});
|
||||
var types = {};
|
||||
|
@ -176,8 +183,6 @@
|
|||
$http(murano_req).success(function(data) {
|
||||
for (var i in data.assets){
|
||||
var asset = data.assets[i];
|
||||
//FIXME work around until service types get into app-catalog repo
|
||||
asset.service = {type: 'murano'};
|
||||
$scope.assets.push(asset);
|
||||
}
|
||||
$scope.murano_loaded = true;
|
||||
|
@ -263,6 +268,17 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
var asset_name_to_asset = {};
|
||||
angular.forEach($scope.assets, function(asset){
|
||||
asset_name_to_asset[asset.name] = asset;
|
||||
});
|
||||
angular.forEach($scope.assets, function(asset){
|
||||
if('depends' in asset) {
|
||||
angular.forEach(asset.depends, function(dep){
|
||||
dep.asset = asset_name_to_asset[dep.name];
|
||||
});
|
||||
}
|
||||
});
|
||||
$scope.update_assets_filtered();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,6 +66,24 @@ Service Types: <label ng-repeat="service in service_filters">
|
|||
<a ng-switch-default class="btn btn-default btn-sm" target="_blank" href="{$ asset.license_url $}">License Details</a>
|
||||
<div ng-switch-when="_undefined_"></div>
|
||||
</dd>
|
||||
<dt ng-switch="asset.depends || '_undefined_'">
|
||||
<div ng-switch-default>Dependencies</div>
|
||||
<div ng-switch-when="_undefined_"></div>
|
||||
</dt>
|
||||
<dd ng-switch="asset.depends || '_undefined_'">
|
||||
<div ng-switch-default>
|
||||
<table>
|
||||
<tr ng-repeat="dep in asset.depends">
|
||||
<td>{$ dep.name $}</td>
|
||||
<td ng-switch="dep.asset.installed">
|
||||
<a ng-switch-default class="btn btn-default btn-sm disabled ajax-modal" href="/}">Checking</a>
|
||||
<a ng-switch-when="false" class="btn btn-default btn-sm ajax-modal" href="/project/images/create/?name={$ dep.asset.name | encodeURIComponent $}&source_type=url&image_url={$ dep.asset.attributes.url | encodeURIComponent $}&disk_format={$ dep.asset.service.disk_format $}&architecture={$ dep.asset.service.architecture $}&minimum_disk={$ dep.asset.service.min_disk $}&minimum_ram={$ dep.asset.service.min_ram $}&description={$ dep.asset.description $}">Install</a>
|
||||
<a ng-switch-when="true" class="btn ntn-default btn-sm disbled">Installed</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div ng-switch-when="_undefined_"></div>
|
||||
</dd>
|
||||
</dl>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in New Issue