Project

General

Profile

« Previous | Next » 

Revision 5a331169

Added by Jared Dillard over 9 years ago

change hardcoded colors to classes

View differences:

src/usr/local/www/status_gateways.php
64 64
require("guiconfig.inc");
65 65

  
66 66
define('COLOR', true);
67
define('LIGHTGREEN', '#90EE90');
68
define('LIGHTCORAL', '#F08080');
69
define('KHAKI',		 '#F0E68C');
70
define('LIGHTGRAY',	 '#D3D3D3');
71
define('WHITE',		 '#FFFFFF');
72 67

  
73 68
$a_gateways = return_gateways_array();
74 69
$gateways_status = array();
......
162 157
					$status = $gateways_status[$gname];
163 158
					if (stristr($status['status'], "force_down")) {
164 159
						$online = gettext("Offline (forced)");
165
						$bgcolor = LIGHTCORAL;
160
						$bgcolor = "bg-danger";
166 161
					} elseif (stristr($status['status'], "down")) {
167 162
						$online = gettext("Offline");
168
						$bgcolor = LIGHTCORAL;
163
						$bgcolor = "bg-danger";
169 164
					} elseif (stristr($status['status'], "loss")) {
170 165
						$online = gettext("Warning, Packetloss") . ': ' . $status['loss'];
171
						$bgcolor = KHAKI;
166
						$bgcolor = "bg-warning";
172 167
					} elseif (stristr($status['status'], "delay")) {
173 168
						$online = gettext("Warning, Latency") . ': ' . $status['delay'];
174
						$bgcolor = KHAKI;
169
						$bgcolor = "bg-warning";
175 170
					} elseif ($status['status'] == "none") {
176 171
						$online = gettext("Online");
177
						$bgcolor = LIGHTGREEN;
172
						$bgcolor = "bg-success";
178 173
					}
179 174
				} else if (isset($gateway['monitor_disable'])) {
180 175
						$online = gettext("Online");
181
						$bgcolor = LIGHTGREEN;
176
						$bgcolor = "bg-success";
182 177
				} else {
183 178
					$online = gettext("Pending");
184
					$bgcolor = LIGHTGRAY;
179
					$bgcolor = "bg-info";
185 180
				}
186 181

  
187 182
				$lastchange = $gateways_status[$gname]['lastcheck'];
188 183

  
189 184
				if (!COLOR) {
190
				   $bgcolor = WHITE;
185
				   $bgcolor = "";
191 186
				}
192 187
?>
193 188

  
194
				<td style="background-color:<?=$bgcolor?>">
189
				<td class="<?=$bgcolor?>">
195 190
					<strong><?=$online?></strong> <?php
196 191
					if (!empty($lastchange)) { ?>
197 192
						<br /><i><?=gettext("Last checked")?> <?=$lastchange?></i>

Also available in: Unified diff