Create new SNMP Settings page
Created new page to display SNMP Managers.
Display the SNMP Manager's IP and port.
https://github.com/openbmc/phosphor-snmp/blob/master/docs/snmp-configuration.md
Future commits will allow the user to add and delete SNMP
managers.
Change-Id: Ia5d633c11728a580c06b25c412e8673925cdc597
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
new file mode 100644
index 0000000..001aae6
--- /dev/null
+++ b/app/configuration/controllers/snmp-controller.html
@@ -0,0 +1,19 @@
+<loader loading="loading"></loader>
+<div id="configuration-snmp">
+ <div class="row column">
+ <h1>SNMP settings</h1>
+ </div>
+ <form class="snmp__form" role="form" action="">
+ <section class="row column">
+ <div class="page-header">
+ <h2 class="bold h4">SNMP information</h2>
+ </div>
+ <fieldset>
+ <div class="snmp__managers" ng-repeat="manager in managers track by $index">
+ <label>SNMP Manager {{$index+1}}</label>
+ <field>{{manager.Address}}:{{manager.Port}}</field>
+ </div>
+ </fieldset>
+ </section>
+ </form>
+</div>
diff --git a/app/configuration/controllers/snmp-controller.js b/app/configuration/controllers/snmp-controller.js
new file mode 100644
index 0000000..4b82334
--- /dev/null
+++ b/app/configuration/controllers/snmp-controller.js
@@ -0,0 +1,31 @@
+/**
+ * Controller for SNMP
+ *
+ * @module app/configuration
+ * @exports snmpController
+ * @name snmpController
+ */
+
+window.angular && (function(angular) {
+ 'use strict';
+
+ angular.module('app.configuration').controller('snmpController', [
+ '$scope', '$window', 'APIUtils',
+ function($scope, $window, APIUtils) {
+ $scope.managers = {};
+ $scope.loading = true;
+
+ var getSNMPManagers = APIUtils.getSNMPManagers().then(
+ function(data) {
+ $scope.managers = data.data;
+ },
+ function(error) {
+ console.log(JSON.stringify(error));
+ });
+
+ getSNMPManagers.finally(function() {
+ $scope.loading = false;
+ });
+ }
+ ]);
+})(angular);
diff --git a/app/configuration/index.js b/app/configuration/index.js
index e9bab01..b418295 100644
--- a/app/configuration/index.js
+++ b/app/configuration/index.js
@@ -30,6 +30,11 @@
'controller': 'networkController',
authenticated: true
})
+ .when('/configuration/snmp', {
+ 'template': require('./controllers/snmp-controller.html'),
+ 'controller': 'snmpController',
+ authenticated: true
+ })
.when('/configuration/firmware', {
'template': require('./controllers/firmware-controller.html'),
'controller': 'firmwareController',
diff --git a/app/configuration/styles/index.scss b/app/configuration/styles/index.scss
index da10ecc..e532583 100644
--- a/app/configuration/styles/index.scss
+++ b/app/configuration/styles/index.scss
@@ -1,3 +1,4 @@
@import "./network.scss";
+@import "./snmp.scss";
@import "./date-time.scss";
@import "./firmware.scss";
diff --git a/app/configuration/styles/snmp.scss b/app/configuration/styles/snmp.scss
new file mode 100644
index 0000000..00dd40b
--- /dev/null
+++ b/app/configuration/styles/snmp.scss
@@ -0,0 +1,13 @@
+// SNMP SCSS
+
+.snmp__form {
+
+ fieldset {
+ padding-left: 1.8em;
+ padding-bottom: 1.8em;
+ border-bottom: 1px solid $medgrey;
+ }
+ .snmp__managers {
+ padding-bottom: 1em;
+ }
+}