diff options
| author | Gunnar Mills <gmills@us.ibm.com> | 2018-08-28 16:21:57 -0500 |
|---|---|---|
| committer | Gunnar Mills <gmills@us.ibm.com> | 2018-09-04 10:48:11 -0500 |
| commit | 9ddd9fdba960d6ee83b549d8bbaf2d78cedb2919 (patch) | |
| tree | b43926d5f7c604d0f62c7aafdebc6533dc87c1d1 /app/server-health | |
| parent | 46f573862ccf97268eb5e57e81be193853f1faf4 (diff) | |
| download | phosphor-webui-9ddd9fdba960d6ee83b549d8bbaf2d78cedb2919.tar.gz phosphor-webui-9ddd9fdba960d6ee83b549d8bbaf2d78cedb2919.zip | |
Remove unused sensors-controller
A 2nd sensors page was visible at server-health/sensors/:type.
This page was not reachable from the menu and did not work.
This page had several bugs flagged by sonar scanner.
Change-Id: Ib444fb398e49d469ba0693ba46856e0a5ac961d1
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'app/server-health')
| -rw-r--r-- | app/server-health/controllers/sensors-controller.html | 86 | ||||
| -rw-r--r-- | app/server-health/controllers/sensors-controller.js | 127 | ||||
| -rw-r--r-- | app/server-health/index.js | 5 |
3 files changed, 0 insertions, 218 deletions
diff --git a/app/server-health/controllers/sensors-controller.html b/app/server-health/controllers/sensors-controller.html deleted file mode 100644 index 8544ebb..0000000 --- a/app/server-health/controllers/sensors-controller.html +++ /dev/null @@ -1,86 +0,0 @@ -<div id="sensors"> - <div class="row column"> - <h1>Fan Speed Sensors</h1> - </div> - <section class="row column"> - <div class="page-header"> - <h2 class="inline h4">Sensors present in the system</h2> - <a ng-href="data:text/json;charset=utf-8,{{export_data}}" class="inline btn-export float-right" download="{{export_name}}" ng-show="filteredSensorData.length">Export</a> - </div> - </section> - - <!-- Filters --> - <section class="row column"> - <!-- search --> - <div class="content__search"> - <label for="content__search-input">Sensors Search</label> - <input id="content__search-input" type="text" placeholder="Filter issues" ng-model="customSearch" ng-keydown="doSearchOnEnter($event)"/> - <input id="content__search-submit" type="submit" class="btn btn-primary" value="Submit" ng-click="doSearchOnClick()"/> - </div> - - <div class="toggle-filter"> - <button class="inline first btn-primary" ng-click="toggleSeverityAll()" - ng-class="selectedSeverity.all ? 'btn-primary' : 'btn-secondary'">All - </button> - <button class="inline " ng-click="toggleSeverity('critical')" - ng-class="selectedSeverity.critical ? 'btn-primary' : 'btn-secondary'">Critical - </button> - <button class="inline" ng-click="toggleSeverity('warning')" - ng-class="selectedSeverity.warning ? 'btn-primary' : 'btn-secondary'">Warning - </button> - <button class="inline last" ng-click="toggleSeverity('normal')" - ng-class="selectedSeverity.normal ? 'btn-primary' : 'btn-secondary'">Normal - </button> - </div> - </section> <!-- end filter --> - - <section class="row column"> - <div id="back-link"> - <a href="#/server-health/sensors-overview">Back to Sensor Overview</a> - </div> - </section> - - <section id="sensor__details" class="row column" ng-hide="!data.display_headers"> - <div class="row column header-row"> - <div class="column small-10 large-11 header__actions-bar"> - <p class="inline priority-tag-circ" ng-class="{'high-priority': data.status == 'critical', 'medium-priority': data.status == 'warning', 'low-priority': data.status == 'normal'}" aria-label="High Priority"></p> - <p class="inline sensor__heading sensor__category">{{data.display_headers[0]}}</p> - <p class="inline sensor__heading middle">{{data.display_headers[1]}}</p> - <p class="inline float-right sensor__heading right">{{data.display_headers[2]}}</p> - </div> - <div class="column small-2 large-1 sensor__heading trigger-col"></div> - </div> - - <!-- Sensor --> - <div ng-repeat="sensor in (filteredSensorData = (data.data|filter:filterBySeverity|filter:filterBySearchTerms))" class="row column accord-row" ng-class="{'active': sensors__metadatarow, 'selected': sensors__selected}"> - <div class="row"> - <div class="column small-10 large-11 sensor__info" ng-click="sensors__metadatarow = ! sensors__metadatarow"> - <p class="inline priority-tag-circ" ng-class="{'high-priority': sensor.status == 'critical', 'medium-priority': sensor.status == 'warning', 'low-priority': sensor.status == 'normal'}" aria-label="High Priority"></p> - <p class="inline sensor__title">{{sensor.title}}</p> - <p class="inline sensor__reading">{{sensor.reading}}</p> - <p class="inline float-right" ng-class="{'sensor__critical-label': sensor.status == 'critical', 'sensor__warning-label': sensor.status == 'warning', 'sensor__normal-label': sensor.status == 'normal'}">{{sensor.status}}</p> - </div> - <div class="column small-2 large-1"> - <button class="accord-trigger" ng-class="{'active': sensors__metadatarow}" ng-click="sensors__metadatarow = ! sensors__metadatarow"></button> - </div> - </div> - <div class="row sensors__metadata-row" ng-class="{'active': sensors__metadatarow}"> - <div class="column small-12"> - <div class="threshold-chart__wrapper"> - <span class="threshold__label low">Low</span> - <div class="threshold-chart"> - <span class="threshold__marker" ng-class="{'thresh__high-critical': sensor.status == 'critical', 'thresh__low-warn': sensor.status == 'warning', 'thresh__normal': sensor.status == 'normal'}" style="left: {{sensor.indicator}};"><span class="threshold__value">{{sensor.reading}}</span></span> - <span class="threshold thresh__low-critical"></span> - <span class="threshold thresh__low-warn"></span> - <span class="threshold thresh__normal"></span> - <span class="threshold thresh__high-warn"></span> - <span class="threshold thresh__high-critical"></span> - </div> - <span class="threshold__label high">High</span> - </div> - </div> - </div> - </div> - - </section> -</div> <!-- end event log -->
\ No newline at end of file diff --git a/app/server-health/controllers/sensors-controller.js b/app/server-health/controllers/sensors-controller.js deleted file mode 100644 index b158dc0..0000000 --- a/app/server-health/controllers/sensors-controller.js +++ /dev/null @@ -1,127 +0,0 @@ -/** - * Controller for sensors - * - * @module app/serverHealth - * @exports sensorsController - * @name sensorsController - */ - -window.angular && (function(angular) { - 'use strict'; - var sensorData = []; - angular.module('app.overview').controller('sensorsController', [ - '$scope', '$log', '$window', 'APIUtils', 'dataService', '$routeParams', - function($scope, $log, $window, APIUtils, dataService, $routeParams) { - $scope.dataService = dataService; - $scope.customSearch = ''; - $scope.dropdown_selected = false; - $scope.$log = $log; - $scope.data = {}; - $scope.searchTerms = []; - - $scope.selectedSeverity = - {all: true, normal: false, warning: false, critical: false}; - - var sensorType = $routeParams.type; - - $scope.export_name = sensorType + '_sensors.json'; - - $scope.toggleSeverityAll = function() { - $scope.selectedSeverity.all = !$scope.selectedSeverity.all; - - if ($scope.selectedSeverity.all) { - $scope.selectedSeverity.normal = false; - $scope.selectedSeverity.warning = false; - $scope.selectedSeverity.critical = false; - } - }; - - $scope.toggleSeverity = function(severity) { - $scope.selectedSeverity[severity] = !$scope.selectedSeverity[severity]; - - if ($scope.selectedSeverity.normal && $scope.selectedSeverity.warning && - $scope.selectedSeverity.critical) { - $scope.selectedSeverity.all = true; - $scope.selectedSeverity.normal = false; - $scope.selectedSeverity.warning = false; - $scope.selectedSeverity.critical = false; - } else { - $scope.selectedSeverity.all = false; - } - }; - - $scope.doSearchOnEnter = function(event) { - var search = - $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, ''); - if (event.keyCode === 13 && search.length >= 2) { - $scope.searchTerms = $scope.customSearch.split(' '); - } else { - if (search.length == 0) { - $scope.searchTerms = []; - } - } - }; - - $scope.doSearchOnClick = function() { - var search = - $scope.customSearch.replace(/^\s+/g, '').replace(/\s+$/g, ''); - if (search.length >= 2) { - $scope.searchTerms = $scope.customSearch.split(' '); - } else { - if (search.length == 0) { - $scope.searchTerms = []; - } - } - }; - - $scope.jsonData = function(data) { - var dt = {}; - data.data.forEach(function(item) { - dt[item.original_data.key] = item.original_data.value; - }); - return JSON.stringify(dt); - }; - - $scope.filterBySeverity = function(sensor) { - if ($scope.selectedSeverity.all) return true; - - return ( - (sensor.severity_flags.normal && $scope.selectedSeverity.normal) || - (sensor.severity_flags.warning && - $scope.selectedSeverity.warning) || - (sensor.severity_flags.critical && - $scope.selectedSeverity.critical)); - }; - $scope.filterBySearchTerms = function(sensor) { - if (!$scope.searchTerms.length) return true; - - for (var i = 0, length = $scope.searchTerms.length; i < length; i++) { - if (sensor.search_text.indexOf($scope.searchTerms[i].toLowerCase()) == - -1) - return false; - } - return true; - }; - - function setSensorData() { - var data = dataService.sensorData.sensors.filter(function(item) { - return item.type == sensorType; - }); - if (data.length) { - sensorData = data[0]; - $scope.data = sensorData; - $scope.export_data = $scope.jsonData($scope.data); - } - } - - if (!dataService.sensorData.sensors) { - APIUtils.getAllSensorStatus(function(data, originalData) { - dataService.sensorData = data; - setSensorData(); - }); - } else { - setSensorData(); - } - } - ]); -})(angular); diff --git a/app/server-health/index.js b/app/server-health/index.js index 64e2255..088105b 100644 --- a/app/server-health/index.js +++ b/app/server-health/index.js @@ -42,11 +42,6 @@ window.angular && (function(angular) { 'controller': 'sensorsOverviewController', authenticated: true }) - .when('/server-health/sensors/:type', { - 'template': require('./controllers/sensors-controller.html'), - 'controller': 'sensorsController', - authenticated: true - }) .when('/server-health', { 'template': require('./controllers/log-controller.html'), 'controller': 'logController', |

