Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Controller for network |
| 3 | * |
| 4 | * @module app/configuration |
| 5 | * @exports networkController |
| 6 | * @name networkController |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 7 | */ |
| 8 | |
Andrew Geissler | ba5e3f3 | 2018-05-24 10:58:00 -0700 | [diff] [blame] | 9 | window.angular && (function(angular) { |
| 10 | 'use strict'; |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 11 | |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 12 | angular.module('app.configuration').controller('networkController', [ |
Gunnar Mills | 0af165b | 2018-06-01 16:24:56 -0500 | [diff] [blame] | 13 | '$scope', '$window', 'APIUtils', 'dataService', '$timeout', '$route', '$q', |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 14 | 'ngToast', |
| 15 | function( |
| 16 | $scope, $window, APIUtils, dataService, $timeout, $route, $q, ngToast) { |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 17 | $scope.dataService = dataService; |
| 18 | $scope.network = {}; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 19 | $scope.oldInterface = {}; |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 20 | $scope.interface = {}; |
| 21 | $scope.networkDevice = false; |
| 22 | $scope.hostname = ''; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 23 | $scope.defaultGateway = ''; |
Gunnar Mills | 7ddc727 | 2018-04-12 16:12:03 -0500 | [diff] [blame] | 24 | $scope.selectedInterface = ''; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 25 | $scope.confirmSettings = false; |
Gunnar Mills | 84981f0 | 2018-05-31 15:19:01 -0500 | [diff] [blame] | 26 | $scope.loading = false; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 27 | $scope.ipv4sToDelete = []; |
Iftekharul Islam | 2a48955 | 2017-11-02 13:23:08 -0500 | [diff] [blame] | 28 | |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 29 | loadNetworkInfo(); |
| 30 | |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 31 | $scope.selectInterface = function(interfaceId) { |
| 32 | $scope.interface = $scope.network.interfaces[interfaceId]; |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 33 | // Copy the interface so we know later if changes were made to the page |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 34 | $scope.oldInterface = JSON.parse(JSON.stringify($scope.interface)); |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 35 | $scope.selectedInterface = interfaceId; |
| 36 | $scope.networkDevice = false; |
| 37 | }; |
Gunnar Mills | bc3ab72 | 2018-07-10 15:11:01 -0500 | [diff] [blame] | 38 | |
| 39 | $scope.addDNSField = function() { |
| 40 | $scope.interface.Nameservers.push(''); |
| 41 | }; |
| 42 | |
beccabroek | cff6150 | 2018-09-13 14:39:23 -0500 | [diff] [blame] | 43 | $scope.removeDNSField = function(index) { |
| 44 | $scope.interface.Nameservers.splice(index, 1); |
| 45 | }; |
| 46 | |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 47 | $scope.addIpv4Field = function() { |
| 48 | $scope.interface.ipv4.values.push( |
| 49 | {Address: '', PrefixLength: '', Gateway: ''}); |
| 50 | }; |
| 51 | |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 52 | $scope.removeIpv4Address = function(index) { |
| 53 | // Check if the IPV4 being removed has an id. This indicates that it is |
| 54 | // an existing address and needs to be removed in the back end. |
| 55 | if ($scope.interface.ipv4.values[index].id) { |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 56 | $scope.ipv4sToDelete.push($scope.interface.ipv4.values[index]); |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 57 | } |
| 58 | $scope.interface.ipv4.values.splice(index, 1); |
| 59 | }; |
| 60 | |
Gunnar Mills | 7ddc727 | 2018-04-12 16:12:03 -0500 | [diff] [blame] | 61 | $scope.setNetworkSettings = function() { |
Gunnar Mills | d01504c | 2018-05-03 13:01:51 -0500 | [diff] [blame] | 62 | // Hides the confirm network settings modal |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 63 | $scope.confirmSettings = false; |
Gunnar Mills | 84981f0 | 2018-05-31 15:19:01 -0500 | [diff] [blame] | 64 | $scope.loading = true; |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 65 | var promises = []; |
| 66 | |
Gunnar Mills | 659651e | 2018-05-30 15:21:07 -0500 | [diff] [blame] | 67 | // MAC Address are case-insensitive |
| 68 | if ($scope.interface.MACAddress.toLowerCase() != |
| 69 | dataService.mac_address.toLowerCase()) { |
| 70 | promises.push(setMACAddress()); |
| 71 | } |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 72 | if ($scope.defaultGateway != dataService.defaultgateway) { |
Gunnar Mills | 659651e | 2018-05-30 15:21:07 -0500 | [diff] [blame] | 73 | promises.push(setDefaultGateway()); |
| 74 | } |
| 75 | if ($scope.hostname != dataService.hostname) { |
| 76 | promises.push(setHostname()); |
| 77 | } |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 78 | if ($scope.interface.DHCPEnabled != $scope.oldInterface.DHCPEnabled) { |
Gunnar Mills | cb2c306 | 2018-05-31 13:13:30 -0500 | [diff] [blame] | 79 | promises.push(setDHCPEnabled()); |
| 80 | } |
Gunnar Mills | 309e06a | 2018-05-30 13:18:10 -0500 | [diff] [blame] | 81 | |
Gunnar Mills | 8265829 | 2018-06-06 16:51:32 -0500 | [diff] [blame] | 82 | // Remove any empty strings from the array. Important because we add an |
| 83 | // empty string to the end so the user can add a new DNS server, if the |
| 84 | // user doesn't fill out the field, we don't want to add. |
| 85 | $scope.interface.Nameservers = |
| 86 | $scope.interface.Nameservers.filter(Boolean); |
Gunnar Mills | 0646782 | 2018-06-06 15:43:18 -0500 | [diff] [blame] | 87 | // toString() is a cheap way to compare 2 string arrays |
| 88 | if ($scope.interface.Nameservers.toString() != |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 89 | $scope.oldInterface.Nameservers.toString()) { |
Gunnar Mills | 0646782 | 2018-06-06 15:43:18 -0500 | [diff] [blame] | 90 | promises.push(setNameservers()); |
| 91 | } |
| 92 | |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 93 | // Set IPV4 IP Addresses, Netmask Prefix Lengths, and Gateways |
| 94 | if (!$scope.interface.DHCPEnabled) { |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 95 | // Delete existing IPV4 addresses that were removed |
| 96 | promises.push(removeIPV4s()); |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 97 | // Update any changed IPV4 addresses and add new |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 98 | for (var i in $scope.interface.ipv4.values) { |
Gunnar Mills | 6549114 | 2018-06-04 14:23:33 -0500 | [diff] [blame] | 99 | if (!APIUtils.validIPV4IP( |
| 100 | $scope.interface.ipv4.values[i].Address)) { |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 101 | ngToast.danger( |
| 102 | $scope.interface.ipv4.values[i].Address + |
| 103 | ' invalid IP parameter'); |
Gunnar Mills | 6549114 | 2018-06-04 14:23:33 -0500 | [diff] [blame] | 104 | $scope.loading = false; |
| 105 | return; |
| 106 | } |
| 107 | if (!APIUtils.validIPV4IP( |
| 108 | $scope.interface.ipv4.values[i].Gateway)) { |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 109 | ngToast.danger( |
| 110 | $scope.interface.ipv4.values[i].Address + |
| 111 | ' invalid gateway parameter'); |
Gunnar Mills | 6549114 | 2018-06-04 14:23:33 -0500 | [diff] [blame] | 112 | $scope.loading = false; |
| 113 | return; |
| 114 | } |
| 115 | // The netmask prefix length will be undefined if outside range |
| 116 | if (!$scope.interface.ipv4.values[i].PrefixLength) { |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 117 | ngToast.danger( |
| 118 | $scope.interface.ipv4.values[i].Address + |
| 119 | ' invalid Prefix Length parameter'); |
Gunnar Mills | 6549114 | 2018-06-04 14:23:33 -0500 | [diff] [blame] | 120 | $scope.loading = false; |
| 121 | return; |
| 122 | } |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 123 | if ($scope.interface.ipv4.values[i].updateAddress || |
| 124 | $scope.interface.ipv4.values[i].updateGateway || |
| 125 | $scope.interface.ipv4.values[i].updatePrefix) { |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 126 | // If IPV4 has an id it means it already exists in the back end, |
| 127 | // and in order to update it is required to remove previous IPV4 |
| 128 | // address and add new one. See openbmc/openbmc/issues/2163. |
| 129 | // TODO: update to use PUT once issue 2163 is resolved. |
| 130 | if ($scope.interface.ipv4.values[i].id) { |
| 131 | promises.push(updateIPV4(i)); |
| 132 | } else { |
| 133 | promises.push(addIPV4(i)); |
| 134 | } |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 135 | } |
| 136 | } |
| 137 | } |
| 138 | |
Gunnar Mills | 0af165b | 2018-06-01 16:24:56 -0500 | [diff] [blame] | 139 | if (promises.length) { |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 140 | $q.all(promises).then( |
| 141 | function(response) { |
| 142 | // Since an IPV4 interface (e.g. IP address, gateway, or |
| 143 | // netmask) edit is a delete then an add and the GUI can't |
| 144 | // calculate the interface id (e.g. 5c083707) beforehand and it |
| 145 | // is not returned by the REST call, openbmc#3227, reload the |
| 146 | // page after an edit, which makes a 2nd REST call. Do this for |
| 147 | // all network changes due to the possibility of a set network |
| 148 | // failing even though it returned success, openbmc#1641, and to |
| 149 | // update dataService and oldInterface to know which data has |
| 150 | // changed if the user continues to edit network settings. |
| 151 | // TODO: The reload is not ideal. Revisit this. |
| 152 | $timeout(function() { |
| 153 | loadNetworkInfo(); |
| 154 | $scope.loading = false; |
| 155 | ngToast.success('Network settings saved'); |
| 156 | }, 4000); |
| 157 | }, |
| 158 | function(error) { |
| 159 | $scope.loading = false; |
| 160 | ngToast.danger('Network settings could not be saved'); |
| 161 | }) |
Gunnar Mills | 0af165b | 2018-06-01 16:24:56 -0500 | [diff] [blame] | 162 | } else { |
Gunnar Mills | 84981f0 | 2018-05-31 15:19:01 -0500 | [diff] [blame] | 163 | $scope.loading = false; |
Gunnar Mills | 0af165b | 2018-06-01 16:24:56 -0500 | [diff] [blame] | 164 | } |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 165 | }; |
| 166 | |
| 167 | function setMACAddress() { |
| 168 | return APIUtils |
Gunnar Mills | 7ddc727 | 2018-04-12 16:12:03 -0500 | [diff] [blame] | 169 | .setMACAddress( |
| 170 | $scope.selectedInterface, $scope.interface.MACAddress) |
| 171 | .then( |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 172 | function(data) {}, |
Gunnar Mills | 7ddc727 | 2018-04-12 16:12:03 -0500 | [diff] [blame] | 173 | function(error) { |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 174 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 175 | return $q.reject(); |
Gunnar Mills | 7ddc727 | 2018-04-12 16:12:03 -0500 | [diff] [blame] | 176 | }); |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | function setDefaultGateway() { |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 180 | return APIUtils.setDefaultGateway($scope.defaultGateway) |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 181 | .then( |
| 182 | function(data) {}, |
| 183 | function(error) { |
| 184 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 185 | return $q.reject(); |
Gunnar Mills | dca79d7 | 2018-05-30 13:07:01 -0500 | [diff] [blame] | 186 | }); |
| 187 | } |
Gunnar Mills | 309e06a | 2018-05-30 13:18:10 -0500 | [diff] [blame] | 188 | |
| 189 | function setHostname() { |
| 190 | return APIUtils.setHostname($scope.hostname) |
| 191 | .then( |
| 192 | function(data) {}, |
| 193 | function(error) { |
| 194 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 195 | return $q.reject(); |
Gunnar Mills | 309e06a | 2018-05-30 13:18:10 -0500 | [diff] [blame] | 196 | }); |
| 197 | } |
| 198 | |
Gunnar Mills | cb2c306 | 2018-05-31 13:13:30 -0500 | [diff] [blame] | 199 | function setDHCPEnabled() { |
| 200 | return APIUtils |
| 201 | .setDHCPEnabled( |
| 202 | $scope.selectedInterface, $scope.interface.DHCPEnabled) |
| 203 | .then( |
| 204 | function(data) {}, |
| 205 | function(error) { |
| 206 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 207 | return $q.reject(); |
Gunnar Mills | cb2c306 | 2018-05-31 13:13:30 -0500 | [diff] [blame] | 208 | }); |
| 209 | } |
| 210 | |
Gunnar Mills | 0646782 | 2018-06-06 15:43:18 -0500 | [diff] [blame] | 211 | function setNameservers() { |
Gunnar Mills | 8265829 | 2018-06-06 16:51:32 -0500 | [diff] [blame] | 212 | // Nameservers does not allow an empty array, since we remove all empty |
Gunnar Mills | 9863d12 | 2018-07-11 13:36:43 -0500 | [diff] [blame] | 213 | // strings above, could have an empty array. TODO: openbmc/openbmc#3240 |
Gunnar Mills | 8265829 | 2018-06-06 16:51:32 -0500 | [diff] [blame] | 214 | if ($scope.interface.Nameservers.length == 0) { |
| 215 | $scope.interface.Nameservers.push(''); |
| 216 | } |
Gunnar Mills | 0646782 | 2018-06-06 15:43:18 -0500 | [diff] [blame] | 217 | return APIUtils |
| 218 | .setNameservers( |
| 219 | $scope.selectedInterface, $scope.interface.Nameservers) |
| 220 | .then( |
| 221 | function(data) {}, |
| 222 | function(error) { |
| 223 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 224 | return $q.reject(); |
Gunnar Mills | 0646782 | 2018-06-06 15:43:18 -0500 | [diff] [blame] | 225 | }); |
| 226 | } |
| 227 | |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 228 | function removeIPV4s() { |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 229 | return $scope.ipv4sToDelete.map(function(ipv4) { |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 230 | return APIUtils.deleteIPV4($scope.selectedInterface, ipv4.id) |
| 231 | .then( |
| 232 | function(data) {}, |
| 233 | function(error) { |
| 234 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 235 | return $q.reject(); |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 236 | }) |
| 237 | }); |
| 238 | } |
| 239 | |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 240 | function addIPV4(index) { |
| 241 | return APIUtils |
| 242 | .addIPV4( |
| 243 | $scope.selectedInterface, |
| 244 | $scope.interface.ipv4.values[index].Address, |
| 245 | $scope.interface.ipv4.values[index].PrefixLength, |
| 246 | $scope.interface.ipv4.values[index].Gateway) |
| 247 | .then( |
| 248 | function(data) {}, |
| 249 | function(error) { |
| 250 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 251 | return $q.reject(); |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 252 | }) |
| 253 | } |
| 254 | |
| 255 | function updateIPV4(index) { |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 256 | // The correct way to edit an IPV4 interface is to remove it and then |
| 257 | // add a new one |
| 258 | return APIUtils |
| 259 | .deleteIPV4( |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 260 | $scope.selectedInterface, |
| 261 | $scope.interface.ipv4.values[index].id) |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 262 | .then( |
| 263 | function(data) { |
| 264 | return APIUtils |
| 265 | .addIPV4( |
| 266 | $scope.selectedInterface, |
| 267 | $scope.interface.ipv4.values[index].Address, |
| 268 | $scope.interface.ipv4.values[index].PrefixLength, |
| 269 | $scope.interface.ipv4.values[index].Gateway) |
| 270 | .then( |
| 271 | function(data) {}, |
| 272 | function(error) { |
| 273 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 274 | return $q.reject(); |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 275 | }); |
| 276 | }, |
| 277 | function(error) { |
| 278 | console.log(JSON.stringify(error)); |
beccabroek | 9a3b542 | 2019-01-15 14:45:12 -0600 | [diff] [blame] | 279 | return $q.reject(); |
Gunnar Mills | a45c385 | 2018-05-30 16:18:45 -0500 | [diff] [blame] | 280 | }); |
| 281 | } |
| 282 | |
Gunnar Mills | 9a0094d | 2018-05-02 21:50:56 -0500 | [diff] [blame] | 283 | $scope.refresh = function() { |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 284 | loadNetworkInfo(); |
Gunnar Mills | 9a0094d | 2018-05-02 21:50:56 -0500 | [diff] [blame] | 285 | }; |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 286 | |
| 287 | function loadNetworkInfo() { |
| 288 | APIUtils.getNetworkInfo().then(function(data) { |
| 289 | dataService.setNetworkInfo(data); |
| 290 | $scope.network = data.formatted_data; |
| 291 | $scope.hostname = data.hostname; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 292 | $scope.defaultGateway = data.defaultgateway; |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 293 | if ($scope.network.interface_ids.length) { |
Rebecca Shaw | ffdef96 | 2018-07-19 13:37:37 -0500 | [diff] [blame] | 294 | // Use the first network interface if the user hasn't chosen one |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 295 | if (!$scope.selectedInterface || |
| 296 | !$scope.network.interfaces[$scope.selectedInterface]) { |
| 297 | $scope.selectedInterface = $scope.network.interface_ids[0]; |
| 298 | } |
| 299 | $scope.interface = |
| 300 | $scope.network.interfaces[$scope.selectedInterface]; |
| 301 | // Copy the interface so we know later if changes were made to the |
| 302 | // page |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 303 | $scope.oldInterface = JSON.parse(JSON.stringify($scope.interface)); |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 304 | } |
beccabroek | 1a0e7d0 | 2018-09-24 15:03:40 -0500 | [diff] [blame] | 305 | // Add id values and update flags to corresponding IPV4 objects |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 306 | for (var i = 0; i < $scope.interface.ipv4.values.length; i++) { |
| 307 | $scope.interface.ipv4.values[i].id = $scope.interface.ipv4.ids[i]; |
beccabroek | 067a1cd | 2018-10-05 10:25:21 -0500 | [diff] [blame] | 308 | $scope.interface.ipv4.values[i].updateAddress = false; |
| 309 | $scope.interface.ipv4.values[i].updateGateway = false; |
| 310 | $scope.interface.ipv4.values[i].updatePrefix = false; |
beccabroek | 971ac1a | 2018-09-24 13:14:05 -0500 | [diff] [blame] | 311 | } |
Gunnar Mills | a3f7532 | 2018-07-10 17:06:02 -0500 | [diff] [blame] | 312 | }); |
| 313 | } |
Andrew Geissler | d27bb13 | 2018-05-24 11:07:27 -0700 | [diff] [blame] | 314 | } |
| 315 | ]); |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 316 | })(angular); |