diff --git a/src/fireedge/src/client/components/HOC/Translate.js b/src/fireedge/src/client/components/HOC/Translate.js index 98ae2222a0..37a3f01fad 100644 --- a/src/fireedge/src/client/components/HOC/Translate.js +++ b/src/fireedge/src/client/components/HOC/Translate.js @@ -24,6 +24,7 @@ import { } from 'react' import PropTypes from 'prop-types' import root from 'window-or-global' +import { Settings } from 'luxon' import { sprintf } from 'sprintf-js' import { useAuth } from 'client/features/Auth' @@ -93,6 +94,7 @@ const TranslateProvider = ({ children = [] }) => { if (!lang || !LANGUAGES[lang]) return try { + Settings.defaultLocale = lang.replace('_', '-') const script = root.document.createElement('script', {}) script.src = `${LANGUAGES_URL}/${lang}.js` diff --git a/src/fireedge/src/client/components/Tabs/Vm/History/HistoryRecord.js b/src/fireedge/src/client/components/Tabs/Vm/History/HistoryRecord.js index 6916005133..4d46ed5677 100644 --- a/src/fireedge/src/client/components/Tabs/Vm/History/HistoryRecord.js +++ b/src/fireedge/src/client/components/Tabs/Vm/History/HistoryRecord.js @@ -78,10 +78,12 @@ const HistoryRecordCard = memo( const { name: userName } = useGetUsersQuery(undefined, { selectFromResult: ({ data }) => getNameFromResult(UID, data), + skip: UID === -1, }) const { name: groupName } = useGetGroupsQuery(undefined, { selectFromResult: ({ data }) => getNameFromResult(GID, data), + skip: UID === -1, }) return ( @@ -93,27 +95,27 @@ const HistoryRecordCard = memo(
- {`#${SEQ} | #${HID} ${HOSTNAME} | ${Tr(T.Action)}: ${action}`} + {`${SEQ} | ${HID} ${HOSTNAME} | ${Tr(T.Action)}: ${action}`}
- + - {`#${DS_ID} ${dsName}`} + {dsName} {+UID !== -1 && ( <> - + - {`#${UID} ${userName}`} + {userName} - + - {`#${GID} ${groupName}`} + {groupName} - {`#${REQUEST_ID}`} + {REQUEST_ID} )} diff --git a/src/fireedge/src/client/constants/index.js b/src/fireedge/src/client/constants/index.js index 87e7bc04cc..c305329831 100644 --- a/src/fireedge/src/client/constants/index.js +++ b/src/fireedge/src/client/constants/index.js @@ -59,7 +59,6 @@ export const SCHEMES = Setting.SCHEMES export const DEFAULT_SCHEME = Setting.SCHEMES.SYSTEM export const CURRENCY = SERVER_CONFIG?.currency ?? 'EUR' -export const LOCALE = SERVER_CONFIG?.lang?.replace('_', '-') ?? undefined export const DEFAULT_LANGUAGE = SERVER_CONFIG?.default_lang ?? 'en' export const LANGUAGES_URL = `${STATIC_FILES_URL}/languages` export const LANGUAGES = SERVER_CONFIG.langs ?? { diff --git a/src/fireedge/src/client/constants/translates.js b/src/fireedge/src/client/constants/translates.js index 7fd13ca96a..0a5b3e061c 100644 --- a/src/fireedge/src/client/constants/translates.js +++ b/src/fireedge/src/client/constants/translates.js @@ -573,7 +573,7 @@ module.exports = { MemoryModification: 'Memory modification', AllowUsersToModifyMemory: "Allow users to modify this template's default memory on instantiate", - MemoryConcept: 'Amount of RAM required for the VM', + MemoryConcept: 'Amount of RAM required for the VM, in Megabytes', CpuConcept: ` Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5`, diff --git a/src/fireedge/src/client/containers/Settings/ConfigurationUI/schema.js b/src/fireedge/src/client/containers/Settings/ConfigurationUI/schema.js index 54059ac1bd..2cd90f8fc4 100644 --- a/src/fireedge/src/client/containers/Settings/ConfigurationUI/schema.js +++ b/src/fireedge/src/client/containers/Settings/ConfigurationUI/schema.js @@ -61,7 +61,7 @@ const DISABLE_ANIMATIONS_FIELD = { name: 'DISABLE_ANIMATIONS', label: T.DisableDashboardAnimations, type: INPUT_TYPES.CHECKBOX, - validation: boolean(), + validation: boolean().yesOrNo(), grid: { md: 12 }, } diff --git a/src/fireedge/src/client/models/Helper.js b/src/fireedge/src/client/models/Helper.js index 3b46d0b650..c61c1ebcac 100644 --- a/src/fireedge/src/client/models/Helper.js +++ b/src/fireedge/src/client/models/Helper.js @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * * limitations under the License. * * ------------------------------------------------------------------------- */ -import { DateTime } from 'luxon' +import { DateTime, Settings } from 'luxon' import { parse as ParserToJson, X2jOptions, @@ -28,7 +28,6 @@ import { UserInputObject, USER_INPUT_TYPES, CURRENCY, - LOCALE, } from 'client/constants' /** @@ -91,7 +90,7 @@ export const stringToBoolean = (str) => */ export const formatNumberByCurrency = (number, options) => { try { - return Intl.NumberFormat(LOCALE, { + return Intl.NumberFormat(Settings.defaultLocale, { style: 'currency', currency: CURRENCY, currencyDisplay: 'narrowSymbol', @@ -116,7 +115,7 @@ export const formatNumberByCurrency = (number, options) => { */ export const areStringEqual = (options) => (a, b) => { try { - const collator = new Intl.Collator(LOCALE, { + const collator = new Intl.Collator(Settings.defaultLocale, { sensitivity: 'base', ...options, })