diff --git a/src/components/vm/nics/vmNicsCard.jsx b/src/components/vm/nics/vmNicsCard.jsx index ac378fee0..90b6bf81b 100644 --- a/src/components/vm/nics/vmNicsCard.jsx +++ b/src/components/vm/nics/vmNicsCard.jsx @@ -18,6 +18,8 @@ */ import React from 'react'; import PropTypes from 'prop-types'; +import { Button } from "@patternfly/react-core/dist/esm/components/Button"; +import { DescriptionList, DescriptionListDescription, DescriptionListGroup, DescriptionListTerm } from "@patternfly/react-core/dist/esm/components/DescriptionList"; import { Dropdown, KebabToggle } from "@patternfly/react-core/dist/esm/deprecated/components/Dropdown"; import { Flex, FlexItem } from "@patternfly/react-core/dist/esm/layouts/Flex"; import { Tooltip } from "@patternfly/react-core/dist/esm/components/Tooltip"; @@ -124,13 +126,46 @@ const NetworkSource = ({ network, networkId, vm, hostDevices }) => { }; }; - const singleSourceElem = source => checkDeviceAviability(source) ? : source; - const addressPortSourceElem = (source, networkId) => ( - - - - -
{_("Address")}{source.address}
{_("Port")}{source.port}
); + const singleSourceElem = source => { + let label = rephraseUI("networkType", network.type); + label = label.charAt(0).toUpperCase() + label.slice(1); + + return ( + + + {label} + + + + + {checkDeviceAviability(source) + ? + : source} + + {needsShutdownIfaceSource(vm, network) && } + + + + ); + }; + const addressPortSourceElem = source => (<> + + + {_("Address")} + + + {source.address} + + + + + {_("Port")} + + + {source.port} + + + ); const getSourceElem = { direct: singleSourceElem, @@ -142,16 +177,23 @@ const NetworkSource = ({ network, networkId, vm, hostDevices }) => { udp: addressPortSourceElem, }; - if (getSourceElem[network.type] !== undefined) { - return ( - - {getSourceElem[network.type](getIfaceSourceName(network), networkId)} - {needsShutdownIfaceSource(vm, network) && } - - ); - } else { - return null; - } + let source; + if (getSourceElem[network.type] !== undefined) + source = getSourceElem[network.type](getIfaceSourceName(network), networkId); + + return ( + + {source} + {network.target && + + {_("TAP device")} + + + {network.target} + + } + + ); }; export class VmNetworkTab extends React.Component { diff --git a/src/machines.scss b/src/machines.scss index 71b041db1..71bb2ccce 100644 --- a/src/machines.scss +++ b/src/machines.scss @@ -35,17 +35,6 @@ font-size: inherit; } -.machines-network-source-descr { - color: var(--ct-color-subtle-copy); - text-align: right; - padding: 5px 10px !important; -} - -.machines-network-source-value { - padding: 5px 10px !important; - text-align: left !important; -} - .machines-listing-actions { display: flex; justify-content: flex-end; diff --git a/test/check-machines-nics b/test/check-machines-nics index a2ca61358..8d03f3710 100755 --- a/test/check-machines-nics +++ b/test/check-machines-nics @@ -59,6 +59,7 @@ class TestMachinesNICs(VirtualMachinesCase): b.wait_in_text("#vm-subVmTest1-network-1-type", "network") b.wait_in_text("#vm-subVmTest1-network-1-source", "default") + b.wait_in_text("#vm-subVmTest1-network-1-tapdevice", "vnet0") b.wait_in_text("#vm-subVmTest1-network-1-ipv4-address", "192.168.122.") b.wait_in_text("#vm-subVmTest1-network-1-state", "up") b.assert_pixels("#vm-subVmTest1-networks", @@ -72,10 +73,11 @@ class TestMachinesNICs(VirtualMachinesCase): self.deleteIface(1) # Test add network - m.execute("virsh attach-interface --domain subVmTest1 --type network --source default --model virtio --mac 52:54:00:4b:73:5f --config --live") + m.execute("virsh attach-interface --domain subVmTest1 --type network --source default --target vnet1 --model virtio --mac 52:54:00:4b:73:5f --config --live") b.wait_in_text("#vm-subVmTest1-network-1-type", "network") b.wait_in_text("#vm-subVmTest1-network-1-source", "default") + b.wait_in_text("#vm-subVmTest1-network-1-tapdevice", "vnet1") b.wait_in_text("#vm-subVmTest1-network-1-model", "virtio") b.wait_in_text("#vm-subVmTest1-network-1-mac", "52:54:00:4b:73:5f") b.wait_in_text("#vm-subVmTest1-network-1-ipv4-address", "192.168.122.") diff --git a/test/reference b/test/reference index d23242a0b..43cb33111 160000 --- a/test/reference +++ b/test/reference @@ -1 +1 @@ -Subproject commit d23242a0b7e7bdb197e39e43e3a4a0156f239b8b +Subproject commit 43cb33111209893b6cadfe260b190fc65268f649