Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 1 | /** |
| 2 | * data service |
| 3 | * |
| 4 | * @module app/common/services/dataService |
| 5 | * @exports dataService |
| 6 | * @name dataService |
| 7 | |
| 8 | * @version 0.0.1 |
| 9 | */ |
| 10 | |
| 11 | window.angular && (function (angular) { |
| 12 | 'use strict'; |
| 13 | |
| 14 | angular |
| 15 | .module('app.common.services') |
| 16 | .service('dataService', ['Constants', function (Constants) { |
| 17 | this.app_version = "openBMC V.0.0.1"; |
| 18 | this.server_health = 'Error'; |
| 19 | this.server_state = 'Unreachable'; |
| 20 | this.server_status = -2; |
| 21 | this.chassis_state = 'On'; |
Michael Davis | dfad5d5 | 2017-07-20 14:53:46 -0500 | [diff] [blame] | 22 | <<<<<<< HEAD |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 23 | this.LED_state = Constants.LED_STATE_TEXT.off; |
| 24 | this.server_id = Constants.API_CREDENTIALS.host.replace(/[^\d]+/m,""); |
Michael Davis | dfad5d5 | 2017-07-20 14:53:46 -0500 | [diff] [blame] | 25 | ======= |
| 26 | this.server_id = "Server 9.3.164.147"; |
| 27 | >>>>>>> 4c1a3dd... Major update to code structure |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 28 | this.last_updated = new Date(); |
| 29 | |
| 30 | this.loading = false; |
| 31 | this.server_unreachable = false; |
| 32 | this.loading_message = ""; |
| 33 | this.showNavigation = false; |
| 34 | this.bodyStyle = {}; |
| 35 | this.path = ''; |
Michael Davis | dfad5d5 | 2017-07-20 14:53:46 -0500 | [diff] [blame] | 36 | <<<<<<< HEAD |
Iftekharul Islam | d2269e2 | 2017-05-02 09:32:45 -0500 | [diff] [blame] | 37 | this.sensorData = []; |
Michael Davis | dfad5d5 | 2017-07-20 14:53:46 -0500 | [diff] [blame] | 38 | ======= |
| 39 | >>>>>>> 4c1a3dd... Major update to code structure |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 40 | |
| 41 | this.setPowerOnState = function(){ |
| 42 | this.server_state = Constants.HOST_STATE_TEXT.on; |
| 43 | this.server_status = Constants.HOST_STATE.on; |
| 44 | }, |
| 45 | |
| 46 | this.setPowerOffState = function(){ |
| 47 | this.server_state = Constants.HOST_STATE_TEXT.off; |
| 48 | this.server_status = Constants.HOST_STATE.off; |
| 49 | }, |
| 50 | |
| 51 | this.setBootingState = function(){ |
| 52 | this.server_state = Constants.HOST_STATE_TEXT.booting; |
| 53 | this.server_status = Constants.HOST_STATE.booting; |
| 54 | }, |
| 55 | |
| 56 | this.setUnreachableState = function(){ |
| 57 | this.server_state = Constants.HOST_STATE_TEXT.unreachable; |
| 58 | this.server_status = Constants.HOST_STATE.unreachable; |
| 59 | } |
| 60 | }]); |
| 61 | |
| 62 | })(window.angular); |