Project

General

Profile

« Previous | Next » 

Revision ffa1178e

Added by Renato Botelho almost 9 years ago

Fix indent and spaces

View differences:

src/usr/local/www/widgets/widgets/openvpn.widget.php
118 118
				</tr>
119 119
			</thead>
120 120
			<tbody>
121
			<?php $rowIndex = 0;
121
<?php
122
			$rowIndex = 0;
122 123
			foreach ($server['conns'] as $conn):
123
			$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
124
			$rowIndex++;
125
			?>
124
				$evenRowClass = $rowIndex % 2 ? " listMReven" : " listMRodd";
125
				$rowIndex++;
126
?>
126 127
				<tr name="<?php echo "r:{$server['mgmt']}:{$conn['remote_host']}"; ?>" class="<?=$evenRowClass?>">
127 128
					<td>
128 129
						<?=$conn['common_name'];?>
......
131 132
						<?=$conn['remote_host'];?>
132 133
					</td>
133 134
					<td>
134
						<i class="fa fa-times-circle" onclick="killClient('<?=$server['mgmt']; ?>', '<?=$conn['remote_host']; ?>');" style="cursor:pointer;"
135
						<i class="fa fa-times-circle"
136
							onclick="killClient('<?=$server['mgmt']; ?>', '<?=$conn['remote_host']; ?>');"
137
							style="cursor:pointer;"
135 138
							name="<?php echo "i:{$server['mgmt']}:{$conn['remote_host']}"; ?>"
136 139
							title=<?=sprintf(gettext('Kill client connection from %s'), $conn['remote_host']);?>>
137 140
						</i>
......
146 149
					</td>
147 150
					<td></td>
148 151
				</tr>
149
		<?php endforeach; ?>
152
<?php
153
			endforeach;
154
?>
150 155
			</tbody>
151 156
		</table>
152 157
	</div>
153 158
</div>
154 159

  
155
<?php endforeach; ?>
156
<?php if (!empty($sk_servers)) { ?>
160
<?php
161
endforeach;
162

  
163
if (!empty($sk_servers)):
164
?>
157 165
<div class="widget panel panel-default">
158 166
	<div class="panel-heading"><h2 class="panel-title"><?=gettext("Peer to Peer Server Instance Statistics");?></h2></div>
159 167
	<div class="table-responsive">
......
166 174
				</tr>
167 175
			</thead>
168 176
			<tbody>
169
<?php foreach ($sk_servers as $sk_server): ?>
177
<?php
178
			foreach ($sk_servers as $sk_server):
179
?>
170 180
				<tr name='<?php echo "r:{$sk_server['port']}:{$sk_server['remote_host']}"; ?>'>
171 181
					<td>
172 182
						<?=$sk_server['name'];?>
......
176 186
					</td>
177 187
					<td>
178 188
<?php
179
					if ($sk_server['status'] == "up") {
180
						/* tunnel is up */
181
						echo '<i class="fa fa-arrow-up text-success"></i>';
182
					} else {
183
						/* tunnel is down */
184
						echo '<i class="fa fa-arrow-down text-danger"></i>';
185
					}
189
				if ($sk_server['status'] == "up") {
190
					/* tunnel is up */
191
					echo '<i class="fa fa-arrow-up text-success"></i>';
192
				} else {
193
					/* tunnel is down */
194
					echo '<i class="fa fa-arrow-down text-danger"></i>';
195
				}
186 196
?>
187 197
					</td>
188 198
				</tr>
......
195 205
					</td>
196 206
					<td></td>
197 207
				</tr>
198
<?php endforeach; ?>
208
<?php
209
			endforeach;
210
?>
199 211
			</tbody>
200 212
		</table>
201 213
	</div>
202 214
</div>
203 215

  
204 216
<?php
205
} ?>
206
<?php if (!empty($clients)) { ?>
217
endif;
218

  
219
if (!empty($clients)):
220
?>
207 221
<div class="widget panel panel-default">
208 222
	<div class="panel-heading"><h2 class="panel-title"><?=gettext("Client Instance Statistics");?></h2></div>
209 223
	<div class="table-responsive">
......
216 230
				</tr>
217 231
			</thead>
218 232
			<tbody>
219
	<?php foreach ($clients as $client): ?>
233
<?php
234
			foreach ($clients as $client):
235
?>
220 236
				<tr name="<?php echo "r:{$client['port']}:{$client['remote_host']}"; ?>">
221 237
					<td>
222 238
						<?=$client['name'];?>
......
233 249
					/* tunnel is down */
234 250
					echo '<i class="fa fa-arrow-down text-danger"></i>';
235 251
				}
236

  
237 252
?>
238 253
					</td>
239 254
				</tr>
......
246 261
					</td>
247 262
					<td></td>
248 263
				</tr>
249
	<?php endforeach; ?>
264
<?php
265
			endforeach;
266
?>
250 267
			</tbody>
251 268
		</table>
252 269
	</div>
253 270
</div>
254 271

  
255 272
<?php
256
}
273
endif;
257 274

  
258 275
if ((empty($clients)) && (empty($servers)) && (empty($sk_servers))) {
259 276
	echo gettext("No OpenVPN instances defined");

Also available in: Unified diff