mirror of
https://github.com/nasa/openmct.git
synced 2025-03-21 03:25:44 +00:00
[Indicators] Add notion of indicators
Add indicators as a category-of-extension, utilized from the bottom bar to populate its contents. WTD-608.
This commit is contained in:
parent
03179284f4
commit
48bcb662c6
@ -42,6 +42,11 @@
|
||||
"key": "ViewSwitcherController",
|
||||
"implementation": "ViewSwitcherController.js",
|
||||
"depends": [ "$scope" ]
|
||||
},
|
||||
{
|
||||
"key": "BottomBarController",
|
||||
"implementation": "BottomBarController.js",
|
||||
"depends": [ "indicators[]" ]
|
||||
}
|
||||
],
|
||||
"directives": [
|
||||
|
@ -1,13 +1,23 @@
|
||||
<div class='abs bottom-bar ue-bottom-bar'>
|
||||
<div class='abs bottom-bar ue-bottom-bar' ng-controller="BottomBarController as bar">
|
||||
<div id='status' class='status-holder abs'>
|
||||
<div id='status_data_flow' class='status block data-flow'>
|
||||
<span class='ui-symbol status-indicator ok'>.</span>
|
||||
<span class='label'>Connected</span>
|
||||
<div ng-repeat="indicator in bar.getIndicators()"
|
||||
class='status block'
|
||||
ng-class='indicator.getClass()'>
|
||||
<span class="ui-symbol status-indicator"
|
||||
ng-class='indicator.getGlyphClass()'>
|
||||
{{indicator.getGlyph()}}
|
||||
</span>
|
||||
<span class="label"
|
||||
ng-class='indicator.getTextClass()'>
|
||||
{{indicator.getText()}}
|
||||
</span>
|
||||
<a href=''
|
||||
class="ui-symbol"
|
||||
ng-if="indicator.configure"
|
||||
ng-click="indicator.configure()">
|
||||
G
|
||||
</a>
|
||||
</div>
|
||||
<!--div id='status_data_connection' class='status block data-connection'>
|
||||
<span class='ui-symbol status-indicator caution'>D</span>
|
||||
<span class='label'>Connected CPU 0.1% / Mem 1.9%</span>
|
||||
</div-->
|
||||
</div>
|
||||
<!--mct-include key="'app-logo'"></mct-include-->
|
||||
</div>
|
36
platform/commonUI/general/src/BottomBarController.js
Normal file
36
platform/commonUI/general/src/BottomBarController.js
Normal file
@ -0,0 +1,36 @@
|
||||
/*global define*/
|
||||
|
||||
define(
|
||||
[],
|
||||
function () {
|
||||
"use strict";
|
||||
|
||||
/**
|
||||
* Controller for the bottombar template. Exposes
|
||||
* available indicators (of extension category "indicators")
|
||||
* @constructor
|
||||
*/
|
||||
function BottomBarController(indicators) {
|
||||
// Utility function used to instantiate indicators
|
||||
// from their injected constructors.
|
||||
function instantiate(Indicator) {
|
||||
return new Indicator();
|
||||
}
|
||||
|
||||
indicators = indicators.map(instantiate);
|
||||
|
||||
return {
|
||||
/**
|
||||
* Get all indicators to display.
|
||||
* @returns {Indicator[]} all indicators
|
||||
* to display in the bottom bar.
|
||||
*/
|
||||
getIndicators: function () {
|
||||
return indicators;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return BottomBarController;
|
||||
}
|
||||
);
|
Loading…
x
Reference in New Issue
Block a user