Merge "Fix displayed type for instance snapshots"

This commit is contained in:
Zuul 2018-01-04 07:40:20 +00:00 committed by Gerrit Code Review
commit 453ef78003
2 changed files with 4 additions and 2 deletions

View File

@ -254,7 +254,7 @@
container_format: { label: gettext('Container Format'), filters: ['uppercase'] },
disk_format: { label: gettext('Disk Format'), filters: ['noValue', 'uppercase'] },
is_public: { label: gettext('Is Public'), filters: ['yesno'] },
type: { label: gettext('Type'), filters: [imagesService.imageType] },
type: { label: gettext('Type')},
'protected': { label: gettext('Protected'), filters: ['yesno'] },
size: { label: gettext('Size'), filters: ['bytes'] },
status: { label: gettext('Status'), values: statuses }

View File

@ -81,7 +81,8 @@
if (null !== item &&
angular.isDefined(item) &&
angular.isDefined(item.properties) &&
item.properties.image_type === 'snapshot') {
(item.properties.image_type === 'snapshot' ||
angular.isDefined(item.properties.block_device_mapping))) {
return gettext('Snapshot');
} else {
return gettext('Image');
@ -131,6 +132,7 @@
image.apiVersion = version;
image.visibility = $filter('imageVisibility')(image, projectId);
image.name = image.name || image.id;
image.type = imageType(image);
return image;
}
}