diff options
| author | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2019-10-24 07:02:12 -0700 |
|---|---|---|
| committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2019-11-14 07:04:27 -0800 |
| commit | 1ab0f7c1d59e3ccae14d92ba865ec52c53772ca2 (patch) | |
| tree | 3bbe46a589857d1c520942fdf9ebe6ec5fcccf8d /app/configuration/components | |
| parent | 432f02cd8355509a8a51fe2baf2097de78a831bf (diff) | |
| download | phosphor-webui-1ab0f7c1d59e3ccae14d92ba865ec52c53772ca2.tar.gz phosphor-webui-1ab0f7c1d59e3ccae14d92ba865ec52c53772ca2.zip | |
Create firmware-card component
Create reusable firmware card component that will be
used in the updated firmware page:
https://ibm.invisionapp.com/share/4XNZ0JAMJ7B#/screens/319212821_4-8-D-1_Home
Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com>
Change-Id: I86e526c59ac5c2e2c011aed0ce4bc3d82db63b5e
Diffstat (limited to 'app/configuration/components')
| -rw-r--r-- | app/configuration/components/card.js | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/app/configuration/components/card.js b/app/configuration/components/card.js new file mode 100644 index 0000000..863c079 --- /dev/null +++ b/app/configuration/components/card.js @@ -0,0 +1,51 @@ +window.angular && (function(angular) { + 'use strict'; + + /** + * + * firmwareCard Component + * + */ + + /** + * Component template + */ + const template = ` + <div class="card-component"> + <div class="card__header" + ng-class="{ + 'card__header--success' : $ctrl.status === 'success', + 'card__header--error' : $ctrl.status === 'error' }"> + <p class="card__header__label inline">{{$ctrl.headerLabel}}</p> + <p class="card__header__value inline">{{$ctrl.headerValue}}</p> + </div> + <div class="card__body" + ng-if="$ctrl.body"> + <div class="row"> + <div class="column small-6"> + <label>BMC Status</label> + {{$ctrl.bmcStatus || 'n/a'}} + </div> + <div class="column small-6"> + <label>Host status</label> + {{$ctrl.hostStatus || 'n/a'}} + </div> + </div> + </div> + </div>` + + /** + * Register firmwareCard component + */ + angular.module('app.configuration').component('firmwareCard', { + template, + bindings: { + headerLabel: '@', + headerValue: '<', + status: '<', // optional, 'success' or 'error' + body: '<', // boolean true to render body content + hostStatus: '<', + bmcStatus: '<' + } + }) +})(window.angular);
\ No newline at end of file |

