summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/configuration/controllers/network-controller.html17
-rw-r--r--app/configuration/controllers/network-controller.js4
-rw-r--r--app/configuration/styles/network.scss9
3 files changed, 23 insertions, 7 deletions
diff --git a/app/configuration/controllers/network-controller.html b/app/configuration/controllers/network-controller.html
index 4bc210a..39a708a 100644
--- a/app/configuration/controllers/network-controller.html
+++ b/app/configuration/controllers/network-controller.html
@@ -73,13 +73,16 @@
<h2 class="inline h4">DNS settings</h2>
</div>
<fieldset>
- <div class="column small-12 large-4">
- <!-- Call Nameservers "DNS Servers" on the GUI -->
- <fieldset class="net-config__static-ip-wrap" ng-repeat="dns in interface.Nameservers track by $index">
- <label for="net-config__prime-dns{{$index+1}}">DNS Server {{$index+1}}</label>
- <input id="net-config__prime-dns{{$index+1}}" type="text" ng-model="dns" ng-blur="interface.Nameservers[$index] = dns" set-focus-on-new-input//>
- </fieldset>
- <button type="button" class="btn-primary inline" ng-click="addDNSField()">Add new DNS server</button>
+ <!-- Call Nameservers "DNS Servers" on the GUI -->
+ <fieldset class="net-config__static-ip-wrap" ng-repeat="dns in interface.Nameservers track by $index">
+ <div class="column small-12">
+ <label for="net-config__prime-dns{{$index+1}}">DNS Server {{$index+1}}</label>
+ <input id="net-config__prime-dns{{$index+1}}" class="network-input column small-6 large-4 inline" type="text" ng-model="dns" ng-blur="interface.Nameservers[$index] = dns" set-focus-on-new-input//>
+ <button class="dns__server-remove inline" ng-click="removeDNSField($index)">Remove</button>
+ </div>
+ </fieldset>
+ <div class="column small-12">
+ <button type="button" class="btn-primary inline dns_add" ng-click="addDNSField()">Add new DNS server</button>
</div>
</fieldset>
<div class="network-config__submit-wrapper">
diff --git a/app/configuration/controllers/network-controller.js b/app/configuration/controllers/network-controller.js
index 9bec746..4d11ae5 100644
--- a/app/configuration/controllers/network-controller.js
+++ b/app/configuration/controllers/network-controller.js
@@ -39,6 +39,10 @@ window.angular && (function(angular) {
$scope.interface.Nameservers.push('');
};
+ $scope.removeDNSField = function(index) {
+ $scope.interface.Nameservers.splice(index, 1);
+ };
+
$scope.setNetworkSettings = function() {
// Hides the confirm network settings modal
$scope.confirm_settings = false;
diff --git a/app/configuration/styles/network.scss b/app/configuration/styles/network.scss
index 26653fd..db32e98 100644
--- a/app/configuration/styles/network.scss
+++ b/app/configuration/styles/network.scss
@@ -47,4 +47,13 @@
{
margin-left: 3em;
}
+ .dns__server-remove {
+ color: $medblue;
+ height: 2.1em;
+ opacity: 1;
+ margin-left: 1em;
+ &:hover {
+ cursor: pointer;
+ }
+ }
}
OpenPOWER on IntegriCloud