blob: 3afd9ae96e736bc5953fb9ec16d5c416ff5e1dbd [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
Ed Tanousbbcf6702017-10-06 13:53:06 -070015 .module('app.common.services', [])
Iftekharul Islam99d199f2017-03-24 15:28:25 -050016 .service('Constants', function () {
17 return {
Iftekharul Islam99d199f2017-03-24 15:28:25 -050018 API_CREDENTIALS: {
Iftekharul Islam1acb4122017-11-02 13:20:32 -050019 host_storage_key: 'API_HOST_KEY',
20 default_protocol: 'https'
Iftekharul Islam99d199f2017-03-24 15:28:25 -050021 },
22 API_RESPONSE: {
23 ERROR_STATUS: 'error',
24 ERROR_MESSAGE: '401 Unauthorized',
25 SUCCESS_STATUS: 'ok',
26 SUCCESS_MESSAGE: '200 OK'
27 },
28 CHASSIS_POWER_STATE: {
29 on: 'On',
Iftekharul Islama1d238f2018-02-26 12:29:45 -060030 on_code: 'xyz.openbmc_project.State.Chassis.PowerState.On',
31 off: 'Off',
32 off_code: 'xyz.openbmc_project.State.Chassis.PowerState.Off'
Iftekharul Islam99d199f2017-03-24 15:28:25 -050033 },
34 HOST_STATE_TEXT: {
35 on: 'Running',
Iftekharul Islama1d238f2018-02-26 12:29:45 -060036 on_code: 'xyz.openbmc_project.State.Host.HostState.Running',
Iftekharul Islam99d199f2017-03-24 15:28:25 -050037 off: 'Off',
Iftekharul Islama1d238f2018-02-26 12:29:45 -060038 off_code: 'xyz.openbmc_project.State.Host.HostState.Off',
CamVan Nguyend80c2802018-04-17 19:25:16 -050039 error: 'Quiesced',
40 error_code: 'xyz.openbmc_project.State.Host.HostState.Quiesced',
Iftekharul Islam99d199f2017-03-24 15:28:25 -050041 unreachable: 'Unreachable'
42 },
43 HOST_STATE: {
44 on: 1,
45 off: -1,
CamVan Nguyend80c2802018-04-17 19:25:16 -050046 error: 0,
Iftekharul Islam99d199f2017-03-24 15:28:25 -050047 unreachable: -2
Iftekharul Islamcd789502017-04-19 14:37:55 -050048 },
49 LED_STATE: {
50 on: true,
51 off: false
52 },
53 LED_STATE_TEXT: {
54 on: 'on',
55 off: 'off'
56 },
Iftekharul Islam34714092017-09-06 10:45:27 -050057 SEVERITY_TO_HEALTH_MAP:{
58 Emergency: 'Critical',
59 Alert: 'Critical',
60 Critical: 'Critical',
61 Error: 'Warning',
62 Warning: 'Warning',
63 Notice: 'Good',
64 Debug: 'Good',
65 Informational: 'Good'
66 },
Iftekharul Islamcd789502017-04-19 14:37:55 -050067 SEVERITY_TO_PRIORITY_MAP:{
Iftekharul Islam34714092017-09-06 10:45:27 -050068 Emergency: 'High',
69 Alert: 'High',
70 Critical: 'High',
Iftekharul Islamcd789502017-04-19 14:37:55 -050071 Error: 'High',
Iftekharul Islam34714092017-09-06 10:45:27 -050072 Warning: 'Medium',
73 Notice: 'Low',
74 Debug: 'Low',
75 Informational: 'Low'
Iftekharul Islamcd789502017-04-19 14:37:55 -050076 },
77 PAGINATION: {
Iftekharul Islam595743a2017-08-23 16:27:18 -050078 LOG_ITEMS_PER_PAGE: 25
Iftekharul Islamd2269e22017-05-02 09:32:45 -050079 },
Iftekharul Islamee27d752017-07-05 15:54:31 -050080 HARDWARE: {
81 component_key_filter: '/xyz/openbmc_project/inventory/system',
82 parent_components: [
83 /xyz\/openbmc_project\/inventory\/system\/chassis\/motherboard\/cpu\d+\//
84 ],
85 uppercase_titles: [
86 'cpu', 'dimm'
87 ]
88 },
Iftekharul Islam8947e702017-07-27 10:28:07 -050089 SENSOR_UNIT_MAP: {
90 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms',
91 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C',
92 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts',
93 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters',
94 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts',
95 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes',
96 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules'
Iftekharul Islam34714092017-09-06 10:45:27 -050097 },
98 SERVER_HEALTH: {
99 critical: 'Critical',
100 warning: 'Warning',
101 good: 'Good',
102 unknown: 'Unknown'
Iftekharul Islam8a122842017-09-11 10:58:16 -0500103 },
104 SENSOR_SORT_ORDER: [
105 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC',
106 'xyz.openbmc_project.Sensor.Value.Unit.RPMS',
107 'xyz.openbmc_project.Sensor.Value.Unit.Meters',
108 'xyz.openbmc_project.Sensor.Value.Unit.Volts',
109 'xyz.openbmc_project.Sensor.Value.Unit.Amperes',
110 'xyz.openbmc_project.Sensor.Value.Unit.Joules',
111 'xyz.openbmc_project.Sensor.Value.Unit.Meters'
112 ],
Iftekharul Islam1acb4122017-11-02 13:20:32 -0500113 SENSOR_SORT_ORDER_DEFAULT: 8,
114 FIRMWARE: {
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600115 ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active',
116 FUNCTIONAL_OBJPATH: '/xyz/openbmc_project/software/functional'
Iftekharul Islam81a49de2018-02-08 13:28:09 -0600117 },
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600118 POLL_INTERVALS: {
119 ACTIVATION: 5000,
120 POWER_OP: 5000,
Gunnar Mills033025f2018-03-06 14:49:40 -0600121 },
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600122 TIMEOUT: {
123 ACTIVATION: 1000 * 60 * 10, // 10 mins
124 CHASSIS_OFF: 1000 * 60 * 5, // 5 mins
125 HOST_ON: 1000 * 60 * 5, // 5 mins
CamVan Nguyend80c2802018-04-17 19:25:16 -0500126 HOST_OFF: 1000 * 60 * 5, // 5 mins
Gunnar Mills033025f2018-03-06 14:49:40 -0600127 },
Iftekharul Islam81a49de2018-02-08 13:28:09 -0600128 MESSAGES: {
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600129 POLL: {
CamVan Nguyend80c2802018-04-17 19:25:16 -0500130 CHASSIS_OFF_TIMEOUT: 'Time out. Chassis did not reach power off state in allotted time.',
131 HOST_ON_TIMEOUT: 'Time out. System did not reach Running state in allotted time.',
132 HOST_OFF_TIMEOUT: 'Time out. System did not reach Off state in allotted time.',
133 HOST_QUIESCED: 'System is in Error state.',
134 },
135 POWER_OP: {
136 POWER_ON_FAILED: 'Power On Failed',
137 WARM_REBOOT_FAILED: 'Warm Reboot Failed',
138 COLD_REBOOT_FAILED: 'Cold Reboot Failed',
139 ORDERLY_SHUTDOWN_FAILED: 'Orderly Shutdown Failed',
140 IMMEDIATE_SHUTDOWN_FAILED: 'Immediate Shutdown Failed',
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600141 },
142 SENSOR: {
143 NO_SENSOR_DATA: 'There are no sensors found.',
144 CRITICAL_NO_SENSOR_DATA: 'There are no sensors in Critical state.',
Iftekharul Islam13ac3af2018-03-20 11:15:17 -0500145 WARNING_NO_SENSOR_DATA: 'There are no sensors in Warning state.',
146 NORMAL_NO_SENSOR_DATA: 'There are no sensors in Normal state.'
Iftekharul Islama1d238f2018-02-26 12:29:45 -0600147 },
148 ERROR_MODAL: {
149 TITLE: 'Unexpected error',
150 DESCRIPTION: 'Oops! An unexpected error occurred. Record specific details of the issue, then contact your company support services.'
CamVan Nguyend80c2802018-04-17 19:25:16 -0500151 },
152 ERROR_MESSAGE_DESC_TEMPLATE: '{{status}} - {{description}}',
CamVan Nguyen33275832018-03-13 18:38:37 -0500153 },
154 POWER_CAP_TEXT: {
155 unit: 'W',
156 disabled: 'Not Enabled'
157 },
158 POWER_CONSUMPTION_TEXT: {
159 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'W',
160 notavailable: 'Not Available'
161 },
Iftekharul Islam99d199f2017-03-24 15:28:25 -0500162 };
163 });
164
Ed Tanousbbcf6702017-10-06 13:53:06 -0700165})(window.angular);