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
11window.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';
22            this.server_id = "Server 9.3.164.147";
23            this.last_updated = new Date();
24
25            this.loading = false;
26            this.server_unreachable = false;
27            this.loading_message = "";
28            this.showNavigation = false;
29            this.bodyStyle = {};
30            this.path = '';
31
32            this.setPowerOnState = function(){
33                this.server_state = Constants.HOST_STATE_TEXT.on;
34                this.server_status = Constants.HOST_STATE.on;
35            },
36
37            this.setPowerOffState = function(){
38                this.server_state = Constants.HOST_STATE_TEXT.off;
39                this.server_status = Constants.HOST_STATE.off;
40            },
41
42            this.setBootingState = function(){
43                this.server_state = Constants.HOST_STATE_TEXT.booting;
44                this.server_status = Constants.HOST_STATE.booting;
45            },
46
47            this.setUnreachableState = function(){
48                this.server_state = Constants.HOST_STATE_TEXT.unreachable;
49                this.server_status = Constants.HOST_STATE.unreachable;
50            }
51        }]);
52
53})(window.angular);