Add Redfish into the web-ui
Currently only GET is supported, but to add PATCH
in the future for redfish, support should be moved from
being hosted directly by bmcweb into the webui.
Tested-by:
Navigated to http://localhost:8080/#/redfish/v1/ with
bmc attached and was able to view all of redfish. Also
tested on platform.
Change-Id: I1dc3936b6b48835a1f69698fcb4fd6fcdb6d91ac
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/app/redfish/controllers/redfish-controller.js b/app/redfish/controllers/redfish-controller.js
new file mode 100644
index 0000000..dcfa6d7
--- /dev/null
+++ b/app/redfish/controllers/redfish-controller.js
@@ -0,0 +1,39 @@
+/**
+ * Controller for Redfish
+ *
+ * @module app/redfish
+ * @exports redfishController
+ * @name redfishController
+ * @version 0.1.0
+ */
+
+window.angular && (function(angular) {
+ 'use strict';
+
+ angular.module('app.redfish').controller('redfishController', [
+ '$scope', '$http', 'dataService', '$routeParams',
+ function($scope, $http, DataService, $routeParams) {
+ $scope.redfishData = {};
+ $scope.isObject = angular.isObject;
+ $scope.isArray = angular.isArray;
+ $scope.loading = true;
+ $http({
+ method: 'GET',
+ url: DataService.getHost() + '/redfish/' + $routeParams.path,
+ withCredentials: true
+ })
+ .then(
+ function(response) {
+ $scope.redfishData = response.data;
+ },
+ function(error) {
+ $scope.display_error = true;
+ console.log(error);
+ })
+ .finally(function() {
+ $scope.loading = false;
+ });
+ }
+
+ ]);
+})(angular);