mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-11 05:17:41 +03:00
parent
e208067817
commit
34575a0708
@ -1,4 +1,4 @@
|
||||
name: 'Dummy'
|
||||
image: 'ON-PREMISE'
|
||||
image: 'ONPREMISE'
|
||||
provision_type: 'onprem'
|
||||
color: '#436637'
|
@ -50,13 +50,15 @@ const ProvisionCard = memo(
|
||||
const IMAGES_URL = isProvider ? PROVIDER_IMAGES_URL : PROVISION_IMAGES_URL
|
||||
|
||||
const stateInfo = PROVISIONS_STATES[BODY.state]
|
||||
const image = propImage ?? BODY?.image ?? DEFAULT_IMAGE
|
||||
const image = propImage ?? BODY?.image
|
||||
|
||||
const isExternalImage = useMemo(() => isExternalURL(image), [image])
|
||||
|
||||
const imageUrl = useMemo(
|
||||
() => (isExternalImage ? image : `${IMAGES_URL}/${image}`),
|
||||
[isExternalImage]
|
||||
const imageUrl = useMemo(() => {
|
||||
if (!image) return DEFAULT_IMAGE
|
||||
|
||||
return isExternalImage ? image : `${IMAGES_URL}/${image}`
|
||||
},[isExternalImage]
|
||||
)
|
||||
|
||||
return (
|
||||
|
@ -78,14 +78,13 @@ const Image = memo(
|
||||
|
||||
return withSources ? (
|
||||
<picture {...pictureProps}>
|
||||
{withSources &&
|
||||
IMAGE_FORMATS.map((format) => (
|
||||
<source
|
||||
key={format}
|
||||
srcSet={`${src}.${format}`}
|
||||
type={`image/${format}`}
|
||||
/>
|
||||
))}
|
||||
{IMAGE_FORMATS.map((format) => (
|
||||
<source
|
||||
key={format}
|
||||
srcSet={`${src}.${format}`}
|
||||
type={`image/${format}`}
|
||||
/>
|
||||
))}
|
||||
<img alt="" {...imageProps} src={src} onError={onImageFail} />
|
||||
</picture>
|
||||
) : (
|
||||
|
Loading…
Reference in New Issue
Block a user