Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 1 | /** |
| 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 | |
| 11 | window.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 Davis | df3bd12 | 2017-08-10 11:03:42 -0500 | [diff] [blame] | 23 | host: 'https://9.3.185.164', |
Iftekharul Islam | c016139 | 2017-06-14 15:46:15 -0500 | [diff] [blame] | 24 | mock_host: 'http://localhost:3000' |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 25 | }, |
| 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 Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 47 | }, |
| 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 Islam | 595743a | 2017-08-23 16:27:18 -0500 | [diff] [blame] | 62 | LOG_ITEMS_PER_PAGE: 25 |
Iftekharul Islam | d2269e2 | 2017-05-02 09:32:45 -0500 | [diff] [blame] | 63 | }, |
Iftekharul Islam | ee27d75 | 2017-07-05 15:54:31 -0500 | [diff] [blame] | 64 | 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 Islam | 8947e70 | 2017-07-27 10:28:07 -0500 | [diff] [blame] | 73 | SENSOR_UNIT_MAP: { |
| 74 | 'xyz.openbmc_project.Sensor.Value.Unit.RPMS': 'rpms', |
| 75 | 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC': 'C', |
| 76 | 'xyz.openbmc_project.Sensor.Value.Unit.Volts': 'volts', |
| 77 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters': 'meters', |
| 78 | 'xyz.openbmc_project.Sensor.Value.Unit.Watts': 'watts', |
| 79 | 'xyz.openbmc_project.Sensor.Value.Unit.Amperes': 'amperes', |
| 80 | 'xyz.openbmc_project.Sensor.Value.Unit.Joules': 'joules' |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 81 | } |
| 82 | }; |
| 83 | }); |
| 84 | |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 85 | })(window.angular); |