Commit 1ed6b998 authored by Franco Fichtner's avatar Franco Fichtner

interfaces: assorted UI tweaks and corrections

parent 331d5a8f
...@@ -162,7 +162,7 @@ $main_buttons = array( ...@@ -162,7 +162,7 @@ $main_buttons = array(
$i++; $i++;
endforeach; ?> endforeach; ?>
<tr> <tr>
<td colspan="4"> <td colspan="5">
<?= gettext("Not all drivers/NICs support 802.1Q QinQ tagging properly. On cards that do not explicitly support it, QinQ tagging will still work, but the reduced MTU may cause problems.");?> <?= gettext("Not all drivers/NICs support 802.1Q QinQ tagging properly. On cards that do not explicitly support it, QinQ tagging will still work, but the reduced MTU may cause problems.");?>
</td> </td>
</tr> </tr>
......
...@@ -40,8 +40,8 @@ if (!isset($config['qinqs']['qinqentry']) || !is_array($config['qinqs']['qinqent ...@@ -40,8 +40,8 @@ if (!isset($config['qinqs']['qinqentry']) || !is_array($config['qinqs']['qinqent
$a_qinqs = &$config['qinqs']['qinqentry']; $a_qinqs = &$config['qinqs']['qinqentry'];
if ($_SERVER['REQUEST_METHOD'] === 'GET') { if ($_SERVER['REQUEST_METHOD'] === 'GET') {
// read form data $id = 0;
if (!empty($a_qinqs[$_GET['id']])) { if (isset($_GET['id']) && !empty($a_qinqs[$_GET['id']])) {
$id = $_GET['id']; $id = $_GET['id'];
} }
$pconfig['if'] = isset($a_qinqs[$id]['if']) ? $a_qinqs[$id]['if'] : null; $pconfig['if'] = isset($a_qinqs[$id]['if']) ? $a_qinqs[$id]['if'] : null;
...@@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -50,7 +50,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig['descr'] = isset($a_qinqs[$id]['descr']) ? $a_qinqs[$id]['descr'] : null; $pconfig['descr'] = isset($a_qinqs[$id]['descr']) ? $a_qinqs[$id]['descr'] : null;
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') { } elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
// validate / save form data // validate / save form data
if (!empty($a_qinqs[$_POST['id']])) { if (isset($_POST['id']) && !empty($a_qinqs[$_POST['id']])) {
$id = $_POST['id']; $id = $_POST['id'];
} }
$input_errors = array(); $input_errors = array();
...@@ -72,7 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -72,7 +72,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$input_errors[] = gettext("QinQ level already exists for this interface, edit it!"); $input_errors[] = gettext("QinQ level already exists for this interface, edit it!");
} }
} }
if (is_array($config['vlans']['vlan'])) { if (isset($config['vlans']['vlan'])) {
foreach ($config['vlans']['vlan'] as $vlan) { foreach ($config['vlans']['vlan'] as $vlan) {
if ($vlan['tag'] == $pconfig['tag'] && $vlan['if'] == $pconfig['if']) { if ($vlan['tag'] == $pconfig['tag'] && $vlan['if'] == $pconfig['if']) {
$input_errors[] = gettext("A normal VLAN exists with this tag please remove it to use this tag for QinQ first level."); $input_errors[] = gettext("A normal VLAN exists with this tag please remove it to use this tag for QinQ first level.");
...@@ -214,7 +214,7 @@ include("head.inc"); ...@@ -214,7 +214,7 @@ include("head.inc");
<td> <td>
<input name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" /> <input name="submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_qinq.php');?>'" /> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_qinq.php');?>'" />
<?php if (isset($id) && $a_qinqs[$id]): ?> <?php if (isset($id) && isset($a_qinqs[$id])): ?>
<input name="id" type="hidden" value="<?=$id;?>" /> <input name="id" type="hidden" value="<?=$id;?>" />
<?php endif; ?> <?php endif; ?>
</td> </td>
......
...@@ -140,67 +140,63 @@ include("head.inc"); ...@@ -140,67 +140,63 @@ include("head.inc");
<div class="row"> <div class="row">
<?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?> <?php if (isset($input_errors) && count($input_errors) > 0) print_input_errors($input_errors); ?>
<section class="col-xs-12"> <section class="col-xs-12">
<div class="content-box"> <div class="content-box tab-content">
<div class="content-box-main"> <form method="post" name="iform" id="iform">
<div class="table-responsive"> <table class="table table-striped">
<form method="post" name="iform" id="iform"> <thead>
<table class="table table-striped"> <tr>
<thead> <td width="22%"><strong><?=gettext("Wireless clone configuration");?></strong></td>
<tr> <td width="78%" align="right">
<td width="22%"><strong><?=gettext("Wireless clone configuration");?></strong></td> <small><?=gettext("full help"); ?> </small>
<td width="78%" align="right"> <i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i>
<small><?=gettext("full help"); ?> </small> &nbsp;
<i class="fa fa-toggle-off text-danger" style="cursor: pointer;" id="show_all_help_page" type="button"></i> </td>
&nbsp; </tr>
</td> </thead>
</tr> <tbody>
</thead> <tr>
<tbody> <td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Parent interface");?></td>
<tr> <td>
<td><i class="fa fa-info-circle text-muted"></i> <?=gettext("Parent interface");?></td> <select name="if" class="selectpicker">
<td>
<select name="if" class="selectpicker">
<?php <?php
foreach (get_interface_list() as $ifn => $ifinfo): foreach (get_interface_list() as $ifn => $ifinfo):
if (match_wireless_interface($ifn)): if (match_wireless_interface($ifn)):
if (strstr($ifn, '_wlan')) { if (strstr($ifn, '_wlan')) {
continue; continue;
}?> }?>
<option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? "selected=\"selected\"" : "";?>> <option value="<?=$ifn;?>" <?=$ifn == $pconfig['if'] ? "selected=\"selected\"" : "";?>>
<?=htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")");?> <?=htmlspecialchars($ifn . " (" . $ifinfo['mac'] . ")");?>
</option> </option>
<?php <?php
endif; endif;
endforeach;?> endforeach;?>
</select> </select>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description");?></td> <td><a id="help_for_descr" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Description");?></td>
<td> <td>
<input name="descr" type="text" value="<?=$pconfig['descr'];?>" /> <input name="descr" type="text" value="<?=$pconfig['descr'];?>" />
<div class="hidden" for="help_for_descr"> <div class="hidden" for="help_for_descr">
<?=gettext("You may enter a description here for your reference (not parsed).");?> <?=gettext("You may enter a description here for your reference (not parsed).");?>
</div> </div>
</div> </div>
</tr> </tr>
<tr> <tr>
<td></td> <td></td>
<td> <td>
<input type="hidden" name="mode" value="<?=isset($pconfig['mode']) ? $pconfig['mode'] : 'bss' ?>" /> <input type="hidden" name="mode" value="<?=isset($pconfig['mode']) ? $pconfig['mode'] : 'bss' ?>" />
<input type="hidden" name="cloneif" value="<?=$pconfig['cloneif']; ?>" /> <input type="hidden" name="cloneif" value="<?=$pconfig['cloneif']; ?>" />
<input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" /> <input name="Submit" type="submit" class="btn btn-primary" value="<?=gettext("Save");?>" />
<input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');?>'" /> <input type="button" class="btn btn-default" value="<?=gettext("Cancel");?>" onclick="window.location.href='<?=(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/interfaces_wireless.php');?>'" />
<?php if (isset($id)): ?> <?php if (isset($id)): ?>
<input name="id" type="hidden" value="<?=$id;?>" /> <input name="id" type="hidden" value="<?=$id;?>" />
<?php endif; ?> <?php endif; ?>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</form> </form>
</div>
</div>
</div> </div>
</section> </section>
</div> </div>
......
...@@ -474,11 +474,11 @@ include("head.inc"); ...@@ -474,11 +474,11 @@ include("head.inc");
<table class="table table-striped"> <table class="table table-striped">
<tr> <tr>
<td> <td>
<?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ". <?= gettext("Using dial-on-demand will bring the connection up again if any packet ".
"triggers it. To substantiate this point: disconnecting manually ". "triggers it. To substantiate this point: disconnecting manually ".
"will %snot%s prevent dial-on-demand from making connections ". "will not prevent dial-on-demand from making connections ".
"to the outside! Don't use dial-on-demand if you want to make sure that the line ". "to the outside. Don't use dial-on-demand if you want to make sure that the line ".
"is kept disconnected."),'<strong>','</strong>')?> "is kept disconnected.") ?>
</td> </td>
</tr> </tr>
</table> </table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment