mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-25 02:50:08 +03:00
parent
8fd3e9671e
commit
3b8d934680
@ -15,5 +15,5 @@
|
||||
# limitations under the License. #
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
image: 'OPENNEBULA-ON-PREM'
|
||||
image: 'OPENNEBULA-ONPREMISE'
|
||||
provider: 'dummy'
|
||||
|
BIN
src/fireedge/src/client/assets/images/logos/default.png
Normal file
BIN
src/fireedge/src/client/assets/images/logos/default.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.3 KiB |
BIN
src/fireedge/src/client/assets/images/providers/ONPREMISE.png
Normal file
BIN
src/fireedge/src/client/assets/images/providers/ONPREMISE.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.3 KiB |
BIN
src/fireedge/src/client/assets/images/providers/ONPREMISE.webp
Normal file
BIN
src/fireedge/src/client/assets/images/providers/ONPREMISE.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
After Width: | Height: | Size: 10 KiB |
Binary file not shown.
After Width: | Height: | Size: 5.8 KiB |
@ -26,7 +26,7 @@ import Image from 'client/components/Image'
|
||||
|
||||
import { timeFromMilliseconds } from 'client/models/Helper'
|
||||
import { isExternalURL } from 'client/utils'
|
||||
import { VM, STATIC_FILES_URL } from 'client/constants'
|
||||
import { VM, STATIC_FILES_URL, DEFAULT_TEMPLATE_LOGO } from 'client/constants'
|
||||
|
||||
const VmTemplateCard = memo(
|
||||
/**
|
||||
@ -48,12 +48,15 @@ const VmTemplateCard = memo(
|
||||
TEMPLATE: { LOGO = '' } = {},
|
||||
} = template
|
||||
|
||||
const logoSource = useMemo(
|
||||
() => (isExternalURL(LOGO) ? LOGO : `${STATIC_FILES_URL}/${LOGO}`),
|
||||
[LOGO]
|
||||
)
|
||||
const isExternalImage = useMemo(() => isExternalURL(LOGO), [LOGO])
|
||||
|
||||
const time = timeFromMilliseconds(+REGTIME)
|
||||
const logoSource = useMemo(() => {
|
||||
if (!LOGO) return `${STATIC_FILES_URL}/${DEFAULT_TEMPLATE_LOGO}`
|
||||
|
||||
return isExternalImage ? LOGO : `${STATIC_FILES_URL}/${LOGO}`
|
||||
}, [isExternalImage, LOGO])
|
||||
|
||||
const time = useMemo(() => timeFromMilliseconds(+REGTIME), [REGTIME])
|
||||
|
||||
return (
|
||||
<div {...rootProps} data-cy={`template-${ID}`}>
|
||||
|
@ -16,8 +16,15 @@
|
||||
import { string } from 'yup'
|
||||
|
||||
import Image from 'client/components/Image'
|
||||
import { T, STATIC_FILES_URL, INPUT_TYPES, HYPERVISORS } from 'client/constants'
|
||||
import { Field, arrayToOptions } from 'client/utils'
|
||||
import {
|
||||
T,
|
||||
STATIC_FILES_URL,
|
||||
INPUT_TYPES,
|
||||
HYPERVISORS,
|
||||
DEFAULT_TEMPLATE_LOGO,
|
||||
TEMPLATE_LOGOS,
|
||||
} from 'client/constants'
|
||||
|
||||
/**
|
||||
* @param {boolean} isUpdate - If `true`, the form is being updated
|
||||
@ -68,26 +75,14 @@ export const LOGO = {
|
||||
name: 'LOGO',
|
||||
label: T.Logo,
|
||||
type: INPUT_TYPES.SELECT,
|
||||
values: [
|
||||
{ text: '-', value: '' },
|
||||
{ text: 'Alpine Linux', value: 'images/logos/alpine.png' },
|
||||
{ text: 'ALT', value: 'images/logos/alt.png' },
|
||||
{ text: 'Arch', value: 'images/logos/arch.png' },
|
||||
{ text: 'CentOS', value: 'images/logos/centos.png' },
|
||||
{ text: 'Debian', value: 'images/logos/debian.png' },
|
||||
{ text: 'Devuan', value: 'images/logos/devuan.png' },
|
||||
{ text: 'Fedora', value: 'images/logos/fedora.png' },
|
||||
{ text: 'FreeBSD', value: 'images/logos/freebsd.png' },
|
||||
{ text: 'HardenedBSD', value: 'images/logos/hardenedbsd.png' },
|
||||
{ text: 'Knoppix', value: 'images/logos/knoppix.png' },
|
||||
{ text: 'Linux', value: 'images/logos/linux.png' },
|
||||
{ text: 'Oracle', value: 'images/logos/oracle.png' },
|
||||
{ text: 'RedHat', value: 'images/logos/redhat.png' },
|
||||
{ text: 'Suse', value: 'images/logos/suse.png' },
|
||||
{ text: 'Ubuntu', value: 'images/logos/ubuntu.png' },
|
||||
{ text: 'Windows xp', value: 'images/logos/windowsxp.png' },
|
||||
{ text: 'Windows 10', value: 'images/logos/windows8.png' },
|
||||
],
|
||||
values: arrayToOptions(
|
||||
[['-', DEFAULT_TEMPLATE_LOGO], ...Object.entries(TEMPLATE_LOGOS)],
|
||||
{
|
||||
addEmpty: false,
|
||||
getText: ([name]) => name,
|
||||
getValue: ([, logo]) => logo,
|
||||
}
|
||||
),
|
||||
renderValue: (value) => (
|
||||
<Image
|
||||
alt="logo"
|
||||
@ -100,7 +95,7 @@ export const LOGO = {
|
||||
validation: string()
|
||||
.trim()
|
||||
.notRequired()
|
||||
.default(() => undefined),
|
||||
.default(() => DEFAULT_TEMPLATE_LOGO),
|
||||
grid: { md: 12 },
|
||||
}
|
||||
|
||||
|
@ -75,3 +75,25 @@ export const KVM_FIRMWARE_TYPES = FIRMWARE_TYPES.concat([
|
||||
])
|
||||
|
||||
export const VCENTER_FIRMWARE_TYPES = FIRMWARE_TYPES.concat(['uefi'])
|
||||
|
||||
export const DEFAULT_TEMPLATE_LOGO = 'images/logos/default.png'
|
||||
|
||||
export const TEMPLATE_LOGOS = {
|
||||
'Alpine Linux': 'images/logos/alpine.png',
|
||||
ALT: 'images/logos/alt.png',
|
||||
Arch: 'images/logos/arch.png',
|
||||
CentOS: 'images/logos/centos.png',
|
||||
Debian: 'images/logos/debian.png',
|
||||
Devuan: 'images/logos/devuan.png',
|
||||
Fedora: 'images/logos/fedora.png',
|
||||
FreeBSD: 'images/logos/freebsd.png',
|
||||
HardenedBSD: 'images/logos/hardenedbsd.png',
|
||||
Knoppix: 'images/logos/knoppix.png',
|
||||
Linux: 'images/logos/linux.png',
|
||||
Oracle: 'images/logos/oracle.png',
|
||||
RedHat: 'images/logos/redhat.png',
|
||||
Suse: 'images/logos/suse.png',
|
||||
Ubuntu: 'images/logos/ubuntu.png',
|
||||
'Windows xp': 'images/logos/windowsxp.png',
|
||||
'Windows 10': 'images/logos/windows8.png',
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user