Skip to content

Commit

Permalink
dhcp: kill lease actions if interface is not there
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Sep 14, 2018
1 parent fdf27dd commit d54f50a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
15 changes: 6 additions & 9 deletions src/www/status_dhcp_leases.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,22 +425,19 @@ function ($a, $b) use ($order) {
<td><?=$data['online'];?></td>
<td><?=$data['act'];?></td>
<td class="text-nowrap">
<?php
if ($data['type'] == "dynamic"):?>
<?php if (!empty($data['if'])): ?>
<?php if ($data['type'] == 'dynamic'): ?>
<a class="btn btn-default btn-xs" href="services_dhcp_edit.php?if=<?=$data['if'];?>&amp;mac=<?=$data['mac'];?>&amp;hostname=<?=$data['hostname'];?>">
<i class="fa fa-plus fa-fw" data-toggle="tooltip" title="<?=gettext("add a static mapping for this MAC address");?>"></i>
</a>
<?php
endif;?>
<?php
if (($data['type'] == "dynamic") && ($data['online'] != "online")):?>
<?php if ($data['online'] != 'online'):?>

<a class="act_delete btn btn-default btn-xs" href="#" data-deleteip="<?=$data['ip'];?>">
<i class="fa fa-trash fa-fw" title="<?= html_safe(gettext('Delete')) ?>" data-toggle="tooltip"></i>
</a>
<?php
endif;?>

<?php endif ?>
<?php endif ?>
<?php endif ?>
</td>
</tr>
<?php
Expand Down
14 changes: 6 additions & 8 deletions src/www/status_dhcpv6_leases.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,20 +480,18 @@ function parse_duid($duid_string) {
<td><?=$data['online'];?></td>
<td><?=$data['act'];?></td>
<td class="text-nowrap">
<?php
if ($data['type'] == "dynamic"):?>
<?php if (!empty($data['if'])): ?>
<?php if ($data['type'] == 'dynamic'): ?>
<a class="btn btn-default btn-xs" href="services_dhcpv6_edit.php?if=<?=$data['if'];?>&amp;duid=<?=$data['duid'];?>&amp;hostname=<?=$data['hostname'];?>">
<i class="fa fa-plus fa-fw" alt="add"></i>
</a>
<?php
endif;?>
<?php
if (($data['type'] == "dynamic") && ($data['online'] != "online")):?>
<?php if ($data['online'] != 'online'): ?>
<a class="act_delete btn btn-default btn-xs" href="#" data-deleteip="<?=$data['ip'];?>" title="<?= html_safe(gettext('Delete')) ?>" data-toggle="tooltip">
<i class="fa fa-trash fa-fw"></i>
</a>
<?php
endif;?>
<?php endif ?>
<?php endif ?>
<?php endif ?>
</td>
</tr>
<?php
Expand Down

0 comments on commit d54f50a

Please sign in to comment.