mitchell852 commented on a change in pull request #4142: Allow IPv6 Only 
Caches, including monitoring and routing
URL: https://github.com/apache/trafficcontrol/pull/4142#discussion_r392449315
 
 

 ##########
 File path: 
traffic_portal/app/src/common/modules/form/server/FormServerController.js
 ##########
 @@ -158,6 +161,40 @@ var FormServerController = function(server, $scope, 
$location, $state, $uibModal
 
     $scope.hasPropertyError = formUtils.hasPropertyError;
 
+    $scope.oneInputHasPropertyError = formUtils.oneInputHasPropertyError;
+
+    $scope.elementId = '';
+
+    $scope.toggleIpAddressRequired = function(elementId) {
+        var elementToChange = elementId === 'ipAddress' ? 'ip6Address' : 
'ipAddress';
+
+        if (document.getElementById(elementId).value === '') {
+            document.getElementById(elementToChange).required = true;
+        } else {
+            document.getElementById(elementToChange).required = false;
+        }
+    };
+
+    $scope.toggleIpGatewayRequired = function(elementId) {
+        var elementToChange = elementId === 'ipGateway' ? 'ip6Gateway' : 
'ipGateway';
+
+        if (document.getElementById(elementId).value === '') {
+            document.getElementById(elementToChange).required = true;
+        } else {
+            document.getElementById(elementToChange).required = false;
+        }
+    };
+
+    $scope.isIPv4 = function() {
 
 Review comment:
   maybe you should rename these to hasIPv4 because this function is not really 
checking if it "IS" IPv4

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to