blob: 7d77ec02f2eb129bfd376279d2b5481756a40656 [file] [log] [blame]
Iftekharul Islam99d199f2017-03-24 15:28:25 -05001/**
2 * common Constant service
3 *
4 * @module app/common/services/constants
5 * @exports Constants
6 * @name Constants
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('Constants', function () {
17 return {
18 LOGIN_CREDENTIALS: {
19 username: "test",
20 password: "testpass",
21 },
22 API_CREDENTIALS: {
Iftekharul Islamf2d74642017-07-10 16:42:14 -050023 host: 'https://9.3.181.15',
Iftekharul Islamc0161392017-06-14 15:46:15 -050024 mock_host: 'http://localhost:3000'
Iftekharul Islam99d199f2017-03-24 15:28:25 -050025 },
26 API_RESPONSE: {
27 ERROR_STATUS: 'error',
28 ERROR_MESSAGE: '401 Unauthorized',
29 SUCCESS_STATUS: 'ok',
30 SUCCESS_MESSAGE: '200 OK'
31 },
32 CHASSIS_POWER_STATE: {
33 on: 'On',
34 off: 'Off'
35 },
36 HOST_STATE_TEXT: {
37 on: 'Running',
38 off: 'Off',
39 booting: 'Quiesced',
40 unreachable: 'Unreachable'
41 },
42 HOST_STATE: {
43 on: 1,
44 off: -1,
45 booting: 0,
46 unreachable: -2
Iftekharul Islamcd789502017-04-19 14:37:55 -050047 },
48 LED_STATE: {
49 on: true,
50 off: false
51 },
52 LED_STATE_TEXT: {
53 on: 'on',
54 off: 'off'
55 },
56 SEVERITY_TO_PRIORITY_MAP:{
57 Informational: 'Low',
58 Error: 'High',
59 Warning: 'Medium'
60 },
61 PAGINATION: {
Iftekharul Islamf2d74642017-07-10 16:42:14 -050062 LOG_ITEMS_PER_PAGE: 25
Iftekharul Islamd2269e22017-05-02 09:32:45 -050063 },
Iftekharul Islamee27d752017-07-05 15:54:31 -050064 HARDWARE: {
65 component_key_filter: '/xyz/openbmc_project/inventory/system',
66 parent_components: [
67 /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\//
68 ],
69 uppercase_titles: [
70 'cpu', 'dimm'
71 ]
72 },
Iftekharul Islamd2269e22017-05-02 09:32:45 -050073 SENSOR_DATA_TEMPLATE: {
74 sensors: [
75 {
76 type: 'fan',
77 title: 'Fan Speed',
78 key_search: 'fan_tach',
79 display_headers: ['Fan Speed(RPM)', 'Reading', 'State'],
80 sensor_row: {
81 title: 'Fan Speed ',
82 reading: ' rpms',
83 status: '',
84 indicator: ''
85 }
86 },
87 {
88 type: 'temperature',
89 title: 'Temperature',
90 'key_search': 'temperature',
91 display_headers: ['Temperature (DegreesC)', 'Reading', 'State'],
92 sensor_row: {
93 title: 'Temperature ',
94 reading: ' degreeC',
95 status: '',
96 indicator: ''
97 }
98 },
99 {
100 type: 'altitude',
101 title: 'Altitude',
102 'key_search': 'altitude',
103 display_headers: ['Altitude (Meters)', 'Reading', 'State'],
104 sensor_row: {
105 title: 'Altitude ',
106 reading: ' Meters',
107 status: '',
108 indicator: ''
109 }
110 },
111 {
112 type: 'voltage',
113 title: 'Voltage',
114 'key_search': 'voltage',
115 display_headers: ['Temperature (Volts)', 'Reading', 'State'],
116 sensor_row: {
117 title: 'Voltage ',
118 reading: ' volts',
119 status: '',
120 indicator: ''
121 }
122 },
123 {
124 type: 'current',
125 title: 'Current',
126 'key_search': 'current',
127 display_headers: ['Current (Amperes)', 'Reading', 'State'],
128 sensor_row: {
129 title: 'Current ',
130 reading: ' amperes',
131 status: '',
132 indicator: ''
133 }
134 },
135 {
136 type: 'power',
137 title: 'Power',
138 'key_search': 'power',
139 display_headers: ['Power (Watts)', 'Reading', 'State'],
140 sensor_row: {
141 title: 'Power ',
142 reading: ' watts',
143 status: '',
144 indicator: ''
145 }
146 },
147 {
148 type: 'energy',
149 title: 'Energy',
150 'key_search': 'energy',
151 display_headers: ['Energy (Joules)', 'Reading', 'State'],
152 sensor_row: {
153 title: 'Energy ',
154 reading: ' joules',
155 status: '',
156 indicator: ''
157 }
158 }
159 ]
Iftekharul Islam99d199f2017-03-24 15:28:25 -0500160 }
161 };
162 });
163
Iftekharul Islamcd789502017-04-19 14:37:55 -0500164})(window.angular);