mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-21 18:03:38 +03:00
B #~: Show only OS, CDROM, and DATABLOCK images on image tab (#2401)
This commit is contained in:
parent
7e42776ea6
commit
ce46eba98f
@ -60,11 +60,13 @@ const imageApi = oneApi.injectEndpoints({
|
||||
: [data.IMAGE_POOL.IMAGE]
|
||||
: []
|
||||
|
||||
const images = imagesPool?.filter?.((image) =>
|
||||
IMAGE_TYPES_FOR_IMAGES.some(() => getType(image))
|
||||
const images = imagesPool.filter((image) =>
|
||||
IMAGE_TYPES_FOR_IMAGES.some(
|
||||
(imageType) => imageType === getType(image)
|
||||
)
|
||||
)
|
||||
|
||||
return images.flat()
|
||||
return images
|
||||
},
|
||||
providesTags: (images) =>
|
||||
images
|
||||
@ -92,11 +94,19 @@ const imageApi = oneApi.injectEndpoints({
|
||||
return { params, command }
|
||||
},
|
||||
transformResponse: (data) => {
|
||||
const images = data?.IMAGE_POOL?.IMAGE?.filter?.((image) =>
|
||||
IMAGE_TYPES_FOR_FILES.some(() => getType(image))
|
||||
const imagesPool = data?.IMAGE_POOL?.IMAGE
|
||||
? Array.isArray(data.IMAGE_POOL.IMAGE)
|
||||
? data.IMAGE_POOL.IMAGE
|
||||
: [data.IMAGE_POOL.IMAGE]
|
||||
: []
|
||||
|
||||
const files = imagesPool.filter((image) =>
|
||||
IMAGE_TYPES_FOR_FILES.some(
|
||||
(imageType) => imageType === getType(image)
|
||||
)
|
||||
)
|
||||
|
||||
return [images ?? []].flat()
|
||||
return files
|
||||
},
|
||||
providesTags: (images) =>
|
||||
images
|
||||
|
Loading…
x
Reference in New Issue
Block a user