blob: 6418c320add59998d199b7096a478ac689b30e00 [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: {
Michael Davis83308992017-09-06 11:04:53 -050023 host: 'https://9.3.185.161',
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',
Michael Davis83308992017-09-06 11:04:53 -050039 booting: 'Standby',
Iftekharul Islam99d199f2017-03-24 15:28:25 -050040 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 },
Iftekharul Islam34714092017-09-06 10:45:27 -050056 SEVERITY_TO_HEALTH_MAP:{
57 Emergency: 'Critical',
58 Alert: 'Critical',
59 Critical: 'Critical',
60 Error: 'Warning',
61 Warning: 'Warning',
62 Notice: 'Good',
63 Debug: 'Good',
64 Informational: 'Good'
65 },
Iftekharul Islamcd789502017-04-19 14:37:55 -050066 SEVERITY_TO_PRIORITY_MAP:{
Iftekharul Islam34714092017-09-06 10:45:27 -050067 Emergency: 'High',
68 Alert: 'High',
69 Critical: 'High',
Iftekharul Islamcd789502017-04-19 14:37:55 -050070 Error: 'High',
Iftekharul Islam34714092017-09-06 10:45:27 -050071 Warning: 'Medium',
72 Notice: 'Low',
73 Debug: 'Low',
74 Informational: 'Low'
Iftekharul Islamcd789502017-04-19 14:37:55 -050075 },
76 PAGINATION: {
Iftekharul Islam595743a2017-08-23 16:27:18 -050077 LOG_ITEMS_PER_PAGE: 25
Iftekharul Islamd2269e22017-05-02 09:32:45 -050078 },
Iftekharul Islamee27d752017-07-05 15:54:31 -050079 HARDWARE: {
80 component_key_filter: '/xyz/openbmc_project/inventory/system',
81 parent_components: [
82 /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\//
83 ],
84 uppercase_titles: [
85 'cpu', 'dimm'
86 ]
87 },
Iftekharul Islam8947e702017-07-27 10:28:07 -050088 SENSOR_UNIT_MAP: {
89 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms',
90 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C',
91 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts',
92 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters',
93 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts',
94 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes',
95 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules'
Iftekharul Islam34714092017-09-06 10:45:27 -050096 },
97 SERVER_HEALTH: {
98 critical: 'Critical',
99 warning: 'Warning',
100 good: 'Good',
101 unknown: 'Unknown'
Iftekharul Islam99d199f2017-03-24 15:28:25 -0500102 }
103 };
104 });
105
Michael Davis83308992017-09-06 11:04:53 -0500106})(window.angular);