]> git.ipfire.org Git - people/ms/ipfire-2.x.git/commitdiff
wireguard.cgi: Only show the location if we have something
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 6 Sep 2024 16:10:48 +0000 (18:10 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Apr 2025 14:48:53 +0000 (16:48 +0200)
Otherwise the text won't be centered in the box which looks a little bit
wrong.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/wireguard.cgi

index 7c01522eefd5297effb4b3f7d501911d920d7943..283fa9e122eb692a3612f0d029877d8f9271e595 100644 (file)
@@ -526,14 +526,14 @@ END
                                                $Lang::tr{'name'}
                                        </th>
 
-                                       <th width='20%' colspan='2'>
-                                               $Lang::tr{'status'}
-                                       </th>
-
                                        <th>
                                                $Lang::tr{'remark'}
                                        </th>
 
+                                       <th width='20%' colspan='2'>
+                                               $Lang::tr{'status'}
+                                       </th>
+
                                        <th width='10%' colspan='3'>
                                                $Lang::tr{'action'}
                                        </th>
@@ -606,6 +606,13 @@ EOF
                                                $name
                                        </th>
 
+                                       <td>
+                                               $remarks
+                                       </td>
+END
+
+                       if ($location) {
+                               print <<END;
                                        <td class="@status">
                                                $connected
                                        </td>
@@ -613,11 +620,16 @@ EOF
                                        <td class="@status">
                                                $location
                                        </td>
-
-                                       <td>
-                                               $remarks
+END
+                       } else {
+                               print <<END;
+                                       <td class="@status" colspan="2">
+                                               $connected
                                        </td>
+END
+                       }
 
+                       print <<END;
                                        <td class="text-center">
                                                <form method='post'>
                                                        <input type='image' name='$Lang::tr{'toggle enable disable'}' src='/images/$gif'