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 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: { 23 host: 'https://9.3.185.173', 24 mock_host: 'http://localhost:3000' 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 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: { 62 LOG_ITEMS_PER_PAGE: 4 63 }, 64 SENSOR_DATA_TEMPLATE: { 65 sensors: [ 66 { 67 type: 'fan', 68 title: 'Fan Speed', 69 key_search: 'fan_tach', 70 display_headers: ['Fan Speed(RPM)', 'Reading', 'State'], 71 sensor_row: { 72 title: 'Fan Speed ', 73 reading: ' rpms', 74 status: '', 75 indicator: '' 76 } 77 }, 78 { 79 type: 'temperature', 80 title: 'Temperature', 81 'key_search': 'temperature', 82 display_headers: ['Temperature (DegreesC)', 'Reading', 'State'], 83 sensor_row: { 84 title: 'Temperature ', 85 reading: ' degreeC', 86 status: '', 87 indicator: '' 88 } 89 }, 90 { 91 type: 'altitude', 92 title: 'Altitude', 93 'key_search': 'altitude', 94 display_headers: ['Altitude (Meters)', 'Reading', 'State'], 95 sensor_row: { 96 title: 'Altitude ', 97 reading: ' Meters', 98 status: '', 99 indicator: '' 100 } 101 }, 102 { 103 type: 'voltage', 104 title: 'Voltage', 105 'key_search': 'voltage', 106 display_headers: ['Temperature (Volts)', 'Reading', 'State'], 107 sensor_row: { 108 title: 'Voltage ', 109 reading: ' volts', 110 status: '', 111 indicator: '' 112 } 113 }, 114 { 115 type: 'current', 116 title: 'Current', 117 'key_search': 'current', 118 display_headers: ['Current (Amperes)', 'Reading', 'State'], 119 sensor_row: { 120 title: 'Current ', 121 reading: ' amperes', 122 status: '', 123 indicator: '' 124 } 125 }, 126 { 127 type: 'power', 128 title: 'Power', 129 'key_search': 'power', 130 display_headers: ['Power (Watts)', 'Reading', 'State'], 131 sensor_row: { 132 title: 'Power ', 133 reading: ' watts', 134 status: '', 135 indicator: '' 136 } 137 }, 138 { 139 type: 'energy', 140 title: 'Energy', 141 'key_search': 'energy', 142 display_headers: ['Energy (Joules)', 'Reading', 'State'], 143 sensor_row: { 144 title: 'Energy ', 145 reading: ' joules', 146 status: '', 147 indicator: '' 148 } 149 } 150 ] 151 } 152 }; 153 }); 154 155})(window.angular); 156