Only update SNMP fields if changed
Use ng-change to determine if the SNMP fields, Address and Port,
have changed and should be updated.
Tested: Only see the rest calls when the fields have changed.
Change-Id: I324c9c422a8b6dfb8816925167953e16099f8044
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/app/configuration/controllers/snmp-controller.html b/app/configuration/controllers/snmp-controller.html
index 3fd9aa3..f4b7279 100644
--- a/app/configuration/controllers/snmp-controller.html
+++ b/app/configuration/controllers/snmp-controller.html
@@ -12,11 +12,11 @@
<div class="snmp__managers" ng-repeat="manager in managers track by $index">
<div class="snmp__manager-field">
<label>SNMP Manager Server</label>
- <input class="inline" id="snmp-manager{{$index+1}}-address" type="text" ng-model="manager.address" ng-blur="managers[$index].address = manager.address"/>
+ <input class="inline" id="snmp-manager{{$index+1}}-address" ng-change="manager.update_address = true" type="text" ng-model="manager.address" ng-blur="managers[$index].address = manager.address"/>
</div>
<div class="snmp__manager-field">
<label>Port</label>
- <input class="inline" id="snmp-manager{{$index+1}}-port" type="text" ng-model="manager.port" ng-blur="managers[$index].port = manager.port"/>
+ <input class="inline" id="snmp-manager{{$index+1}}-port" type="text" ng-change="manager.update_port = true" ng-model="manager.port" ng-blur="managers[$index].port = manager.port"/>
</div>
<button class="snmp__manager-remove" ng-click="removeSNMPManager($index)">Remove</button>
</div>