"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "openstack_dashboard/dashboards/project/static/dashboard/project/workflow/launch-instance/launch-instance-model.service.js" between
horizon-18.6.2.tar.gz and horizon-18.6.3.tar.gz

About: OpenStack Horizon (Optional Service: Dashboard) provides a web-based self-service portal to interact with underlying OpenStack services, such as launching an instance, assigning IP addresses and configuring access controls.
The "Victoria" series (maintained release).

launch-instance-model.service.js  (horizon-18.6.2):launch-instance-model.service.js  (horizon-18.6.3)
skipping to change at line 570 skipping to change at line 570
function addImageSourcesIfEnabled(config) { function addImageSourcesIfEnabled(config) {
// in case settings are deleted or not present // in case settings are deleted or not present
var allEnabled = !config; var allEnabled = !config;
// if the settings are missing or the specific setting is missing default to true // if the settings are missing or the specific setting is missing default to true
var enabledImage = allEnabled || !config.disable_image; var enabledImage = allEnabled || !config.disable_image;
var enabledSnapshot = allEnabled || !config.disable_instance_snapshot; var enabledSnapshot = allEnabled || !config.disable_instance_snapshot;
if (enabledImage || enabledSnapshot) { if (enabledImage || enabledSnapshot) {
var filter = {status: 'active', sort_key: 'name', sort_dir: 'asc'}; var filter = {status: 'active', sort_key: 'name', sort_dir: 'asc'};
glanceAPI.getImages(filter).then( var filterCommunity = angular.merge({}, filter, {visibility: 'community'
});
var imagePromises = [
glanceAPI.getImages(filter),
glanceAPI.getImages(filterCommunity)
];
$q.all(imagePromises).then(
function(data) { function(data) {
onGetImageSources(data, enabledImage, enabledSnapshot); onGetImageSources(data, enabledImage, enabledSnapshot);
} }
); );
} }
} }
function addVolumeSourcesIfEnabled(config) { function addVolumeSourcesIfEnabled(config) {
var volumeDeferred = $q.defer(); var volumeDeferred = $q.defer();
var volumeSnapshotDeferred = $q.defer(); var volumeSnapshotDeferred = $q.defer();
skipping to change at line 681 skipping to change at line 686
} }
function isValidSnapshot(image) { function isValidSnapshot(image) {
return getImageType(image) === 'snapshot' && isBootableImageType(image); return getImageType(image) === 'snapshot' && isBootableImageType(image);
} }
function onGetImageSources(data, enabledImage, enabledSnapshot) { function onGetImageSources(data, enabledImage, enabledSnapshot) {
model.imageSnapshots.length = 0; model.imageSnapshots.length = 0;
model.images.length = 0; model.images.length = 0;
angular.forEach(data.data.items, function(image) { var imageIdsProcessed = [];
if (isValidSnapshot(image) && enabledSnapshot) {
model.imageSnapshots.push(image); angular.forEach(data, function(data) {
} else if (isValidImage(image) && enabledImage) { angular.forEach(data.data.items, function(image) {
model.images.push(image); if (imageIdsProcessed.includes(image.id)) {
} return;
}
imageIdsProcessed.push(image.id);
if (isValidSnapshot(image) && enabledSnapshot) {
model.imageSnapshots.push(image);
} else if (isValidImage(image) && enabledImage) {
image.name_or_id = image.name || image.id;
model.images.push(image);
}
});
}); });
if (enabledImage) { if (enabledImage) {
addAllowedBootSource( addAllowedBootSource(
model.images, bootSourceTypes.IMAGE, gettext('Image') model.images, bootSourceTypes.IMAGE, gettext('Image')
); );
} }
if (enabledSnapshot) { if (enabledSnapshot) {
addAllowedBootSource( addAllowedBootSource(
 End of changes. 2 change blocks. 
7 lines changed or deleted 22 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)