Skip to content

Commit 9c55ab1

Browse files
F #7172: refresh actions (#3880)
- Upgrade zeromq to 6.5.1 - Upgrade fast-xml-parser to v4 - Remove manual HE encoding - Update PCI profile selector - Add missing data-cy selector(s) - Reverts 524da99 (This needs to be further tested to measure performance impact => Uploaded files are not deleted from /var/tmp one#7252) - Fixes sec_group update call Signed-off-by: Victor Hansson <vhansson@opennebula.io> Co-authored-by: Jorge Miguel Lobo Escalona <jlobo@opennebula.io>
1 parent 34b808b commit 9c55ab1

File tree

27 files changed

+333
-1060
lines changed

27 files changed

+333
-1060
lines changed

src/fireedge/package-lock.json

Lines changed: 73 additions & 825 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/fireedge/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"build:remotes": "npm run build:um && npm run build:cm && npm run build:ctm && npm run build:cpm && npm run build:mm && npm run build:fm && npm run build:hm && npm run build:pm",
1919
"build": "NODE_ENV=production npm run build-client && NODE_ENV=production npm run build-server && NODE_ENV=production npm run build:remotes",
2020
"start": "NODE_ENV=production node ./dist/index.js",
21+
"start:dev": "NODE_ENV=development node ./dist/index.js",
2122
"pot": "node potfile.js",
2223
"po2json": "node po2json.js",
2324
"lint": "npm run lint-client && npm run lint-server",
@@ -92,7 +93,7 @@
9293
"dompurify": "2.2.6",
9394
"express": "4.17.1",
9495
"external-remotes-plugin": "1.0.0",
95-
"fast-xml-parser": "3.19.0",
96+
"fast-xml-parser": "4.4.1",
9697
"file-loader": "5.1.0",
9798
"fs-extra": "9.0.1",
9899
"fuse.js": "6.4.1",
@@ -168,6 +169,6 @@
168169
"xmlrpc": "1.3.2",
169170
"yaml": "1.10.0",
170171
"yup": "0.32.9",
171-
"zeromq": "5.2.0"
172+
"zeromq": "6.5.0"
172173
}
173174
}

src/fireedge/src/modules/components/Cards/VirtualMachineCard.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
* limitations under the License. *
1515
* ------------------------------------------------------------------------- */
1616
import { Box, Stack, Tooltip, Typography, useTheme } from '@mui/material'
17-
import PropTypes from 'prop-types'
1817
import { getResourceLabels, prettyBytes } from '@UtilsModule'
18+
import PropTypes from 'prop-types'
1919
import { ReactElement, memo, useMemo } from 'react'
2020

2121
import {

src/fireedge/src/modules/components/Forms/Vm/AttachPciForm/schema.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import { T, INPUT_TYPES } from '@ConstantsModule'
2626
import { uniqWith } from 'lodash'
2727
import { useFormContext } from 'react-hook-form'
2828

29-
const samePciDevice = (obj1, obj2) =>
30-
obj1.VENDOR === obj2.VENDOR &&
31-
obj1.DEVICE === obj2.DEVICE &&
32-
obj1.CLASS === obj2.CLASS &&
33-
obj1.SHORT_ADDRESS === obj2.SHORT_ADDRESS
29+
const samePciDevice = (a, b) =>
30+
a &&
31+
b &&
32+
['DEVICE', 'VENDOR', 'CLASS'].every((k) => a[k] === b[k]) &&
33+
a.SHORT_ADDRESS?.split('.')[0] === b.SHORT_ADDRESS?.split('.')[0]
3434

3535
/**
3636
* Transform a PCI device to String.
@@ -81,6 +81,8 @@ const NAME_FIELD = {
8181

8282
return arrayToOptions(uniqWith(pciDevices, samePciDevice), {
8383
getText: ({ DEVICE_NAME } = {}) => DEVICE_NAME,
84+
addDescription: true,
85+
getDescription: (opt) => opt?.TYPE,
8486
getValue: transformPciToString,
8587
})
8688
},

src/fireedge/src/modules/components/Forms/Vm/UpdateConfigurationForm/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
decodeBase64,
2121
getUnknownAttributes,
2222
isBase64,
23-
transformXmlString,
2423
} from '@UtilsModule'
2524
import { set } from 'lodash'
2625
import { reach } from 'yup'
@@ -74,7 +73,7 @@ const UpdateConfigurationForm = createForm(SCHEMA, undefined, {
7473
if (template.RAW.DATA) {
7574
// DATA exists, so we add TYPE and transform DATA
7675
knownTemplate.RAW.TYPE = template.HYPERVISOR
77-
knownTemplate.RAW.DATA = transformXmlString(template.RAW.DATA)
76+
knownTemplate.RAW.DATA = template.RAW.DATA
7877
} else {
7978
// DATA doesn't exist, remove RAW from template
8079
delete knownTemplate.RAW

src/fireedge/src/modules/components/Forms/VmTemplate/CreateForm/Steps/General/capacitySchema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ export const DISK_COST = generateCostCapacityInput({
231231
step: 0.1,
232232
inputProps: {
233233
setValueAs: (v) => (v === '' ? undefined : Number(v)),
234-
'data-cy': 'general-showback-DISK_COST',
234+
'data-cy': 'general-showback-DISK_COST', // Overwrites auto generated data cy
235235
},
236236
helperText: <HelperDiskCost />,
237237
}),

src/fireedge/src/modules/components/Status/Chip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ const StatusChip = memo(
136136

137137
StatusChip.propTypes = {
138138
stateColor: PropTypes.string,
139-
text: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
139+
text: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
140140
clipboard: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
141141
forceWhiteColor: PropTypes.bool,
142142
dataCy: PropTypes.string,

src/fireedge/src/modules/components/Tables/Enhanced/pagination.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Pagination.propTypes = {
124124
useTableProps: PropTypes.object.isRequired,
125125
count: PropTypes.number.isRequired,
126126
showPageCount: PropTypes.bool,
127-
styles: PropTypes.object,
127+
styles: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
128128
}
129129

130130
export default Pagination

src/fireedge/src/modules/components/Tabs/SecurityGroup/Info/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,12 @@ import Information from '@modules/components/Tabs/SecurityGroup/Info/information
2828

2929
import { Tr } from '@modules/components/HOC'
3030
import { T } from '@ConstantsModule'
31-
import { getActionsAvailable, jsonToXml, filterAttributes, prettySecurityGroup } from '@ModelsModule'
31+
import {
32+
getActionsAvailable,
33+
jsonToXml,
34+
filterAttributes,
35+
prettySecurityGroup,
36+
} from '@ModelsModule'
3237
import { cloneObject, set } from '@UtilsModule'
3338

3439
const HIDDEN_ATTRIBUTES = /^(RULE)$/
@@ -131,11 +136,12 @@ const SecurityGroupInfoTab = ({ tabProps = {}, id }) => {
131136
{rulesPanel?.enabled && (
132137
<RulesSecGroupsTable
133138
title={Tr(T.SecurityGroup)}
134-
rules={
135-
(Array.isArray(TEMPLATE?.RULE) ? TEMPLATE?.RULE : [TEMPLATE?.RULE])
136-
.filter(Boolean)
137-
.map(prettySecurityGroup)
138-
}
139+
rules={(Array.isArray(TEMPLATE?.RULE)
140+
? TEMPLATE?.RULE
141+
: [TEMPLATE?.RULE]
142+
)
143+
.filter(Boolean)
144+
.map(prettySecurityGroup)}
139145
/>
140146
)}
141147
{attributesPanel?.enabled && (

src/fireedge/src/modules/components/Tabs/Vn/Security.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ const SecurityTab = ({
106106
const { data: vnet } = VnAPI.useGetVNetworkQuery({ id })
107107

108108
const [update] = VnAPI.useUpdateVNetMutation()
109-
const splittedSecGroups = vnet?.TEMPLATE.SECURITY_GROUPS?.split(',') ?? []
109+
110+
const splittedSecGroups = []
111+
.concat(vnet?.TEMPLATE?.SECURITY_GROUPS)
112+
?.flatMap((n) => String(n)?.split(','))
110113
const secGroups = [splittedSecGroups].flat().map((sgId) => +sgId)
111114

112115
const { enqueueSuccess } = useGeneralApi()

0 commit comments

Comments
 (0)