diff --git a/legacy/src/app/controllers/networks_list.js b/legacy/src/app/controllers/networks_list.js index 05b1ce45d7..234db1dde3 100644 --- a/legacy/src/app/controllers/networks_list.js +++ b/legacy/src/app/controllers/networks_list.js @@ -286,11 +286,18 @@ function NetworksListController( $scope.newObject = null; }; - // Return the name name for the VLAN. + // Return the short name for the VLAN. $scope.getVLANName = function(vlan) { return VLANsManager.getName(vlan); }; + // Return the full name for the VLAN. + $scope.getFullVLANName = function(vlan_id) { + var vlan = VLANsManager.getItemFromList(vlan_id); + var fabric = FabricsManager.getItemFromList(vlan.fabric); + return FabricsManager.getName(fabric) + "." + VLANsManager.getName(vlan); + }; + // Return the name of the fabric from its given ID. $scope.getFabricNameById = function(fabricId) { return FabricsManager.getName(FabricsManager.getItemFromList(fabricId)); @@ -310,6 +317,8 @@ function NetworksListController( if (vlan.dhcp_on) { return "MAAS-provided"; + } else if (vlan.relay_vlan) { + return "Relayed via " + $scope.getFullVLANName(vlan.relay_vlan); } return "No DHCP"; diff --git a/legacy/src/app/controllers/node_details.js b/legacy/src/app/controllers/node_details.js index 1cb9244c69..120dbbc08f 100644 --- a/legacy/src/app/controllers/node_details.js +++ b/legacy/src/app/controllers/node_details.js @@ -1519,6 +1519,13 @@ function NodeDetailsController( return text; }; + // Return the full name for the VLAN. + $scope.getFullVLANName = function(vlan_id) { + var vlan = VLANsManager.getItemFromList(vlan_id); + var fabric = FabricsManager.getItemFromList(vlan.fabric); + return FabricsManager.getName(fabric) + "." + VLANsManager.getName(vlan); + }; + $scope.getDHCPStatus = iface => { const { vlans } = $scope; const vlan = vlans.find(vlan => vlan.id === iface.vlan_id); @@ -1529,7 +1536,10 @@ function NodeDetailsController( if (vlan.dhcp_on) { return "MAAS-provided"; + } else if (vlan.relay_vlan) { + return "Relayed via " + $scope.getFullVLANName(vlan.relay_vlan); } + } return "No DHCP"; };