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 |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame^] | 15 | .module('app.common.services', []) |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 16 | .service('Constants', function () { |
| 17 | return { |
| 18 | LOGIN_CREDENTIALS: { |
| 19 | username: "test", |
| 20 | password: "testpass", |
| 21 | }, |
| 22 | API_CREDENTIALS: { |
Iftekharul Islam | 1acb412 | 2017-11-02 13:20:32 -0500 | [diff] [blame] | 23 | host_storage_key: 'API_HOST_KEY', |
| 24 | default_protocol: 'https' |
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', |
Iftekharul Islam | 8a12284 | 2017-09-11 10:58:16 -0500 | [diff] [blame] | 39 | booting: 'Quiesced', |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 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 | }, |
Iftekharul Islam | 3471409 | 2017-09-06 10:45:27 -0500 | [diff] [blame] | 56 | 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 Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 66 | SEVERITY_TO_PRIORITY_MAP:{ |
Iftekharul Islam | 3471409 | 2017-09-06 10:45:27 -0500 | [diff] [blame] | 67 | Emergency: 'High', |
| 68 | Alert: 'High', |
| 69 | Critical: 'High', |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 70 | Error: 'High', |
Iftekharul Islam | 3471409 | 2017-09-06 10:45:27 -0500 | [diff] [blame] | 71 | Warning: 'Medium', |
| 72 | Notice: 'Low', |
| 73 | Debug: 'Low', |
| 74 | Informational: 'Low' |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 75 | }, |
| 76 | PAGINATION: { |
Iftekharul Islam | 595743a | 2017-08-23 16:27:18 -0500 | [diff] [blame] | 77 | LOG_ITEMS_PER_PAGE: 25 |
Iftekharul Islam | d2269e2 | 2017-05-02 09:32:45 -0500 | [diff] [blame] | 78 | }, |
Iftekharul Islam | ee27d75 | 2017-07-05 15:54:31 -0500 | [diff] [blame] | 79 | 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 Islam | 8947e70 | 2017-07-27 10:28:07 -0500 | [diff] [blame] | 88 | 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 Islam | 3471409 | 2017-09-06 10:45:27 -0500 | [diff] [blame] | 96 | }, |
| 97 | SERVER_HEALTH: { |
| 98 | critical: 'Critical', |
| 99 | warning: 'Warning', |
| 100 | good: 'Good', |
| 101 | unknown: 'Unknown' |
Iftekharul Islam | 8a12284 | 2017-09-11 10:58:16 -0500 | [diff] [blame] | 102 | }, |
| 103 | SENSOR_SORT_ORDER: [ |
| 104 | 'xyz.openbmc_project.Sensor.Value.Unit.DegreesC', |
| 105 | 'xyz.openbmc_project.Sensor.Value.Unit.RPMS', |
| 106 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters', |
| 107 | 'xyz.openbmc_project.Sensor.Value.Unit.Volts', |
| 108 | 'xyz.openbmc_project.Sensor.Value.Unit.Amperes', |
| 109 | 'xyz.openbmc_project.Sensor.Value.Unit.Joules', |
| 110 | 'xyz.openbmc_project.Sensor.Value.Unit.Meters' |
| 111 | ], |
Iftekharul Islam | 1acb412 | 2017-11-02 13:20:32 -0500 | [diff] [blame] | 112 | SENSOR_SORT_ORDER_DEFAULT: 8, |
| 113 | FIRMWARE: { |
Iftekharul Islam | 2a48955 | 2017-11-02 13:23:08 -0500 | [diff] [blame] | 114 | ACTIVATE_FIRMWARE: 'xyz.openbmc_project.Software.Activation.RequestedActivations.Active', |
Iftekharul Islam | 1acb412 | 2017-11-02 13:20:32 -0500 | [diff] [blame] | 115 | FALLBACK_DOWNLOAD_FILENAME: 'firmware_download.tar', |
| 116 | TYPES: { |
| 117 | Functional: 'Functional', |
| 118 | Active: 'Active', |
| 119 | Ready: 'Ready' |
| 120 | } |
| 121 | } |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 122 | }; |
| 123 | }); |
| 124 | |
Ed Tanous | bbcf670 | 2017-10-06 13:53:06 -0700 | [diff] [blame^] | 125 | })(window.angular); |