diff --git a/share/oneprovision/edge-clusters/onprem/provisions/onprem.d/fireedge.yml b/share/oneprovision/edge-clusters/onprem/provisions/onprem.d/fireedge.yml index 14602325aa..306a44dfe9 100644 --- a/share/oneprovision/edge-clusters/onprem/provisions/onprem.d/fireedge.yml +++ b/share/oneprovision/edge-clusters/onprem/provisions/onprem.d/fireedge.yml @@ -15,5 +15,5 @@ # limitations under the License. # # ---------------------------------------------------------------------------- # -image: 'OPENNEBULA-ON-PREM' +image: 'OPENNEBULA-ONPREMISE' provider: 'dummy' diff --git a/src/fireedge/src/client/assets/images/logos/default.png b/src/fireedge/src/client/assets/images/logos/default.png new file mode 100644 index 0000000000..a6cc3fb9ff Binary files /dev/null and b/src/fireedge/src/client/assets/images/logos/default.png differ diff --git a/src/fireedge/src/client/assets/images/providers/ONPREMISE.png b/src/fireedge/src/client/assets/images/providers/ONPREMISE.png new file mode 100644 index 0000000000..9da7992530 Binary files /dev/null and b/src/fireedge/src/client/assets/images/providers/ONPREMISE.png differ diff --git a/src/fireedge/src/client/assets/images/providers/ONPREMISE.webp b/src/fireedge/src/client/assets/images/providers/ONPREMISE.webp new file mode 100644 index 0000000000..939f692c7c Binary files /dev/null and b/src/fireedge/src/client/assets/images/providers/ONPREMISE.webp differ diff --git a/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.png b/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.png new file mode 100644 index 0000000000..62b62c451d Binary files /dev/null and b/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.png differ diff --git a/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.webp b/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.webp new file mode 100644 index 0000000000..b8a6d0855e Binary files /dev/null and b/src/fireedge/src/client/assets/images/provisions/OPENNEBULA-ONPREMISE.webp differ diff --git a/src/fireedge/src/client/components/Cards/VmTemplateCard.js b/src/fireedge/src/client/components/Cards/VmTemplateCard.js index 48be2dd99e..2fa0806f5b 100644 --- a/src/fireedge/src/client/components/Cards/VmTemplateCard.js +++ b/src/fireedge/src/client/components/Cards/VmTemplateCard.js @@ -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 (
diff --git a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/General/informationSchema.js b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/General/informationSchema.js index 4c4e057df1..1a55126096 100644 --- a/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/General/informationSchema.js +++ b/src/fireedge/src/client/components/Forms/VmTemplate/CreateForm/Steps/General/informationSchema.js @@ -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) => ( logo undefined), + .default(() => DEFAULT_TEMPLATE_LOGO), grid: { md: 12 }, } diff --git a/src/fireedge/src/client/constants/vmTemplate.js b/src/fireedge/src/client/constants/vmTemplate.js index 0f1a560c81..e722ef71ce 100644 --- a/src/fireedge/src/client/constants/vmTemplate.js +++ b/src/fireedge/src/client/constants/vmTemplate.js @@ -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', +}