blob: 5a95e644335d9cc98395aa8e17fe5552636105d9 [file] [log] [blame]
Iftekharul Islam99d199f2017-03-24 15:28:25 -05001/**
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) {
Michael Davis09209382017-07-31 18:27:49 -050017 this.app_version = "V.0.0.1";
Iftekharul Islam99d199f2017-03-24 15:28:25 -050018 this.server_health = 'Error';
19 this.server_state = 'Unreachable';
20 this.server_status = -2;
21 this.chassis_state = 'On';
Michael Davisdfad5d52017-07-20 14:53:46 -050022<<<<<<< HEAD
Iftekharul Islamcd789502017-04-19 14:37:55 -050023 this.LED_state = Constants.LED_STATE_TEXT.off;
24 this.server_id = Constants.API_CREDENTIALS.host.replace(/[^\d]+/m,"");
Michael Davisdfad5d52017-07-20 14:53:46 -050025=======
26 this.server_id = "Server 9.3.164.147";
27>>>>>>> 4c1a3dd... Major update to code structure
Iftekharul Islam99d199f2017-03-24 15:28:25 -050028 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 Davisdfad5d52017-07-20 14:53:46 -050036<<<<<<< HEAD
Iftekharul Islamd2269e22017-05-02 09:32:45 -050037 this.sensorData = [];
Michael Davisdfad5d52017-07-20 14:53:46 -050038=======
39>>>>>>> 4c1a3dd... Major update to code structure
Iftekharul Islam99d199f2017-03-24 15:28:25 -050040
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);