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: { |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 23 | host: 'https://9.41.165.233/' |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 24 | }, |
| 25 | API_RESPONSE: { |
| 26 | ERROR_STATUS: 'error', |
| 27 | ERROR_MESSAGE: '401 Unauthorized', |
| 28 | SUCCESS_STATUS: 'ok', |
| 29 | SUCCESS_MESSAGE: '200 OK' |
| 30 | }, |
| 31 | CHASSIS_POWER_STATE: { |
| 32 | on: 'On', |
| 33 | off: 'Off' |
| 34 | }, |
| 35 | HOST_STATE_TEXT: { |
| 36 | on: 'Running', |
| 37 | off: 'Off', |
| 38 | booting: 'Quiesced', |
| 39 | unreachable: 'Unreachable' |
| 40 | }, |
| 41 | HOST_STATE: { |
| 42 | on: 1, |
| 43 | off: -1, |
| 44 | booting: 0, |
| 45 | unreachable: -2 |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 46 | }, |
| 47 | LED_STATE: { |
| 48 | on: true, |
| 49 | off: false |
| 50 | }, |
| 51 | LED_STATE_TEXT: { |
| 52 | on: 'on', |
| 53 | off: 'off' |
| 54 | }, |
| 55 | SEVERITY_TO_PRIORITY_MAP:{ |
| 56 | Informational: 'Low', |
| 57 | Error: 'High', |
| 58 | Warning: 'Medium' |
| 59 | }, |
| 60 | PAGINATION: { |
| 61 | LOG_ITEMS_PER_PAGE: 4 |
Iftekharul Islam | d2269e2 | 2017-05-02 09:32:45 -0500 | [diff] [blame] | 62 | }, |
| 63 | SENSOR_DATA_TEMPLATE: { |
| 64 | sensors: [ |
| 65 | { |
| 66 | type: 'fan', |
| 67 | title: 'Fan Speed', |
| 68 | key_search: 'fan_tach', |
| 69 | display_headers: ['Fan Speed(RPM)', 'Reading', 'State'], |
| 70 | sensor_row: { |
| 71 | title: 'Fan Speed ', |
| 72 | reading: ' rpms', |
| 73 | status: '', |
| 74 | indicator: '' |
| 75 | } |
| 76 | }, |
| 77 | { |
| 78 | type: 'temperature', |
| 79 | title: 'Temperature', |
| 80 | 'key_search': 'temperature', |
| 81 | display_headers: ['Temperature (DegreesC)', 'Reading', 'State'], |
| 82 | sensor_row: { |
| 83 | title: 'Temperature ', |
| 84 | reading: ' degreeC', |
| 85 | status: '', |
| 86 | indicator: '' |
| 87 | } |
| 88 | }, |
| 89 | { |
| 90 | type: 'altitude', |
| 91 | title: 'Altitude', |
| 92 | 'key_search': 'altitude', |
| 93 | display_headers: ['Altitude (Meters)', 'Reading', 'State'], |
| 94 | sensor_row: { |
| 95 | title: 'Altitude ', |
| 96 | reading: ' Meters', |
| 97 | status: '', |
| 98 | indicator: '' |
| 99 | } |
| 100 | }, |
| 101 | { |
| 102 | type: 'voltage', |
| 103 | title: 'Voltage', |
| 104 | 'key_search': 'voltage', |
| 105 | display_headers: ['Temperature (Volts)', 'Reading', 'State'], |
| 106 | sensor_row: { |
| 107 | title: 'Voltage ', |
| 108 | reading: ' volts', |
| 109 | status: '', |
| 110 | indicator: '' |
| 111 | } |
| 112 | }, |
| 113 | { |
| 114 | type: 'current', |
| 115 | title: 'Current', |
| 116 | 'key_search': 'current', |
| 117 | display_headers: ['Current (Amperes)', 'Reading', 'State'], |
| 118 | sensor_row: { |
| 119 | title: 'Current ', |
| 120 | reading: ' amperes', |
| 121 | status: '', |
| 122 | indicator: '' |
| 123 | } |
| 124 | }, |
| 125 | { |
| 126 | type: 'power', |
| 127 | title: 'Power', |
| 128 | 'key_search': 'power', |
| 129 | display_headers: ['Power (Watts)', 'Reading', 'State'], |
| 130 | sensor_row: { |
| 131 | title: 'Power ', |
| 132 | reading: ' watts', |
| 133 | status: '', |
| 134 | indicator: '' |
| 135 | } |
| 136 | }, |
| 137 | { |
| 138 | type: 'energy', |
| 139 | title: 'Energy', |
| 140 | 'key_search': 'energy', |
| 141 | display_headers: ['Energy (Joules)', 'Reading', 'State'], |
| 142 | sensor_row: { |
| 143 | title: 'Energy ', |
| 144 | reading: ' joules', |
| 145 | status: '', |
| 146 | indicator: '' |
| 147 | } |
| 148 | } |
| 149 | ] |
Iftekharul Islam | 99d199f | 2017-03-24 15:28:25 -0500 | [diff] [blame] | 150 | } |
| 151 | }; |
| 152 | }); |
| 153 | |
Iftekharul Islam | cd78950 | 2017-04-19 14:37:55 -0500 | [diff] [blame] | 154 | })(window.angular); |