@@ -259,6 +279,7 @@ const EnhancedTable = ({
/>
+ {messages && }
{/* NO DATA MESSAGE */}
{!isLoading &&
!isUninitialized &&
@@ -290,6 +311,9 @@ const EnhancedTable = ({
key={key}
original={original}
value={values}
+ {...(messageValues.length && {
+ globalErrors: messageValues,
+ })}
className={isSelected ? 'selected' : ''}
{...(!cannotFilterByLabel && {
onClickLabel: (label) => {
@@ -358,6 +382,7 @@ EnhancedTable.propTypes = {
PropTypes.node,
PropTypes.bool,
]),
+ messages: PropTypes.array,
}
export * from 'client/components/Tables/Enhanced/Utils'
diff --git a/src/fireedge/src/client/components/Tables/Vms/index.js b/src/fireedge/src/client/components/Tables/Vms/index.js
index a7cb621e32..8c8dd83004 100644
--- a/src/fireedge/src/client/components/Tables/Vms/index.js
+++ b/src/fireedge/src/client/components/Tables/Vms/index.js
@@ -52,9 +52,27 @@ const VmsTable = (props) => {
...result,
data:
result?.data
- ?.filter((vm) =>
- host?.ID ? [host?.VMS?.ID ?? []].flat().includes(vm.ID) : true
- )
+ ?.filter((vm) => {
+ if (host?.ID) {
+ if (
+ host?.ERROR_VMS?.ID ||
+ host?.UPDATED_VMS?.ID ||
+ host?.UPDATING_VMS?.ID
+ ) {
+ return [
+ host?.ERROR_VMS.ID ?? [],
+ host?.UPDATED_VMS.ID ?? [],
+ host?.UPDATING_VMS.ID ?? [],
+ ]
+ .flat()
+ .includes(vm.ID)
+ }
+
+ return [host?.VMS?.ID ?? []].flat().includes(vm.ID)
+ }
+
+ return true
+ })
?.filter(({ STATE }) => VM_STATES[STATE]?.name !== STATES.DONE) ?? [],
}),
})
diff --git a/src/fireedge/src/client/components/Tables/Vms/row.js b/src/fireedge/src/client/components/Tables/Vms/row.js
index ac4e8286fc..97ebe7029f 100644
--- a/src/fireedge/src/client/components/Tables/Vms/row.js
+++ b/src/fireedge/src/client/components/Tables/Vms/row.js
@@ -13,20 +13,20 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
-import { memo, useMemo, useCallback } from 'react'
import PropTypes from 'prop-types'
+import { memo, useCallback, useMemo } from 'react'
-import vmApi, { useUpdateUserTemplateMutation } from 'client/features/OneApi/vm'
-import { VirtualMachineCard } from 'client/components/Cards'
import { ConsoleButton } from 'client/components/Buttons'
-import { jsonToXml } from 'client/models/Helper'
+import { VirtualMachineCard } from 'client/components/Cards'
import { VM_ACTIONS } from 'client/constants'
+import vmApi, { useUpdateUserTemplateMutation } from 'client/features/OneApi/vm'
+import { jsonToXml } from 'client/models/Helper'
const { VNC, RDP, SSH, VMRC } = VM_ACTIONS
const CONNECTION_TYPES = [VNC, RDP, SSH, VMRC]
const Row = memo(
- ({ original, value, onClickLabel, ...props }) => {
+ ({ original, value, onClickLabel, globalErrors, ...props }) => {
const [update] = useUpdateUserTemplateMutation()
const state = vmApi.endpoints.getVms.useQueryState(undefined, {
@@ -54,6 +54,7 @@ const Row = memo(
rootProps={props}
onClickLabel={onClickLabel}
onDeleteLabel={handleDeleteLabel}
+ globalErrors={globalErrors}
actions={
<>
{CONNECTION_TYPES.map((connectionType) => (
@@ -78,6 +79,7 @@ Row.propTypes = {
className: PropTypes.string,
onClick: PropTypes.func,
onClickLabel: PropTypes.func,
+ globalErrors: PropTypes.array,
}
Row.displayName = 'VirtualMachineRow'
diff --git a/src/fireedge/src/client/components/Tabs/SecurityGroup/Vms/index.js b/src/fireedge/src/client/components/Tabs/SecurityGroup/Vms/index.js
index 8b62070b19..3fa0a28afb 100644
--- a/src/fireedge/src/client/components/Tabs/SecurityGroup/Vms/index.js
+++ b/src/fireedge/src/client/components/Tabs/SecurityGroup/Vms/index.js
@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and *
* limitations under the License. *
* ------------------------------------------------------------------------- */
-import { ReactElement } from 'react'
-import PropTypes from 'prop-types'
-import { T } from 'client/constants'
-import EmptyTab from 'client/components/Tabs/EmptyTab'
-import { useHistory, generatePath } from 'react-router-dom'
import { PATH } from 'client/apps/sunstone/routesOne'
-import { useGetSecGroupQuery } from 'client/features/OneApi/securityGroup'
import { VmsTable } from 'client/components/Tables'
+import EmptyTab from 'client/components/Tabs/EmptyTab'
+import { T } from 'client/constants'
+import { useGetSecGroupQuery } from 'client/features/OneApi/securityGroup'
+import { CloudDesync, WarningTriangleOutline } from 'iconoir-react'
+import PropTypes from 'prop-types'
+import { ReactElement } from 'react'
+import { generatePath, useHistory } from 'react-router-dom'
/**
* Renders mainly Vms tab.
@@ -43,6 +44,20 @@ const VmsTab = ({ id }) => {
disableGlobalSort
displaySelectedRows
host={secGroup}
+ messages={[
+ {
+ rows: [secGroup?.ERROR_VMS.ID ?? []].flat(),
+ message: T.ErrorUpdatingSecGroups,
+ icon: ,
+ type: 'error',
+ },
+ {
+ rows: [secGroup?.UPDATING_VMS.ID ?? []].flat(),
+ message: T.PendingUpdatingSecGroups,
+ icon: ,
+ type: 'info',
+ },
+ ]}
onRowClick={(row) => handleRowClick(row.ID)}
noDataMessage={}
/>
diff --git a/src/fireedge/src/client/constants/translates.js b/src/fireedge/src/client/constants/translates.js
index 36eafe48af..99593b2479 100644
--- a/src/fireedge/src/client/constants/translates.js
+++ b/src/fireedge/src/client/constants/translates.js
@@ -290,6 +290,8 @@ module.exports = {
NoDataAvailable: 'There is no data available',
ErrorsOcurred: '%s error(s) occurred',
UpdatedNic: 'Updated nic',
+ ErrorUpdatingSecGroups: 'VMs in error. The Update to the latest rules failed',
+ PendingUpdatingSecGroups: 'VMs waiting to be updated with the latest rules',
/* steps form */
AdvancedOptions: 'Advanced options',